digidotcom / xbee-python

Python library to interact with Digi International's XBee radio frequency modules.
Mozilla Public License 2.0
183 stars 93 forks source link

digi.xbee.exception.InvalidOperatingModeException: Unsupported operating mode: AT mode #69

Open manuaatitya opened 5 years ago

manuaatitya commented 5 years ago

I have 3 XBees s1 all configured in API mode with one coordinator and 2 end device and I'm tring to send data explcitly to one of the bees.I'm using XCTU to visualise the data recieved in which both my end devices have the serial connection closed.

My code is as follows :

from digi.xbee.devices import *

Instantiate a XBee object server = XBeeDevice("COM4",115200)

Open a port for communication server.open()

Instantiate a remote object thanos = RemoteXBeeDevice(server,XBee64BitAddress.from_hex_string("0013A2004103D949")) hulk = RemoteXBeeDevice(server,XBee64BitAddress.from_hex_string("0013A2004103D932"))

Message to be sent to the bot server._send_expl_data(thanos,0xA0, 0xA1, 0x1554, 0xC105, "Iron Man") time.sleep(2)

Close the communication port server.close()

But i get the error :

Traceback (most recent call last): File "explicit_data_bee.py", line 8, in server.open() File "C:\Users\DELL\AppData\Local\Programs\Python\Python37\lib\site-packages\digi\xbee\devices.py", line 1262, in open raise InvalidOperatingModeException.from_operating_mode(self._operating_mode) digi.xbee.exception.InvalidOperatingModeException: Unsupported operating mode: AT mode

But both all my Xbees are in API mode only.

Any help is appreciated.

DavePlater commented 3 years ago

The directly connect XBee is your coordinator? Is send_expl_data(remote_xbee, data, src_endpoint, dest_endpoint, cluster_id, profile_id, transmit_options=0) what you have to use?

Can you accomplish the task by using send_data(remote_xbee, data, transmit_options=0) ? You might get a different error message to work with at least?