So I have Domoticz set up on an Orange Pi PC board which has a 3 pin ttl serial port right next to the power connector. I was hoping that I could connect that to my gateway which would free up my USB serial adapter for other uses, not to mention making the setup less bulky. I have two main issues with it.

First, the port in linux that references it is /dev/ttlS0. When I try to open my serial monitor to use that port, it can't connect to it for some reason. However, if I go to a terminal and type "cat /dev/ttlS0" and reset the gateway, I see the gateway identification data come through.

Second, when I look at the setup of the gateway in Domoticz, I don't have the option of selecting that serial port. The only port it shows me for a selection is /dev/ttlUSB0, and that is only if I have my USB adapter plugged in. If I unplug that and refresh, I have 0 options in the drop down list for the port selection. Is Domoticz set up to ONLY look at USB serial devices? If so, is there any way I can change that?

]]>https://forum.mysensors.org/topic/4224/orange-pi-ttl-serial-port-solvedRSS for NodeFri, 22 Feb 2019 16:34:34 GMTMon, 04 Jul 2016 14:51:57 GMT60So I have Domoticz set up on an Orange Pi PC board which has a 3 pin ttl serial port right next to the power connector. I was hoping that I could connect that to my gateway which would free up my USB serial adapter for other uses, not to mention making the setup less bulky. I have two main issues with it.

First, the port in linux that references it is /dev/ttlS0. When I try to open my serial monitor to use that port, it can't connect to it for some reason. However, if I go to a terminal and type "cat /dev/ttlS0" and reset the gateway, I see the gateway identification data come through.

Second, when I look at the setup of the gateway in Domoticz, I don't have the option of selecting that serial port. The only port it shows me for a selection is /dev/ttlUSB0, and that is only if I have my USB adapter plugged in. If I unplug that and refresh, I have 0 options in the drop down list for the port selection. Is Domoticz set up to ONLY look at USB serial devices? If so, is there any way I can change that?

]]>https://forum.mysensors.org/post/42248https://forum.mysensors.org/post/42248Mon, 04 Jul 2016 23:31:41 GMT@dbemowsk for the first question, I would look at the permissions on the device (ls -l). Are they different from the device that works?

]]>https://forum.mysensors.org/post/42273https://forum.mysensors.org/post/42273Mon, 04 Jul 2016 18:22:00 GMT@mfalkvidd OK, we'll try to get through the first part and I think your suggestion for the symbolic link on the second part is going to work just fine. That was something I hadn't thought of.

Now, as for the first part, looking at ls -l for /dev/ttyS0 vs /dev/ttyUSB0, there are two differences that I see that could affect this. The first is as you mentioned, permissions.
Crw--w---- for /dev/ttyS0
Crw-rw---- for /dev/ttyUSB0
The second issue is that /dev/ttyUSB0 is in the group dialout, but /dev/ttyS0 is in the group tty. So I did 2 things. I added the orangepi user to the tty group with "usermod -a -G tty orangepi". Next I tried to change the permissions for /dev/ttyS0 using "chmod 660 /dev/ttyS0" which did change the permissions, but as soon as I did a restart to get the user groups to update properly, I tried opening the port in CuteCom and it said that I could not open it. I checked the permissions again and it seems that that is something that gets checked and reset on reboot. I am not sure where to look to find where it checks the permissions on that. I could have a shell script that runs on boot that changes it back to the 660 permissions, but I think that is pointless if there is a way to disable the change back in the first place.

The serial port might be setup for console login. In that case you should disable that to use the port for another program. You can google how to check and do that.

Then use a udev rule if you want to have persistent change of permissions of the port.

]]>https://forum.mysensors.org/post/42294https://forum.mysensors.org/post/42294Mon, 04 Jul 2016 22:55:34 GMT@martinhjelmare I think I do recall reading something that that port was for console logins. I liked it because it was an easy 3 pin header to connect to. I think /dev/ttyS1 is on the GPIO header. I will look at using that one.
]]>https://forum.mysensors.org/post/42295https://forum.mysensors.org/post/42295Mon, 04 Jul 2016 23:05:29 GMTSo I found that GPIO pins 6, 8 and 10 were /dev/ttyS3. I used the link from @mfalkvidd and did the symbolic link and changed the /etc/rc.local file and I now have everything working in Domoticz on /dev/ttyUSB30. I cannot seem to see the device in CuteCom, but if I need to debug in there I can do it on /dev/ttyS3.