[SOLVED] USB OTG port as a serial gadget

Post Reply
RWAP
Posts: 17
Joined: Mon Apr 30, 2018 4:28 am
languages_spoken: english
ODROIDs: Odroid C1
Has thanked: 0
Been thanked: 2 times
Contact:

[SOLVED] USB OTG port as a serial gadget

Post by RWAP »

I am trying to connect an Odroid C4 to a Windows 10 computer, so that I can capture the data being sent from the computer to a CUSTOM VKP80III printer. The printer will no longer be used.

The printer normally connects over USB using a virtual COM port, so it appears that I need to connect into the USB-OTG port on the Odroid C4.

We have compiled the Ubuntu Kernel with USB-OTG support and with the command:

Code: Select all

modprobe g_serial idVendor=0x0dd4 idProduct=0x8205 
we can see the virtual COM port appear on the Windows PC.

However, when I try to connect to the COM port using PUTTY on the Windows PC, I get the error "unable to open serial port".

Any ideas what I am missing?

mad_ady
Posts: 9090
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 597 times
Been thanked: 584 times
Contact:

Re: USB OTG port as a serial gadget

Post by mad_ady »

Can you try attaching on the odroid side too? Assuming /dev/ttyS0 gets created by modprobe (check dmesg), try screen /dev/ttyS0 9600 (or the desired baud)

RWAP
Posts: 17
Joined: Mon Apr 30, 2018 4:28 am
languages_spoken: english
ODROIDs: Odroid C1
Has thanked: 0
Been thanked: 2 times
Contact:

Re: USB OTG port as a serial gadget

Post by RWAP »

I have not checked dmesg, but managed to use stty /dev/ttyS0 115200 without any errors.

User avatar
odroid
Site Admin
Posts: 36468
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1451 times
Been thanked: 990 times
Contact:

Re: USB OTG port as a serial gadget

Post by odroid »

Was there any kernel message from C4 when the Windows host opened the COM port?
Which Kernel version did you modify/compile?

RWAP
Posts: 17
Joined: Mon Apr 30, 2018 4:28 am
languages_spoken: english
ODROIDs: Odroid C1
Has thanked: 0
Been thanked: 2 times
Contact:

Re: USB OTG port as a serial gadget

Post by RWAP »

I have resolved this issue - it was down to the parameters being passed to modprobe - they ended up having to be:

Code: Select all

modprobe g_serial use_acm=0 idVendor=0x0dd4 idProduct=0x8205 iManufacturer="CUSTOM Engineering S.p.A." bcdDevice=0x0480 iSerialNumber="VKP80III_USB_Num.:_0" iProduct="(error)"
These users thanked the author RWAP for the post (total 2):
mad_ady (Fri Nov 27, 2020 6:36 pm) • odroid (Mon Nov 30, 2020 10:04 am)

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 0 guests