Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MKRNB1500 + Arduino IoT Cloud Connection Issues #274

Open
Brennan-Richards opened this issue Aug 4, 2021 · 7 comments
Open

MKRNB1500 + Arduino IoT Cloud Connection Issues #274

Brennan-Richards opened this issue Aug 4, 2021 · 7 comments

Comments

@Brennan-Richards
Copy link

Board I am using: MKR NB 1500

Sensors: multiple IC sensors for physical environment readings

Power source: LiPo battery pack via on-board JST port

Other libraries: Arduino LowPower for SAMD

My problem is that I cannot get the board to maintain a connection consistently with the Arduino IoT cloud. I’m attempting to use the LowPower library to save power, but putting the board into sleep mode tends to disrupt the connection. I disabled sleep mode and the connection was maintained for a few hours last night, however it also seems to have been disrupted. I’ve also disabled the watchdog at this point because the code in my loop runs sometimes longer than the ~16 second timer, and a reset is undesirable.

I am looking to deploy the modules ‘in the field’ over extended periods. Is there a way I can ensure that my board stays connected, and to re-establish a connection to the Arduino IoT Cloud in the case that it disconnects? (I am exploring subscribing to the DISCONNECT event which triggers a callback that runs the ArduinoCloud.begin() method, thoughts on this?)

Thanks in advance and best regards,
Brennan.

@Brennan-Richards Brennan-Richards changed the title Some troubling behavior MKRNB1500 + Arduino IoT Cloud Connection Issues Aug 4, 2021
@Brennan-Richards
Copy link
Author

Hi all, I can see that some of the contributors to this Arduino IoT Cloud library have also worked on this issue through this library: https://github.com/arduino-libraries/Arduino_ConnectionHandler/blob/master/src/Arduino_ConnectionHandler.cpp. Is this a recommended inclusion?

@Brennan-Richards
Copy link
Author

Update: I've re-enabled the watchdog timer, and the board maintained connection for three hours (with resets, even though that's not best case for me) and still in the end ultimately lost connection permanently although the Arduino MKR NB 1500 board and circuit are certainly still powered up and running. They have not moved from the same spot at any point.

Anyone else experiencing this or similar?

Best,
Brennan

@Brennan-Richards
Copy link
Author

Bump... Is anyone else experiencing similar problems?

Is it a hardware problem? There seems to be a lot of fussing with the SARA R4 modem on board going on in an attempt to improve connection reliability.

Is it a network problem? My hope is that these problems will start to disappear as the LTE-M/NB-IoT are cultivated.

Any help or general discussion is welcomed please.

@aentinger
Copy link
Collaborator

because the code in my loop runs sometimes longer than the ~16 second

Instead of disabling the watchdog I'd suggest to strategically sprinkle your loop with a couple of watchdog_reset(); calls. Also as of right now Low Power/Deep Sleep is not supported by the Arduino IoT Cloud firmware stack.

@jsword
Copy link

jsword commented Aug 20, 2021

I experienced a similar issue with my MKR WiFi 1010. Using a similar setup and LowPower it would run for a few hours and then freeze. After a LOT of debugging I discovered a memory leak every time ArduinoCloud.begin() was called. Eventually your board just runs out of memory and stops. I have currently worked around it by monitoring memory and triggering a reset whenever it gets down to 1/3 free.

Free memory init: 13419
ArduinoCloud.begin
Free memory post-init: 12915
...
Free memory init: 12635
ArduinoCloud.begin
Free memory post-init: 12131
....
Free memory init: 11851
ArduinoCloud.begin
Free memory post-init: 11347

@aentinger
Copy link
Collaborator

Hey @jsword 👋
You really should be calling ArduinoCloud.begin() only once. As I wrote above, low power sleep isn't currently supported in the framework.

@jsword
Copy link

jsword commented Aug 30, 2021

Sorry @aentinger I’m a bit of a newbie. 🤷‍♂️
Is there any supported way to conserve power since I’m running a solar/battery powered system?
Is there a way to look up the cross framework support/compatibility that I might have missed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants