I have a question about hidden memory usage - following publish operations
I have a system set for threaded operation and MANUAL mode. The system runs on a 1 second / 10 state loop, with a manual ‘Particle.process()’ at the end of 10 seconds.
The system also prints stack and free memory every second (as I was experiencing crashes especially if the Wifi router was unplugged from the cloud - separate as yet unanswered post…).
At startup I see
SP: 0x20007CC8 Free: 0x7BC4 5>Inputs: 00000000
At this point I publish two messages
Alnwick.MBA1,temps:0123,Housetemp:26.18,HPflowtemp:22.62,Outsidetemp:22.68,DHWTemp:22.81 send OK
8,ThermistorOn:10,thermostat:12,HWdemand:14 send OK
Next FreeMem shows that 2612 bytes have been allocated to something…My guess is a couple of TCP packets to handle the publish.
SP: 0x20007CC8 Free: 0x7190 6> read IO…run programs
SP: 0x20007CC8 Free: 0x7190 7> run rules
SP: 0x20007CC8 Free: 0x7190 8> rules/diags to UDP >r
So we go round the state loop again…
SP: 0x20007CC8 Free: 0x7190 0>21:37:31
SP: 0x20007CC8 Free: 0x7190 1>t1=26.12,
SP: 0x20007CC8 Free: 0x7190 2>t2=22.62,
SP: 0x20007CC8 Free: 0x7190 3>t3=22.68,
SP: 0x20007CC8 Free: 0x7190 4>t4=22.81,
SP: 0x20007CC8 Free: 0x7190 5>Inputs: 00000000
At this point I publish two messages again - basically the same as before.
Alnwick.MBA1,temps:0123,Housetemp:26.12,HPflowtemp:22.62,Outsidetemp:22.68,DHWTemp:22.81 send OK
Alnwick.MBA1,pins:01234567,immersionhtr:0,ValveOn4Hot:3,HotWaterPump:5,HeatPumpPump:7,HeatingPump:8,ThermistorOn:11,thermostat:12,HWdemand:14 send OK
OK so now we have lost another 1264 bytes.
SP: 0x20007CC8 Free: 0x6CA0 6> read IO…run programs
So I just 'LOST’
SP: 0x20007CC8 Free: 0x6CA0 7> run rules
SP: 0x20007CC8 Free: 0x6CA0 8> rules/diags to UDP >r
Now - we continue to run at this level, so my memory blocks NEVER come back, but remain stable, continuing to publish two reports every 10 seconds.
The system now stays like this until such time as there is a cloud problem (EG pull the ethernet out of the WiFi router). Then we lose more memory which again never comes back - until my system bombs - probably when the heap trashes the stack :-O.
NB I would appreciate a response from the dev team - as I have now posted a number of reports of this type with no response :-((. I am hoping that these have been investigated and are being fixed for the next release - as I can’t see how pulling the cloud is my fault :-O.
The product is now rapidly becoming unusable - as I cannot deploy into a user environment where I have no control over Internet access, there is no official watchdog (another unanswered post), and the inability to reload firmware remotely - doesn’t reboot afterwards - again unanswered posts (not just from me).
Maybe its me not checking the cloud for every action which needs wifi (local or cloud), but if its going to fail it really should fail gracefully ???.
Hopefully I may get a response this time - PLEASE ???.