-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making it work into RS232 #29
Comments
Finally I get it working. At least most of the times. p.get_values_single(1) works always However p.get_values() only works sometimes. Other times it fails with a weird response, I do not why 😕 What I did:
Change read_frame() to read until '\n' (end of frame)
As mentioned, p.get_system_parameters() does never fail.
p.get_values_single(1) does not fail:
But p.get_values() fails most of the times (one good each a lot of bads):
Bad:
Bad:
Bad:
Some clue? Perhaps is something normal and the packets in this protocol get corrupted sometimes, more probabbly if they are greater? Does this happen with RS485? One of the most received error frame is this: b'~200146060000FDAD\r' could someone break it down for me? It has to specify some type of error in some field |
Hi tomascrespo, I have two UP5000 which i plan to monitor .. KR |
Hi,
I completely forgot about this issue :(. I didn't know that the rs232 proto was documented.; maybe I should find + upload the PDF here?
Indeed, merging both protocols would be awesome!
Happy new year :-)
…On December 29, 2023 5:38:08 PM GMT+01:00, MC68030 ***@***.***> wrote:
Hi tomascrespo,
i had the same idea as you described/ask, let's use the serial console.
Can you please do a fork/share your code ,so we can work together on it?
I have two UP5000 which i plan to monitor ..
BTW, beside the RS485 communication document, there also exists document from pylontech regarding the RS232 communication.
KR
--
Reply to this email directly or view it on GitHub:
#29 (comment)
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
Just search for "PYLON LFP Battery communication protocol - RS232" :-) |
Hi Frakkkkk!
I have read your code and it is great
I would like to make it work through RS232 because my Pylon are using RS485 interface to communicate with my inversor.
As far as I know Pylontech RS485 protocol and RS232 are almost the same, but I am not completly sure.
My batteries communicate with RS232 with BatteryView (Pylontech software) perfectly, using and RS232 to USB adapter connected to console port.
I think the first step is putting the serial port in 1200 bps, because this is the default for Pylontech RS232 (although they could go faster setting them up with a specific command)
Before I deep more into this I want to know if someone has tried before or your knowledge, if it is possible or not
Lots of thanks
Let's start!
Changing only the baud rate from 115200 to 1200 and adding some print for debug (same port, /dev/ttyUSB0)
Error parsing number of modules... 🤔 So now I have changed the address from 2 to 1 in get_values():
From this:
To this
No what I get is:
🤔 I think we have not caught the full response. So I updated the timeout from 2 to 3. Now I get:
This response looks quite longer, but same error. I am thinking in changing the self.s.read() for something like read_until('\r') or something similar, I mean reading until certain byte value, to detect the end of the frame and avoid receiving garbage. What do you think? Have you seen something I can not see?
I would like learning to break down the response. I have read the protocol PDF but I will need some detailed example
The text was updated successfully, but these errors were encountered: