Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

USB OTG detection

Featured Replies

Hello Everyone..

I am using Olimex A20 board in my project wherein I will be using USB OTG as Ethernet/ LAN commuication with PC. The Ethernet/LAN communication is working properly. However, I am writing a program in C, wherein I want to detect the USB OTG connection (USB cable connected between olimex board and PC) at power ON.

Do you know, if there is a PMU on the Board?

 

As I know from Banana Pi, you can detect the connection from sysfs. On the Banana Pi there is /sys/power/axp_pmu/vbus/connected file. If you read 1, the OTG is plugged in, otherwise you'll read 0.

 

Hope this is a good hint.

 

Yours,

Martin

Do you know, if there is a PMU on the Board?

 

As I know from Banana Pi, you can detect the connection from sysfs. On the Banana Pi there is /sys/power/axp_pmu/vbus/connected file. If you read 1, the OTG is plugged in, otherwise you'll read 0.

All A20 based boards should have AXP209 PMU, but this sysfs node will be present only on mainline kernel. If superuser privileges for direct memory access is not a problem, then it's better to read GPIO input responsible for OTG detection directly.

 

Edit: Also there are some issues with OTG on mainline kernel and Lime2 boards, so basic OTG should be tested first.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.