This is a great tutorial. I have been messing with these modules for weeks to find out how to communicate between an XBee module and an ESP32 module. Huge thanks!!!! I can't wait to test it.
That's great! Something for you to consider...Unless you need the processing power of the ESP32, you might want to consider simplifying your project by using the XBee's MicroPython capabilities and its available GPIO pins. You can add wifi capabilities with an ESP8266. You might be interested in a new project I'm working on. It uses many, many remote XBee modules running micropython, connected to sensors. The remote units report back to a coordinator (also running micropython) which utilizes an ESP8266 to connect to the cloud. I'll have series of videos published soon.
I totally agree, there is no need for the ESP, as long as you don't need Wifi or some higher performance, but since I have started my project on the very beginning with ESP and Wifi, it seemed to be easier for me to migrate only the comminacation part to the XBee (to extend the range and stabilize the communication), and leave the data processing on th ESP. I do not have any experience with Micropython and I am not sure if it is possible to omit the MCU completely from my setup. I have a DHT22 sensor with digital output connected to the ESP32, which is reading the temperature and humidity, then the ESP hands over the data to the XBee, which is remotely connected to a server. The server then decides whether to open or close the window, which is controlled also by the ESP32 (relay with an electric motor). I am planning to build a whole system on this, so I am constantly searching for better solutions, since I am planning to implement this system in a huge building area. I am definitely looking forward for your upcoming tutorials, thanks for the effort on creating such great content for us.
That's interesting. Here is a sneak peek at my github repository for an upcoming "Intro to MicroPython on XBee" video (github.com/gregcompton/AtmosphereMonitor). It uses a BME280 temp/humidity/pressure sensor over I2C, but the code could be easily adapted for the DHT22. Just search for "dht22 python example"
This is very useful for us. I saw your 3 Xbee video. Thanks to you. And please explain one clear video Cloud-based and data streaming-based with the Xbee S6B wifi module. I will be waiting for your next post.
Hi thanks for the video, I am using Xbee shield on Arduino leonardo board. And the transmission is not happening properly in my case. What could be the possible issue and please help me out with this.
This video is really helpful. However, I find that the examples for the XBee-arduino library does not work on XBee3 modules. Waiting for your video on the XBee library!
Hi, excelent work, but I have a question, I hope that you can help me! Do you know what is the difference between mode AT and API? Only the way that I can send the informartion or more velocity?
AT mode or transparent operating mode send the data in string for example "Hello world" and API mode works with bits packages in Hex ( A4 0D etc) is easier work in AT mode because you can send the data in string and you don't have to make a package
This is a good question and it took me a while to wrap my head around it too. Asking about the “difference between AT and API” is not strictly correct. Actually, you need to think about this in terms of “Transparent mode” and “API mode”. Like @Baditos stated, transparent mode just sends data in strings. API mode sends “frames” that are formatted in a very specific manner and the “payload” is just one part of the frame. Transparent mode is very easy to use if you have very simple implementation (only one or radios) or you don’t care from which radio the data originated. Also in transparent mode you must enter “command mode” in order to read/change the radio settings, via AT commands. There is a very specific process and timing to do this. API mode is a little more complicated to setup, but the metadata available from each frame makes implementation much, much easier. There are great libraries for Python and Arduino which abstract away the complexities of generating frames. Digi’s XBee Python and MicroPython libraries are extremely easy to use. I’ll be posting a tutorial video on these soon. Furthermore, API mode has various types of frames which make certain tasks much easier. For example, you can use an AT Command frame to read/change radio settings in one step. Regarding throughput, transparent mode will give you the highest data throughput, because you could send a constant stream of serial data without the overhead of API frames. However, you would need to have a way of ingesting this data on the receiving end. Frankly, I can can only imagine some edge cases where this would be useful. Ultimately, I highly recommend that you spend a little time learning the API libraries. API mode makes everything easier. Hope that helps!
Hello sir, I have a question here that if we want to send the data to another router how can we add the address of that router in the payload? this method is okay for coordinator but what can we do for mesh communication.
Hello Sir, I've been stuck on trying to send data from one arduino to another using xbee. I have watched a lot of youtube videos and even read a lot of documentations but I am still not able to make it work. any help?
Hello sir, this is really amazing stuff but I am facing a problem in communication in API mode with Arduino but it is working perfectly in AT mode. I don't know why. I tried a lot to figure out that what's the problem but I couldn't find out. I followed your tutorial completely. Can you please help in this or can you please make a video on arduino to arduino communication through xbee API mode with or without using arduino xbee library?
if (xbee.getResponse().isAvailable()) { // got something char apid=xbee.getResponse().getApiId(); Serial.println(apid); if (xbee.getResponse().getApiId() == ZB_RX_RESPONSE) { // got a zb rx packet datalength=rx.getFrameDataLength(); Serial.println(datalength); // now fill our zb rx class xbee.getResponse().getZBRxResponse(rx); //uint8_t rssi=rx.rssi(); for(int i=0; i
Clear and concise!
This. Is. Amazing! I've been stuck on my radio integration for months. This is stellar. Thank you!!
This is a great tutorial. I have been messing with these modules for weeks to find out how to communicate between an XBee module and an ESP32 module. Huge thanks!!!! I can't wait to test it.
That's great!
Something for you to consider...Unless you need the processing power of the ESP32, you might want to consider simplifying your project by using the XBee's MicroPython capabilities and its available GPIO pins. You can add wifi capabilities with an ESP8266.
You might be interested in a new project I'm working on. It uses many, many remote XBee modules running micropython, connected to sensors. The remote units report back to a coordinator (also running micropython) which utilizes an ESP8266 to connect to the cloud. I'll have series of videos published soon.
I totally agree, there is no need for the ESP, as long as you don't need Wifi or some higher performance, but since I have started my project on the very beginning with ESP and Wifi, it seemed to be easier for me to migrate only the comminacation part to the XBee (to extend the range and stabilize the communication), and leave the data processing on th ESP. I do not have any experience with Micropython and I am not sure if it is possible to omit the MCU completely from my setup. I have a DHT22 sensor with digital output connected to the ESP32, which is reading the temperature and humidity, then the ESP hands over the data to the XBee, which is remotely connected to a server. The server then decides whether to open or close the window, which is controlled also by the ESP32 (relay with an electric motor). I am planning to build a whole system on this, so I am constantly searching for better solutions, since I am planning to implement this system in a huge building area. I am definitely looking forward for your upcoming tutorials, thanks for the effort on creating such great content for us.
That's interesting. Here is a sneak peek at my github repository for an upcoming "Intro to MicroPython on XBee" video (github.com/gregcompton/AtmosphereMonitor). It uses a BME280 temp/humidity/pressure sensor over I2C, but the code could be easily adapted for the DHT22. Just search for "dht22 python example"
@@gregcompton9631 I will definitely check this out soon, thanks for the link, it is highly appreciated. Thank you!
Thanks for this tutorial, Greg. I found XBee 3 to be different and your videos are very helpful!
Super helpful stuff. Would certainly love to see more. Thanks for posting.
Thanks Blake!
This is very useful for us. I saw your 3 Xbee video. Thanks to you. And please explain one clear video Cloud-based and data streaming-based with the Xbee S6B wifi module. I will be waiting for your next post.
Another great, useful video. Thank you, Greg.
Thanks Hundred Times Thanks For this Video Greg.
Hello thank you very much for your useful video i want to ask how i can send sensor data using this configuration?
Very useful! I've been looking for this content for a long time. Could you make a video on how to use the xbee library? Thank you very much!
Thanks for the lesson, I have a problem.
My xbee is mounted on a
My API cannot detect the xbee any help
THANK YOU SO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Great! Thanks.
Hi thanks for the video, I am using Xbee shield on Arduino leonardo board. And the transmission is not happening properly in my case. What could be the possible issue and please help me out with this.
This video is really helpful. However, I find that the examples for the XBee-arduino library does not work on XBee3 modules. Waiting for your video on the XBee library!
Hi, excelent work, but I have a question, I hope that you can help me!
Do you know what is the difference between mode AT and API?
Only the way that I can send the informartion or more velocity?
AT mode or transparent operating mode send the data in string for example "Hello world" and API mode works with bits packages in Hex ( A4 0D etc) is easier work in AT mode because you can send the data in string and you don't have to make a package
This is a good question and it took me a while to wrap my head around it too. Asking about the “difference between AT and API” is not strictly correct. Actually, you need to think about this in terms of “Transparent mode” and “API mode”.
Like @Baditos stated, transparent mode just sends data in strings. API mode sends “frames” that are formatted in a very specific manner and the “payload” is just one part of the frame.
Transparent mode is very easy to use if you have very simple implementation (only one or radios) or you don’t care from which radio the data originated. Also in transparent mode you must enter “command mode” in order to read/change the radio settings, via AT commands. There is a very specific process and timing to do this.
API mode is a little more complicated to setup, but the metadata available from each frame makes implementation much, much easier. There are great libraries for Python and Arduino which abstract away the complexities of generating frames. Digi’s XBee Python and MicroPython libraries are extremely easy to use. I’ll be posting a tutorial video on these soon. Furthermore, API mode has various types of frames which make certain tasks much easier. For example, you can use an AT Command frame to read/change radio settings in one step.
Regarding throughput, transparent mode will give you the highest data throughput, because you could send a constant stream of serial data without the overhead of API frames. However, you would need to have a way of ingesting this data on the receiving end. Frankly, I can can only imagine some edge cases where this would be useful.
Ultimately, I highly recommend that you spend a little time learning the API libraries. API mode makes everything easier.
Hope that helps!
Hello sir, I have a question here that if we want to send the data to another router how can we add the address of that router in the payload? this method is okay for coordinator but what can we do for mesh communication.
Hi Greg, Did you know how to do a mesh with Xbee Digimesh?
hi did you find anything easy on internet. kindly do let me know
Yes of curse fella
Hello Sir, I've been stuck on trying to send data from one arduino to another using xbee. I have watched a lot of youtube videos and even read a lot of documentations but I am still not able to make it work. any help?
Can anybody Please explain how to do broadcast data transmission between coordinator to router and end device… in digi XCTU ZIGBEE
I have no option coming of generating frame
Anyone know why my xctu cannot discover my XBee S2C module😢
Hello sir, this is really amazing stuff but I am facing a problem in communication in API mode with Arduino but it is working perfectly in AT mode. I don't know why. I tried a lot to figure out that what's the problem but I couldn't find out. I followed your tutorial completely. Can you please help in this or can you please make a video on arduino to arduino communication through xbee API mode with or without using arduino xbee library?
#include
#include
#define rxPin 2
#define txPin 3
SoftwareSerial xbeee = SoftwareSerial(rxPin, txPin);
XBee xbee = XBee();
XBeeResponse response = XBeeResponse();
ZBRxResponse rx = ZBRxResponse();
ModemStatusResponse msr = ModemStatusResponse();
char data;
int datalength;
void setup() {
Serial.begin(9600);
xbeee.begin(9600);
xbee.begin(xbeee);
}
void loop() {
xbee.readPacket();
if (xbee.getResponse().isAvailable()) {
// got something
char apid=xbee.getResponse().getApiId();
Serial.println(apid);
if (xbee.getResponse().getApiId() == ZB_RX_RESPONSE) {
// got a zb rx packet
datalength=rx.getFrameDataLength();
Serial.println(datalength);
// now fill our zb rx class
xbee.getResponse().getZBRxResponse(rx);
//uint8_t rssi=rx.rssi();
for(int i=0; i
when you said that was a byte i was like no that's hex code.
I linked to this video in my git repo as you did a great job showing api setup. ty
github.com/prichardsondev/ioct
Great! I'm glad it was helpful