When I power the Xbee3 (through XBee Grove Dev board) chip with USB port, the chip run the stored Python code correctly.
However, when I power the XBee3 (through XBee Grove Dev board) chip with battery (2 x 1.5V AA battery). The chip just blink the On/Sleep and ASSOC but it does not run my Python code.
I cannot found the document about this strange behavior. How to run the Python code when power with battery?
Short answer: voltage of 3V provided by 2 disposable AA batteries is too low.
Looking development board’s schematic (https://www.digi.com/resources/documentation/digidocs/90001457-13/reference/xbee_smt_grove_schematics.pdf) you’ll find a NSR1020MW2 Schottky barrier diode after Vbat input. That’s there for protection against reverse polarity and will “eat” ~0.24V from input voltage provided by battery pack.
Then you’ll find a low dropout regulator (RT9167/A-33GB from Richtek). This provides stable 3.3V output as Vcc for the board, but also needs input voltage bit over Vcc. Actual voltage drop depends on current absorbed by XBee module and rest of the board. Don’t underestimate XBee3 pro module consumption, which is 135mA during transmission (https://www.digi.com/resources/documentation/digidocs/90001543/#reference/r_specs_power_reqs.htm%3FTocPath%3DIEEE%2520802.15.4-specific%2520specifications|_____2). According to RT9167/A datasheet this causes regulator dropout to reach some hundreds of mV.
Total voltage drop (Schottky diode + regulator) could reach ~0.5V depending on board’s load. Ideally a voltage of ~3.8V (3.3V + ~0.5V) should be provided to Vbat.
You can add another AA battery in order to reach 4.5V (3 x 1.5V). This should be safe because RT9167/A can accept 7V as maximum input voltage.
You could also try with 3 NiMh rechargeable batteries to get ~3.6V in total. Due to dropout across the regulator increasing with drawn current, I’m not sure this will provide enough voltage to PRO modules. If you try this option I’d be interested in knowing the result as a comment, thanks. Maybe 4 NiMh elements (~4.8V in total) could be a better option.
Similarly you could try a single Lithium Ion or Lithium Polymer cell (~3.6V to 3.7V). I presume this is what Digi meant to be used for battery-powering their development boards. I would’t dare using double cells Li-Ion/Li-Po battery with nominal voltage of ~7.2V (maybe even higher, when the battery is just recharged) because voltage after Schottky diode would be very close to regulator’s maximum input voltage. Some small drones batteries at 3.7V use same JST PH connector (2mm pitch, also named PowerWhoop, or mCPX) mounted on Digi’s boards. These batteries can be easily found on e-stores, just be aware they usually have reversed pinout: their JST PH connectors have pin 1 connected to ground and pin 2 to Vbat, while XBee grove development boards requires Vbat on pin 1 and ground on pin 2 (https://www.digi.com/resources/documentation/digidocs/90001457-13/#reference/r_power_battery_connect_grove.htm%3FTocPath%3DOverview|Power%2520supply|_____3).