Web server does not respond, light is green

Trying to understand this. The log that you posted showed the last restart on 10/7. Is that about when your problems started?

The unit was finally restarted after the message log was read from the SDcard. Can you take it out again and let me see what has happened since the restart?

I still believe this is a WiFi issue. Some routers have the ability to insulate individual devices from each other. My Ubiquity does that on my guest network. I am thinking there is some type of filtering going on in your router or a switch. I’ll see in the updated log, but it’s curious that your router doesn’t know about the IoTaWatt IP address. Is your DHCP server in your router? How can it assign an IP to the IoTaWatt then not know about it?

FYI, A larger SD card will not increase the device capacity. The one year current log and 10+ year history log will use less than 4GB. The unit comes with 8GB.

Problems started before that. Probably around the 20th of September.

I’ll try unplugging every wifi AP in the home except for the router itself and see if that solves the issue.

Here’s the log for the last restart:

** Restart **

SD initialized.
10/07/22 09:19:02z Real Time Clock is running. Unix time 1665134342 
10/07/22 09:19:02z Reset reason: Software/System restart
10/07/22 09:19:02z Trace:  34:10[11], 34:30, 34:10[12], 34:30, 34:10[13], 34:30, 34:10[9], 34:5, 34:5, 34:5, 34:6[11], 34:10[9], 34:30, 34:10[8], 34:30, 34:10[11], 34:30, 34:10[10], 34:30, 34:10[12], 34:30, 34:10[13], 11:31[3], 11:30[3], 11:35, 11:36, 11:35, 11:40, 11:45, 11:50, 11:55, 11:70
10/07/22 09:19:02z ESP8266 ID: 480839, RTC M41T81 (68)
10/07/22 09:19:02z IoTaWatt 5.0, Firmware version 02_07_05
10/07/22 09:19:02z SPIFFS mounted.
10/07/22 11:19:02 Local time zone: +1:00, using DST/BST when in effect.
10/07/22 11:19:02 device name: Iotawatt
10/07/22 11:19:02 HTTP server started
10/07/22 11:19:02 timeSync: service started.
10/07/22 11:19:02 statService: started.
10/07/22 11:19:02 dataLog: service started.
10/07/22 11:19:02 dataLog: Last log entry 10/07/22 10:02:40
10/07/22 11:19:07 historyLog: service started.
10/07/22 11:19:07 historyLog: Last log entry 10/07/22 10:02:00
10/07/22 11:19:07 WiFi connected. SSID=Guay fai, IP=192.168.1.94, channel=6, RSSI -58db
10/07/22 11:19:07 MDNS responder started for hostname Iotawatt
10/07/22 11:19:07 LLMNR responder started for hostname Iotawatt
10/07/22 11:19:07 Updater: service started. Auto-update class is MINOR
10/07/22 11:19:08 Updater: Auto-update is current for class MINOR.

** Restart **

SD initialized.
10/13/22 16:16:40z Real Time Clock is running. Unix time 1665677800 
10/13/22 16:16:40z Reset Reason: Power-fail restart.
10/13/22 16:16:40z ESP8266 ID: 480839, RTC M41T81 (68)
10/13/22 16:16:40z IoTaWatt 5.0, Firmware version 02_07_05
10/13/22 16:16:40z SPIFFS mounted.
10/13/22 18:16:40 Local time zone: +1:00, using DST/BST when in effect.
10/13/22 18:16:40 device name: Iotawatt
10/13/22 18:16:43 Connecting with WiFiManager.
10/13/22 18:16:47 HTTP server started
10/13/22 18:16:47 WiFi connected. SSID=Guay fai, IP=192.168.1.94, channel=6, RSSI -65db
10/13/22 18:16:47 MDNS responder started for hostname Iotawatt
10/13/22 18:16:47 LLMNR responder started for hostname Iotawatt
10/13/22 18:16:47 timeSync: service started.
10/13/22 18:16:47 statService: started.
10/13/22 18:16:47 Updater: service started. Auto-update class is MINOR
10/13/22 18:16:47 dataLog: service started.
10/13/22 18:16:47 dataLog: Last log entry 10/13/22 17:57:20
10/13/22 18:16:49 Updater: Auto-update is current for class MINOR.
10/13/22 18:16:52 historyLog: service started.
10/13/22 18:16:52 historyLog: Last log entry 10/13/22 17:57:00
10/13/22 21:17:31 Updater: Invalid response from server. HTTPcode: -4

Prior to the 22 the IoTaWatt was connected on channel 11. On the 22 it changed to channel 1, then either 1or 6. It is now on 6. After the last restart it was able to access the internet and as you report able to get requests from HASS.

Ok, so I I’ve forced every AP to use channel 11 for the 2.4 GHz band and now Iotawatt is answering browser requests from every browser.
The channels were previously set to automatically select the least occupied part of the spectrum. Apparently, somebody set up a new AP close by in the last month and it caused the APs to switch back and forth between channels.
For some reason, iotawatt only likes some of them and with channel 11 it works consistently.

** Restart **

SD initialized.
10/14/22 18:40:22z Real Time Clock is running. Unix time 1665772822 
10/14/22 18:40:22z Reset Reason: Power-fail restart.
10/14/22 18:40:22z ESP8266 ID: 480839, RTC M41T81 (68)
10/14/22 18:40:22z IoTaWatt 5.0, Firmware version 02_07_05
10/14/22 18:40:22z SPIFFS mounted.
10/14/22 20:40:22 Local time zone: +1:00, using DST/BST when in effect.
10/14/22 20:40:22 device name: Iotawatt
10/14/22 20:40:25 Connecting with WiFiManager.
10/14/22 20:40:28 HTTP server started
10/14/22 20:40:28 WiFi connected. SSID=Guay fai, IP=192.168.1.94, channel=11, RSSI -73db
10/14/22 20:40:28 MDNS responder started for hostname Iotawatt
10/14/22 20:40:28 LLMNR responder started for hostname Iotawatt
10/14/22 20:40:28 timeSync: service started.
10/14/22 20:40:29 statService: started.
10/14/22 20:40:29 Updater: service started. Auto-update class is MINOR
10/14/22 20:40:29 dataLog: service started.
10/14/22 20:40:29 dataLog: Last log entry 10/14/22 20:40:10
10/14/22 20:40:29 Updater: Auto-update is current for class MINOR.
10/14/22 20:40:34 historyLog: service started.
10/14/22 20:40:34 historyLog: Last log entry 10/14/22 20:40:00

But here comes the fun part. Now HASS is throwing this error and does not get data from Iotawatt anymore:

Logger: homeassistant.components.iotawatt.coordinator
Source: components/iotawatt/coordinator.py:76
Integration: IoTaWatt (documentation, issues)
First occurred: 9:13:20 PM (150 occurrences)
Last logged: 11:05:33 PM

Unexpected error fetching 192.168.1.94 data: 'NoneType' object has no attribute 'text'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/iotawatt/coordinator.py", line 76, in _async_update_data
    await self.api.update(lastUpdate=self._last_run)
  File "/usr/local/lib/python3.10/site-packages/iotawattpy/iotawatt.py", line 76, in update
    await self._refreshSensors(timespan, lastUpdate)
  File "/usr/local/lib/python3.10/site-packages/iotawattpy/iotawatt.py", line 154, in _refreshSensors
    results = response.text
AttributeError: 'NoneType' object has no attribute 'text'

Funnily enough, iotawatt.local does not find iotawatt in the home, but I checked the core.config_entries file in HASS and the IP is still set to 192.168.1.94 (and a rule in the router assigns that IP to the iotawatt every time), so it’s not that.

In my limited experience, that’s not a good idea, but if it works for you… I have better success setting each AP to a fixed channel using 1,6 and 11. My guess is that it’s more about the APs not switching channels than being on different channels. When they are all on the same channel, they compete with each other for bandwidth.

There could be one or more other APs within “earshot” that compete on other channels. Also, there are a lot of 2.4 GHz devices out there that can stomp on WiFi packets.

No idea what with the ethernet and Docker.

OK, so I’d leave a ping to your IoTaWatt IP running continuously from this host (the one with the 192.168.1.93 IP) to see when/if it fails, while logging the timestamp:

ping 192.168.1.94 | ts

or

ping -D 192.168.1.94

But it already doesn’t seem to be a problem between your Docker subnet and the Docker host itself, and more of a WiFi problem like @overeasy was pointing out.

Ok, so after ensuring the iotawatt can only connect to a certain AP and always on the same channel everything works again. Browsers can reach it, it responds to ARP requests and HASS is also connected.
Not really sure what the underlying issue is, but it is working now.
Let me know if there’s any additional log or test you may need (at least I don’t have to take out the SD card to get them anymore) for documentation or debugging purposes.

Thanks everyone for your help.

1 Like