"Config not found" - ERROR[403]: Protected

Hi Bob,
I seem to have run into that (normal-ish) situation where the config.txt file gets lost:

I tried the suggestion you’ve given before to download the prior version from the esp_spiffs directory, then upload to the root - but I get a permissions error:

(It does still seem to be logging data - just doesn’t know where to upload it to)

Thanks,
Sandy

Can you post your message log please?

SD initialized.
7/18/21 20:16:10z Real Time Clock is running. Unix time 1626639370
7/18/21 20:16:10z Power failure detected.
7/18/21 20:16:10z Reset reason: External System
7/18/21 20:16:10z ESP8266 ChipID: 2870702
7/18/21 20:16:10z IoTaWatt 4.x, Firmware version 02_06_05
7/18/21 20:16:10z SPIFFS mounted.
7/18/21 20:16:10z setConfig: config.txt open failed.
7/18/21 20:16:10z config file invalid, attempting recovery.
7/18/21 14:16:10 configuration recovery successful.
7/18/21 14:16:10 Local time zone: -7:00
7/18/21 14:16:11 Using Daylight Saving Time (BST) when in effect.
7/18/21 14:16:11 device name: IotaWatt
7/18/21 14:16:14 Connecting with WiFiManager.
7/18/21 14:16:17 HTTP server started
7/18/21 14:16:17 emoncms: Starting, interval:10, url:http://192.168.0.6/emoncms
7/18/21 14:16:17 WiFi connected. SSID=BLACKBURN, IP=192.168.0.17, channel=11, RSSI -58db
7/18/21 14:16:17 MDNS responder started for hostname IotaWatt
7/18/21 14:16:17 LLMNR responder started for hostname IotaWatt
7/18/21 14:16:18 timeSync: service started.
7/18/21 14:16:18 statService: started.
7/18/21 14:16:18 Updater: service started. Auto-update class is ALPHA
7/18/21 14:16:18 emoncms: Start posting at 07/18/21 14:11:30
7/18/21 14:16:18 dataLog: service started.
7/18/21 14:16:19 dataLog: Last log entry 07/18/21 14:12:25
7/18/21 14:16:20 Updater: Auto-update is current for class ALPHA.
7/18/21 14:16:23 historyLog: service started.
7/18/21 14:16:23 historyLog: Last log entry 07/18/21 14:12:00

** Restart **

SD initialized.
7/18/21 20:24:27z Real Time Clock is running. Unix time 1626639867
7/18/21 20:24:27z Power failure detected.
7/18/21 20:24:27z Reset reason: External System
7/18/21 20:24:27z ESP8266 ChipID: 2870702
7/18/21 20:24:27z IoTaWatt 4.x, Firmware version 02_06_05
7/18/21 20:24:27z SPIFFS mounted.
7/18/21 20:24:27z setConfig: config.txt open failed.
7/18/21 20:24:27z config file invalid, attempting recovery.
7/18/21 14:24:27 configuration recovery successful.
7/18/21 14:24:27 Local time zone: -7:00
7/18/21 14:24:28 Using Daylight Saving Time (BST) when in effect.
7/18/21 14:24:28 device name: IotaWatt
7/18/21 14:24:31 Connecting with WiFiManager.
7/18/21 14:24:34 HTTP server started
7/18/21 14:24:34 emoncms: Starting, interval:10, url:http://192.168.0.6/emoncms
7/18/21 14:24:34 WiFi connected. SSID=BLACKBURN, IP=192.168.0.17, channel=11, RSSI -69db
7/18/21 14:24:34 MDNS responder started for hostname IotaWatt
7/18/21 14:24:34 LLMNR responder started for hostname IotaWatt
7/18/21 14:24:35 timeSync: service started.
7/18/21 14:24:35 statService: started.
7/18/21 14:24:35 Updater: service started. Auto-update class is ALPHA
7/18/21 14:24:35 emoncms: Start posting at 02/05/06 23:28:26
7/18/21 14:24:35 dataLog: service started.
7/18/21 14:24:36 dataLog: Last log entry 07/18/21 14:18:50
7/18/21 14:24:38 Updater: Auto-update is current for class ALPHA.
7/18/21 14:24:40 historyLog: service started.
7/18/21 14:24:40 historyLog: Last log entry 07/18/21 14:18:00

** Restart **

SD initialized.
7/18/21 20:59:44z Real Time Clock is running. Unix time 1626641984
7/18/21 20:59:44z Power failure detected.
7/18/21 20:59:44z Reset reason: External System
7/18/21 20:59:44z ESP8266 ChipID: 2870702
7/18/21 20:59:44z IoTaWatt 4.x, Firmware version 02_06_05
7/18/21 20:59:44z SPIFFS mounted.
7/18/21 20:59:44z setConfig: config.txt open failed.
7/18/21 20:59:44z config file invalid, attempting recovery.
7/18/21 14:59:44 configuration recovery successful.
7/18/21 14:59:44 Local time zone: -7:00
7/18/21 14:59:44 Using Daylight Saving Time (BST) when in effect.
7/18/21 14:59:45 device name: IotaWatt
7/18/21 14:59:48 Connecting with WiFiManager.
7/18/21 14:59:51 HTTP server started
7/18/21 14:59:51 emoncms: Starting, interval:10, url:http://192.168.0.6/emoncms
7/18/21 14:59:51 WiFi connected. SSID=BLACKBURN, IP=192.168.0.17, channel=11, RSSI -69db
7/18/21 14:59:51 MDNS responder started for hostname IotaWatt
7/18/21 14:59:51 LLMNR responder started for hostname IotaWatt
7/18/21 14:59:52 timeSync: service started.
7/18/21 14:59:52 statService: started.
7/18/21 14:59:52 Updater: service started. Auto-update class is ALPHA
7/18/21 14:59:52 emoncms: Start posting at 02/05/06 23:28:26
7/18/21 14:59:52 dataLog: service started.
7/18/21 14:59:52 dataLog: Last log entry 07/18/21 14:59:25
7/18/21 14:59:53 Updater: Auto-update is current for class ALPHA.
7/18/21 14:59:57 historyLog: service started.
7/18/21 14:59:57 historyLog: Last log entry 07/18/21 14:59:00
7/18/21 17:14:35 WebServer: Upload aborted: /config.txt

The SPIFFS has been deprecated, and so IoTaWatt is moving to a different, more robust config update system. Your unit is currently running on the file config+1.txt. Could you post the contents of that file please?

config+1.txt (4.0 KB)
(jsonchecker.com didn’t see any formatting issues)

OK, that’s the config that your unit is using at startup. Recovery should be installing it permanently, so I’ll need to figure out why it’s not. In the meantime, if you download config+1.txt, then upload it, it should install permanently as config.txt.

I don’t know the problem with Emoncms upload. I suspect the instance of Emoncms. In any event, once you download/upload the config, you should be able to refresh the configuration app and edit the Emoncms uploader setup.

Unfortunately, that’s back to the issue I started with: ERROR[403]: Protected

Are you uploading the file as config+1.txt?

The way it works is that you can’t just upload a config.txt. You have to upload config+1.txt and the IoTaWatt then attempts to parse and install that file. If no errors are found, it then renamed the existing config.txt to config-1.txt and then renamed config+1.txt to config.txt.

With this scheme you can’t upload a bad config and there is only a very small window where there is no config.txt. Previously, any error uploading a new config.txt would result in a lost config.

A bit strange; it still says ‘Config not found’ - but it’s working!
I uploaded the file, as config+1.txt this time, then restarted. The IotaWatt UI still doesn’t seem to see the config (and there still isn’t a config.txt file). But it does seem to be uploading to my local EmonCMS.

I’d need to see the message log. Have you refreshed the config app since uploading the +1 file?

I did restart the browser. And did a Ctl-F5.
Here’s the log. The 401 errors are my fault - I first uploaded the exact file I sent you above - with the API key 'x’d out! Second upload & restart is with the key corrected. It’s been running for the last day, happily uploading to EmonCMS.
SD initialized.

7/20/21 18:10:29z Real Time Clock is running. Unix time 1626804629
7/20/21 18:10:29z Reset reason: Software/System restart
7/20/21 18:10:29z Trace: 1:6[6], 1:1[7], 1:2[8], 9:0[8], 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[8], 1:2[9], 9:0[9], 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 10:2, 10:3
7/20/21 18:10:29z ESP8266 ChipID: 2870702
7/20/21 18:10:29z IoTaWatt 4.x, Firmware version 02_06_05
7/20/21 18:10:29z SPIFFS mounted.
7/20/21 18:10:29z setConfig: config.txt open failed.
7/20/21 18:10:29z config file invalid, attempting recovery.
7/20/21 12:10:30 configuration recovery successful.
7/20/21 12:10:30 Local time zone: -7:00
7/20/21 12:10:30 Using Daylight Saving Time (BST) when in effect.
7/20/21 12:10:30 device name: IotaWatt
7/20/21 12:10:30 HTTP server started
7/20/21 12:10:30 emoncms: Starting, interval:10, url:http://192.168.0.6/emoncms
7/20/21 12:10:30 timeSync: service started.
7/20/21 12:10:30 statService: started.
7/20/21 12:10:31 dataLog: service started.
7/20/21 12:10:31 dataLog: Last log entry 07/20/21 12:10:25
7/20/21 12:10:35 historyLog: service started.
7/20/21 12:10:35 historyLog: Last log entry 07/20/21 12:10:00
7/20/21 12:10:35 WiFi connected. SSID=BLACKBURN, IP=192.168.0.17, channel=11, RSSI -66db
7/20/21 12:10:36 MDNS responder started for hostname IotaWatt
7/20/21 12:10:36 LLMNR responder started for hostname IotaWatt
7/20/21 12:10:36 Updater: service started. Auto-update class is ALPHA
7/20/21 12:10:36 emoncms: Query failed 401
7/20/21 12:10:38 Updater: Auto-update is current for class ALPHA.
7/20/21 12:10:41 emoncms: Query failed 401
7/20/21 12:10:46 emoncms: Query failed 401
7/20/21 12:10:51 emoncms: Query failed 401
7/20/21 12:10:56 emoncms: Query failed 401
7/20/21 12:11:01 emoncms: Query failed 401

7/20/21 12:13:23 Restart command received.

** Restart **

SD initialized.
7/20/21 18:13:25z Real Time Clock is running. Unix time 1626804805
7/20/21 18:13:25z Reset reason: Software/System restart
7/20/21 18:13:25z Trace: 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:1[2], 1:2[3], 9:0[3], 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 10:2, 10:3
7/20/21 18:13:25z ESP8266 ChipID: 2870702
7/20/21 18:13:25z IoTaWatt 4.x, Firmware version 02_06_05
7/20/21 18:13:25z SPIFFS mounted.
7/20/21 18:13:25z setConfig: config.txt open failed.
7/20/21 18:13:25z config file invalid, attempting recovery.
7/20/21 12:13:26 configuration recovery successful.
7/20/21 12:13:26 Local time zone: -7:00
7/20/21 12:13:26 Using Daylight Saving Time (BST) when in effect.
7/20/21 12:13:26 device name: IotaWatt
7/20/21 12:13:26 HTTP server started
7/20/21 12:13:26 emoncms: Starting, interval:10, url:http://192.168.0.6/emoncms
7/20/21 12:13:26 timeSync: service started.
7/20/21 12:13:26 statService: started.
7/20/21 12:13:27 dataLog: service started.
7/20/21 12:13:27 dataLog: Last log entry 07/20/21 12:13:20
7/20/21 12:13:31 historyLog: service started.
7/20/21 12:13:31 historyLog: Last log entry 07/20/21 12:13:00
7/20/21 12:13:31 WiFi connected. SSID=BLACKBURN, IP=192.168.0.17, channel=11, RSSI -68db
7/20/21 12:13:32 MDNS responder started for hostname IotaWatt
7/20/21 12:13:32 LLMNR responder started for hostname IotaWatt
7/20/21 12:13:32 Updater: service started. Auto-update class is ALPHA
7/20/21 12:13:32 emoncms: Start posting at 05/03/21 21:07:30
7/20/21 12:13:34 Updater: Auto-update is current for class ALPHA.