Thinking about an Ethernet solution

I know the topic of ethernet support has been thrown around quite a bit, came up with this idea and was wondering if anyone else had already gone down this path (a quick search didnt turn up anything)…

I know the Iotawatt is ESP based and that there are libraries that support serial output over the USB port. I should be able to build firmware with that functionality enabled (it looks like it might already be present?), then use an upstream Raspberry Pi with ethernet to read the serial output over USB and push that over the network to the final destination (in my case, Home Assistant). I’ve actually got two iotawatts for complete panel coverage, so it’d have to read from two USB ports.

Is there any reason this wouldnt work? I think the only real unknown is whether there’s enough storage on the ESP devices to add whatever libraries need to be present to output serial over USB…

You are correct that the ESP8266 based IoTaWatt cannot support Ethernet. There are no IO Pins available, no SPI available, and the real time processing requirements would so degrade sampling that the core mission of power sampling would be severely compromised.

The IoTaWatt does have the ability to output serial via the USB. It’s already there. If you connect a unit to your computer via USB and fire up a serial monitor like PuTTy (115,200baud) it will output all of the messages going to the message log as well as occasional diagnostic information. All that is needed to use it is a Serial.print command.

But that’s the easy part. The devil is in the details.

  • How do you trap the current HTTP requests and package them up?
  • How do you return the response?

A simpler way to get to Ethernet is to use the RPi as a proxy server running something like NGINX. All of the components are already available.

Take a look at the HTTPS proxy server support in the docs. This mechanism can send the uploader HTTP traffic to a server, typically a RPi which runs NGINX and sends the WiFi request out via Ethernet HTTPS. You basically setup a RPi with a WiFi AP and Ethernet.

There is other WiFi traffic not currently supported by the HTTPS proxy:

  1. Web Server
  2. Updater
  3. NTP Time

NGINX is capable of handling the first two which are HTTP. The RPi can run a time server directly to service the UDP NTP requests..

You are probably turned off by the WiFi involvement, but the RPi AP can run a dedicated network for just the IoTaWatt, and you can put the whole shebang in a good steel box with the Ethernet cable running out.

A heck of a lot easier than trying to hook it up via serial.

1 Like