Expandable-6-Channel-ESP32-Energy-Meter icon indicating copy to clipboard operation
Expandable-6-Channel-ESP32-Energy-Meter copied to clipboard

EmonESP unable to set port of EmonCMS server

Open mmallozzi opened this issue 2 years ago • 2 comments

When I try to enter a custom port in the traditional way for the EmonCMS server, such as 192.168.1.3:27015, the code seems to treat the entire string as the hostname field, and uses hardcoded port 80 to try to connect to. So ultimately it tries to connect to 192.168.1.3:27015:80 and spits out errors accordingly.

This might just require pulling in a fix from upstream: https://github.com/openenergymonitor/EmonESP/pull/102

Also, what are the changes in the EmonESP fork? Is it possible to just use the mainstream EmonESP?

mmallozzi avatar Feb 16 '22 23:02 mmallozzi

For anyone looking for a temporary workaround, I modified emoncms.cpp in the emoncms_publish method to pass my desired port (27015) as the optional third parameter to get_http in the "Plain old HTTP" branch. For me (puled down master a couple days ago) that was on line 63.

mmallozzi avatar Feb 17 '22 14:02 mmallozzi

Thanks for following up with this. I'll take a look at what needs to be changed to fix it.

The version for the 6 channel meter adds calibration fields, and the additional current channels depending on how many add-on boards are used, if any. Unfortunately, the original EmonESP would not work properly with the 6 channel meter.

CircuitSetup avatar Feb 18 '22 13:02 CircuitSetup