I have recently received my first IoTaWatt, and after configuring it today seem to have hit a bug with the EmonCMS upload script. At the moment if I attempt to use EmonCMS it causes IoTaWatt to reboot continuously.
This can only be interrupted by removing the 9V voltage reference, so that IoTaWatt stops attempting to upload data to EmonCMS.
After doing some Wireshark analysis it appears that IoTaWatt is attempting an invalid API query (sending a POST to an endpoint that only supports GET), and EmonCMS replies to this with the login page. That response is quite large (45K) and so I wonder if this is causing the exception, but that is a supposition.
My EmonCMS is run locally, and is the latest version (10.8.5). For now I’ve raised an issue on Github (here) but I wonder if there’s something else I’m missing? Extracts of the log & config.txt are below.
Sequence of Events
- 19:45:41z: IoTaWatt was restarted manually
- 19:54:00z: 9V voltage reference was connected to IoTaWatt, triggering an attempt to upload to EmonCMS
- 19:54:01z: IotaWatt issues the POST query to EmonCMS
- 19:54:02z: IoTaWatt reboots with an Exception
- 19:54:06z: IoTaWatt attempts same POST query and reboots again, this continues until the 9V voltage reference is removed (breaking the reboot loop)
- If the EmonCMS configuration is deleted then the 9V voltage reference can be connected continuously.
IoTaWatt Log
SD initialized.
2/19/22 19:45:41z Real Time Clock is running. Unix time 1645299941
2/19/22 19:45:41z Reset reason: Software/System restart
2/19/22 19:45:41z Trace: 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:2, 1:2, 1:3, 1:3, 1:1[1], 1:2[2], 9:0[2], 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 1:3, 1:1[2], 1:2, 9:0, 9:0, 8:2, 8:2, 1:2
2/19/22 19:45:41z ESP8266 ID: 523643, RTC M41T81 (68)
2/19/22 19:45:41z IoTaWatt 5.0, Firmware version 02_07_05
2/19/22 19:45:41z SPIFFS mounted.
2/19/22 19:45:41z Local time zone: +0:00, using DST/BST when in effect.
2/19/22 19:45:41z device name: IotaWatt
2/19/22 19:45:41z HTTP server started
2/19/22 19:54:00z emoncms: Starting, interval:10, url:http://192.168.1.17
2/19/22 19:54:00z WiFi connected. SSID=Wireless, IP=192.168.1.15, channel=11, RSSI -65db
2/19/22 19:54:00z MDNS responder started for hostname IotaWatt
2/19/22 19:54:00z LLMNR responder started for hostname IotaWatt
2/19/22 19:54:00z timeSync: service started.
2/19/22 19:54:01z statService: started.
2/19/22 19:54:01z Updater: service started. Auto-update class is MINOR
2/19/22 19:54:01z dataLog: service started.
2/19/22 19:54:01z dataLog: Last log entry 02/19/22 19:40:40
2/19/22 19:54:01z historyLog: service started.
2/19/22 19:54:01z historyLog: Last log entry 02/19/22 17:55:00
** Restart **
SD initialized.
2/19/22 19:54:02z Real Time Clock is running. Unix time 1645300442
2/19/22 19:54:02z Reset reason: Exception
2/19/22 19:54:02z Trace: 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 1:3, 1:1[1], 1:2[2], 9:0[2], 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 1:3, 1:1[2], 1:2, 9:0, 9:0, 8:4, 8:6, 8:8, 8:9, 1:2
2/19/22 19:54:02z ESP8266 ID: 523643, RTC M41T81 (68)
2/19/22 19:54:02z IoTaWatt 5.0, Firmware version 02_07_05
2/19/22 19:54:02z SPIFFS mounted.
2/19/22 19:54:02z Local time zone: +0:00, using DST/BST when in effect.
2/19/22 19:54:02z device name: IotaWatt
2/19/22 19:54:02z HTTP server started
2/19/22 19:54:02z emoncms: Starting, interval:10, url:http://192.168.1.17
2/19/22 19:54:02z timeSync: service started.
2/19/22 19:54:02z statService: started.
2/19/22 19:54:02z dataLog: service started.
2/19/22 19:54:02z dataLog: Last log entry 02/19/22 19:40:40
2/19/22 19:54:02z historyLog: service started.
2/19/22 19:54:02z historyLog: Last log entry 02/19/22 17:57:00
2/19/22 19:54:06z WiFi connected. SSID=Wireless, IP=192.168.1.15, channel=11, RSSI -61db
2/19/22 19:54:06z MDNS responder started for hostname IotaWatt
2/19/22 19:54:06z LLMNR responder started for hostname IotaWatt
2/19/22 19:54:06z Updater: service started. Auto-update class is MINOR
** Restart **
SD initialized.
2/19/22 19:54:07z Real Time Clock is running. Unix time 1645300447
2/19/22 19:54:07z Reset reason: Exception
2/19/22 19:54:07z Trace: 9:0, 8:4, 8:6, 8:8, 8:9, 1:2, 1:3, 1:3, 1:6[1], 1:6[2], 1:6[3], 1:5[14], 1:6[4], 14:0, 14:4, 14:5, 14:7, 14:8, 1:6[6], 1:1, 1:2[1], 9:0[1], 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2
2/19/22 19:54:07z ESP8266 ID: 523643, RTC M41T81 (68)
2/19/22 19:54:07z IoTaWatt 5.0, Firmware version 02_07_05
2/19/22 19:54:07z SPIFFS mounted.
2/19/22 19:54:07z Local time zone: +0:00, using DST/BST when in effect.
2/19/22 19:54:07z device name: IotaWatt
2/19/22 19:54:07z HTTP server started
2/19/22 19:54:07z emoncms: Starting, interval:10, url:http://192.168.1.17
2/19/22 19:54:07z timeSync: service started.
2/19/22 19:54:07z statService: started.
2/19/22 19:54:07z dataLog: service started.
2/19/22 19:54:07z dataLog: Last log entry 02/19/22 19:54:05
2/19/22 19:54:07z historyLog: service started.
2/19/22 19:54:07z historyLog: Last log entry 02/19/22 19:45:00
2/19/22 19:54:11z WiFi connected. SSID=Wireless, IP=192.168.1.15, channel=11, RSSI -60db
2/19/22 19:54:11z MDNS responder started for hostname IotaWatt
2/19/22 19:54:11z LLMNR responder started for hostname IotaWatt
2/19/22 19:54:11z Updater: service started. Auto-update class is MINOR
config.txt
{
"format": 2,
"timezone": 0,
"update": "MINOR",
"device": {
"name": "IotaWatt",
"version": 3,
"channels": "15",
"burden": [
0,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20
]
},
"inputs": [
{
"channel": 0,
"name": "Voltage",
"type": "VT",
"model": "Ideal 77DB-06-09(UK)",
"cal": 20.01
},
{
"channel": 1,
"name": "Input_1",
"type": "CT",
"model": "HWCT-004",
"phase": 0.1,
"turns": 1000,
"cal": 50
},
{
"channel": 2,
"name": "Input_2",
"type": "CT",
"model": "SCT013-000",
"phase": 2.3,
"turns": 2000,
"cal": 100
},
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
],
"outputs": [
{
"name": "Voltage",
"units": "Volts",
"script": "@0"
}
],
"dstrule": {
"adj": 60,
"utc": true,
"begin": {
"month": 3,
"weekday": 1,
"instance": -1,
"time": 60
},
"end": {
"month": 10,
"weekday": 1,
"instance": -1,
"time": 60
}
},
"emoncms": {
"type": "emoncms",
"revision": 0,
"node": "IotaWatt",
"postInterval": 10,
"bulksend": 1,
"url": "http://192.168.1.17",
"apikey": "EMONCMS_READ_WRITE_API_KEY",
"user": "",
"pwd": "",
"outputs": [
{
"name": 1,
"script": "@0",
"units": ""
},
{
"name": 2,
"script": "@1",
"units": ""
},
{
"name": 3,
"script": "@2",
"units": ""
},
{
"name": 4,
"script": "@3",
"units": ""
},
{
"name": 5,
"script": "@4",
"units": ""
},
{
"name": 6,
"script": "@5",
"units": ""
},
{
"name": 7,
"script": "@6",
"units": ""
},
{
"name": 8,
"script": "@7",
"units": ""
},
{
"name": 9,
"script": "@8",
"units": ""
},
{
"name": 10,
"script": "@9",
"units": ""
},
{
"name": 11,
"script": "@10",
"units": ""
},
{
"name": 12,
"script": "@11",
"units": ""
},
{
"name": 13,
"script": "@12",
"units": ""
},
{
"name": 14,
"script": "@13",
"units": ""
},
{
"name": 15,
"script": "@14",
"units": ""
}
],
"userid": "",
"begdate": 1645228800
}
}