I'm trying to connect a barcode reader on the UART of the GPIO pins of the Raspberry Pi 3B+. I've installed minicom to read the serialport and have allready added the user pi to the groups tty and dialout. I try to communicate to the barcode reader using the following command:
minicom -b 9600 -D /dev/ttyS0
The output is:
minicom: cannot open /dev/ttyS0: Permission denied
When adding sudo to the command, I can access the barcode reader, but the output doesn't seem right. When scanning the barcode 604797026269, I get the following output: As you can see there is a lot of unknown characters and newlines which shouldn't be here. I'm sure the baud rate is right.
I also tried running the following command before starting minicom:
sudo chmod 666 /dev/ttyS0
Minicom can start now and read the barcode reader for a few minutes, before denying the access again. When scanning a barcode I get the same output as shown above.
I've also tried to connect the barcode reader to a USB port using a TTL-to-USB converter, which works fine.
Please let me know if you got some ideas to fix this problem.