#!/bin/bash
DEV=/dev/ttyS2
while read line; do
echo "["$(date "+%Y-%m-%d %H:%M:%S")"] from Arduino: "$line
done < <(cat $DEV)
here i see my keepalives…if i try to send via
echo "AT" >/dev/ttyS2
i get no response (my arduino sends back “AT”-Strings)…arduino is connected also via usb to my workstation, if i send same string via ardiono-console, i see the response in the console and my script-output…so there is a problem with sending to the device (same construction works with raspi [script+send on another terminal via echo])
How did you test it? I use an arduino nano with level-shifter which sends keepalives (which i receive) and sends back what it receive (got no resonse if i send)
uart0, uart1, uart2 all work in my setup with kernel 4.15 rc1. for uart3, i will test it . but it seems having not pin out for it on the board. the way i test is using loopback.
found out, that the problem seems to be the arduino…have my circuit placed on raspberry, where it works before…
if usb is connected to pc, serial is only receiving from it…if i power arduino via cellular-powersupply, it works with raspberry…
can you please look in my dts(i) why uart1 (11003000) not found in system? also tried to put uart2 in dts before others like i’ve done in dtsi, but without luck
│ Symbol: SERIAL_8250_NR_UARTS [=2] │
│ Type : integer │
│ Prompt: Maximum number of 8250/16550 serial ports │
│ Location: │
│ -> Device Drivers │
│ -> Character devices │
│ -> Serial drivers │
│ (6) -> 8250/16550 and compatible serial support (SERIAL_8250 [=y]) │
│ Defined at drivers/tty/serial/8250/Kconfig:169 │
│ Depends on: TTY [=y] && HAS_IOMEM [=y] && SERIAL_8250 [=y] │
good to know its configurable…
-CONFIG_SERIAL_8250_NR_UARTS=2
-CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
Linux bpi-r2 4.14.8-00022-gb3e6160-dirty #47 SMP Thu Dec 21 15:53:13 CET 2017 armv7l
[15:56] root@bpi-r2:~# find /sys -name '*serial*'
[15:56] root@bpi-r2:~# dmesg | grep tty
[ 0.000000] Kernel command line: board=bpi-r2 console=earlyprintk fbcon=map:0 console=ttyS0,115200 root=/dev/mmcbl0
[ 0.231181] console [ttyS0] disabled
[ 0.251356] 11004000.serial: ttyS0 at MMIO 0x11004000 (irq = 195, base_baud = 1625000) is a ST16650V2
[ 0.919335] console [ttyS0] enabled
[ 0.943721] 11002000.serial: ttyS1 at MMIO 0x11002000 (irq = 196, base_baud = 1625000) is a ST16650V2
[ 0.973765] 11003000.serial: ttyS2 at MMIO 0x11003000 (irq = 197, base_baud = 1625000) is a ST16650V2
[ 4.306955] systemd[1]: Expecting device dev-ttyS0.device...
Is there a way to get serial working from the box (in compiled image)? I understand everyone here is a linux engineer but how people without this kind of background can get it working?
You can use debian/ubuntu-images and installing one my compiled kernels (4.4 or 4.14). I have activated the uart-nodes.
The configuration of the serial-port itself depends on your device. Basicly you can use raw-mode with 8n1 and desired speed (documentation of your device)