End device stuck if ZigBee network is not available

Issue Description:
Our end device operates in sleep mode. When the button is pressed, it wakes up and sends data using MicroPython script, the transmission is a unicast. Once the button is released, the device returns to sleep mode. However, if the router is removed, In this scenario, if anyone presses the button, the end device gets stuck and does not send data until the reset button is pressed. Even after reconnecting the router, and after reset also multiple attempts are required for the device to successfully transmit data.
I am using xbee3 firmware 1014 and end device is in PIN Hibernate mode.

Requirement:
We need a solution where the device does not get stuck when the router is absent. Instead, when the router becomes available, it should send data immediately upon button press without requiring multiple attempts or a reset.

If anyone has a solution, please share your insights.

You should be using the JN and JV commands. Also in your code, you should be checking the AI command before you send data. You should also have in your code, a function to test a connection and retry queering the AI before you try again. You may also want to have it issue a local network reset (NR0) if it is unable to transmit after a given number of attempts.

most welcome for your valuable topic.

Hi,
I tried both the JN and JV commands but situation is same, as well as the AI command. However, the AI command consistently returns zero, even when no router is present on the network. I also attempted a watchdog reset, but after the reset, the device still takes a few seconds to connect to the router. If I press the button repeatedly to wake up the device, it connects, or sometimes fails to connect at all.

My requirement is that after the router disconnects, pressing the button should not cause the device to get stuck. If it does get stuck, then once the router is reconnected, a single button press should re-establish the connection. If there is any other solution to achieve this, please share your suggestions.

This is something that will need to be addressed in your code. When you are unable to transmit data to the parent router/destination, you will want to do a local network reset (ATNR0). This will place the radio into a Joining/scanning for a network state. This will remain until it is able to connect to a network.