Looking more closely at the device type it is different from other tty devices.
It is the only device with those major and minor numbers but that may not be an issue.

0 crw--w---- 1 root tty     240,  0 Oct 16 05:58 /dev/ttyGS0

This is interesting also.
It appears to be a character device though.

And some more info:

  File: /dev/ttyACM0
  Size: 0         	Blocks: 0          IO Block: 4096   character special file
Device: 6h/6d	Inode: 14407       Links: 1     Device type: a6,0
Access: (0660/crw-rw----)  Uid: (    0/    root)   Gid: (   20/ dialout)
Access: 2019-10-16 05:58:29.736796001 +0000
Modify: 2019-10-16 05:58:29.736796001 +0000
Change: 2019-10-16 05:58:29.736796001 +0000
 Birth: -

dr-offig's code hangs. I've tinkered with that for ages.
I don't know what

#include <rtdk.h>

is. So I commented it out.
It compiles and runs but nothing happens.

Actually, no it doesn't compile as is:

/root/Bela/projects/Serial3/render.cpp:148:15: error: no matching function for call to 'Bela_createAuxiliaryTask'    ttyTask = Bela_createAuxiliaryTask(readSerialPort, 50, "bela-arduino-comms");

Is there any code simpler than this?

are you sending anything from the teensy? The port is open as "blocking" (i.e.: O_NONBLOCK is not set in the flags to open()), so it's normal for read() to hang until data is received. If you want to wait with a timeout you will need to use poll() or select() before reading.

Many thanks it compiles and runs.
Yes, the Teensy sends data from sensors to trigger audio file playback.

Thanks again.

OK, I've been testing the code and will it doesn't hang, I'm not seeing the data I expect to see.
"screen" still does not show anything displayed.

I'm not sure what the debugging strategy is next but I'll keep pondering it.

Any thoughts?

OK, well USB input seems to be working OK now.
From a few hours ago, I didn't really do anything, just moved a few kilometers.
Data needs better formatting but it is getting through and is correct.

The timeliness of the help from the Bela community is commendable.

Oh, I could be back with more problems soon, who knows.
I know though that they'll get answered too.

Is the UART transmission rate you set on the Teensy the same you use on Bela? The code linked above receives at 9600baud.

    Yes. But I changed it to a higher rate and it works fine. 9600 is a bit slow these days.
    One thing I do note now, and I've yet to look into this in detail, is that more data is coming in than I want.
    It might be a retriggering issue like key bounce. I'm not sure yet.

    3 years later

    janklug giuliomoro
    Im trying to do the same, import serial data from arduino to a pd patch flashed on Bela. i tried to build the above render.cpp to the 8th example with the custom render but i got some errors like :
    no matching function for call to 'Bela_createAuxiliaryTask' column: 27, line: 220
    use of undeclared identifier 'libpd_get_sys_soundin'; did you mean 'get_sys_soundin'? column: 11, line: 280
    use of undeclared identifier 'libpd_get_sys_soundout'; did you mean 'get_sys_soundout'? column: 12, line: 281

    Could someone post a working solution, or guide me to make it work?