Solved

Zigbee Device access from delphi

Posted on 2010-08-26
11
1,458 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

26 Experts available now in Live!

Get 1:1 Help Now