does RevPi Connect S support Using RS485 as a Serial Console?

Topics about the Hardware of Revolution Pi
Post Reply
p.xie
Posts: 3
Joined: 21 Feb 2024, 01:35

does RevPi Connect S support Using RS485 as a Serial Console?

Post by p.xie »

In this page, it says revpi-flat can use RS485 as a Serial Console without HDMI:
https://revolutionpi.com/en/tutorials/o ... utzen-flat

We have RevPi Connect S. Does it support this feature the same?

Regards
Peter
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: does RevPi Connect S support Using RS485 as a Serial Console?

Post by dirk »

Hello Peter, this should be possible, I have just successfully created a test setup.
However, not with a RevPi Connet S but with a RevPi Connect 4, where it works like this. I have checked which ttyAMA* is available - ttyAMA5:
ttyAMA
ttyAMA
I then changed the /boot/config.txt as follows

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait nosplash plymouth.ignore-serial-consoles console=ttyAMA5,115200n8
Using a logic analyzer, I was able to determine that data was transferred
Trace Connect 4 Modbus
Trace Connect 4 Modbus
Please ensure which settings are necessary on your system and change this solution accordingly, then it should work.
p.xie
Posts: 3
Joined: 21 Feb 2024, 01:35

Re: does RevPi Connect S support Using RS485 as a Serial Console?

Post by p.xie »

Hi Dirk

Thank you for the confirmation. Will give it a try on mine when I get a USB to RS485 adapter.

Regards
Peter
User avatar
p.rosenberger
Posts: 91
Joined: 03 Jul 2020, 11:07

Re: does RevPi Connect S support Using RS485 as a Serial Console?

Post by p.rosenberger »

Hi Peter,

it should be possible to use the RS485 as console. But be aware, that the RS485 on the Connect(+/S) is connected via USB. This has some impact on some minor use-cases. So you only get output from the console after the USB subsystem is initialized. This is later in the kernel startup. But after this it should work just fine.

Best regards,
Philipp
p.xie
Posts: 3
Joined: 21 Feb 2024, 01:35

Re: does RevPi Connect S support Using RS485 as a Serial Console?

Post by p.xie »

This is my device /dev details:

Code: Select all

root@HiveController:/boot# ls /dev/
autofs         fuse       loop1         mmcblk0       pts    ram6            serial     tty11  tty23  tty35  tty47  tty59         ttyS0    vcs2      vcsu         video14
block          gpiochip0  loop2         mmcblk0boot0  ram0   ram7            serial0    tty12  tty24  tty36  tty48  tty6          ttyUSB0  vcs3      vcsu1        video15
btrfs-control  gpiochip1  loop3         mmcblk0boot1  ram1   ram8            serial1    tty13  tty25  tty37  tty49  tty60         ttyUSB1  vcs4      vcsu2        video16
bus            gpiochip2  loop4         mmcblk0p1     ram10  ram9            shm        tty14  tty26  tty38  tty5   tty61         ttyUSB2  vcs5      vcsu3        video18
cachefiles     gpiochip3  loop5         mmcblk0p2     ram11  random          snd        tty15  tty27  tty39  tty50  tty62         uhid     vcs6      vcsu4        video20
char           gpiochip4  loop6         mmcblk0rpmb   ram12  raw             spidev0.0  tty16  tty28  tty4   tty51  tty63         uinput   vcsa      vcsu5        video21
console        hwrng      loop7         mqueue        ram13  rfkill          stderr     tty17  tty29  tty40  tty52  tty7          urandom  vcsa1     vcsu6        video22
cuse           i2c-1      loop-control  net           ram14  rpivid-h264mem  stdin      tty18  tty3   tty41  tty53  tty8          v4l      vcsa2     vga_arbiter  video23
disk           initctl    mapper        null          ram15  rpivid-hevcmem  stdout     tty19  tty30  tty42  tty54  tty9          vchiq    vcsa3     vhci         watchdog
dma_heap       input      media0        piControl0    ram2   rpivid-intcmem  tty        tty2   tty31  tty43  tty55  ttyAMA0       vcio     vcsa4     video10      watchdog0
fb0            kmsg       media1        port          ram3   rpivid-vp9mem   tty0       tty20  tty32  tty44  tty56  ttyConBridge  vc-mem   vcsa5     video11      zero
fd             log        media2        ppp           ram4   rtc             tty1       tty21  tty33  tty45  tty57  ttyprintk     vcs      vcsa6     video12
full           loop0      mem           ptmx          ram5   rtc0            tty10      tty22  tty34  tty46  tty58  ttyRS485      vcs1     vcsm-cma  video13

root@HiveController:/boot# ls -l /dev/ttyRS485 /dev/ttyUSB1 /dev/ttyAMA0
crw-rw---- 1 root dialout 204, 64 Mar  5 14:47 /dev/ttyAMA0
lrwxrwxrwx 1 root root          7 Mar  5 14:22 /dev/ttyRS485 -> ttyUSB1
crw-rw---- 1 root dialout 188,  1 Mar  5 14:47 /dev/ttyUSB1
I tried to change cmdline.txt to use /dev/ttyAMA0, but it seemed to break my application with Revpi DIO module. Maybe ttyAMA0 is the Revpi DIO module interface.

Code: Select all

dwc_otg.lpm_enable=0 console=ttyAMA0,115200n8 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait nosplash plymouth.ignore-serial-consoles
Then I saw /dev/ttyRS485, and I thought maybe that is the dev I should use, and I changed cmdline.txt as follows:

Code: Select all

dwc_otg.lpm_enable=0 console=ttyRS485,115200n8 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait nosplash plymouth.ignore-serial-consoles
But I connect the COM port with baudrate 115200 with putty on Windows, I just got weird characters.
```
▒▒▒@@B▒▒'▒▒▒▒▒+▒▒▒▒G@P▒▒▒▒▒+▒▒▒▒@@B▒▒'▒▒▒▒B▒+▒▒▒▒G@P▒▒▒▒ ▒+▒▒▒▒@@B▒▒'▒▒▒▒B ▒+▒▒▒▒G@P▒▒▒▒▒+▒▒▒▒@@B▒▒'▒▒▒▒ ▒+▒▒▒▒G@P▒▒▒▒ ▒+▒▒▒▒G@P▒▒▒▒▒+▒▒▒▒@@W$▒▒▒▒ Pw▒▒▒BA@ҁ▒▒▒@@B▒▒'▒▒▒▒ ▒+▒▒▒▒B@@W$▒▒▒▒G Pw▒▒▒BA@ҁ▒▒▒@@B▒▒'▒▒▒▒ ▒+▒▒▒▒@@W▒▒▒▒G Pw▒▒▒A@ҁ
```
I use this RS485 to USB adapter https://core-electronics.com.au/industr ... erter.html, and wired the adapter A+ to RS485 interface P on the RS485 interface, and B- to N interface.

OS version:

Code: Select all

cat /etc/*release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
Any suggestion?

Thanks
Peter
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: does RevPi Connect S support Using RS485 as a Serial Console?

Post by dirk »

Hi Peter, ttyAMA0 is the PiBridge and therefore cannot work. "ttyRS485" is a symlink that points to the actual UART.
As this UART is only set later during booting, the target must be used. Query can be made with readlink /dev/ttyRS485 i.e.

Code: Select all

pi@RevPi99988:~ $ readlink /dev/ttyRS485
ttyAMA5
Post Reply