I have a HAT (from from Waveshare) implementing 2 serial channels created using a DUART type SC16IS752 on spi1 and a CAN device on spi0. The serial prost show up in de directory /dev/ and they look all right when I do: dmesg | grep -i ‘(can|spi)’ However, when I do: echo “tralalalalalal” > /dev/ttySC0, nothing happens with the CE wire on the board, it is and stays high. How comes?
The thing is that using a standard pi 5 with Pi os having linux kernel 6.12.47+rpt-rpi-2712, works okay. The Pi with haos has linux kernel 6.12.34-haos-raspi however does not work.
Can I ask questions about this matter here?
If so: what would be the difference between these 2 kernels?
If not: where would I best be going?
Probably very little, but there is a difference in the environment.
Your PiOS have direct hardware access
HA is running in a Docker container on an Alpine OS, so it is a virtualized instance.
@ WallyRWally
I see now what you mean. Thanks for pointing out.
So the USB ports are accessable inside the Docker container and the memory mapped I/O of the DUART not.
in the meantime I helped myself using a USB to RS485 device from Waveshare. Now it workd all right.
Where should I go if I want to persue the access of the DART? I can imagine that somewhere there is an config file that specifies what resources are shared, or need to be shared?
Any idea?
There might be code that needs to be compiled in the kernel or other software pieces that needs to be inserted in the Alpine Linux startup process.
You could try to alter it yourself, but with each update of HAOS it will removed.
You could try to make a feature request for it, but a while back the access to GPIO was removed from HA core, so the access to such stuff might not wanted.
The issue is probably that there are so many different hats that require so many different setup and if they allow one then they will get a flood of requests to allow others too, which will make it hell to maintain a slim streamlined HAOS image.