Enable 'failsafe' ttyUSB0 login shell

jeroen
 
Posts: 2
Joined: Fri May 15, 2020 5:01 am

Enable 'failsafe' ttyUSB0 login shell

Sun May 17, 2020 12:23 pm

I have a VoCore2 Ultimate which is in a nice standard plastic case. I was experimenting installing LIRC to it and built a custom firmware for it (quite a learning process, but an enjoyable one). Of course as part of this I managed to semi-brick it a couple of times, having it not respond to Wifi nor the ethernet port. So I had to get it out of the case and connect an usb to serial converter to it to get a login prompt.
To avoid doing this, I added support for a login shell on /dev/ttyUSB0 in my custom firmware:
  • Enable the kernel modules kmod-usb-serial and kmod-usb-serial-pl2303 (you can add other kmod-usb-serial-xxx's as well)
  • Enable 'getty' in the busybox 'Login/Password Management Utilities' and 'uudecode' in the 'Core Utilities'
  • Added the line 'ttyUSB0::respawn:/sbin/getty -L ttyUSB0 115200 vt100' to the '/etc/inittab' file, by adding a copy of it as 'files/etc/inittab' in the openwrt build directory:
      Code: Select all
      ::sysinit:/etc/init.d/rcS S boot
      ::shutdown:/etc/init.d/rcS K shutdown
      ::askconsole:/usr/libexec/login.sh
      ttyUSB0::respawn:/sbin/getty -L ttyUSB0 115200 vt100

So now when I'm in trouble I can insert a usb to serial converter in the USB port of the VoCore2, connect the TX and RX pins to the RX and TX pins of another usb to serial converter in my PC, connect with a terminal program (115200,n,8,1) and I'm greeted with a login prompt. :)
While this does not give you uboot access, it does allow you to inspect the system and manually correct it even do a firmware upgrade. You can execute 'uudecode' on the VoCore2 and then upload a uuencoded firmware.bin to the serial connection. It will take a while but then you can flash it manually.

Maybe this is something to enable in the default firmware for the Vocore and Vocore2?

Vonger
 
Posts: 802
Joined: Sun Oct 19, 2014 6:00 am

Re: Enable 'failsafe' ttyUSB0 login shell

Mon May 18, 2020 2:18 pm

Looks like you are making a "reverse" USB to TTL :)

The VoCore2 Ultimate microUSB is already has USB2TTL function, you can directly connect it to your computer by a USB cable(connect to the microUSB on VoCore2, another side to your computer), then our computer will have a COM port, it do not need to install any driver for mac and linux(maybe windows need to install a profile)
Please check vocore.io/v2u.html

jeroen
 
Posts: 2
Joined: Fri May 15, 2020 5:01 am

Re: Enable 'failsafe' ttyUSB0 login shell

Mon May 18, 2020 4:40 pm

Yes, I literally saw that -very nice- feature just after I posted my post. But I couldn't edit my post because it had to be approved first. :lol: So no sense adding it to the VoCore 2 standard firmware. But maybe to the VoCore 1?

Vonger
 
Posts: 802
Joined: Sun Oct 19, 2014 6:00 am

Re: Enable 'failsafe' ttyUSB0 login shell

Thu May 21, 2020 3:09 pm

VoCore1 has stop production almost five years :)

Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: No registered users and 4 guests