Skip to content
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

error in scan with pyhon 3.7.2 #93

Open
RiccardoBa opened this issue Feb 7, 2020 · 2 comments
Open

error in scan with pyhon 3.7.2 #93

RiccardoBa opened this issue Feb 7, 2020 · 2 comments

Comments

@RiccardoBa
Copy link

When I try to connect an RTU device during the scan I get an error because the instruction does not work. data[:4] is a string and then also if the base_addr is right systems not recognize it.
if data[:4] == b'SunS': self.base_addr = addr # print('device base address = %d' % self.base_addr) break

I've tried to change b'Suns' in 'Suns' but I get an error in a following statement.
This is my python code
import sunspec.core.client as client d = client.SunSpecClientDevice(client.RTU, 1, 'com9', baudrate=19200, timeout=10)

address, Com, baudrate and timeout and connection using sunspec dashboard works correctly.

@altendky
Copy link
Contributor

altendky commented Feb 7, 2020

This strikes me as a duplicate of #60. Maybe give #62 a try (yourenv/bin/pip install git+https://github.com/altendky/pysunspec@60-altendky-bytes_for_both_py2_and_py3).

@bobfox
Copy link
Contributor

bobfox commented Feb 14, 2020

Updated with a fix. Give it a try and see if it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants