Xbee 64-bit address in API mode - zigbee

I'm currently working on a project in which I use antennas such xbee XBee 2mW Wire Antenna - Series 2 (ZigBee Mesh).
how can I get my antenna64bit address so I can set it up using my software automatically?
Can I send zigbee message to antenna so that it returns a message that contains it`s antenna address, then I decode the message and know the address of my antenna.
thanks.

If you want an easy way of doing this, you can send one message from the Router/End-Device to the Coordinator in your ZigBee network. You can use the special 16-bit Network Address 0x0000 to address the Coordinator.
This message should contain the 16-bit Network Address (or the 64-bit Address), so later the Coordinator can use this address in order to communicate back with this node. That is how you can do if you work with AT Mode. If you work with API Mode, the "Receive Packet" already contains the address of the sender, so you do not need to explicitely add it to your message.

When you press one time the commission button: the module sends a node identification broadcast transmission.
Thus, I assume you are using the API mode, so from your Coordinator API (software side) you can send a Remote AT Command Request, in broadcast, which set the CB (commission button) to 1. This is the same of press the commission button virtually at one time. Here is the packet:
7E 00 10 17 00 00 00 00 00 00 00 FF FF FF FE 00 43 42 01 67
Then, when all your devices receive this packet, they should answer to the coordinator with a Node Identification Indicator, which contains their 16-bit and 64-bit address. This way, you can automatically set up your network on software.

Related

Is it possible for a certain sequence of data bytes to drop a TCP connection

I have a simple TCP client/server arrangement (running on Windows 10/11) used to transfer binary data from multiple remote clients to a single server. This works 99% of the time. However, whenever the following hexadecimal sequence appears in the data (being sent from the client to the server) the TCP connection drops and the client generates a 10053 error.
6C 74 01 00 08 00 00 00
Running the server application on a local network has slightly different results... the connection does not drop but the client receives no ACK from the server.
Is it possible for a certain sequence of bytes to drop, or otherwise interfere with, a TCP connection?

Can BLE devices act as beacons

This could be a wrong question but just need to know whether this is feasible
For one of our ble devices the manufcaturer data comes as when scanned using the noble package using the [peripheral.advertisement.manufacturerData]
manufacturerData: <Buffer 59 00 08 8a 00 00 50 f8 c8 f0 6e b9 cd> }.This data mainly has some data related to the device like the battery level and hardware versions.
Can this device work as a beacon as well as a ble device if we change the advertising package ?
Yes, any BLE device can act as a beacon as long as you can control the advertisement payload. Beacons are a subset of BLE devices. By definition, beacons are BLE devices that are constantly/continuously advertising data that are relevant to other remote devices, usually containing information about its location/proximity.
So to answer your question, as Mike Petrichenko suggested, all you need to do is alter your advertisement data to something that is relevant to remote devices. If you still need to send your current adverts, then you'll need to alternate between sending the current advert data and the relevant beacon data. You can control the frequency at which each data is sent depending on your application (e.g. For every 10 adverts of your current payload you can send the beacon advert if it's less frequently needed).
Some references:-
What Are Beacons and How Beacons Technology Works
5 Things You Need to Know about Beacon Technology
What Are Beacons, and How Are They Used in IoT Applications
I hope this helps.

LORA Sx1276 send same response in every condition

I am usign one of Dorji's pruduct. The products name is DRF1276DM. The image of the product can seen in following images
In the application note the producers state that the module can communicate over serial port with TTL level UART. In their application note which can be found at http://www.dorji.com/docs/data/DRF1278DM.pdf. They state that if we send a command like AF AF 00 00 AF 80 03 02 00 00 92 0D 0A the device will response as AF AF 00 00 AF 00 03 02 00 00 12 0D 0A I try to check this command in order to test the device but I receive same command in my all trial. The device send me that 2400 O 8 1 DRF128X V2.7. In the application note they state that the device will send only one time this command when power is one but In my case the response is always same regardless to command code.
For checking the condition I try to use every command on http://www.dorji.com/docs/data/DRF1278DM.pdf but I recieved same respond. My first question is this. Are there any one who deal with same problem with me or could you give me any solution for this case. I am suspicious that the device get reset in every time when I try to send command over serial port. Is there any way to reset the device to default either using software or hardware.
In the application note they state that the first respond which I quoted above, will give the information for communcating device In our case I expected to communicate with device on odd parity 8 bit data size 2400 baud rate but the device only gives irrelevant or nonlogical bytes in 2400 baud rate. Only logical answer I received from device is on the 9600 baud rate. My second question is this. Is there a bug on this device setting or did I miss someting because as far as I know we cannot communicate with devices over multiple baud rate option.
PS:
I try to use their configuration tool which can be found in http://www.dorji.com/products-detail.php?ProId=61, but I got same "time out"
Error from device, I used 2400 boud rate and even parity but the result cannot changed.
Pin EN must be connected to logical 0
Firstly, the Error Time Out error appears because of a damaged UART-to-USB converter or this happens when you are using multiple jumper wires for a single pin of the module. Try using the a single female-to-female jumper wire to connect every pin of your module with the corresponding pin of the UART-to-USB converter.
Your UART is probably working fine, i have the same issues.
My DRF1278/76 modules dont seem to respon to me changing the baudrate in configuration parameters, it looks like its fixed to 9600 bauds, wich is a boomer
I had this problem too, my issue was the EN pin needs to be pulled low. Even with the USB to UART adapter I bought with the modules, that line is allowed to site high by default. Use a jumper to pull it to ground.

How to program XBee S2 (standalone)

I currently have XBee S2 and I want to program the GPIO pins to switch ON/OFF LED. I saw a lot of tutorial by using external MCU(like Arduino) but in my case I want to use the XBee without any external MCU attached. It seems that XCTU software only allow the GPIO pins to be set HIGH, LOW, input, etc without any logic that can change their conditions.
So is there any IDE or software that allow XBee GPIO pins to be program?
Digi sells a "Programmable XBee" that includes a separate 8-bit processor you can compile C code to, but that probably isn't what you had in mind.
If you create a network with two XBee modules (A and B), you can have a computer wired to XBee A send a "Remote AT Request" (in API mode) to XBee B to change the I/O pin wirelessly. If you read through the documentation, you'll find everything you need to know about API mode and the Remote AT Request frame type.
Is that the sort of control you were looking for? If not, can you describe your use case in more detail?
Have you found your solution?
Using XCTU has settings for the DIO pins which include HIGH and LOW. What that means is when the XBee comes out of reset, that will be the default setting. So if set HIGH, coming out of reset, the DIO pin will default HIGH. That is my understanding anyway and that seems to be correct.
I am going through the exercise to have a non-programmable XBee sans micro controller to switch some circuits on and off remotely. The setup is as follows:
1) a control XBee which will be attached to a micro
2) a router XBee without a micro (standalone)
Fairly mundane. What I noticed in my setup was that the standalone XBee's associate pin would toggle for a bit then stop for a bit and repeat. This didn't seem right. When I sent a command from the controller XBee it was hit or miss as to whether the command was carried out by the standalone unit. A bit puzzling.
To check out what was going on with the standalone XBee, I hooked up a computer and fired up XCTU. The problem went away. To cut to the chase, I discovered that when I hooked the computer's serial TX to the XBee's RX pin solved the issue!
My XBees are setup with a level shifting IC so the outside world is 5 volt and the XBee is at 3.3v. My best guess is a floating RX pin which is connected to a level shifter is the culprit. Now holding the RX high at 3.3v seems to overcome the problem.
Then it is just a matter up using the API to set the DIO pin HIGH or LOW
In my case I am toggling DIO_1. Here is the API call from the controller XBee:
7E 00 10 17 01 00 7D 33 A2 00 41 50 EA D5 FF FE 02 44 31 05 69
The hex 44 31 is D1 in ASCII the 05 sets the pin HIGH
And for low:
7E 00 10 17 01 00 7D 33 A2 00 41 50 EA D5 FF FE 02 44 31 04 6A
Again the 44 31 but now set to 04 - LOW
And the standalone XBee responds properly to the command. No micro attached!
The floating RX pin may or may not be your issue, but the API string should work using your config params. And don't forget the PAN ID must be the same.
Hope this helps.

use serialforwarder data in another program

how can i build the serialforwarder or use it to forward the received data to another program to make some process?
how to parse the data and use it as input data to another program such as Matlab or c# or java application.
which protocol used to parse the recieved data ?
last question: it is just for motes which is base station mote ? can i build one for any mote ?
You have to read thoroughly the serial stack...its not very easy but its do able.
You can directly read from serial port. You don't need serial forwarder in this case. There are few things to take care of.
For example if you want to read a serial message that is being send to serial port of your PC (usb sensorboards just work like serial, since they are using usb to serial converters lik FTDI chip).
in C# (same for Java, etc...) you can read byte streams that are coming in the serial port. You can parse this byte streams to extract a standard serial message of tinyos.
This is somehow explained in TEP #113 although it has some problems, but you should be able to find those problems and make your program work.
As it stated in TEP 113, a standard serial packet is something like:
7e 40 09 00 be ef 05 7d 5d 06 01 02 03 04 05 7e
That means, a packet starts with hex 7E ( I believe its 126 or 127) and ends also with 7E. The last 2 bytes are CRC of the packet. So you can in your c# program start reading from serial port when you encounter 7E and stop reading when you reach the next 7E in the stream. Everything in between will be your packet.
You have to be careful of escaping that is if a 7E is part of your packet content, to be not be confused with start and end dilimeters, it will be escaped to something else...that's also is explained in that TEP 113.
I believe there were some C++ code fro calculating the CRC that you can easily convert it to C# or Java code.
Also check the source code of Serial.h which contains some details about how a serial packet is being formed in TinyOS.

Resources