mraa icon indicating copy to clipboard operation
mraa copied to clipboard

rpi: add uart device_path

Open Mani-Sadhasivam opened this issue 7 years ago • 8 comments

Currently there is no device_path registered for UART in Raspberry Pi source. This will hinder the working of UART driver in mraa.

So, register the device_path with '/dev/serial0' as most of the raspbian images make this as a soft link to real UART port by default.

Tested-on: Raspberry pi 3 model B

Signed-off-by: Manivannan Sadhasivam [email protected]

Mani-Sadhasivam avatar Nov 14 '17 11:11 Mani-Sadhasivam

The change is technically trivial and looks ok to me, but are you sure the path is the same on RasPi 1 & 2, in addition to 3? Quick googling gives me this may be a RasPi 3 thing and on older versions the port was either /dev/ttyAMA0 or /dev/ttyS0. I don't have any of those to check, unfortunately.

On the other hand, if it wasn't there at all, it didn't work anyway, so having a wrong one would do no harm.

alext-mkrs avatar Nov 14 '17 20:11 alext-mkrs

@alext-mkrs I assumed that /dev/serial0 exists for all Rpi models!

Changed the serial port to /dev/ttyS0 for all models except Rpi3. This port is used as general purpose UART while /dev/ttyACM0 is used for console. Also, /dev/serial0 is used for Rpi3.

Mani-Sadhasivam avatar Nov 15 '17 05:11 Mani-Sadhasivam

@kvkdileep Can you do a quick test now?

Mani-Sadhasivam avatar Nov 15 '17 05:11 Mani-Sadhasivam

@Mani-Sadhasivam spare me some time, i will test it with sensor having uart interface

kvkdileep avatar Nov 15 '17 07:11 kvkdileep

@kvkdileep have you had a chance to test this?

arfoll avatar Nov 17 '17 09:11 arfoll

@kvkdileep did this work?

arfoll avatar Jan 04 '18 13:01 arfoll

@kvkdileep, are you still up to checking this one out? That's the last step before merging as everything else looks ok (Travis failure is unrelated to the change contents).

alext-mkrs avatar Jan 16 '18 22:01 alext-mkrs

If this was tested I'm OK to merge!

Propanu avatar Apr 30 '18 19:04 Propanu