Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dev/ttyS0 issue connecting with browser [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
hunky
l33t
l33t


Joined: 19 Nov 2003
Posts: 914
Location: Alaska

PostPosted: Mon Sep 30, 2024 7:17 pm    Post subject: dev/ttyS0 issue connecting with browser [SOLVED] Reply with quote

I'm trying to install a presence detector and having issues that may be from connecting to ttyS0. It is all explained in my posts here:
https://github.com/EverythingSmartHome/everything-presence-lite/issues/178

The designer of the board suggests I may have an issue connecting with the USB port (paired to ttyS0) in my browser. I'm trying with Chrome. Essentially, I can see the detector using the setup website here: https://everythingsmarthome.github.io/everything-presence-lite/updating.html and get as far as connecting and issuing the "install" command, but that errors out with "fails to initialize". The designer suggests possible browser to port issue?

Also, at some point it was suggested for needing drivers for CH340 (arduino?) but the kernel only has CH341 as close. Should I search out an older kernel?


Last edited by hunky on Mon Sep 30, 2024 10:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 661

PostPosted: Mon Sep 30, 2024 9:28 pm    Post subject: Re: dev/ttyS0 issue connecting with browser, perhaps Reply with quote

hunky wrote:
I'm trying to install a presence detector and having issues that may be from connecting to ttyS0. It is all explained in my posts here ... Should I search out an older kernel?

I don't think so, the ch341.c source file makes reference to "fixes" added to support the "eccentricities" of the ch340; if it wasn't intended to be backward compatible I fail to see what this comment is doing there...
My serial port adaptor shows up on /dev/ttyUSB0, I know its an rs485 adapter, but the kernel doesn't care what is spat out of the non-USB end. What are the permissions on that like, is it an option on the update website, does dmesg tell you where the device ended up when you plug it in?

hunky wrote:
On that dongle I've flashed it into bluetooth proxy, but haven't yet figured out how to enable that in my docker containers or yamls or wherever.
Is that for connection or so you can flash the unit over BT? I'm no docker expert, but if you make the device available and the container privileged*
Code:
devices:
      - /dev/usb:/dev/usb
    privileged: true
would that not be enough for it to "work inside the container"?

*seek expert advice on "privileged" though, I only use it to push AI TPU's into containers, there is nothing of value at risk.
Back to top
View user's profile Send private message
hunky
l33t
l33t


Joined: 19 Nov 2003
Posts: 914
Location: Alaska

PostPosted: Mon Sep 30, 2024 10:28 pm    Post subject: Reply with quote

Thanks Ralphred!

When I initially searched on the port i did this: # grep -i 'tty' /var/log/dmesg and it showed ttyS0 as being connected. I don't recall much else. When trying to configure the device, it gave a list of ports and ttyS0 had a "paired" following it. The other ports did not. So that's the one I used.

Your suggestion of dmesg made me give it another try. I had the device unplugged, so plugged it back in and ran that again and got this:

Code:
# grep -i 'tty' /var/log/dmesg
[    0.109131] printk: console [tty0] enabled
[    0.405069] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    0.506766] Bluetooth: RFCOMM TTY layer initialized
[    3.108628] usb 1-4: ch341-uart converter now attached to ttyUSB0


The baud rate of the device is 115200 so maybe assumed that one. But seeing "now attached" on ttyUSB0 made me give that a try and hell if it didn't work. So I'm good. I also tried:
Code:
# dmesg | grep tty
[    0.109131] printk: console [tty0] enabled
[    0.405069] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    3.108628] usb 1-4: ch341-uart converter now attached to ttyUSB0
[ 1211.656855] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 1235.357702] usb 1-4: ch341-uart converter now attached to ttyUSB0
[ 1558.957677] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 1565.218535] usb 1-4: ch341-uart converter now attached to ttyUSB0
[ 2808.212698] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[15758.259203] usb 1-4: ch341-uart converter now attached to ttyUSB0


which made it obvious.

Thanks for the reply as it made me think again.

And I already had privileged: true. Now on to trying to get esphome set up and bluetooth proxy.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum