ttyAMA0 physically available

Topics about the Hardware of Revolution Pi
Post Reply
mats-olov_rustad
Posts: 17
Joined: 01 Apr 2020, 11:40
Answers: 0

ttyAMA0 physically available

Post by mats-olov_rustad »

Is the builtin serial port represented by the device file /dev/ttyAMA0 physically available as an rS232 port? I.e. can I connect a 3,3V to RS232 level converter somewhere on the Connect+ and have a serial port available as a console or a service port for our background service?
/Mats-Olov Rustad
Application Developer
ASFT Industries AB
User avatar
dirk
KUNBUS
Posts: 1946
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: ttyAMA0 physically available

Post by dirk »

Hi mats-olov_rustad, the RevPi Connect/+ has a RS485 interface which uses 5 volts.
/dev/ttyRS485 is a symbolic link to /dev/ttyAMA0 /dev/ttyUSB0

Have a look at the shop article USB - RS485 Converter:
https://revolution.kunbus.de/shop/en/us ... -konverter

Hava a look at the schematics here:
https://revolution.kunbus.com/tutorials/downloads/
mats-olov_rustad
Posts: 17
Joined: 01 Apr 2020, 11:40
Answers: 0

Re: ttyAMA0 physically available

Post by mats-olov_rustad »

My company has two Connect+ 32 GB modules when we coldstart (i.e. powers them on) there are 2 symbolic links in the /dev directory. ttyConBridge is usually a symbolic link to ttyUSB1 and ttyRS485 is usually a symbolic link to ttyUSB0. An terxtal USB-RS232-adapter or an external USB-RS485-adapter are usually represented by ttyUSB2, ttyUSB3 and so on. The output from ls -l shows that ttyUSB0, ttyUSB1, ttyUSB2 and ttyAMA0 all are character devices.

Our application is configured to use ttyRS485 for one type of sensor and ttyUSB2 for another type. That usually works as we intended.

ttyConBridge and ttyRS485 are both shown as links. All other tty* device files are shown as character devices.

What is funny is the configuring ttyUSB0 in our application doesn't work while configuring ttyRS485 does work even when ttyRS485 is a symbolic link to ttyUSB0. That makes no sense to me. Both device files should result in our application getting a file descriptor to the same device.

With regards,
/Mats-Olov Rustad
Application Developer
ASFT Industries AB
User avatar
dirk
KUNBUS
Posts: 1946
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: ttyAMA0 physically available

Post by dirk »

Hi Mats-Olov,
ttyRS485 is a symbolic link to ttyUSB0
- no, "/dev/ttyRS485" links to "/dev/ttyAMA0" ;)
mats-olov_rustad
Posts: 17
Joined: 01 Apr 2020, 11:40
Answers: 0

Re: ttyAMA0 physically available

Post by mats-olov_rustad »

This is the output from the command ls -l /dev/ttyRS485:
lrwxrwxrwx 1 root root 7 jan 26 16:03 /dev/ttyRS485 -> ttyUSB0

Does this not mean that /dev/ttyRS485 is a symbolic link to /dev/ttyUSB0?

With regards,
/Mats-Olov Rustad
Application Developer
ASFT Industries AB
User avatar
dirk
KUNBUS
Posts: 1946
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: ttyAMA0 physically available

Post by dirk »

Hi yes this is right.
Post Reply