ccfiel Posted April 11, 2016 Share Posted April 11, 2016 I have a orange pi pc (H3). I connected a thermal printer which has a TTL interface so I connected the TX wire from the printer to 8 and RX to 10 to orange pi. I change the serial port in my script to /dev/ttyS0 and tried a test print but it will not print. I have tried this in raspberry pi 2 and it works. Any tips how to connect the thermal printer to orange pi. Link to comment Share on other sites More sharing options...
Nick Posted April 11, 2016 Share Posted April 11, 2016 Does the thermal printer have a TTL port or is it normal RS 232? If it's a normal RS232 port (which it probably is) then you will either need to use a USB -> RS232 convertor, or one of these: http://s288.photobucket.com/user/ninexunix/media/Max3232.png.html Edit, just read that it has a TTL interface, my mistake! Have you tried swapping the wires? Pin 8 is TX from the Pi to the printer, Pin 10 is RX from the printer to the Pi, also I don't think ttyS0 is bound to those pins as it is normally used on the debug port. Try ttyS3 instead. Link to comment Share on other sites More sharing options...
martinayotte Posted April 11, 2016 Share Posted April 11, 2016 The UART on header pin 8/10 is not /dev/ttyS0 ! The /dev/ttyS0 is the UART attached to the small 3 pins header next to DC Barrel. The one on the header pin 8/10 is the UART3, therefore, as @candratech mentioned, it should be /dev/ttyS3... Link to comment Share on other sites More sharing options...
ccfiel Posted April 11, 2016 Author Share Posted April 11, 2016 @martinayotte @candratech the problem is /dev/ttyS3 does not exist only /dev/ttyS0. How can I enable the ttyS3? Any ideas? The UART on header pin 8/10 is not /dev/ttyS0 ! The /dev/ttyS0 is the UART attached to the small 3 pins header next to DC Barrel. The one on the header pin 8/10 is the UART3, therefore, as @candratech mentioned, it should be /dev/ttyS3... Link to comment Share on other sites More sharing options...
Nick Posted April 11, 2016 Share Posted April 11, 2016 @martinayotte @candratech the problem is /dev/ttyS3 does not exist only /dev/ttyS0. How can I enable the ttyS3? Any ideas? What version of Armbian are you running, what kernel version etc? I'm running two Orange Pi PC boards here, both systems were compiled from the Dev branch i.e. V4 kernel, one about a month ago and one 2 or 3 months ago and they both have /dev/ttyS3. I've not tried using UART3 so I don't know if it actually works, but it is certainly present in /dev on both devices. Link to comment Share on other sites More sharing options...
martinayotte Posted April 11, 2016 Share Posted April 11, 2016 Yes ! with V4.x kernel, all the serials are present in DTS. For Legacy v3.4.xxx, maybe the FEX needs to be tweaked, you can look at it by using bin2fex (and fex2bin if you need to change something) Link to comment Share on other sites More sharing options...
ccfiel Posted April 11, 2016 Author Share Posted April 11, 2016 @martinayotte @candratech Im using legacy and the Kernel 3.4.110 so I think this is the problem. I have an orange pi pc h3 and the download page has only legacy versions http://www.armbian.com/orange-pi-pc/. Where can I get the vanilla version for this board? and I have notice all h3 board has only legacy version in download page. Where did you get yours? Link to comment Share on other sites More sharing options...
Nick Posted April 11, 2016 Share Posted April 11, 2016 @ccfiel Vanilla isn't ready for OPi PC yet, it's still in dev (or was the last time that I checked) so you will have to build it from scratch. Start here: https://github.com/igorpecovnik/lib When following the build menu, you will need to make sure that you choose the option to build the dev branch. Link to comment Share on other sites More sharing options...
ccfiel Posted April 12, 2016 Author Share Posted April 12, 2016 @candratech I was able to get a copy of version V4.x kernel in this link http://kaiser-edv.de/tmp/4U4tkD/and ttyS1 to ttyS5 was present in the /dev folder but its not accessible in the my code. I tried to dmesg | grep tty only /dev/ttyS0 is enable and used for debug port any suggestion how to enable the other UART ports? Can you please try in your device this command dmesg | grep tty if other tty is enabled in your OS? Thanks in advance! @martinayotte as you say For Legacy v3.4.xxx, maybe the FEX needs to be tweaked, you can look at it by using bin2fex (and fex2bin if you need to change something) Maybe you can give me some tips how to enable the UART ports?. I am noobs in this things. In my rasbian all UART ports is enable. I was wondering why this ports are not default enable in ambian Link to comment Share on other sites More sharing options...
tkaiser Posted April 12, 2016 Share Posted April 12, 2016 For legacy kernel see here https://github.com/igorpecovnik/lib/blob/master/config/orangepipc.fex#L159-L191and please keep in mind that Pins that you're defining as uart might be defined as GPIO and therefore have to be undefined first. Same applies to SPI and so on. http://linux-sunxi.org/Fex_Guide#.5Buart_para.5D Link to comment Share on other sites More sharing options...
martinayotte Posted April 12, 2016 Share Posted April 12, 2016 ttyS1 to ttyS5 was present in the /dev folder but its not accessible in the my code. Looking at my v4.6.0-rc1 source tree, I see that those are not enabled in DTS yet, present but without any pins assigned. So, it need to be tweaked soon using a patch. EDIT : I've done it ! here is in attachment my latest sun8i-h3-orangepi-pc.dtb-4.6-PATCHED (ttyS0 to ttyS3, which also include my I2C stuff added few weeks ago) EDIT2 : I've done some loopback tests, ttyS1 and ttyS3 are working fine, but for unknown reason, ttyS2 doesn't work, although same DTS recipe has been done. sun8i-h3-orangepi-pc.dtb-4.6-PATCHED.zip Link to comment Share on other sites More sharing options...
ccfiel Posted April 12, 2016 Author Share Posted April 12, 2016 @martinayotte How can I pached my existing OS using the file? (im using already 4.x kernel already) @tkaiser Thanks I will try this also Link to comment Share on other sites More sharing options...
ccfiel Posted April 13, 2016 Author Share Posted April 13, 2016 @martinayotte What I tried so far 1. rename the file to sun8i-h3-orangepi-pc.dtb-4.6-PATCHED to sun8i-h3-orangepi-pc.dtb 2. replace the file from /boot/sun8i-h3-orangepi-pc.dtb to the file a donwloaded 3. reboot. It boot properly but the problem is Ethernet is disable. The orange and green light is off. Did I installed the patch correctly? Link to comment Share on other sites More sharing options...
martinayotte Posted April 13, 2016 Share Posted April 13, 2016 @ccfiel, Yes, the way you've installed my DTB was the good way (except the path is /boot/dtb/ ). BTW, I'm always keep backups of previous DTBs and use symlink to point to new one. Since I'm still using a WiFi dongle, maybe I've accidentally forgot to reapply the Ethernet patches. Let me check and I will resend new ZIP. EDIT : For the Ethernet, it is a bit strange ... I've looked and the patches were there. But I will investigate, also since I saw that Igor pushed new patches earlier today. Link to comment Share on other sites More sharing options...
mccaffm Posted April 15, 2016 Share Posted April 15, 2016 @ccfiel, Yes, the way you've installed my DTB was the good way (except the path is /boot/dtb/ ). BTW, I'm always keep backups of previous DTBs and use symlink to point to new one. Since I'm still using a WiFi dongle, maybe I've accidentally forgot to reapply the Ethernet patches. Let me check and I will resend new ZIP. EDIT : For the Ethernet, it is a bit strange ... I've looked and the patches were there. But I will investigate, also since I saw that Igor pushed new patches earlier today. FYI - Ethernet is working fine here with your patch Link to comment Share on other sites More sharing options...
martinayotte Posted April 15, 2016 Share Posted April 15, 2016 Good to know ! Maybe I've messed up somehow with my own built kernel ... I will have to redo a new build soon. Link to comment Share on other sites More sharing options...
wirog80 Posted May 30, 2016 Share Posted May 30, 2016 hi all, same case for Orange Pi One too. can i use same way to enable all UART for Orange Pi One? i'm using Jessy Destop image. thanks Link to comment Share on other sites More sharing options...
Recommended Posts