Page 1 of 1

Enable 'failsafe' ttyUSB0 login shell

Posted: Sun May 17, 2020 12:23 pm
by jeroen
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
      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?

Re: Enable 'failsafe' ttyUSB0 login shell

Posted: Mon May 18, 2020 2:18 pm
by Vonger
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

Re: Enable 'failsafe' ttyUSB0 login shell

Posted: Mon May 18, 2020 4:40 pm
by jeroen
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?

Re: Enable 'failsafe' ttyUSB0 login shell

Posted: Thu May 21, 2020 3:09 pm
by Vonger
VoCore1 has stop production almost five years :)