Xbee mesh network: Can end-devices have bi-directional communication with a coordinator? - xbee

Quick question: I'm setting up a mesh network with Digi's Xbees series 2, one coordinator and as many as 8 end-devices and as the title implies.
I was wondering if the end-devices could receive data from the coordinator, making for a 2-way communication as I know they can send data to it. These are used in an Arduino-based robot location triangulation project.

Yes, you can do it using API mode if you know the mac address of the device you want to talk to.
Try it here: Digi API Frame Maker. The Frame you need to use is Transmit Request (type 0x10).
You can do it in Transparent Mode too, but in this case you need to enter command mode and set the device address before sending data each time you need to talk to a different module (using ATDLand ATDH commands).

Related

How to stream data via BLE?

I am currently evaluating the board of Maxim Integrated MAXREFDES100#. As part of my thesis, I would like to examine whether there is the possibility of using BLE for data streaming.
The supplied software is fully functional and can already transfer data. Of course, only smaller data packets over a longer period like Temperature or precalculated Heart Rate values. I am aware that BLE is not suitable and has not been designed to transmit data continuously. Nevertheless, I would like to try to transfer the ECG raw data also via the BLE interface. So that I can check whether my data has been arrived completely and correctly in time (prerequisite for ECG data), I have developed the following test setup:
Currently, I store data of a sine wave to a large FIFO and transfer 20-byte sine packets to a characteristic. So far everything works wonderfully. Using an Android device and a BLE sniffer I catch the data packets and check if the sine has any interruptions. The following graphic is taken from a longer measurement: (I have tested my FIFO and the sine datas are complete without any inerruption): This is a capture of my Android and my BLE Sniffer: Data packets are missing.
Sine & Spektrogram Image
Further measurements show that the errors do not occur sequentially, they can always be found at different times. (The Fifo Implementation must be correct)
Sine & Spektrogram Image 2
Since my phone and my Adafruit BLE sniffer have identical errors in the same place, the data packages on the board-side must be corrupt. I suspect they are lost at some protocol level (GAP maybe?). Interestingly, errors affect at least 200 following bytes (256 bytes data are a complete sine). This means that at least 10 data packets each 20 Bytes would have to be in order to get such a graphic.
What options are there for continuously sending data via the BLE interface?
Is it possible to send the data directly via L2CAP without GATT/ATT?
Are there any more wireless, low power protocols that allow data streaming? (So ​​with acknowledgment like TCP for completeness and chronological correctness)
Best regards, Emin
What options are there for continuously sending data via the BLE interface?
Is it possible to send the data directly via L2CAP without GATT/ATT?
BLE v4.1 introduced LE Connection-Oriented Channels which is a way to send data directly via L2CAP without GATT/ATT (think about network sockets). See also Bluetooth Core Specification Vol. 3 Part A Section 3.4.
The board you are using has a EM9301 BLE chip which seems to support BLE v4.1. However, the mbed library you are using doesn't allow you to use them. See here, you have an interface for connect/disconnect callbacks and GATT characteristics read/write/notification. Nothing about LE Connection-Oriented Channel.

programming for Xbee meshing

i have one query actually i have 3 xbees series2.
i want xbee 1 (sensor+xbee(end device)) and xbee 2 as coordinator,where XBee2 will be attched to MCU.
now i have xbee 3 which again ((sensor+xbee(end device)).
now i want to make xbee3 also to communicate with coordinator(Xbee2).
now i have kept the same pan ID of Xbee1 and xbee3 as like Xbee2.
and again i have set xbee1 and xbee3 destination address for the Xbee 2 .
now my question are
how do i program the MCU using eclipse environment for receiving both Xbee1 and Xbee3 data?
and i want to communicate all Xbees with UART communication means i want to read data using pin 2 and 3 of Xbee..is it possible??
can anyone provide me the code for developing this procedure???
thanks
This is a common scenario. Run the coordinator in API mode and the end devices (you may want to start with those nodes as routers, and figure out the "sleeping end device" details once everything else is working) in AT mode.
The "AT mode" devices with DH and DL set to 0 will just pass serial data to the coordinator, and the MCU can parse the API frames to determine which device sent the data. The MCU can also address requests to the other devices -- either Remote AT Commands or data to send out the serial port.
Write code for the MCU however you normally would. There's a portable ANSI C library available if that's your language of choice. It can parse the API frames for you and simplify communications on the network.

XBee communication in API mode using X-CTU

I am trying to communicate between two XBee S2 modules both in API mode using the XCTU tool.
One device as router and another device as coordinator. I got successful communication of two XBee modules in AT mode and either of them as API or AT mode. But when I configure both of them in API mode they are not communicating.
How do you know they're not communicating? How are you forming your API frames to send into the device?
In API mode, the XBee module requires a checksummed series of bytes in a specific format to send data to another device. During your tests between the module in AT mode and the one in API mode, you were probably able to see a received frame on the API module when typing data into X-CTU on the AT module.
What language are you going to write your program in? I would recommend using a code library to manage encoding and decoding the API frames.
Digi has a webpage listing XBee host libraries in various languages.
After giving a lot of try i found two tricks in configuring X Bee modules
If your X Bee module is not getting read, just write with the suitable firmware
choosing manually
If it is not responding to read or even write also, connect reset pin to
ground using single wire for few second.

Windows TCP/UDP mouse driver

I am working on creating a touch pad device (custom hardware but similar to an android device) that acts as a touchscreen drawing pad similar to the Wacom Bamboo drawing pads. However, the key feature of the device is instead of connecting it to the computer with wires or via Bluetooth, it connects to the local WiFi network and searches for devices with a port open (currently 5000 for testing purposes). Currently, I have a client written in C that when launched opens up a DatagramSocket on port 5000 and waits for a custom UDP packet containing normalized X, Y, and pressure. Then, for testing purposes, I am putting the normalized X and Y into SendInput. SendInput "works" however injecting packets into the computers current mouse is not what I want. Instead, I want to have it considered as a seperate input device so programs like gimp will be able to detect it and assign custom functions based on the data (ie: have gimp utilize the pressure data).
The problem is I dont know where to start to create a driver that does the former. I have been extensively looking at the winddk thinking that might be the key. The problem with the winddk is I cannot find any documentation on creating a HID driver using data that is not from a ps/2 or usb. This tutorial got me thinking about using IOCTLs, but I am not really sure how to make them be considered as input.
As a side note, in the title I said TCP/UDP because I am willing, and considering for security purposes, to change from UDP connection to TCP.
If someone can push me in the right direction or link me to some related documentation and samples, that would be awesome because right now I am lost. Thank you.

How can I send data packets into the network without using sockets?

I want to send data packets into the network bypassing the Linux network stack. I mean is there any way where I can interrupt the network card driver and place a frame in the network card buffer directly to send it in the network? I am a newbie in Linux Kernel hacking so any guideline on how I can get started will be very helpful.
You would be better off if you used some virtual device like TAP. You can easily hack a control interface into the TAP kernel module, via which you can then pass frames ready to be sent out to the driver. That approach can be compared to the performance of a regular socket application as the baseline. Since in the end the TAP device will "send" out egress frames via a character device, you can easily write a test application measuring performance and latency.

Resources