Solved

Zigbee Device access from delphi

Posted on 2010-08-26
11
1,450 Views
Last Modified: 2012-05-10
My application (Master) communicates with 2 separate devices (slave) using zigbee technologie. I need to change the destination attribute of the Master in Realtime from my delphi program to communicate with the appropriate device.  How can i do that! how can i access  the Zigbee Module ZigBee® PRO XBee like in XCTU tool and make some change in the configuration directly from my application. What do i need? is there any example-Code
0
Comment
Question by:Nelzoom
  • 5
  • 4
11 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 33529899
I would reckon the devices come with an SDK?

If your devices are currently set to AT mode, basically you just send text commands to it via a serial connection, e.g. ATDT 1F<CR> where <CR> is a carriage return.

Remember to set the correct baud rate (default 9600)
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 33529928
On the other hand, if you're in API mode, you will basically send binary data over... with each packet starting with $7E and ending with a checksum of the packet.
0
 

Author Comment

by:Nelzoom
ID: 33530125
Hi DragonSlayer,

thank you for your comment.

i just want to add more information about this post.

Actually, i'm using  AT Mode and i communicate with remote slave device (node) by sending some Commands via zigbee module (Coordinater) connected to usb port and recognized as comport. it a just serial communication. with  the request <MyComPort.putChar($9)>  i get Value X as answer from device 1 for example.  other commands are defined to request more informations from the device.

The problem is how to send this command alternatively to an other device in realtime by chaging the destination address in the Coordinator zigbee module. the frequence is 10request/s to each device.

Is there any possibility to do that? how? i'm a new to zigbee and need some help.

thank's





0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 33533838
Hi Nelzoom,

Check the section titled API Frames in your guide, under Explicit Addressing ZigBee Command Frame. Bytes 6-13 allows you to set the address of the destination device, or 0xFFFF for a broadcast
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Nelzoom
ID: 33548578
Hi DragonSlayer,

Thank you for you comment.

I will read all those staf and give you a feed back.

if i understand, i can send alternatively commands to each device by only specifying it address in the packet to send!?

Changing the  address will not affect the speed of my realtime application? where can i find some code witch may help me.

thanks.
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 33548622
Hi Nelzoom,

1. At a default rate of 9600 bps, if your average command packet is at, say, 30 bytes, that allows you to send up to 320 commands per second, bandwidth-wise.

2. Not sure of sample code for Delphi, there are some available frameworks for these devices for both .NET and Java
0
 

Author Comment

by:Nelzoom
ID: 33616332
Hello,

I spent a lot of time in reading DIGI documentation and  things are a bit clear.

Now,  from my small delphi test program (the Master with API=1)  i can  address a small packet with 'hello' message to the slave (XCTU with API:= 0)

...

ComPort2.output:= char($7E) +  char($00) +  char($0A) + Char($01) + Char($01) + char($50) +  char($01) + char($00) + char($48) + char($65) + char($6C) +char($6C)+ Char($6F) + char($B8);
   {
// 7E 00 0A 01 01 50 01 00 48 65 6C 6C 6F B8

    - 7E
 Start delimiter

  - 00 0A
 Length bytes

  - 01
 API identifier

  - 01
 API frame ID

  - 50 01
 Destination address low

  - 00
 Option byte

  - 48 65 6C 6C 6F
 Data packet

  - B8
 Checksum
}

The message is displayed correctly in the XCTU tool. but a get an answer back from the Slave RF Module. i think it an ACK . now i dont need to receave this confirmation from the slave, so i change the 8th from 00 to 01 as in the documentation. when testing XCTU does not display the hello messahe any more.

this step is important because in my main project all slaves must answer immediately by sending some data acuired from the PIC, in response to the sent command from the master.

Any idea!
 
0
 

Author Comment

by:Nelzoom
ID: 33634678
Hi Every One , I resolve it thank you for all
0
 

Accepted Solution

by:
Nelzoom earned 0 total points
ID: 33634689

The API FRAME Number should be set to 0.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now