Zigbee (AP=0) transmit() router to coord fails on 2nd, 3rd, ... attempts

Transmit a message (ex. “Hello”) from router to coordinator works on first transmit() but fails (bricks?) on next and thereafter transmit().

Setup: xb3-24z modules (1 coord and 1 router), FW 100D or 1013 (used same FW version on both modules when testing them), uPy code flashed into modules via XCTU, Transparent mode, 2 PC’s (one for each module so can run XTCU for diagnostics), antenna’s attached and modules physical distance apart is a couple feet.

Coordinator uPy code - create network (until AI=0) then infinite loop waiting for router data to transfer to coordinators serial terminal (TeraTerm, XCTU).

Router uPy code - associate to network then transmit() ‘Hello’ in infinite loop (alternative version no loop just transmit() a few times coded sequentially).

Initial Network config - CE, JV, ID, AP values as required, 115200 baud; other config settings at default.

Associated values reported - AI=0, AP=0, matching OP, matching CH, matching OI on both Coord and Router. JV, CE correct on each. MAC ACK failures = 0

uPy flash coding attempts to fix issue - time.sleep() in various ways to buy time for functions, ATRN0 in uPy on both Coord and Router in all possible variations, hard code DH/DL in router within transmit(). Since transmit() blocking, tried checking AI==0 in a loop with transmit(), besides import xbee and time in uPy code, imported other libs (modules) sys, micropython, machine, etc to try.

Network config change from default - Replace DH/DL fields (defaults 0) with modules SH/SL (MAC) on both and one module at a time as well.

Results - Exactly the same in all and every attempt listed above. First “Hello” transmitted from router and received by coordinator and sent out to PC serial terminal and thereafter nothing.

My guess is others doing the same simply test and have things working no problem and I’m missing something stupid. Ideas and help please.

Add ? xbee3 MMT any electrical changes on pin-outs when migrated due to supply chain issue i.e. a pin high now pin low or ???. Old modules compatible with FW from 1003 to current 1013 (%C = 1) yet current modules compatible with FW100D to 1013 ((%C = 2).

Not at an electrical level but at a component level. Newer modules are not able to install the older code as they do not have the component that is no longer installed.

You should be specifying the transmit request frame within your code and not in the DL/DH function of the radio.

mvut, Could you expound on what you mean "transmit request frame . . . " or an example snippet please. We are in transparent mode. The code below to me should transmit ‘Hello’ 3 times and received by the coordinator but only does the 1st one ie ‘Hello 1’. The code is flashed into the modules using XCTU “os.format(), ctrl-f, ctrl-d process”. Do you see a problem with my code? I have removed the try-excepts and played with sleep.time() delays and/or removing them and none of that makes a difference ie only first ‘Hello’ gets thru. Also hard coded addresses instead of ‘dest’ in my code and same results. The use of 'atcmd(“NR0”) did not change anything either. By the way the use of ‘ADDR_COORDINATOR’ for addresses does not work if that means anything to you. All the key parameters (AI, AP, CH, OP, etc) show network associated the whole time and it is (I can power down the router then power it up and network associate recovers and since that restarts the router code, yes I get the 1st ‘Hello’ again and that’s it). I have used different serial monitors (TeraTerm, XCTU and a custom PC program I wrote) and all show 1st ‘Hello’ only so it can’t be a monitoring issue. Sorry to include the code but I did not know how else to reply informatively. Thanks mvut

Router code:
import xbee, time

def network_status():
return xbee.atcmd(“AI”) # actually indented in my code

while network_status() != 0: # establish network connection
time.sleep(0.5) # actually indented in my code

time.sleep(1) # just a delay if now that associated needs a little time
x = 10 # just a dummy variable to use below
payload1 = “Hello 1\n”
payload2 = “Hello 2\n”
payload3 = “Hello 3\n”
dest = atcmd(“DH”) + atcmd(“DL”)

try: # 1st sending of Hello
xbee.transmit(dest,payload1) # indented in my code
except Exception as err:
x = 10 # indented in my code
sleep(1)

try: # 2nd sending of Hello
xbee.transmit(dest,payload2) # indented in my code
except Exception as err:
x = 10 # indented in my code
sleep(1)

try: # 3rd sending of Hello
xbee.transmit(dest,payload3) # indented in my code
except Exception as err:
x = 10 # indented in my code
sleep(1)

while True: # just to keep code running
x = 10 # indented in my code

Coordinator code:
import xbee, time

def network_status():
return xbee.atcmd(“AI”) # indented in my code

while network_status() != 0:
time.sleep(0.5) # indented in my code

time.sleep(1) # delay in case for association
node_list =
while len(node_list) == 0:
node_list = list(xbee.discover()) # indented in my code
time.sleep(1) # delay in case for association

x=10 # dummy variable for while infinte loop
while True:
x=10 # indented in my code
time.sleep(0.1) #indented in my code

Are you trying to load and run this code on the module that is also in transparent mode?

Yes mvut, router code flashed into one module and set up as a router in settings and is in transparent mode (AP=0). The coordinator code flashed into the other module that is set up as a coordinator in settings and also is in transparent mode (AP=0).

By the way, with older xbee3 MMT modules before part change all this works with FW1008 and older (1007,1006, . . . ) but fails with FW1009 and newer FW versions. Newer xbee3 modules only compatible with FW100D and newer FW releases and fails as well. Is there a reason in FW revisions for this?

This will not work the way you think it will. Your Python script runs independently from the radios AT commands. If you want to run a Micro Python application, then you really should be running in Micro Python mode via the AP command.

I would also suggest looking a the Sample Applications found in the Digi XBee Plugin for PyCharm.

Added: My actually application is a simple data logging framework literally just need to replace wires with a wireless connection. Sensor on routers always and only transmitting sensor data to 1 coordinator that only needs to receive that data and shuffle out the UART. A ZigBee network allows greater distances from some routers to coordinator due to repeater like capabilities and the inherent self healing properties is a bonus. I used transparent mode on all routers and coordinator with older FW because had on hand older xbee3 MMT modules and the project ran great and was simple uPy code with ‘transmit(destination address, payload)’ on router instead of having to do an API frame build within the code. Coordinator only needed to create network and associate the routers and thereafter an infinite loop doing nothing but letting the transparent mode shuffle out data via UART. The least amount of code in modules needed to run is beneficial in my application as that contributes to higher data rate through-put hence I yield higher data value resolution. The option of using a 802.15.4 FW and frame work I can’t get the benefits of ZigBee that matter for me. Just like in the ’ Hello’ coding, in my actual application I only get the first data point and nothing thereafter. To me I’m guessing something changed along the way with FW revisions and I misunderstanding something. Today current xbee3 MMT production requires FW100D or higher. I’m just trying to give you the most complete information I can and feel very bad I’m being a pain.

Just saw your reply prior to my ADD reply. “Your Python script runs independently from the radios AT commands.” THANK YOU very much.