MKR NB not working when powered through battery socket

Johanna,

I am also a very frustrated MKR NB owner... In summary, I'm now experimenting with the third board shipped by Arduino, as two previous ones were found faulty.

I found out that power management on this board is different than the one on the first board I got.
First board was behaving more like the MKR GSM.

Second board behaves the same way as the third board.

First thing first, do you experience the same?

Interestingly enough, my setup works best when running on battery only... But in certain conditions.

Also, one point if you didn't already do that. In the code, remove

while (!Serial);

If any, as it would wait for the Serial connection to the PC to be established.
On battery only this never happens, so you would end up staying in that loop.

May I ask you to try this and tell me if you get the same:

Scenario 1:

  1. Connect a charged battery only -> code working, MQTT connection established and stable, keepalives exchanged, green LED slighly ON, very dimmed, but expected
  2. Connect a USB power supply to USB port -> green LED goes fully ON, board freezes, not exactly sure where in the code, but my MQTT connection goes of, and I get disconnected from operator's network, and orange LED (charging) stays off.
  3. Short press reset button: orange LED comes ON. Connects to my MQTT broker is established, however no subsequent MQTT traffic (I don't publish or subscribe to anything, I only send keepalives), and connection times out on broker side.
  4. Disconnect USB power -> orange LED goes off, green LED dimms a bit, but not as much as in point 1. It's on a bit dimmed as it is on the MKR GSM when running on battery only. No MQTT connection coming in.
  5. Push reset button again, and we go back to point 1.

Scenario 2:

  1. Connect USB power source only -> green LED goes ON, orange LED fast blink, which is expected as no battery is connected, no MQTT connection coming in to my broker.
  2. Short press reset button -> green LED stays ON, this time orange LED doesn't fast blink, still no MQTT connection coming in.
  3. Connect the battery -> same as point 2
  4. Short press reset button -> orange LED comes ON, however no connection to my MQTT broker.
  5. Double press to go in bootloader mode -> charging LED goes OFF, built in LED fades up and down.
  6. Short press to go out from bootloader mode: orange LED comes ON. Connects to my MQTT broker is established, however no subsequent MQTT traffic, and connection times out on broker side.
  7. Disconnect the USB power source: orange and green led are both still on! Yes, you heard me, charging LED is on even though only battery is connected, at least for some time, then it goes off, green led still on (it should not as per documentation when battery only is used). And no connection to my MQTT broker
  8. Short press reset button -> back to scenario 1, point 1, stuation which is the only stable one in my case.

It took me ages to figure ths out, because of having to visibility on what is happening. With the MQTT connection, I can clearly see when that work or not.

No be noted that all of this seems to behave differently when USB connection is make to a PC instead of a bear power source...

So that make very difficult to understand where all of this stucks...

Regards