Enable UART (ttyAMA0) - Kodi crashes

Hi everyone,

I wanted combine OSMC on my RasPi 4 with my home automation system FHEM, which needs access to UART via ttyAMA0 for one of my radio modules.

To do so I needed to add this to /boot/config-user.txt

enable_uart=1
dtoverlay=miniuart-bt

, and run the following lines.

sudo systemctl stop serial-getty@ttyAMA0.service
sudo systemctl disable serial-getty@ttyAMA0.service
sudo systemctl mask serial-getty@ttyAMA0.service
sudo shutdown -r now

Unfortunately, after the reboot I did not get my TV connected via HDMI anymore.

I was able to get the HDMI back working by restarting the serial-getty@ttyAMA0.service, but obviously this does not solve the problem.

Any ideas how to get this configuration working?

Best regards,
Stephan

Do you have some logs which show Kodi crashing?

Thanks

Sam

I had to find out what /dev/ttyAMA0 is about – and it’s a bit complicated.

However, here’s /dev/ttyAMA0 and my pi3B and Pi4 devices:

Pi3B:
crw-rw---- 1 root dialout 204, 64 Aug 18 21:00 /dev/ttyAMA0

Pi4:
crw--w---- 1 root tty 204, 64 Aug 14 06:20 /dev/ttyAMA0

My one other observation is that user osmc is not in the tty group, but is in dialout.

And yes, logs.

I will try to upload logs in the evening today.

Unfortunately I messed around with enabling and disabling the serial-getty service until Kodi did not allow to login via ssh anymore (connection refused) - don’t know how this could happen.

Probably I will create a fresh install, test the UART enabling again and provide this log.

Sorry guys, it took a while until I found time to repeat the experiment - family and work, I am pretty sure you know what I am talking about.

Anyway, today I found some time. I created a fully fresh OSMC, installed the home automation software FHEM and a mariadb instance and then did what I wrote before with exactly the same result.

Here you will find the log.

https://paste.osmc.tv/otaraqadif

Unfortunately, I do not know how to create the log from the terminal directly. Hence, I guess the situation where kodi did not start anymore is not shown here, as I had to revert the previously described commands & reboot to get it back running.

grab-logs -A

Thanks! I will try this in the evening.

Thanks again for the command! I managed to test it right now.

I did as follows to make it easier for debugging:

  1. manipulated the /boot/config-user.txt
enable_uart=1
dtoverlay=miniuart-bt
  1. restarted twice, in both cases Kodi started fine. Anyway, for completeness here is the log after the 2nd reboot https://paste.osmc.tv/oyepepicoc

  2. run the masking of ttyAMA0 by executing the following commands in the terminal

sudo systemctl stop serial-getty@ttyAMA0.service
sudo systemctl disable serial-getty@ttyAMA0.service
sudo systemctl mask serial-getty@ttyAMA0.service
sudo shutdown -r now
  1. This time Kodi started fine, just showing an failed status for the home automation system for 1 or 2 seconds (have to check this by myself) before booting to the GUI. I collected the logs via
grab-logs -A

These are the logs https://paste.osmc.tv/osumahosir. Seems be quite fine.

Now I have to check if I can get the sensor up running. I will keep you informed.

Once again, thank you all very much for your help!

Seems like everything is working. I don’t know what conflicted initially, but now everything seems to run fine.

Thank you all for your help. At least I learned how to grab the logs via terminal. :wink:

Best regards

1 Like