Comments (9)
Hi! What is the status of this feature?
I have an application that needs to sleep for extended periods of time between updates (~10min), and I am not sure if the Arduino can reconnect with the cloud after the deep sleep (using Arduino Low Power library on MKR GSM board).
Is that currently possible?
from arduinoiotcloud.
hi @generationmake
You have a really good point there.
We have been working on an update which will allow better control of connection/disconnection.
Of course our goal is to work on something which won't introduce breaking changes, but we're getting there.
Stay tuned :)
from arduinoiotcloud.
Hi @generationmake
Thank you very much for raising this issue. If you have already a complete implementation feel free to create a pull request. I'll have to advise you though that currently refactoring efforts are under way which might render your PR obsolete, so I suggest the best course of action is to wait it out a bit and then create a PR with your suggested changes.
from arduinoiotcloud.
Hi @ubidefeo and @lxrobotics.
Thank you for your answers.
I will stay patient and see what comes up next.
from arduinoiotcloud.
hi @podhrmic
I have successfully used the automatic reconnect on IoT Cloud using MKR GSM waking up from deep sleep.
I have occasionally had reconnection issues when coverage wasn't available but it worked once signal was fine again
from arduinoiotcloud.
Thanks for the quick reply!
from arduinoiotcloud.
my pleasure, @podhrmic
just make sure you give the board enough time to reconnect before it goes back to sleep ;)
from arduinoiotcloud.
hi @ubidefeo
I have the same problem. I have a MKRGSM1400 with a MKRENV shield and I want to send dato to cloud.
I use Arduino low power library to put the MKRGSM in deep sleep but after some times it stop working. For example with deep sleep time of 15 minutes it works for a while then it stop working. In my last test it worked for 4 hours then it stop working.
With a sleep time of 30 minutes or 1 hour it stop working immediately.
This is my simple sketch:
#include <Arduino_MKRENV.h>
#include <ArduinoLowPower.h>
#include "thingProperties.h"
GSM_SMS sms;
unsigned long tempo;
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1000*30);
// Defined in thingProperties.h
initProperties();
// Imposto Callback per invio SMS informativo alla prima connessione
ArduinoIoTPreferredConnection.addConnectCallback(onNetworkConnect);
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
/*
The following function allows you to obtain more information
related to the state of network and IoT Cloud connection and errors
the higher number the more granular information you’ll get.
The default is 0 (only errors).
Maximum is 4
*/
setDebugMessageLevel(4);
ArduinoCloud.printDebugInfo();
// Inizializzo MKRENV
if (!ENV.begin()) {
Serial.println("Failed to initialize MKR ENV shield!");
while (1);
}
// Imposto funzione da richiamare al risveglio
LowPower.attachInterruptWakeup(RTC_ALARM_WAKEUP, onWakeUp, CHANGE);
tempo = millis();
}
void loop() {
ArduinoCloud.update();
// Your code here
// read sensor values
temperatura = ENV.readTemperature();
umidita = ENV.readHumidity();
pressione = ENV.readPressure();
if (millis() - tempo > 90000) {
// Triggers a 300 seconds sleep (the device will be woken up only by the registered wakeup sources and by internal RTC)
// The power consumption of the chip will drop consistently
LowPower.deepSleep(900000);
delay(10000);
tempo = millis();
}
}
void onNetworkConnect(void *_arg) {
static int SMSConnessione = 0;
if (SMSConnessione == 0) {
// Invio SMS di conferma inizializzazione scheda
sendSMS("xxxxxxxxxx", "Scheda Inizializzata");
SMSConnessione = 1;
}
}
void sendSMS(char numero[], char testoSMS[]){
sms.beginSMS(numero);
sms.print(testoSMS);
sms.endSMS();
}
void onWakeUp() {
// This function will be called once on device wakeup
// You can do some little operations here (like changing variables which will be used in the loop)
// Remember to avoid calling delay() and long running functions since this functions executes in interrupt context
//ArduinoIoTPreferredConnection.connect();
//tempo = millis();
}
Thanks
from arduinoiotcloud.
Just FYI I had a similar problem - I have Arduino MKR GSM shield with a number of I2C sensors, and it all works nicely until Arduino goes to sleep. After spending some time trying to debug what is going on, I used Arduino Uno to turn Arduino MKR GSM on and off (and Uno sleeps in between) and that works as expected.
from arduinoiotcloud.
Related Issues (20)
- Reset when connected to network but no internet HOT 1
- Version 1.10.0 - Error in OTA.h HOT 4
- Compilation of my sketch fails: "`'class ArduinoIoTCloudTCP' has no member named 'getFloatProperty'`" HOT 1
- Include the capability to send messages from the modules to the messenger dashboard HOT 13
- Fatal Error: SFU.h: No Such File or Directory HOT 4
- Incompatible Lszz.py with Apple M1 processor HOT 6
- Add a cloud pause capability needed for cellular modem devices like MKR NB 1500
- OTA support for Renesas-based boards: `UNO R4 WiFi`, `Portenta C33`
- ESP32 WROOM 32 DevKit (DIYMall) error connecting to ArduinoCloud HOT 2
- Negative values HOT 5
- Scheduler isn't valid when using Time zone HOT 5
- Where are the Micropython examples and help? HOT 1
- [WIRE-10] Make ota error codes homogeneous and board specific
- Add support for LZSS tools on Windows
- Compilation fails "multiple definition of ..." when "ESP Mail Client" and ArduinoIoTCloud libraries used in sketch
- Package tools on PyPI
- Warnings of usage of depricated code within Arduin Cloud libraries
- Add support cloud type for thermostat / Alexa.TemperatureSensor
- Library does not compile from the Arduino Cloud IDE for MKR Wi-Fi 1010 HOT 4
- OTA-esp32.cpp:125:29: error: 'isCapable' is not a member of 'Arduino_ESP32_OTA' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinoiotcloud.