Just wanted to follow up:
- Eagle-200 user here
- SCE customer (enabled and can see stuff on rainforestcloud.com)
- Running emqx (mosquitto should work though) as an MQTT broker
Start a container running the following:
docker run -e MQTT_BROKER_IP=<BROKER_IP> -e MQTT_BROKER_PORT=<BROKER_PORT> -p 22042:22042 evanrich/py-eagle-mqtt
Go to rainforestcloud.com portal, Cloud tab, Add Upload Destination
- Custom
- Label (make up anything)
- Protocol: HTTP (unless you put this container behind an SSL termination)
- Hostname: IP or hostname of the machine you ran the
docker
command from
- URL:
/
- Format:
XML:RAW
If you subscribe to your broker on topic power/#
, you should start to see data points like this:
# about every 8 seconds
power/elec/Home/power {"time": 1553059760.0, "power": 1125.0}
# about every 180 seconds
power/elec/Home/price {"time": 1553059840.0, "price": 0.0, "tier": 0} # or whatever these values should be
# about every 240 seconds
power/elec/Home/energy {"time": 1553059920.0, "consumed": 4856.396, "produced": 3651.877}
For some reason docker logs [containerID]
wasn’t working, so you can tail the logs of the container by starting the container as a shell:
docker exec -it [containerID] /bin/sh
tail -f /var/log/tHome/eagle.log
So far, I’m seeing the same publish events to my broker, but also see these errors on occasion:
2019-03-20 05:37:22,368 : ERROR: Error parsing Eagle posted data
Traceback (most recent call last):
File "/app/src/bin/tHome-eagle.py", line 75, in root_post
obj = T.eagle.parse( data )
File "/app/src/python/tHome/eagle/parse.py", line 18, in parse
child = root[0]
IndexError: child index out of range
2019-03-20 05:39:07,096 : ERROR: Error parsing Eagle posted data
Traceback (most recent call last):
File "/app/src/bin/tHome-eagle.py", line 75, in root_post
obj = T.eagle.parse( data )
File "/app/src/python/tHome/eagle/parse.py", line 15, in parse
root = ET.fromstring( xmlText )
File "/usr/local/lib/python3.7/xml/etree/ElementTree.py", line 1315, in XML
parser.feed(text)
File "<string>", line None
2019-03-20 05:39:00,830 : ERROR: Error parsing Eagle posted data
Traceback (most recent call last):
File "/app/src/bin/tHome-eagle.py", line 75, in root_post
obj = T.eagle.parse( data )
File "/app/src/python/tHome/eagle/parse.py", line 15, in parse
root = ET.fromstring( xmlText )
File "/usr/local/lib/python3.7/xml/etree/ElementTree.py", line 1315, in XML
parser.feed(text)
File "<string>", line None
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 2, column 1