Nice, I like your links and will check them quickly.
To be most concrete as possible, I’ve done again tests with very minimal sketch, and the results are really speaking.
Here is the sketch:
//TEST STABILITY
//<<LIBRARIES>>
#define BLYNK_PRINT Serial // Comment this out to disable prints and save flash space
#define BLYNK_DEBUG // Comment this out to disable prints and save flash space
#define BLYNK_NO_BUILTIN // Disable built-in analog & digital pin operations to spare
#define BLYNK_NO_FLOAT // Disable float operations to spare flash space
#define BLYNK_NO_INFO // Skip device info to spare flash space
#include <BlynkSimpleUIPEthernet.h> // ENC28J60 ethernet BLYNK library
//<<VARIABLES>>
unsigned long lastRunTime; // mémoire du timing de la dernière requête au NANO Slave
unsigned long currentTime;
void setup() {
Serial.begin(9600); // start serial for output
Ethernet.begin("DE:ED:BA:FE:AA:A1", IPAddress(192,168,0,51),IPAddress(192,168,0,1),IPAddress(192,168,0,1),IPAddress(255,255,255,0)); //!!!!Changer MAC et IP arduino!!!! //!!!!Changer Auth Token / IP Serveur / Port!!!!
Blynk.config("d9ee4fa34c9545cca6ccb7787f733d35", "192.168.0.17", 8442);
}
BLYNK_WRITE(V27){ //TEST COMMAND
int buttonstate = param.asInt();
if (buttonstate == 1) {
Blynk.virtualWrite(V5, currentTime/1000);
}
}
void loop(){
currentTime = millis();
while (Blynk.connected()==false) {Blynk.disconnect(); Blynk.connect();}
Blynk.run();
if ((currentTime - lastRunTime >= 500) ){ //timer low-cost 0.5sec
lastRunTime = currentTime;
//Blynk.virtualWrite(V5, currentTime/1000);
}
}
Memory situation confortable->
23434 octets (72%) de l’espace de stockage de programmes. Le maximum est de 32256 octets.
Les variables globales utilisent 1341 octets (65%) de mémoire dynamique, ce qui laisse 707 octets pour les variables locales. Le maximum est de 2048 octets.
Just two commands (identical). One in the timer of 0,5sec, the other in the manual function “BLYNK_WRITE(V27)”.
First test: I push the widget V27 one time by 10 sec (my 5 other devices are power ON).
Result : The action reacts with some seconds of late on the serial and the NANO disconnects afer one or two actions.
[52]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.0 on Arduino Uno
[137] Disconnected
[157] Connecting to 192.168.0.17:8442
[5157] Connecting to 192.168.0.17:8442
[6156] Disconnected
[10158] Connecting to 192.168.0.17:8442
[10680] <[02|00|01|00]
[10681] <tokenXXXXXXXXXXXXXXXX
[10716] >[00|00|01|00|C8]
[10717] Ready (ping: 34ms).
[10742] Free RAM: 640
[20684] <[06|00|02|00|00]
[20716] >[00|00|02|00|C8]
[30685] <[06|00|03|00|00]
[32686] <[06|00|04|00|00]
[34688] <[06|00|05|00|00]
[36248] >[14|06|CD|00|07]
[36249] >vw[00]27[00]1
[36316] <[14|06|CD|00|07]
[36316] <vw[00]5[00]36
[36317] >[14|06|CE|00|07]
[36340] >vw[00]27[00]0
[36355] >[00|00|03|00|C8]
[36383] >[00|00|04|00|C8]
[36411] >[14|06|CF|00|07]
[36439] >vw[00]27[00]1
[36530] <[14|06|CF|00|07]
[36530] <vw[00]5[00]36
[36531] >[14|06|D0|00|07]
[36555] >vw[00]27[00]0
[36570] >[00|00|05|00|C8]
[46532] <[06|00|06|00|00]
[48533] <[06|00|07|00|00]
[50534] <[06|00|08|00|00]
[52535] <[06|00|09|00|00]
[52598] Heartbeat timeout: 52598, 36597, 52535
[52621] Disconnected
[57536] Connecting to 192.168.0.17:8442
[58057] <[02|00|01|00]
[58058] <d9ee4fa34c9545cca6ccb7787f733d35
[58092] >[00|00|01|00|C8]
Second test: I push the widget V27 one time by 1 sec (10X faster BUT my 5 other devices are power OFF).
Result : The action reacts immediatly on the serial and on the app, no disconnect after more than hundred actions!!
[52]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.0 on Arduino Uno
[137] Disconnected
[157] Connecting to 192.168.0.17:8442
[1521] <[02|00|01|00]
[1522] <tokenXXXXXXXXXXXXXXXXXXXXX
[1555] >[00|00|01|00|C8]
[1556] Ready (ping: 34ms).
[1580] Free RAM: 640
[10801] >[14|07|00|00|07]
[10802] >vw[00]27[00]1
[10869] <[14|07|00|00|07]
[10881] <vw[00]5[00]10
[10882] >[14|07|01|00|07]
[10884] >vw[00]27[00]0
[11650] >[14|07|03|00|07]
[11651] >vw[00]27[00]1
[11719] <[14|07|03|00|07]
[11719] <vw[00]5[00]11
[11756] >[14|07|04|00|07]
[11757] >vw[00]27[00]0
[12177] >[14|07|05|00|07]
[12178] >vw[00]27[00]1
[12246] <[14|07|05|00|07]
[12257] <vw[00]5[00]12
[12258] >[14|07|06|00|07]
[12260] >vw[00]27[00]0
[12643] >[14|07|07|00|07]
[12644] >vw[00]27[00]1
[12712] <[14|07|07|00|07]
[12712] <vw[00]5[00]12
[12754] >[14|07|08|00|07]
[12755] >vw[00]27[00]0
[13082] >[14|07|09|00|07]
[13083] >vw[00]27[00]1
[13150] <[14|07|09|00|07]
[13161] <vw[00]5[00]13
[13162] >[14|07|0A|00|07]
[13164] >vw[00]27[00]0
[13509] >[14|07|0B|00|07]
[13510] >vw[00]27[00]1
[13578] <[14|07|0B|00|07]
[13578] <vw[00]5[00]13
[13579] >[14|07|0C|00|07]
[13602] >vw[00]27[00]0
[13877] >[14|07|0D|00|07]
[13878] >vw[00]27[00]1
[13946] <[14|07|0D|00|07]
[13958] <vw[00]5[00]13
[13959] >[14|07|0E|00|07]
[13961] >vw[00]27[00]0
.............................................................. -> and so on
Third test: I uncomment the “Blynk.virtualWrite(V5, currentTime/1000);” in the loop to be acted 2 times by sec (AND my 5 other devices are powered ON).
Result : The actions reacts immediatly on the serial and on the app, no disconnect after more than hundred actions!!
So the problem is only with the manual action by “BLYNK_WRITE(V27)”. The “Blynk.virtualWrite” works very well all time.
[52]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.0 on Arduino Uno
[137] Disconnected
[157] Connecting to 192.168.0.17:8442
[5157] Connecting to 192.168.0.17:8442
[5679] <[02|00|01|00]
[5680] <tokenXXXXXXXXXXXXXXXXXXXXXXXX
[5713] >[00|00|01|00|C8]
[5714] Ready (ping: 34ms).
[5737] Free RAM: 640
[5781] <[14|00|02|00|06]
[5786] <vw[00]5[00]5
[6260] <[14|00|03|00|06]
[6261] <vw[00]5[00]6
[6760] <[14|00|04|00|06]
[6761] <vw[00]5[00]6
[7260] <[14|00|05|00|06]
[7261] <vw[00]5[00]7
[7760] <[14|00|06|00|06]
[7761] <vw[00]5[00]7
[8260] <[14|00|07|00|06]
[8261] <vw[00]5[00]8
[8760] <[14|00|08|00|06]
[8761] <vw[00]5[00]8
[9260] <[14|00|09|00|06]
[9261] <vw[00]5[00]9
[9760] <[14|00|0A|00|06]
[9761] <vw[00]5[00]9
[10260] <[14|00|0B|00|07]
[10261] <vw[00]5[00]10
[10760] <[14|00|0C|00|07]
[10761] <vw[00]5[00]10
[11260] <[14|00|0D|00|07]
[11261] <vw[00]5[00]11
[11760] <[14|00|0E|00|07]
[11761] <vw[00]5[00]11
[12260] <[14|00|0F|00|07]
[12261] <vw[00]5[00]12
[12760] <[14|00|10|00|07]
...................................................................-> and so on.......
I show here that the NANO with this light sketch works fine, excepted for the manual widget action “BLYNK_WRITE(V27)”, and only if other devices are connected to the local server.
So I don’t understand how it could be related with a leak of memory?? I really think there is a problem in the how the function “BLYNK_WRITE(V27)” is handled by the server.
(sorrry for the long post, but I think it’s necessary to be complete for such cases 