Skip to content

Problem using RS485-Ethernet gateway #25

@Jschz99

Description

@Jschz99

Hi everyone. My name is Jesús, I'm a junior engineer. First of all, thanks for your contribution with the python-pylontech lib, it is a great help. I'm using it to connect my force L1 Pylontech to my RaspBerry Pi and I have a problem with it. If you had time and could answer me, I would appreciate it.

My case is the next one: I'm using a R-485 to Ethernet adapter (RSETHER). I run the next command:

                               socat pty,link=$HOME/bat2,waitslave tcp:<IP_ADDRESS>:<PORT>

The problem is that I'm not sure what part of the code I've to change. I've change the next line from the pylontech.py file:

                               def init​​__(self, serial​​_port='/dev/ttyUSB0', baudrate=115200):

And I've changed it into:

                               def init​​__(self, serial​​_port='/home/jesus/bat2', baudrate=115200):

(Thats the rute to my virtual serial port) Then I run the script and I get the next fails:

Traceback (most recent call last):

File "/home/jesus/Desktop/GitHun/python-pylontech-master/pylontech/PRUEBA.py", line 3,
      print(p.get_values())

File "/home/jesus/Desktop/GitHun/python-pylontech-master/pylontech/pylontech.py", line 269, in get_values
      f = self.read_frame()

File "/home/jesus/Desktop/GitHun/python-pylontech-master/pylontech/pylontech.py", line 199, in read_frame
      f = self._decode_hw_frame(raw_frame=raw_frame)

File "/home/jesus/Desktop/GitHun/python-pylontech-master/pylontech/pylontech.py", line 181, in_decode_hw_frame
      assert got_frame_checksum == int(frame_chksum, 16)
Value: invalid literal for int() with base 16: b''

PRUEBA is the name of my script. And thats everything. I don't understand the problem it is reporting, I don't know if I have to change anything else from the lib. And I think it is not a wiring problem, as I've check continuity and everything is ok.

Again, I would be very grateful with any answer.

Best Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions