Omega2+ as usb device?



  • I would like to build a small usb device running Linux that I can plug into a host PC like a flash drive. A possible plan would be to use an Omega2+ board with a male usb connector and a few extra components packaged in a 3d printed enclosure.

    1. Is the Omega2+ a right fit for this project?
    2. What extra components do I need? (I'll have the same male usb connector for power and data transfer. I'd forgo the dock because even the smallest version is pretty large. If understand it right, I will need a 3.3V regulator. What else?)
    3. How long does it take the Omega2+ to boot up?


  • @Arden-Jerrod said in Omega2+ as usb device?:

    Omega2+ board with a male usb connector and a few extra components packaged in a 3d printed enclosure.

    If you not give more details what your intention is, it will be hard to give you a good advice.

    The Omega2+ is not more as a small computer running a "Router OS" (OpenWRT) headless on it. The startup time depends a lot of what you install and need on boot up. Default from Onion.io it takes about 30 Seconds to start it up and a bit more till the WIFI is ready to use.



  • I would like to keep it as generic and tinkerable as possible. One day I might need a flash drive that I can also access wirelessly from my phone. Another day I may wish to share the host computer's internet connection with a few people at a party. A third day I may use it as a virtual keyboard to paste long passwords on a public machine or use my phone's mike on a computer that doesn't have one built in. Linux is flexible, usb is flexible, why shouldn't be I? šŸ™‚

    Thanks, 30 seconds sounds reasonable.



  • The Omega2's MT7688 simply does not support operation as a USB device. It can only be a host.

    If you want to connect it to something that expects a USB device, you will need intermediate circuitry. For example, you could connect a USB serial converter to the Omega serial pins, and then present to another computer as a (USB) serial port, for uses that are compatible with that interface.

    Or you could perhaps use a USB file transfer cable, however while generally supported in upstream Linux that support is not necessarily present in the prebuilt system, or easy to add. Also that typically presents in the Linux world as a network interface, but as something different in the Windows world, so it is not very cross-platform.

    I'm not aware of any truly "arbitrary protocol" USB bridge devices, about the closest you might come is to find one of the MCU's with dual USB device interfaces and rig it up so that you can download custom firmware or at least device descriptors and forwarding rules to make it a reconfigurable bridge. This is, however, likely to limit you to USB full speed (12Mbs) or USB low speed. Further, by the time you have done this, any cost advantages are destroyed - you should look instead to something based on a tablet or phone chip, that has a dual-role or OTG USB interface (or, if your resource needs are lower, just use a high end MCU with USB device interface, rather than an embedded Linux system).

    While not directly applicable, an illustration both of what is possible and what sorts of workarounds are sometimes required is the fact that there exists on the market a novel gadget based on the AR933x (a conceptually similar chip, used in the previous Omega) which has an SD card slot, a USB-SD adapter, and a USB multiplexor. Basically the idea is that it lets a smartphone access an SD card - directly, if the phone supports being a USB host, otherwise the phone contacts the embedded router chip via wifi, and that accesses the SD card using the USB-SD adapter in order to server the files to the phone.

    Effectively the design intent is that the Omega[2] would interact with other computers via wifi, either by being an access point or by being a client of the same access point as the computer that wants to talk to it.



  • Answering OP's question, Omega2 as a USB device

    I think the best solution is to use a $2 shipped board such as ATMega32u8 USB module, running some type of special firmware, such as "Rubber Duckie" emulator.

    From a different viewpoint, Rubber Duckie + WiFi for remote control will be overly devious.



  • Or even a raspberry pi zero. I have seen a number of projects to create usb stick computers (youtube is where I first saw them). I grabbed one over the weekend to mess around with. Keep in mind, the raspberry pi zero does NOT come with any kind of built in networking (ethernet or wifi) and getting a dongle to work is messy.



  • Thanks for the detailed answers. I seem to have missed the fact that the MT7688 has host-only USB. That probably makes the Omega2+ impractical for my project.

    I was indeed inspired by these artices for the Pi Zero:
    https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/overview
    https://www.novaspirit.com/2016/10/18/raspberry-pi-zero-usb-dongle/

    They use the DWC2 driver for device-mode usb on the BCM2835, which allows me to use "arbitrary protocol" USB as described at http://www.linux-usb.org/gadget/. I could even implement my own userspace USB drivers using GadgetFS.

    I was hoping to get something similar in a smaller form factor with the Omega2+, which also includes wifi out of the box.

    A microcontroller-based solution would be nice as well, I especially like their much faster "boot-up" times, but afaik (I'm not an expert on them) they would require reprogramming for every specific use case, whereas I can just ssh into a linux gadget and reconfigure it on the go as long as it's connected to a power bank.

    My current best bet is a Pi Zero with some sort of wireless extension.



  • @Arden-Jerrod If you can get your hands on the NextThingCo's C.H.I.P., it includes WiFi and Bluetooth and has both a USB-host port and a USB-OTG-port, so that's another option.



  • @Arden-Jerrod I just bought into this one, for similar reasons:
    https://www.kickstarter.com/projects/1728237598/notixed-turn-your-pi-zero-to-usb-device

    Might be exactly what you would need.



  • @Kurt-Roesener said in Omega2+ as usb device?:

    @Arden-Jerrod I just bought into this one, for similar reasons:
    https://www.kickstarter.com/projects/1728237598/notixed-turn-your-pi-zero-to-usb-device

    Might be exactly what you would need.

    damnit, you just had to go link this... now I had to buy one.



  • @Brad-Buskey Haha, like you needed an excuse!


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.