Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error reading uart information #841

Closed
kvkdileep opened this issue Nov 2, 2017 · 14 comments
Closed

error reading uart information #841

kvkdileep opened this issue Nov 2, 2017 · 14 comments
Labels

Comments

@kvkdileep
Copy link

kvkdileep commented Nov 2, 2017

Iam using mraa on raspberry pi 3 which is running raspbian stretch
when i try to list the uart bus. It is throwing error
# mraa-uart list
0. ---- error reading uart information ----

Can anyone help me resolve the issue ?

@Mani-Sadhasivam
Copy link
Contributor

Could you please post the relevant libmraa logs? By default, the logs are stored in /var/log/syslog

@Mani-Sadhasivam
Copy link
Contributor

@kvkdileep I see the issue now! If the UART port you are trying to access is already occupied for console output, you will likely see that error message.

It looks like from the error there is only one UART available in Raspberry pi3 and that is assigned as the console out. So, as a work around you can release the UART console by removing console=tty***115200 parameter in kernel bootargs, but for that you have to recompile the kernel.

@kvkdileep
Copy link
Author

I removed the console=tty***115200 from /boot/cmdline.txt and rebooted, but still the same.

In syslog it shows only two lines

Nov 2 10:25:30 raspberrypi systemd-udevd[750]: Process '/usr/sbin/th-cmd --socket /var/run/thd.socket --passfd --udev' failed with exit code 1.
Nov 2 10:25:38 raspberrypi kernel: [ 64.174233] random: crng init done
Nov 2 10:27:07 raspberrypi libmraa[810]: libmraa version v1.7.0-73-g615e0cd initialised by user 'pi' with EUID 1000
Nov 2 10:27:07 raspberrypi libmraa[810]: libmraa initialised for platform 'Raspberry Pi 3 Model B' of type 5

@Mani-Sadhasivam
Copy link
Contributor

I am not familiar with Rpi3 but it looks like there are 2 serial ports and one is used by the console and another one is used for Bluetooth.

So, it would be great if you can disable both and login using the keyboard/monitor then execute mraa-uart list.

For disabling Bluetooth, add the following line in /boot/config.txt
dtoverlay=pi3-disable-bt

For disabling console, remove console=serial0,115200 or console=ttyAMA0,115200 in /boot/cmdline.txt.

Now, reboot and let us know.

@kvkdileep
Copy link
Author

I have done the same, but same situation here. Here are the files attached.
cmdline.txt
config.txt

@kvkdileep
Copy link
Author

Iam using raspbian stretch image for pi3, is it a problem ?

@Mani-Sadhasivam
Copy link
Contributor

Not sure! Could you please remove dtoverlay=pi3-miniuart-bt from config.txt and console=tty1 from cmdline.txt?

@kvkdileep
Copy link
Author

tried the same. Here are the attached files & the result after reboot
cmdline.txt
config.txt

pi@raspberrypi:~ $ mraa-uart list
0. ---- error reading uart information ----
pi@raspberrypi:~ $

@Mani-Sadhasivam
Copy link
Contributor

@kvkdileep Got the issue! There is no device_path registered for UART in the Raspberry pi Source.

Only way to get over this issue is to add b->uart_dev[0].device_path = "/dev/serial0"; after this line in the mraa source and rebuild it.

Note: I assumed /dev/serial0 is a symbolic link to correct serial port. Please cross check it.

@Mani-Sadhasivam
Copy link
Contributor

Let me know if this works for you. I will submit a patch to update the source!

@kvkdileep
Copy link
Author

kvkdileep commented Nov 14, 2017

Holy Moly ! that saved my day.

pi@raspberrypi:~/mraa/mraa/build $ mraa-uart list
0. /dev/serial0 <undefined>         9600 8N1 (none) XONXOFF
pi@raspberrypi:~/mraa/mraa/build $

Thanks Mani, it works. You may update the source with the patch

@Mani-Sadhasivam
Copy link
Contributor

Cool. Fix submitted #842.

You can close the issue now!

@alext-mkrs
Copy link
Contributor

...or better yet - you can include "Fixes #841" in the commit message and then GitHub will close the issue as soon as the PR is merged (i.e. when it's really fixed).

@Mani-Sadhasivam
Copy link
Contributor

@alext-mkrs Not aware of this! Will do it for upcoming fixes ;-) Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants