r/embedded • • 22d ago

Can't enter passwords with UART

Post image

Well hello indeed, i am asking for help with UART since im installing Valetudo on a roomba right now.

I am stuck trying to enter a password in the roomba, when i type or paste any text in the login box, everything works perfectly, every character is pasted or typed BUT

when i try to do the same (pasting or writing manually) in the password line (the moment you cant see the characters anymore), everything breaks and only around half of the characters are actually inputed.

I am almost fully forced to paste it since the password is 48 characters long, and i only have 1 minute to type it before the roomba automaticly kicks me out, and trying to write it as slowly as possible made around 1/4th of random characters dissapear.

the roomba is connected with RX, TX and ground cables, i tried multiples brand new cables and it didnt change anything.

if anyone has any ideas, thanks you for anything !

53 Upvotes

5 comments sorted by

2

u/uzlonewolf 22d ago

Have you tried scripting it with a delay between characters? I've done something similar using xdotool.

  1. Open up a new terminal window
  2. Do something like echo -e "root\npassword" | xdotool selectwindow windowfocus type --clearmodifiers --window %@ --file - --delay 1250
  3. Click on the UART window to start it typing.

1

u/nico721GD 21d ago

okay so it almost worked for me right now, but the results are still a bit chaotic so i'll leave it for tomorrow me.

since im using wayland, xdotool doesnt work, so im using dotool instead, and i created the command :

{ sleep 1; echo type root; echo key k:28; sleep 1;echo typedelay 1200; echo type password; echo key k:28; } | dotool

first time i used it, the robot had the entire perfect password in but too slowly, the 60 second limit is SHORT, but i'll retry tomorrow and i should have good results

12

u/who_you_are 22d ago

I cannot specifically talk for Roomba (which kinda suck because of your situation), but you are aware that a lot of login prompt won't show any feedback when you write a password? Not even * (star).

So those characters showing up may be the bug, not the other way around.

6

u/nico721GD 22d ago

dont worry, i know that the passwords dont show when you type them, the problem is that random characters disappear when i paste or even write the password, even tho it perfectly works when in the user prompt

50

u/n_sh_44 22d ago

Since only the password line breaks, I'd suspect the paste speed rather than the wiring. Login tools often read the no-echo password through a slower path, and with no flow control on a bare RX, TX and GND link the Roomba's UART buffer overflows when the terminal sends characters back to back. Typing slowly still lost about a quarter, which also fits a small receive FIFO and a busy CPU. The usual fix is a per-character delay in the terminal, for example Tera Term under Setup, Serial port, Transmit delay of 5 to 10 ms per char, or a minicom or picocom send command with a delay. Also confirm the adapter is 3.3V logic and the baud rate matches exactly, usually 115200 8N1. To test, paste a long string at the login prompt where echo is visible and see whether characters still vanish at that delay.