Reboots when upload to EmonCMS

Hi,

I’ve seen lots of threads related to this but i’m not able to figure this out.

Everytime Iotawatt does an update to my local Emon server the device reboots.

I did a wireshark and the post appears to be working fine

POST /input/bulk HTTP/1.1

host:XXX:80

content-type:application/x-www-form-urlencoded

Authorization:Bearer XX

Content-Length:922

time=1675131620&data=[[10,“IotaWatt”,121.42,1064.2,316.29,194.71,162.7,28.72,93.01,0,5.06,28.13,32.05,0,0,0,0],[20,“IotaWatt”,121.39,1052.64,319.54,167.41,161.86,29.3,98.88,0,3.55,27.78,31.64,0,0,0,0],[30,“IotaWatt”,121.35,1059.67,350.76,165.52,158.21,29.85,95.9,0,3.81,27.61,31.78,0,0,0,0],[40,“IotaWatt”,121.38,1066.41,370.25,169.65,162.88,35.65,100.51,0,4.02,27.58,31.64,0,0,0,0],[50,“IotaWatt”,121.43,1057.29,364.44,170.2,160.42,39.69,98.1,0,3.77,27.84,31.58,0,0,0,0],[60,“IotaWatt”,121.45,1038.59,361.17,165.53,158.7,33.42,99.77,0,4.87,27.33,31.81,0,0,0,0],[70,“IotaWatt”,121.38,1047.46,354.47,169.93,159.98,31.83,98.28,0,3.97,27.53,31.75,0,0,0,0],[80,“IotaWatt”,121.35,1047.52,348.96,168.29,159.84,34.79,98.52,0,4.1,27.69,31.8,0,0,0,0],[90,“IotaWatt”,121.44,1047.8,351.5,170.41,160.28,37.43,97.64,0,4.01,27.84,31.75,0,0,0,0],[100,“IotaWatt”,121.47,1055.74,326.62,171.54,160.9,34.79,97.67,0,3.84,28.18,31.81,0,0,0,0]]

And when i check EmonCMS it shows that the inputs are all being updated correctly.

Any ideas?

Can I see the message log please?

Here you go.

** Restart **

SD initialized.
1/31/23 02:37:52z Real Time Clock is running. Unix time 1675132672
1/31/23 02:37:52z Reset reason: Exception
1/31/23 02:37:52z Trace: 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 1:3, 1:6[1], 1:6[3], 1:5[31], 1:6[4], 31:0, 31:1, 31:2[6], 31:90, 21:110, 21:110, 31:91, 31:9, 31:1, 1:6[6], 1:3, 1:3, 1:6[1], 1:6[3], 1:5[31], 1:6[4], 31:0, 31:1, 31:2[4], 3:91
1/31/23 02:37:52z ESP8266 ID: 16279796, RTC PCF8523 (68)
1/31/23 02:37:52z IoTaWatt 5.0, Firmware version 02_07_05
1/31/23 02:37:52z SPIFFS mounted.
1/30/23 21:37:52 Local time zone: -5:00, using DST/BST when in effect.
1/30/23 21:37:52 device name: IotaWatt
1/30/23 21:37:53 HTTP server started
1/30/23 21:37:53 emoncms: Starting, interval:10, url:http://XX:80
1/30/23 21:37:53 influxDB_v2: Starting, interval:10, url:http://XXX:8086
1/30/23 21:37:53 timeSync: service started.
1/30/23 21:37:53 statService: started.
1/30/23 21:37:53 dataLog: service started.
1/30/23 21:37:55 dataLog: Last log entry 01/30/23 21:37:50
1/30/23 21:37:58 historyLog: service started.
1/30/23 21:37:58 historyLog: Last log entry 01/30/23 21:37:00
1/30/23 21:38:02 Updater: service started. Auto-update class is MAJOR
1/30/23 21:38:02 WiFi connected. SSID=XXX, IP=10.2.1.25, channel=1, RSSI -74db
1/30/23 21:38:02 MDNS responder started for hostname IotaWatt
1/30/23 21:38:02 LLMNR responder started for hostname IotaWatt
1/30/23 21:38:02 emoncms: Start posting at 01/30/23 21:37:50
1/30/23 21:38:03 PVoutput: started
1/30/23 21:38:03 influxDB_v2: Resume posting 01/30/23 21:37:40
1/30/23 21:38:03 Updater: Auto-update is current for class MAJOR.
1/30/23 21:38:05 PVoutput: System GMC, interval 5, donator mode
1/30/23 21:38:05 PVoutput: Start status beginning 01/30/23 21:35:00

** Restart **

SD initialized.
1/31/23 02:39:33z Real Time Clock is running. Unix time 1675132773
1/31/23 02:39:33z Reset reason: Exception
1/31/23 02:39:33z Trace: 9:0, 8:4, 8:6, 8:8, 8:9, 1:2, 1:3, 1:3, 1:6[1], 1:6[3], 1:5[31], 1:6[4], 31:0, 31:1, 31:2[6], 31:90, 21:110, 21:110, 31:91, 31:9, 31:1, 1:6[6], 1:3, 1:3, 1:6[1], 1:6[3], 1:5[31], 1:6[4], 31:0, 31:1, 31:2[4], 3:91
1/31/23 02:39:33z ESP8266 ID: 16279796, RTC PCF8523 (68)
1/31/23 02:39:33z IoTaWatt 5.0, Firmware version 02_07_05
1/31/23 02:39:33z SPIFFS mounted.
1/30/23 21:39:33 Local time zone: -5:00, using DST/BST when in effect.
1/30/23 21:39:33 device name: IotaWatt
1/30/23 21:39:34 HTTP server started
1/30/23 21:39:34 emoncms: Starting, interval:10, url:XXX:80
1/30/23 21:39:34 influxDB_v2: Starting, interval:10, url:1XXX:8086
1/30/23 21:39:34 timeSync: service started.
1/30/23 21:39:34 statService: started.
1/30/23 21:39:34 dataLog: service started.
1/30/23 21:39:36 dataLog: Last log entry 01/30/23 21:39:30
1/30/23 21:39:39 historyLog: service started.
1/30/23 21:39:40 historyLog: Last log entry 01/30/23 21:39:00
1/30/23 21:39:40 WiFi connected. SSID=XXX, IP=10.2.1.25, channel=1, RSSI -75db
1/30/23 21:39:40 MDNS responder started for hostname IotaWatt
1/30/23 21:39:41 LLMNR responder started for hostname IotaWatt
1/30/23 21:39:41 Updater: service started. Auto-update class is MAJOR
1/30/23 21:39:41 emoncms: Start posting at 01/30/23 21:39:30
1/30/23 21:39:42 influxDB_v2: Resume posting 01/30/23 21:39:20
1/30/23 21:39:44 PVoutput: started
1/30/23 21:39:44 Updater: Auto-update is current for class MAJOR.
1/30/23 21:39:45 PVoutput: System GMC, interval 5, donator mode
1/30/23 21:39:45 PVoutput: Start status beginning 01/30/23 21:35:00
1/30/23 21:40:36 emoncms: stopped, Last post 01/30/23 21:39:20

I’ve seen several of these lately. Can you:

Show the wireshark trace of the Emoncms response?
Try setting bulksend to 6?
Tell me the Emoncms version that you are using?

I tried 6 but it still reboots.

EmonCMS version is 10.8.1

i’m looking in the wireshark and the HTTP stream wasn’t closing correctly but the TCP stream shows i have Emoncms problems!

Warning: fopen(/var/opt/emoncms/phpfina/122.dat): failed to open stream: Permission denied in /var/www/emoncms/Modules/feed/engine/PHPFina.php on line 188

i’m guess this is causing it!

The response is 18k so maybe its overflowing a buffer?

That is probably the issue but there is a problem in IoTaWatt in that the unexpectedly large response is accepted into memory and causes an exception. I’m working on that but if you fix the Emoncms side your responses will revert to “ok” which work just fine.

Thanks. the files got corrupted at some point so i have to recover them and fix the perms. all good now. thank you for the help!