classicdiy / pylontomqtt Goto Github PK
View Code? Open in Web Editor NEWReads data from the Sage BMS console port and publishes to MQTT
Reads data from the Sage BMS console port and publishes to MQTT
I now find data from Pack1 in Mosquitto.
How do I also get Pack2? What am I missing?
Hi,
first of all, many thanks for this project and your efforts.
Basically I just want to let you know that the MAX232 rx / tx are wired up wrong in the given image, at least with the two MAX232 I have tested.
The MAXs RX PIN needs to be connected the RX PIN of the ESP32, same for the TX Pin.
The normally used tx -> rx connections applies not to the input of the MAX.
Hope this helps.
I don't know what I am doing wrong. I flashed the ESP32 twice already. Connected RS323-TTL adapter, connected Pace BMS via RS323. However, I only ever get "Online" on PylonToMQTT/LVTOPSUN/tele/LWT (LVTOPSUN is the name of my battery that has a Pace BMS in it sending Pylon formatted data). The Pace BMS is the same as in the Jakiper batteries. Do not get any other data. Even using MQTT Explorer to listen. Using Mosquitto broker in Home Assistant.
What data should I receive with battery disconnected?
Hi! First thing congratulations for this great project! As far as I know your software is for Jakiper but it will work with a Pylontech US2000B, isn't it?
I am trying to communicate my Raspberry 3B+ with my rack of 2 Pylontech US2000B by console port (RS232) using your software. Previously I had used ICC to communicate with my batteries, and batteryview software also works, so I think my cable is working perfectly.
I have tried your software as mentioned in point 4 of your wiki (Adding PylonToMQTT to an existing system). I have tried command line and docker container with the same result. It publish only a topic in my MQTT server, /PylonToMQTT/Main/tele/LWT=Online, but nothing more, and logut this error:
023-04-04 08:16:47,503:INFO:PylonToMQTT:pylon_mqtt starting up... 2023-04-04 08:16:47,535:INFO:PylonToMQTT:pylonPort = /dev/ttyUSB0 2023-04-04 08:16:47,536:INFO:PylonToMQTT:baud_rate = 9600 2023-04-04 08:16:47,537:INFO:PylonToMQTT:rackName = Main 2023-04-04 08:16:47,537:INFO:PylonToMQTT:mqttHost = 192.168.2.245 2023-04-04 08:16:47,538:INFO:PylonToMQTT:mqttPort = 1883 2023-04-04 08:16:47,538:INFO:PylonToMQTT:mqttRoot = PylonToMQTT 2023-04-04 08:16:47,539:INFO:PylonToMQTT:mqttUser = tomascrespo 2023-04-04 08:16:47,539:INFO:PylonToMQTT:mqttPassword = ********** 2023-04-04 08:16:47,540:INFO:PylonToMQTT:publishRate = 5 2023-04-04 08:16:47,540:INFO:PylonToMQTT:sok = False 2023-04-04 08:16:47,541:INFO:PylonToMQTT:Connecting with clientId=tomascrespo_mqttclient_267 2023-04-04 08:16:47,542:INFO:PylonToMQTT:Connecting to MQTT 192.168.2.245:1883 2023-04-04 08:16:47,546:INFO:PylonToMQTT:MQTT connected OK Returned code=0 2023-04-04 08:16:47,547:INFO:PylonToMQTT:Subscribed to PylonToMQTT/Main/cmnd/# 2023-04-04 08:16:58,389:ERROR:PylonToMQTT:Failed to process response! 2023-04-04 08:16:58,390:ERROR:PylonToMQTT:invalid literal for int() with base 16: b'\x00\x80\x80\x80' Traceback (most recent call last): File "pylon_to_mqtt.py", line 235, in periodic number_of_packs = pylontech.get_pack_count().PackCount File "/support/pylontech.py", line 149, in get_pack_count f = self.read_frame() File "/support/pylontech.py", line 143, in read_frame f = self._decode_hw_frame(raw_frame=raw_frame) File "/support/pylontech.py", line 127, in _decode_hw_frame assert got_frame_checksum == int(frame_chksum, 16) ValueError: invalid literal for int() with base 16: b'\x00\x80\x80\x80' 2023-04-04 08:17:09,418:ERROR:PylonToMQTT:Failed to process response! 2023-04-04 08:17:09,418:ERROR:PylonToMQTT:invalid literal for int() with base 16: b'\x00\x80\x80\x80'
Any clue?
Every command to a battery takes 5 seconds because you use readline(). Every response from a battery ends with CR, not LF. Wouldn't it be better to use read_until(b'\r') instead?
That said, I have learned a lot from your project because of its completeness. Thank you!
When I start the script I get the following errors:
Command
python3 pylon_to_mqtt.py --pylon_port /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_B0001B3W-if00-port0 --baud_rate 9600 --mqtt_host [MY_IP] --mqtt_port [;MY_PORT] --mqtt_root SmartHome/Jakiper
Error message:
Traceback (most recent call last):
File "pylon_to_mqtt.py", line 1, in
from paho.mqtt import client as mqttclient, error_string
ImportError: cannot import name 'error_string' from 'paho.mqtt' (/home/pi/.local/lib/python3.7/site-packages/paho/mqtt/init.py)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.