Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Zigbee Device access from delphi

Posted on 2010-08-26
11
Medium Priority
?
1,533 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

636 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