One Port To Rule Them All // Serial, Ethernet, USB OTG, Raspberry Pi, OpenWrt

Опубликовано: 09 Октябрь 2024
на канале: Dev Odyssey
4,807
85

Support Me

Get a 5% off Ekster Products
https://shop.ekster.com/devodyssey or discount code "DEV" at checkout!
(PAID Link)

Follow me on Twitter and Facebook
  / dev_odyssey  
  / dev0dyssey  

Description

Welcome back to Dev Odyssey! In this episode, we're harnessing the power of USB OTG to power and connect to our OpenWrt 21.02 Raspberry Pi, via serial and ethernet, all with one USB-C cable. Briefly, USB OTG allows your devices to switch between host and device mode, depending on the scenario. For example, it lets your phone act as USB host, when you plug in a flash drive, but also lets your phone act as a USB device, when you plug in your phone, to your computer. For the wanderlust developer who needs to pack light, OTG compliments their travel requirements. For those who despise cable clutter, OTG is also for you. The use cases are vast, from serial, ethernet, mass storage, use with a USB C Tablet, like an iPad, improved connection stability, and more. With all the possible combinations, you're only limited by the USB guest configurations available.

Best of all, USB OTG is not limited to Raspberry Pi or Raspberry Pi OS. So long as your device, or single board computer, has a USB OTG enabled port, and an operating system thats supports it, then you can reap the same benefits of USB OTG. Watch till the end to see two of the most useful examples of USB OTG configurations!

Links

Hardware

Raspberry Pi 4B
https://rpilocator.com/?cat=PI4

Cat 5/6 Ethernet Cable

USB-C to USB-C Cable

Software

OpenWrt USB Guest configuration
https://openwrt.org/docs/guide-user/h...

OpenWrt OTG Serial Config
https://gist.github.com/odevodyssey/d...

OpenWrt OTG Serial And Ethernet Config
https://gist.github.com/odevodyssey/5...

OpenWrt OTG Ethernet Config
https://gist.github.com/odevodyssey/3...

OpenWrt Packages Used

Serial Only
kmod-usb-dwc2
kmod-usb-gadget-serial

Serial and Ethernet
kmod-usb-dwc2
kmod-usb-gadget-cdc-composite

Ethernet Only
kmod-usb-dwc2
kmod-usb-gadget-eth

00:00 Intro
00:54 OTG Explanation
01:42 OTG Benefits
02:52 Hardware / Software
03:43 OTG Serial Config
07:17 OTG Serial + Ethernet Config
13:33 Closing Notes
14:17 Outro

Attributions

Music | "Ocean Love" by LiQWYD
Watch:    • LiQWYD - Ocean Love [Official]  
License: https://www.liqwydmusic.com/how-to-use
Download/Stream: https://hypeddit.com/liqwyd/oceanlove

Icons made by Freepik, runkanicon, iconmas from Flaticon
https://www.flaticon.com

Raspberry Pi trademark of Raspberry Pi Trading
OpenWrt is a registered trademark owned by Software Freedom Conservancy (SFC)

#RaspberryPi #OpenWrt #USBOTG #Router