Comments (9)
What MQTT broker are you using?
What are the settings on the MQTT broker? Do you have authentication enabled? allow anonymous auth? Are you using TLS encryption on the broker or is it 'plain' comms?
I currently have a Sungrow SG5K-D inverter, Eclipse Mosquitto as my MQTT Broker (with authentication and TLS), and have Home Assistant reading from that to automate stuff in the house, and it's all working 👌
from solariot.
Thank you for your reply,
I'm using the mosquito broker, this is built into the Hass.io supervisor store. Authentication is turned on although TLS is not.
I'm not sure if anonymous auth is activated, will review and confirm.
While the system 100% was pulling data, it would only last about 10 minutes before an error would crash. We are accessing via a wifi dongle on the same SG5K-D.
Finally it obviously never actually created an entity etc. as the broker would fail. Can you confirm you broke setup? Is it via Hass.Io?
from solariot.
Ohh ok so it's actually working end-to-end, just after some time there's error(s).
If you've got a user/pass setup then anon auth isn't needed.
I've got just a separate mqtt broker running with Traefik infront providing (transparent) TLS, mqtt broker itself thinks there's no TLS.
It seems to be working just fine, I've got hass as well as mqtt2prometheus listening to the solariot topic and they're both fine.
What's the crash? Do you have any logs? I suspect this is probably a hass mqtt broker problem though and not solariot?
Edit: I also setup my mqtt listener settings in yaml directly as the UI stuff wasn't really working for me
from solariot.
Exception in thread Thread-293:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/solariot/solariot.py", line 402, in publish_mqtt
mqtt_client.reconnect()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1075, in reconnect
sock = self._create_socket_connection()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3546, in _create_socket_connection
return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
File "/usr/local/lib/python3.9/socket.py", line 844, in create_connection
raise err
File "/usr/local/lib/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)
socket.timeout: timed out
Please note I've found this in the logs... so it will connect and grab the data, followed by the above error.
from solariot.
I will add this is being run via a docker... not sure if there is anything specific needed for this to work? albeit I am connecting to the invertor and grabbing the data.
from solariot.
I guess that error above is more to do with the MQTT server not being availabe/routable/connectable from solariot..?
If it cannot create the socket, that just means roughly "the packets never made it to MQTT" or "the packets never made it back from MQTT" and doesn't seem to be a solariot specific issue
from solariot.
If it's in docker can you exec
into the solariot container and telnet
to the mqtt IP/port to verify you can manually connect?
from solariot.
root@meltaxa-solariot1:/solariot# telnet
telnet> open 192.168.1.222 1883
Trying 192.168.1.222...
Connected to 192.168.1.222.
Yes, I can connect via Telnet and can also confirm the broker is seeing the connection
1631067992: Socket error on client pv_data, disconnecting.
1631067992: New connection from 192.168.1.111 on port 1883.
1631067992: New client connected from 192.168.1.111 as pv_data (p2, c1, k60, u'mqttuser').
1631068003: Socket error on client pv_data, disconnecting.
1631068003: New connection from 192.168.1.111 on port 1883.
1631068003: New client connected from 192.168.1.111 as pv_data (p2, c1, k60, u'mqttuser').
1631068004: Client has exceeded timeout, disconnecting.
1631068015: Socket error on client pv_data, disconnecting.
1631068015: New connection from 192.168.1.111 on port 1883.
1631068015: New client connected from 192.168.1.111 as pv_data (p2, c1, k60, u'mqttuser').
1631068026: Socket error on client pv_data, disconnecting.
1631068026: New connection from 192.168.1.111 on port 1883.
1631068026: New client connected from 192.168.1.111 as pv_data (p2, c1, k60, u'mqttuser').
1631068038: Socket error on client pv_data, disconnecting.
1631068038: New connection from 192.168.1.111 on port 1883.
1631068038: New client connected from 192.168.1.111 as pv_data (p2, c1, k60, u'mqttuser').
1631068049: Socket error on client pv_data, disconnecting.
I just keep getting this socket error message can't work out what it is referring too???
from solariot.
Message 0 received on inverter/stats at 12:49:
{
"daily_power_yield": 19500,
"total_power_yield": 73.93,
"internal_temp": 51.2,
"pv1_voltage": 296.9,
"pv1_current": 9.3,
"pv2_voltage": 190.8,
"pv2_current": 8.4,
"total_pv_power": 4382,
"grid_voltage": 250.3,
"inverter_current": 16.4,
"total_active_power": 4382,
"grid_frequency": 50,
"export_power": -4381,
"export_power_indicator": 65535,
"power_meter": 0,
"daily_purchased_energy": 13.2,
"daily_energy_consumption": 3400,
"total_energy_consumption": 1695.8,
"year": 2021,
"month": 9,
"day": 8,
"hour": 12,
"minute": 49,
"second": 13,
"timestamp": "8/9/2021 12:49:13"
}
QoS: 0 - Retain: false
I can also confirm if I listen for inverter/stats the broker receives the message... it's just something to do with socket error on client pv_data ... I have no idea what this could mean... any help is appreciated.
from solariot.
Related Issues (20)
- RPi4 HA Docker - MQTT No sensor/intergration - modbus proxy?
- sungrow-sg5kd Modbus connection failed HOT 2
- Sungrow SG10RT inverter modbus HOT 10
- WiFi vs Ethernet HOT 9
- python 3.9.2 issues? HOT 1
- Not working with InfluxDB 2.0 HOT 2
- Sungrow SG10RT - "unable to decode request" HOT 17
- InfluxDB and Grafana HOT 1
- SG15RT support HOT 2
- Command errored out with exit status 1 HOT 4
- Adding in the custom user to the Dockerfile broke existing permissions HOT 1
- Failed to scrape inverter: sg8kd HOT 1
- InfluxDBClientError: 400: {"error":"unable to parse 'Sungrow,location=XXXXX ': invalid field format HOT 1
- Error loading config.py HOT 2
- How to create a new device from template
- Quick update
- Sungrow SH5K HOT 1
- Solariot + SMA Inverters xx000TL-20
- WARNING:Modbus connection failed WARNING:Failed to scrape inverter, sleeping until next scan HOT 1
- WARNING:root:Failed to scrape inverter, sleeping until next scan HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solariot.