Frage

I have 4 arduino modules that have temperature,humidity and co2. They send this data as a single line through xbee. The raspberry pi reads these lines through xbee. Here is the output I get at the level of the raspberry pi:

Node_2 57.4 21.9 24264

Node_4 56.0 22.4 877.0 23884

Node_3 Node_1 56.5 22.2 864.0 24180

53.7 22.8 24260

Node_2 57.4 21.9 24264

Node_1 53.7 22.8 24260

The problem is that I get interferences between lines and don't know how to solve this problem. Line 3 shows that two lines interfered. The program that reads this is python based. I would also want to know the mac address of every packet sent to the raspberry pi.

Thank you

War es hilfreich?

Lösung

Use API mode.

This way, every message sent to your python program would be encapsulated on his own packet. On the header of this packet, you can get the mac address of the module that sent the message.

The frames you need are Transmit Request (type 0x10) and Receive Packet (0x90). Take a look:

Digi API Frame Maker

More information about API mode and frame types:

Product Manual: XBee / XBee-PRO ZB RF Modules

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top