Hi Brian,
I’m using
modpoll --tcp 192.168.1.254 --config https://raw.githubusercontent.com/gavinying/modpoll/master/contrib/foxess/foxess.cfg --mqtt-host 127.0.0.1 --mqtt-topic-prefix emon --mqtt-user emonpi --mqtt-pass emonpimqtt2016
The config came from an example in the modpoll library specific to the Fox-ESS inverter I am messing with.
2023-10-23 17:57:58,524 | I | modpoll.main | Setup MQTT connection to 127.0.0.1
2023-10-23 17:57:58,528 | I | modpoll.modbus_task | Loading config from: https://raw.githubusercontent.com/gavinying/modpoll/master/contrib/foxess/foxess.cfg
2023-10-23 17:57:58,530 | I | modpoll.mqtt_task | Connection successful
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3591, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1756, in loop_forever
rc = self._loop(timeout)
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1164, in _loop
rc = self.loop_read()
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1556, in loop_read
rc = self._packet_read()
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2439, in _packet_read
rc = self._packet_handle()
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3039, in _packet_handle
return self._handle_connack()
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3138, in _handle_connack
on_connect(
File "/home/pi/.local/lib/python3.9/site-packages/modpoll/mqtt_task.py", line 29, in _on_connect
client.subscribe(f"{args.mqtt_topic_prefix}+/set")
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1491, in subscribe
raise ValueError('Invalid subscription filter.')
ValueError: Invalid subscription filter.
Traceback (most recent call last):
File "/home/pi/.local/bin/modpoll", line 8, in <module>
sys.exit(app())
File "/home/pi/.local/lib/python3.9/site-packages/modpoll/main.py", line 63, in app
if not modbus_setup(args, event_exit):
File "/home/pi/.local/lib/python3.9/site-packages/modpoll/modbus_task.py", line 398, in modbus_setup
load_config(args.config)
File "/home/pi/.local/lib/python3.9/site-packages/modpoll/modbus_task.py", line 380, in load_config
parse_config(csv_reader)
File "/home/pi/.local/lib/python3.9/site-packages/modpoll/modbus_task.py", line 296, in parse_config
fc = row[1].lower()
IndexError: list index out of range
I think it relates to the top line device,foxess,1. I think that value should be 247.
If I copy the config to the Pi and try to run like this
modpoll --tcp 192.168.1.254 --config foxess.cfg --mqtt-host 127.0.0.1 --mqtt-topic-prefix emon --mqtt-user emonpi --mqtt-pass emonpimqtt2016
I get an error requests.exceptions.MissingSchema: Invalid URL 'foxess.cfg': No scheme supplied. Perhaps you meant https://foxess.cfg?
So I think the config file needs to be hosted on a web server?