Jump to content

RX/TX UART problem


ccfiel

Recommended Posts

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

Armbian & Khadas are rewarding contributors

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

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

@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

@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

@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

@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

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

@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

@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

@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

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines