Adding an external serial console port to NanoPi R6S

I had no trouble with my first experience with NanoPi R6S while installing and running the FriendlyWrt/OpenWrt 22.03 image, but that was another story when testing Ubuntu or Debian as the mini PC would not boot at all after flashing the images with eFlasher apparently successfully, but suspiciously fast (under 2 seconds).

I spent nearly four hours trying the different images and then the Rockchip Windows utility, but all my attempts failed, and FriendlyElec was not overly helpful. So I decided to connect a serial console to see what was going on. The NanoPi R6S comes with a 3-pin header for the serial console, but it’s not populated.

serial console port NanoPi R6S

So I soldering one, but not at the top of the bottom, and instead at the bottom since it would allow me to still use the metal enclosure to cool the processor.

3-pin serial console header soldered to NanoPi R6S

Some readers, or at least one, often complain about the lack of external access to the serial console in routers to debug issues without having to disconnect the device and open it up. But with the NanoPi R6S, it’s fairly easy to create to add an external serial console port by soldering the header on the bottom side of the board and then making a hole in the bottom plate.

UART console opening

I used a power drill and a file tool, and the result is functional but not exactly neat. People with better skills than me or a CNC machine could make something neater.

GND Tx Rx markings

I’ll also pretend I did not center the hole on purpose in order to be able to see the markings (GND, Tx, Rx).

NanoPi R6S DIY external UART console

But it does the job and we can now access the serial console without having to tear down the router, simply connect Tx, Rx, and GND to a USB to TTL debug board with jumper wires and we are good to go. I had to cut the headers by about 1 mm to prevent them from touching the desk once we are not using the serial console anymore. A plastic cover would be nice, and looking around in my office, plastic bits covering HDMI cables seem to be good candidates for this purpose, provided we make a hole of the right size.

It works within the eFlasher utility or when I boot the FrienlyWrt/OpenWrt image using 1,500,000 bps baudrate stipulated in the wiki:


But there’s no output at all with Ubuntu or Debian. So something must be wrong while flashing the image inside the eFlasher utility especially since it just takes one or two seconds to complete the “firmware upgrade”, I’m guessing some issues with the MicroSD card (I/O errors or too small), but that will be for another day.

I hope FriendlyElec considers providing easy access to the serial console in their future routers, as it should cost close to nothing to implement a solution as described above.

[Update: Pastrav has come up with a nicer way to add a serial port to NanoPi R6S using a 2.5mm audio connector attached to the hole reserved for an antenna. See comments for details.

NanoPi R6S audio jack serial port

]

This is it for the 10,000th post published on CNX Software!

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX Rockchip RK3588 mini-ITX motherboard

20 Replies to “Adding an external serial console port to NanoPi R6S”

  1. I feel like I’m “at least one” of the readers who often complain about the lack of console on their boards 🙂 Indeed it’s more accessible on this one, but frankly, having a micro-USB port accessible costs nothing either and provides way more value than just exposing pins and requiring the user to find a working USB-TTL adapter.

    By the way the flashing problem you faced sounds very similar to the one I faced with my Station-M2 with the crappy rockchip flashing tool. This thing has trouble selecting the proper flash and in my case it mistakenly flashed the MMC image to the SPI NOR, failed after 16 MB and bricked it. Worse, the recovery procedure refused to reflash the correct image there, thinking there was already a valid one. The support insisted that I find a windows machine to reflash everything because the linux tool doesn’t work (the windows one doesn’t work much better, but if you ignore the numerous errors, at some point you get a booting machine).

    1. Yes that was you I was referring to :p
      I think giving access to the serial header without having to open the device would already be a nice improvement. They’d need to add a USB to a serial chip and a micro USB port otherwise.

      With regard to the flashing problem, I think my problem may be different, as I can still go back to OpenWrt, it’s just the Debian and Ubuntu images that are not working at all. FriendlyElec told me eFlasher Ubuntu and Debian images work on their side. Another person also tested the Debian image successfully but they boot directly from a MicroSD card, instead of flashing it to the eMMC flash.

      1. > I think giving access to the serial header without having to open the device would already be a nice improvement.

        Sure, I don’t deny this, and that’s what I had done on a dockstar and a goflex home. But each time I want to use them I need to find an unused TTL adapter. It’s still better than having to also take the screwdriver.

        > They’d need to add a USB to a serial chip and a micro USB port otherwise.

        The CH340E was something like $0.50 or so last time I checked. There’s definitely no excuse for not having that, even in that price range. If I have the choice between a console-less device and one with a console, with a $5 price difference, I won’t even hesitate!

        > With regard to the flashing problem (…)

        OK at least yours is not bricked, that’s always better.

  2. @@@@ Awarded For Excellent Article @@@@@

    Given by Theguyuk ( creep 😇 )

    To Jean – Luc Aufranc ( if as a award receiver, he accepts the Award ).

    Publish long and financial proper 👍🎀 🎄⛄🇬🇧

    PS No I don’t have substance, alcohol issues.

    Pps the value of this Award is probably rated at 1% + – 10%

  3. I think there’s an easier and cleaner way of adding a serial port to the R6S: insert a thin 2.5 mm audio jack into the antena hole in the case.
    Here’s how it looks:

    1. One of the regulars on cnx recently suggested using audio jacks, great advice.
      Here’s a block terminal to 2.5 jacck converter hooked up to an ftdi 232

      1. I’m one of those suggesting jacks when it’s too difficult to make a large hole (though the plug can be large behind). I’ve borrowed this idea from CASIO calculators 30 years ago when I was still a student, they were also using 2.5mm jacks for file transfers.

  4. Can’t you you use OpenOCD using the SWD port next to the serial port? Bypassing the bootloader, maybe? JTAG debug maybe?

  5. This is cnx Software at its best. Group think, blue sky, solution seeking. With participants feedback and lived experience expression.

    Very most illuminating 😀👍

  6. Finally found the issue with booting Ubuntu 22.04 on NanoPi R5S. I flashed the gz image with USBImager 1.0.8. It will somehow corrupt it leading to file systems errors when boot, and most compress firmware files from FriendlyElec will not work, with one exception being the FriendlyWrt image.

    The workaround for Ubuntu and Debian images is to decompress the firmware with gzip first, and then I can flash the image with USBImager.

    See issue @ https://gitlab.com/bztsrc/usbimager/-/issues/109

    1. Does this mean USBImager is not verifying by default or is the verify OK (AKA similarly flawed since the corruption happens while decompressing)?

      1. It looks like it is a 4GB limit issue, which explains why FriendWrt is working, but larger images are not.

Leave a Reply

Your email address will not be published. Required fields are marked *

Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...
Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...