Traceback (most recent call last):
File "main.py", line 37, in <module>
from gurux_serial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/__init__.py", line 35, in <module>
from .GXSerial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/GXSerial.py", line 51, in <module>
from ._handlers.GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/__init__.py", line 40, in <module>
from .GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/GXLinuxHandler.py", line 183
raise Exception("getBaudRate failed. ") from e
^
any advice?
dmesg | grep tty
[ 8.162569] spi1.0: ttySC1 at I/O 0x1 (irq = 199, base_baud = 921600) is a SC16IS752
Hi Mikko, in the interim i have tested with another device using the generic usb 2 wire convertor. I get the same error. So i presume this is also driver related?
dmesg | grep tty
[ 19.547227] ch341-uart ttyUSB0: break control not supported, using simulated break
[ 19.547701] usb 1-1: ch341-uart converter now attached to ttyUSB0
python main.py
Traceback (most recent call last):
File "main.py", line 37, in <module>
from gurux_serial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/__init__.py", line 35, in <module>
from .GXSerial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/GXSerial.py", line 51, in <module>
from ._handlers.GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/__init__.py", line 40, in <module>
from .GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/GXLinuxHandler.py", line 183
raise Exception("getBaudRate failed. ") from e
lsusb
Bus 001 Device 002: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ls /sys/module/usbserial/drivers/usb
usb:ch341/ usb-serial:generic/ usb:usbserial_generic/
python main.py
Traceback (most recent call last):
File "main.py", line 37, in <module>
from gurux_serial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/__init__.py", line 35, in <module>
from .GXSerial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/GXSerial.py", line 51, in <module>
from ._handlers.GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/__init__.py", line 40, in <module>
from .GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/GXLinuxHandler.py", line 183
raise Exception("getBaudRate failed. ") from e
^
SyntaxError: invalid syntax
python main.py -S /dev/ttyUSB0
Traceback (most recent call last):
File "main.py", line 37, in <module>
from gurux_serial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/__init__.py", line 35, in <module>
from .GXSerial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/GXSerial.py", line 51, in <module>
from ._handlers.GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/__init__.py", line 40, in <module>
from .GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/GXLinuxHandler.py", line 183
raise Exception("getBaudRate failed. ") from e
^
SyntaxError: invalid syntax
You are using the old version 1.0.18.
The new serial port component version was not updated for GXDLMSClient requirements.txt. It's now updated. Get the latest version from Github or change the version from 1.0.18 to 1.0.19 to requirements.txt and give it a new try.
Hi,
Hi,
I believe that getBaudRate is not implemented for the HAT. One HAT is ordered so this can be tested. We have to wait until it's delivered.
BR,
Mikko
Thanks Mikko, looking forward
Thanks Mikko, looking forward to your feedback, once you have received and tested.
Hi Mikko, in the interim i
Hi Mikko, in the interim i have tested with another device using the generic usb 2 wire convertor. I get the same error. So i presume this is also driver related?
dmesg | grep tty
[ 19.547227] ch341-uart ttyUSB0: break control not supported, using simulated break
[ 19.547701] usb 1-1: ch341-uart converter now attached to ttyUSB0
python main.py
Traceback (most recent call last):
File "main.py", line 37, in <module>
from gurux_serial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/__init__.py", line 35, in <module>
from .GXSerial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/GXSerial.py", line 51, in <module>
from ._handlers.GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/__init__.py", line 40, in <module>
from .GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/GXLinuxHandler.py", line 183
raise Exception("getBaudRate failed. ") from e
lsusb
Bus 001 Device 002: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ls /sys/module/usbserial/drivers/usb
usb:ch341/ usb-serial:generic/ usb:usbserial_generic/
Hi,
Hi,
I have HL-340 on my desc and I tested this. Everything worked without problems until I realized that I was running Python 3.7.3 and not 2.7.
This is now fixed and the serial port component works with python 2.7 again.
Update to version 1.0.19 and let me know if you have problems.
BR,
Mikko
Hi Mikko,
Hi Mikko,
Thanks for the update. Unfortunately i receive the same error.
git clone https://github.com/gurux/Gurux.DLMS.Python 1.0.19
Cloning into '1.0.19'...
remote: Enumerating objects: 2794, done.
remote: Counting objects: 100% (704/704), done.
remote: Compressing objects: 100% (184/184), done.
remote: Total 2794 (delta 638), reused 557 (delta 516), pack-reused 2090
Receiving objects: 100% (2794/2794), 1.35 MiB | 608.00 KiB/s, done.
Resolving deltas: 100% (2365/2365), done.
cd 1.0.19/
~/1.0.19 $ cd Gurux.DLMS.Client.Example.python/
pip install -r requirements.txt
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting gurux-common==1.0.13 (from -r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/dd/b2/9c92b62f2b1b2324fa3f9310a…
Collecting gurux-dlms==1.0.124 (from -r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/ba/58/ac08b222817023ae4f3b1eddd… (287kB)
100% |████████████████████████████████| 296kB 238kB/s
Collecting gurux-net==1.0.18 (from -r requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/f0/d4/5d8d384cbf806e9f4bfdafdc8…
Collecting gurux-serial==1.0.18 (from -r requirements.txt (line 4))
Downloading https://files.pythonhosted.org/packages/13/4d/b9cb82dc13fe2626a90ab7f5c…
Building wheels for collected packages: gurux-common, gurux-dlms, gurux-net, gurux-serial
Running setup.py bdist_wheel for gurux-common ... done
Stored in directory: /home/wirepas/.cache/pip/wheels/1c/9a/a8/f7e53fd231d936acef177cc391fccbdcf49150c2bdb256278c
Running setup.py bdist_wheel for gurux-dlms ... done
Stored in directory: /home/wirepas/.cache/pip/wheels/94/f9/cb/b8d9b9955bc38e4db5c372ac1bc737fedba10496c22b4ed5b0
Running setup.py bdist_wheel for gurux-net ... done
Stored in directory: /home/wirepas/.cache/pip/wheels/69/80/08/f66b47450329ee430f3d23eaf0ada6d2ca37d488aee25c8dad
Running setup.py bdist_wheel for gurux-serial ... done
Stored in directory: /home/wirepas/.cache/pip/wheels/9c/ac/69/65ee4d9bd0358cf0b579a4bb8b9ef2b0b759fd752e85016a8c
Successfully built gurux-common gurux-dlms gurux-net gurux-serial
Installing collected packages: gurux-common, gurux-dlms, gurux-net, gurux-serial
Successfully installed gurux-common-1.0.13 gurux-dlms-1.0.124 gurux-net-1.0.18 gurux-serial-1.0.18
python main.py
Traceback (most recent call last):
File "main.py", line 37, in <module>
from gurux_serial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/__init__.py", line 35, in <module>
from .GXSerial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/GXSerial.py", line 51, in <module>
from ._handlers.GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/__init__.py", line 40, in <module>
from .GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/GXLinuxHandler.py", line 183
raise Exception("getBaudRate failed. ") from e
^
SyntaxError: invalid syntax
python main.py -S /dev/ttyUSB0
Traceback (most recent call last):
File "main.py", line 37, in <module>
from gurux_serial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/__init__.py", line 35, in <module>
from .GXSerial import GXSerial
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/GXSerial.py", line 51, in <module>
from ._handlers.GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/__init__.py", line 40, in <module>
from .GXLinuxHandler import GXLinuxHandler
File "/home/wirepas/.local/lib/python2.7/site-packages/gurux_serial/_handlers/GXLinuxHandler.py", line 183
raise Exception("getBaudRate failed. ") from e
^
SyntaxError: invalid syntax
Hi,
Hi,
You are using the old version 1.0.18.
The new serial port component version was not updated for GXDLMSClient requirements.txt. It's now updated. Get the latest version from Github or change the version from 1.0.18 to 1.0.19 to requirements.txt and give it a new try.
BR,
Mikko
Thanks Mikko. This worked.
Thanks Mikko. This worked.