alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.36k stars 194 forks source link

🐛 [SignalK] Connecting to ttyUSB* #1450

Open MrHobsons opened 1 week ago

MrHobsons commented 1 week ago

Description

Not sure if it is a bug or not but I'm not able to get a connection via ttyUSB0 or ttyUSB0 under Connections in SignalK

image image

Reproduction steps

1. Go to 'SignalK'
2. Click on 'Data Connections'

Addon Logs

Registering new address record for ::1 on lo.*.
Registering new address record for 127.0.0.1 on lo.IPv4.
Server startup complete. Host name is db21ed7f-signalk.local. Local service cookie is 1282224705.
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
signalk-server running at 0.0.0.0:3000

Error: Permission denied, cannot open /dev/ttyUSB1
GET / 302 44.263 ms - 58
GET /admin/ 200 29.302 ms - 562
GET /admin/main.js 304 16.176 ms - -
GET /@signalk/vesselpositions/remoteEntry.js 304 51.468 ms - -
GET /admin/208.js 304 20.925 ms - -
GET /admin/41.js 304 15.591 ms - -
GET /admin/144.js 304 8.884 ms - -
GET /admin/259.js 304 7.148 ms - -
GET /skServer/plugins 304 58.821 ms - -
GET /skServer/loginStatus 200 12.505 ms - 204

Architecture

No response

OS

HAos

alexbelgium commented 3 days ago

Hi, I need to map access to it. Any other devices I should add at the same time?

alexbelgium commented 3 days ago

I've added the devices and pushed a version

MrHobsons commented 3 days ago

Hi Alexandre,

Ok, I have tried again but no luck, error still the same: Jun 29 23:42:29 Error: Permission denied, cannot open /dev/ttyUSB1

Any ideas?

reagrds /anders


From: Alexandre @.> Sent: Saturday, June 29, 2024 17:36 To: alexbelgium/hassio-addons @.> Cc: MrHobsons @.>; Author @.> Subject: Re: [alexbelgium/hassio-addons] 🐛 [SignalK] Connecting to ttyUSB* (Issue #1450)

OK done

— Reply to this email directly, view it on GitHubhttps://github.com/alexbelgium/hassio-addons/issues/1450#issuecomment-2198238773, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BE2F2LZJQFUW3RPL3QUUOQTZJ3IANAVCNFSM6AAAAABJ2IKZSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGIZTQNZXGM. You are receiving this because you authored the thread.Message ID: @.***>

alexbelgium commented 2 days ago

Hi, perhaps I need to adapt apparmor permissions in addition to the config options, I'll try that later today

MrHobsons commented 2 days ago

Hi,

Tried the latest version but no success, still same error message

Mvh /anders


From: Alexandre @.> Sent: Sunday, June 30, 2024 09:04 To: alexbelgium/hassio-addons @.> Cc: MrHobsons @.>; Author @.> Subject: Re: [alexbelgium/hassio-addons] 🐛 [SignalK] Connecting to ttyUSB* (Issue #1450)

Reopened #1450https://github.com/alexbelgium/hassio-addons/issues/1450.

— Reply to this email directly, view it on GitHubhttps://github.com/alexbelgium/hassio-addons/issues/1450#event-13341470148, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BE2F2L2SHLNOPR5KMU6FNFDZJ6UYHAVCNFSM6AAAAABJ2IKZSOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTGM2DCNBXGAYTIOA. You are receiving this because you authored the thread.Message ID: @.***>

alexbelgium commented 1 day ago

I'm sorry it's the only configurable options linked to ttyusb that HA proposes I am not sure how to help...

MrHobsons commented 1 day ago

Hi,

ok, I'm also using the node-red addon and from that I can access ttyUSB0 and ttyUSB1 but I really need it to work with the signal k addon

Could you look at the node-red addon and see if you can get some info regarding this issue?

https://github.com/hassio-addons/addon-node-red [https://opengraph.githubassets.com/af5ec5bb7f72a58de7f5dc4b3d61354d8a80d1c7606c3afa12703874f4cd020d/hassio-addons/addon-node-red]https://github.com/hassio-addons/addon-node-red GitHub - hassio-addons/addon-node-red: Node-RED - Home Assistant Community Add-onshttps://github.com/hassio-addons/addon-node-red Node-RED - Home Assistant Community Add-ons. Contribute to hassio-addons/addon-node-red development by creating an account on GitHub. github.com

regards /anders


From: Alexandre @.> Sent: Monday, July 1, 2024 12:07 To: alexbelgium/hassio-addons @.> Cc: MrHobsons @.>; Author @.> Subject: Re: [alexbelgium/hassio-addons] 🐛 [SignalK] Connecting to ttyUSB* (Issue #1450)

I'm sorry it's the only configurable options linked to ttyusb that HA proposes I am not sure how to help...

— Reply to this email directly, view it on GitHubhttps://github.com/alexbelgium/hassio-addons/issues/1450#issuecomment-2199745351, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BE2F2L645XCQDWI3FQKPUWDZKES4VAVCNFSM6AAAAABJ2IKZSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJZG42DKMZVGE. You are receiving this because you authored the thread.Message ID: @.***>

alexbelgium commented 1 day ago

This addon has TONS of permissions added... I can try to add all of those but it will be preferable to remove it after to avoid creating security risks.

If you are ok I could duplicate the addon on my test repo and add the permissions there

MrHobsons commented 1 day ago

Hi,

ok I understand.

It would be great if you could do that, but I’m not sure how I can update to that version.

regards /anders

Skickat från Outlook för iOShttps://aka.ms/o0ukef


Från: Alexandre @.> Skickat: Monday, July 1, 2024 4:30:10 PM Till: alexbelgium/hassio-addons @.> Kopia: MrHobsons @.>; Author @.> Ämne: Re: [alexbelgium/hassio-addons] 🐛 [SignalK] Connecting to ttyUSB* (Issue #1450)

This addon has TONS of permissions added... I can try to add all of those but it will be preferable to remove it after to avoid creating security risks.

If you are ok I could duplicate the addon on my test repo and add the permissions there

— Reply to this email directly, view it on GitHubhttps://github.com/alexbelgium/hassio-addons/issues/1450#issuecomment-2200322049, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BE2F2L435J6TBU64ZZAY743ZKFRXFAVCNFSM6AAAAABJ2IKZSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGMZDEMBUHE. You are receiving this because you authored the thread.Message ID: @.***>

alexbelgium commented 8 hours ago

Hi,

Can you please install the repository https://github.com/alexbelgium/hassio-addons-test ? It will contain an addon named "Signalk Server Test" that has all possible permissions found in the nodered addon. We'll adapt depending on that ;-)

Thanks for your help!

alexbelgium commented 8 hours ago

I'll also push an update to the main repo version with a potential fix from https://github.com/esp8266/source-code-examples/issues/26

MrHobsons commented 4 hours ago

Hi,

Thanks, I will try this tomorrow and get back to you.

regards /anders

Skickat från Outlook för iOShttps://aka.ms/o0ukef


Från: Alexandre @.> Skickat: Tuesday, July 2, 2024 7:10:45 PM Till: alexbelgium/hassio-addons @.> Kopia: MrHobsons @.>; Author @.> Ämne: Re: [alexbelgium/hassio-addons] 🐛 [SignalK] Connecting to ttyUSB* (Issue #1450)

Hi,

Can you please install the repository https://github.com/alexbelgium/hassio-addons-test ? It will contain an addon named "Signalk Server Test" that has all possible permissions found in the nodered addon. We'll adapt depending on that ;-)

Thanks for your help!

— Reply to this email directly, view it on GitHubhttps://github.com/alexbelgium/hassio-addons/issues/1450#issuecomment-2203870246, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BE2F2LYSWAGT27JM254NHB3ZKLNJJAVCNFSM6AAAAABJ2IKZSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBTHA3TAMRUGY. You are receiving this because you authored the thread.Message ID: @.***>