kellerza / sunsynk

Deye/Sunsynk Inverter Python library and Home Assistant OS Addon
https://kellerza.github.io/sunsynk/
MIT License
194 stars 84 forks source link

ValueError: unsupported scheme '' for /dev/ttyUSB0 #28

Closed McAllstar closed 2 years ago

McAllstar commented 2 years ago

Issue related to the Python sunsynk library

ValueError: unsupported scheme '' for /dev/ttyUSB0

Describe the issue/bug

when i start the plugin I get this error listed below.

File "/usr/local/lib/python3.9/site-packages/connio/init.py", line 21, in connection_for_url raise ValueError("unsupported scheme {!r} for {}".format(scheme, url)) ValueError: unsupported scheme '' for /dev/ttyUSB0 A clear and concise description of what the bug is.

Expected behavior

expect the plugin to start. A clear and concise description of what you expected to happen. expect the plugin to start and run

Logs (if applicable)

image

paste logs in 3x backticks...
McAllstar commented 2 years ago

2022-03-25 15:28:43,615 INFO Connected to /dev/ttyUSB0 2022-03-25 15:28:43,619 DEBUG send: 0x1 0x3 0x0 0x3 0x0 0x5 0x75 0xc9 2022-03-25 15:28:43,621 DEBUG Adding transaction 1 2022-03-25 15:28:53,634 ERROR Timeout reading: 2022-03-25 15:28:53,635 INFO ############################################################ 2022-03-25 15:28:53,636 INFO No response on the Modbus interface, try checking the wiring to the Inverter, the USB-to-RS485 converter, etc 2022-03-25 15:28:53,637 INFO ############################################################ 2022-03-25 15:28:53,638 CRITICAL This Add-On will terminate in 30 seconds, use the Supervisor Watchdog to restart automatically.

McAllstar commented 2 years ago

thats if i change it to pymodbus

kellerza commented 2 years ago

Umodbus requires the port to start with serial:// so you end up with serial:///dev/ttyUSB0

McAllstar commented 2 years ago

thanks I realised it was an issue on my side with the configs

McAllstar commented 2 years ago

Hi

Hope you are well. Any idea why I could be getting this? I did a complete re-install of HA and only installed mosquito etc and then the Sunsynk addon and I get this below.

Thanks Brett

@.***

It seems as if it makes the connection but it’s unable to read. My cabling is correct, and I tried using umodbus with serial: ///dev/ttyUSB0 and also pymodbus /dev/ttyUSB0sr

From: Johann Kellerman @.> Date: Friday, 25 March 2022 at 15:40 To: kellerza/sunsynk @.> Cc: McAlister, B. (Brett) @.>, State change @.> Subject: Re: [kellerza/sunsynk] ValueError: unsupported scheme '' for /dev/ttyUSB0 (Issue #28) CAUTION - EXTERNAL SENDER - Please be careful when opening links and attachments. Nedbank - IT Information Security Department (ISD)

Umodbus requires the port to start with serial:// so you end up with serial:///dev/ttyUSB0

— Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkellerza%2Fsunsynk%2Fissues%2F28%23issuecomment-1079038952&data=04%7C01%7CBrettM%40Nedbank.co.za%7Cd20f31612a684bbabea308da0e65110d%7C0b1d23d810d140938cb7fd0bb32f81e1%7C0%7C0%7C637838124495957709%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=o2E%2FuQGlvaXaKcTDgU4jym7GC8HxogylZ2jyrJ1C1Vo%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJHBIBB2EVSQLPLWMYCEZLDVBW62PANCNFSM5RUETMYA&data=04%7C01%7CBrettM%40Nedbank.co.za%7Cd20f31612a684bbabea308da0e65110d%7C0b1d23d810d140938cb7fd0bb32f81e1%7C0%7C0%7C637838124495957709%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=ISHKH%2Bht3vmrZNf65E6LB%2F%2BsrwPVuKhFV7uRXGunK0Q%3D&reserved=0. You are receiving this because you modified the open/close state.Message ID: @.***>


Nedbank disclaimer and confidentiality notice:

This email may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this email or all or some of the information contained therein, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this email is neither an offer or a solicitation to buy or sell any securities, investment products or other financial product or service, nor is it an official confirmation of any transaction or an official statement of Nedbank. Any views or opinions presented are solely those of the author and do not necessarily represent those of Nedbank. Nedbank Ltd Reg No 1951/000009/06.

The following link displays the names of the Nedbank Board of Directors and Company Secretary. [http://www.nedbank.co.za/terms/DirectorsNedbank.htm]

If you do not want to click on a link, please type the relevant address in your browser


kellerza commented 2 years ago

The only other way to do this is to use mbusd as a tcp to rtu gateway then connect to tcp://ip:port

McAllstar commented 2 years ago

Ok thanks a mil. I’ll try figure it out.

I enabled debug logging and go the below error again.

@.***

From: Johann Kellerman @.> Date: Monday, 28 March 2022 at 18:12 To: kellerza/sunsynk @.> Cc: McAlister, B. (Brett) @.>, State change @.> Subject: Re: [kellerza/sunsynk] ValueError: unsupported scheme '' for /dev/ttyUSB0 (Issue #28) CAUTION - EXTERNAL SENDER - Please be careful when opening links and attachments. Nedbank - IT Information Security Department (ISD)

The only other way to do this is to use mbusd as a tcp to rtu gateway then connect to tcp://ip:port

— Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkellerza%2Fsunsynk%2Fissues%2F28%23issuecomment-1080843236&data=04%7C01%7CBrettM%40Nedbank.co.za%7Cf08ca28fb8dc499b678608da10d5bb93%7C0b1d23d810d140938cb7fd0bb32f81e1%7C0%7C0%7C637840807426795544%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=7u8U8368CvV%2FFN7ImXpdNcxOt7i3TJmzYuh4VSs4mhk%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJHBIBCGI53PKRGJ7AIASVDVCHK35ANCNFSM5RUETMYA&data=04%7C01%7CBrettM%40Nedbank.co.za%7Cf08ca28fb8dc499b678608da10d5bb93%7C0b1d23d810d140938cb7fd0bb32f81e1%7C0%7C0%7C637840807426951778%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=b5KfLM%2FU1bgG5OM%2FkeErQyORTVHCcz5gLA4yc9gb8As%3D&reserved=0. You are receiving this because you modified the open/close state.Message ID: @.***>


Nedbank disclaimer and confidentiality notice:

This email may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this email or all or some of the information contained therein, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this email is neither an offer or a solicitation to buy or sell any securities, investment products or other financial product or service, nor is it an official confirmation of any transaction or an official statement of Nedbank. Any views or opinions presented are solely those of the author and do not necessarily represent those of Nedbank. Nedbank Ltd Reg No 1951/000009/06.

The following link displays the names of the Nedbank Board of Directors and Company Secretary. [http://www.nedbank.co.za/terms/DirectorsNedbank.htm]

If you do not want to click on a link, please type the relevant address in your browser