This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

serial port-cc 2531 communication

Other Parts Discussed in Thread: CC2531, CC2530, Z-STACK

hello,

i wish to know "how to read data from the serial port sent by cc2531 when serial app is running" without using a smart rf board?

  • Hi Sri,

    The UART logic of CC253x/4x cannot directly drive a serial port. That's why you need the SmartRF boards for this, there are level shifters on this board.

    However, some USB-to-Serial cables can support the logical levels of CC253x/4x. I have not tested this cable, but I know cables like this can do the job. http://www.alliedelec.com/search/productdetail.aspx?sku=70069429&gclid=CLLg0eaaxbUCFQrpnAodhTgAEA

  • thanks a lot sorby.

    the cc2531 is getting recognised as a virtual com port(using serial app) but iam not able to communnicate with it using the hyperterminal.What are the hyper terminal specifications for this?

  • The default baud rate should be 115200. You said that you can not communicate with it and what kind of command do you use to communicate with CC2531? What FW do you use on your CC2531? Specify more clear will give us more information to help you find the problem.

  • Thank you Yikai chen...

    we are using a cc2531 DK_Dongle Rev 2.4
    i downloaded the serial app for cc2531 (Z Stack tool )  from this TI link :

    http://e2e.ti.com/support/low_power_rf/f/158/t/151438.aspx

    i don't have a smart RF board, i used CCdebugger to download and debug that code into cc2531.
    now it is getting successfully recognized as a serial port -

    i then ran the packet sniffer using another cc2531 and i got these packets

    Next ,i powered  a cc2530 end device - using battery ( programmed using CC2530ZNP Mini kit end device example )

    now i got these packets in packet sniffer.

    but i was not able to read any data in hyperterminal when i connected it to the cc2531 usb cdc serial port
    i tried the following settings
    115200 bits per sec , Data bit : 8 , Parity :none , stop bit :1, flow control : hardware

    Please help me.

    is there any other software through which i can read or save the data from that cc2531 serial port ?

  • Hyperterminal only handles ASCII but the data from cc2531 is hex format. I recommend you to use Z-tool under your ZStack's tool folder to do the communication.

  • Thank you YiKai Chen,

    But i encounter the following error when i open the Z-tool under z stack
    Unhandled exception has occurred in your application..
    i have included the screen shot

    i tried the solutions from the following posts, but it shows the same error.

    http://e2e.ti.com/support/low_power_rf/f/158/t/199611.aspx

    http://e2e.ti.com/support/low_power_rf/f/158/t/140170.aspx

    i am using Windows 8 and if i try to install .net the following info is displayed

    Same or higher version of .NET Framework 4 has already been installed on this computer.

    I am logged in as Administrator too.

    All i want to do, is to save the data which a cc2531 dongle receives to my pc.

    The data is sent by a cc2530 end device to the cc2531 coordinator ( which is connected to the pc via usb port - no smartrfboards involved)

    please refer to the previous questions in this post for details.

  • I would suggest you to find a PC which runs winXP or win7 to use Ztool on it. Do not waste time on windows 8.

  • Thank you YiKai Chen...

    i tried it on another windows 7 pc

    it still shows the same error.
    Are there any other software

  • I opened Z-tool 2.0( using the run as administrator option)

    i connected the cc2531 dongle ( running serial app )

    i go to  tools menu ->settings and under serial devices my ports were listed.
    i gave the following settings baud rate 115200 Data bit : 8 , Parity :none , stop bit :1, flow control : none

    but when i scan for my device , it says

    NO devices found

  • Hi Maddy,

    Sorry, I might misunderstand your question. Z-tool is only used for talking to devices with MT command. What FW do you use on your CC2531? ZNP or MT command?

  • Thank  you Yikai Chen ,

    i am currently using ZNP.

    please tell me how to program using MT commannds

  • Please check your handshake setting in the com port of you ZTool. You nee to choose RTS/CTS when using ZNP via serial port.

  • Thank you Yikai Chen

    i changed the setting to cts/rts , but it still says " NO Devices Found "

    can you please tell me how to use MT commands  as you mentioned above

  • You can open the znp.eww project under C:\Texas Instruments\ZStack-CC2530-2.5.1a\Projects\zstack\ZNP\CC253x and choose cc2530 or cc2531 debug configuration depends on which chip you use. Then build the code and download it to your device. Connect the device and open ZTool to work on it. This project using MT command and you can refer to the Z-Stack Monitor and Test API.pdf under C:\Texas Instruments\ZStack-CC2530-2.5.1a\Documents.

  • if you want to read data from the serial port,

    I think you can use third-party software. for example:

    Awavo serial port terminal :

    download: http://www.awavo.com/serial-port-monitor/

  • Hi,

    I used cc2531 usb dongle as zig bee HA coordinator by flashing the znp from z-stack home from texas.I successfully established communication with the HA Bulb using MT commands through z-tool on my pc.I am able to on/off the bulb when i send commands through z-tool.

    Now i manually generated the MT frames taking reference from monitor and test commands pdf. when i send the commands through cutecom i get the transmission success response from the coordinator but the bulb does not respond.

    when i start the zigbee stack by sending zigbee start request command then the bulb continuosly sends beacons which contains the bulb's 64 bit and 16 bit address. so i assume that communication with the bulb is possible.

    My doubt is can i use the MT commands by manually generating MT frames and send it via any serial communication software?

    I already tried with cutecom on linux and hercules software on windows machine but i face the same problem that the bulb does not send the response.But it continuesly sends the beacons.

    Please someone guide me on this.

  • It seems that your bulb doesn't join coordinator.
  • HI YK Chen

    Thanks for your response.
    My bulb joins the coordinator as i have already tested it by sending the command.
    when i send the get device information command frame through other serial communication software other than z-tool it gives me the list of devices associated with the coordinator.In that i get one device associated and also the 16 bit network address of the bulb.Also when i start the zigbee stack by sending zigbee start request the bulb continuosly sends beacons which shows it's 64 bit fix address and 16 bit network address is different every time it joins the network.

    Thanks a lot for the response. I kindly request you to guide me further on this issue.

    Charmi.
  • Do you use Ubiqua Packet Analyzer to check this? You can attach the sniffer log so I can check it.
  • Hi Yk Chen

    I do not use the protocol analyser but i send the commands through z-tool software to communicate with the coordinator and use monitor ans test commands in the z-stack home from texas for communication.

    here i attach the screen shots of the z-tool software in which i recieve coordinator response by sending util get device info command and next the response from the bulb where i recieve the response from the bulb which on/off the bulb.p { margin-bottom: 0.25cm; line-height: 120%; }

  • I do not use the protocol analyser but i send the commands through z-tool software to communicate with the coordinator and use monitor ans test commands in the z-stack home from texas for communication.

    here i attach the screen shots of the z-tool software in which i receive coordinator response by sending util get device info command and next the response from the bulb where i receive the response from the bulb which on/off the bulb.


    Thanks a lot for your responses.Please share your views for solving this issue.

    Thanks in advance.

  • I don't see the screenshot. By the way, you can download trail version of Packet analyzer. It is useful to debug.
  • Hi Yk Chen

    Thanks for your responses and sorry i was not able to attach the screen shot due to some problem with my pc.Now i attach the screen shots.

    Please share your views to solve this issue.

    Thanks in advance.

  • I attached the screen shots but when i submit it does not show here.I don't understand how to attach it?
    I am sorry to ask such a question.
    please guide me.
  • You can click " Use rich formatting" and drag and drop the snapshot to the input window.
  • Hi Yk Chen

    Thanks a lot for your kind help i attached the screen shots in the above post please refer to it.
    There i have put the first screen shot of the response that i receive from the bulb when i send the command to off the bulb it works perfectly through z-tool.The second screen shot is the response from coordinator for the list of devices associated to it.In that it shows the 16 bit network address of the bulb.

    Now i wish to control the bulb in the same way as it operates with z-tool from the other serial communication software by manually generating the same frames that are sent from z-tool.I tried with that but i did not receive response from the device.

    Please share your views on this issue.

    Thanks
    Charmi.
  • I see you send 4 bytes ZCL payload (0x01, 0x00, 0x00, 0x00) by Z-tool to control the bulb. According to ZCL spec, it should be 3 bytes not 4.
  • But with this data the bulb is operated and it on and off through this commands.I think in zcl specification the data length is variable.
  • This screen shot is just an example but even if i try to receive simple descriptor using other serial communication terminal i does not get response from the device.while using the same commands and values from z-tool i get the response from the bulb.
  • Do you send MT command with hex format and correct checksum in other serial communication terminal?
  • yes i send it correctly because for starting the zigbee stack i need to send zigbee start request command and many other commands of call backs for which i get the correct response.but that all commands are response to coordinator.when i send commands from which i need response from the bulb it shows transmit sucess response but the bulb does not respond to the command.
  • If so, I suggest you again to use Ubiqua Packet Analyzer to check over the air message and confirm the message is sent.
  • Hi Yk Chen

    I am also facing similar issue. Here is a brief description about it.

    I have flashed Z-stack ZNP hex file on CC2531 USB dongle (as coordinator) & started ZTool software on host machine to access CC2531. I am successfully able to start the network, HA supported Bulb joins it as end device. I am even able to turn ON/OFF bulb successfully using Ztool.

    Now, I have started using serial terminal utility to access CC2531 instead of using Ztool software (Because, finally, I need to integrate MT command in my serial application). Now, in this test scenario, I have prepared frames manually (as per MT command frame document PDF) & was able to start the network successfully. I have verified this by sending a command to CC2531 to read available end device joined wih coordinator & it returns device address. Now, When I send command to read ZDO information from end device (bulb in my case), it returns SUCCESS response but response received from end device (bulb) does not reach to my serial terminal utility. 

    So I am just curious to know that, is Ztool add something extra information while sending the command ? 

    Thanking you in advance for your kind help

    Regards

    Ashish

  • Hi Ashish,
    No, Z-Tool doesn't add anything. It only format your inputs to MT command format. I also suggest you using Ubiqua Packet Analyzer to check this issue.
  • Thank you so much YK Chen for you prompt response.

    To use Ubiqua Packet Analyzer, Do I need to use another CC2531 with packet sniffer firmware in it OR existing CC2531 with ZNP firmware will do the needful ?

    Regards
    Ashish
  • Yes, you need to use another CC2531 with packet sniffer FW on it.
  • OK. Thanks YK Chen. Will get back to you with Ubiqua Packet Analyzer logs if required.

    Regards
    Ashish
  • You are welcome.
  • Hi YK Chen,

    What If someone try to write a c program ( Linux system programming) to get Hex value and convert it to Ascii or other readable format? (just to check the logs coming from cc2530)

    Thanks & Regards,
    Hardik
  • @Hardik what's your point?

  • Hi YK Chen,

    I was just going through the post and have seen your reply to maddy
    --> "Hyperterminal only handles ASCII but the data from cc2531 is hex format. I recommend you to use Z-tool under your ZStack's tool folder to do the communication."

    So I asked if i can translate the data coming from cc2530/31 into readable form.

    Regards,
    Hardik
  • Yes, you can do it.