0
Abdullah Seba

How to change OTG mode from serial to HID keyboard on the Orange pi zero?

Recommended Posts

Hi

I'm a newbie to Armbian and just got the Orange Pi Zero.

I want it to behave as a keyboard on the OTG port. Right now it works as a serial console.

I cant find any docs on this anywhere and I'm not clued up on Linux to mess around  too much :(

Can any one help?

Thanks in advance. :) 

Share this post


Link to post
Share on other sites
Just now, MitchD said:

Which kernel are you using? If you are using mainline, I understand than the OTG options aren't there yet.

 

If on legacy, you can try: modprobe -r g_serial

followed by: modprobe g_hid

 

From there, see if any new devices are created.  Full documentation is here: https://www.kernel.org/doc/Documentation/usb/gadget_hid.txt

Thanks for  replying.

I'm using the latest from here https://www.armbian.com/orange-pi-zero/ marked as legacy stable.  Not sure what kernel it's using.

I tried `modprobe -r g_serial`  and got: `modprobe: FATAL: Module g_serial is in use.` I tried with the otg port plugged in and unplugged.

`modprobe g_hid` returned `modprobe: ERROR: could not insert 'g_hid': No such device`
 

Share this post


Link to post
Share on other sites

Sorry, put sudo before those commands and run them again. It must be run as root. I'll try with a legacy stable image tonight and see if I can get it operational.

Share this post


Link to post
Share on other sites
10 minutes ago, MitchD said:

Sorry, put sudo before those commands and run them again. It must be run as root. I'll try with a legacy stable image tonight and see if I can get it operational.

Same thing happened. Thanks :)

Share this post


Link to post
Share on other sites

Try toggling: https://github.com/armbian/build/blob/master/config/fex/orangepizero.fex#L504

 

3 hours ago, MitchD said:

Not sure why this hasn't been patched yet. 

 

Afaik it should work. Perhaps unloading is not working as it should. This kernel is from some other times ... removal from /etc/modules and reboot might be needed.

 

Nobody is working on H3 legacy kernels anymore :( Modern kernel will be here soon.

 

@Abdullah Seba Technical support is our free will. Our expense and we tend to rest on Sundays.

Share this post


Link to post
Share on other sites

Hello, i have been looking into this subject lately but couldn't find something useful. I want to be able to act as a mouse and keyboard with opi zero. I have some experience with programming and a bit of linux ecosystem so i i think i can look into/follow some stuff if you guide me. Also i know its off-topic but does gpio pins have any latency on them? I want to share data in real time between opi zero and rpi zero. Thank you for your attention. Sincerly

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
0