Connect to your Raspberry Pi over USB using gadget mode
howchoo.com
howchoo.com
Side note, USB HID descriptors are a disaster and someone should do something about it. Even commercial devices by reputable manufacturers have broken descriptors. A tool with modern ergo and integration would probably get a surprising amount of traction.
I also noticed how problematic it is to support even major controllers like the PS4 controller under SDL. Games have to be aware of the exact model of controller that they are attached to. I was thinking you could use a RPi0 and it could "clean" all the device specific issues.
In your case, there is no reason that a FUSE like USB interposer couldn't exist purely in userland, but this is what we have.
As for software translation, that was out early in the design process: I needed Windows and I did not want to write a Windows device driver or fight with code signing. Nor did I want a Windows-only or Linux-only solution. So the only solution was to control the platform the software ran on (-> raspberry pi), then drop down far enough in the stack that everyone agreed on a protocol (-> USB HID). I would have been very very happy if I could have implemented this at a higher level.
I like that you prototyped it in Python first. I wonder why it didn't work? Python function call overhead?
It would be neat if there was a cross platform USB HID muxing and translation layer that used Wasm for all its logic, then the "fixups" would be portable.
Yeah, I think some of my irritation with the situation bled through there, lol, didn't mean to come off as aggressive. I also lament the absence of a common input standard of some sort. WASM or the like would be a neat common layer; I feel like it's a good target for embedded scripting and module systems these days.
But I wonder if games that detect bots would trigger on this.
It's slow but steady, seeing more in stock notifications from authorized resellers on rpilocator.com, and the stock doesn't deplete for 30 minutes to an hour now, instead of like 5-10 minutes earlier this year.
First, I already have devices. Second, people are still waiting in like to get Pi’s and based on the last interview I saw the Raspberry people think the system is working. They don’t want to raise their prices.
I am fairly sure if you have more money to offer your suppliers that scarce components are easier to get ahold of. They could keep their margins the same and raise their rates and generate a lot more revenue.
You mean as if every rpi adjacent thread doesn't already get filled with these supply issue comments?
"Call it out"? For what? Do you think the Raspberry folks are just choosing to not make enough? I'm pretty sure they don't like the current situation as much as you don't.
Certainly inconvenient for hobbyists, students and instructors.
It would be better if there were more boards that were hardware and software compatible with the Pi.
You can pay suppliers preferential prices for preferential treatment. That has been Apple’s MO for a decade and a half.
Raise your prices until demand just starts to taper. Use the money to butter up suppliers (place bigger orders, pay cash on delivery, in advance, whatever). Get it done, stop patting yourself on the back for five years running for not being able to keep up with demand.
They did raise prices.
https://www.raspberrypi.com/news/supply-chain-shortages-and-...
it is for them
Worse, I suspect this will become an urban legend of sorts even when there are no more shortages.
Circa $30 over old retail but then they and so much else will never get back there.
Why would it when people will pay the new normal?
yeah I got tired of doing that
I want to be able to wirelessly change the music on the "USB drive" in my car; i.e. the "drive" is actually an always-on computer, e.g. a Pi.
Change the music from the computer at home and be on my way?
Nota bene, do not mount it two places at the same time!
Something I’d still like to add is a USB OTG emulation of iOS/Android/iPod/etc, so that the currently playing track shows on the dash, steering wheel controls can be used, etc, but my last experimentation a couple years ago didn’t go anywhere. (All the open source stuff for emulating CarPlay and Android Auto seem to be for the other direction: the dash, not the device.)
As in, I'm fine with the SYSTEM that plays music now (I have Toyota Entune) and I don't much want to mess with it.
I literally just want to be able to remotely change the files on the USB drive in the car -- without ever having to take it out of the car; that's it.
Best example of such a use-case was someone who wanted to make an old printing press fetch files its files from the internet. The press only had an interface for floppy disks. He replaced the floppy disk controller with a floppy emulator that exposed an USB port. Connected a phone with DriveDroid. Synced usb image files from the internet to be exposed over usb mass storage. The image files were fat images that hold the printing job files. They were generated by the server automatically. It worked pretty well from what I heard.
Similar solutions are also popular in the 3D printing space, look up Fysetc or BTT wifi sd cards.
It's a USB gadget kernel module that pretends to be an iPod to stream music to car/etc.
Pity the market keeps evaporating. Very cool product.
I recently realized I can use a $15 USB capture card with an HDMI input on the other end to snag the video feed of a Pi or anything else that can output HDMI. As I use Linux, you can tap into the /dev/video<number> device as if it was a camera, using VLC/OBS. (There's also a paid app on Play store that allows me to also do this on my phone as the display side, using OTG. Would love to be able to use my tablet running a de-Googled LineageOS as well, but that'd entail figuring out how to crack/patch out Google's license checking library, and I haven't found any FOSS alternatives, ugh.)
From there, making the (my) dream happen would be if there was some convenient way to use the same device that's tapping into the video out as the keyboard/mouse input, much in the modal way of VMWare/VirtualBox, where it overtakes your input, and using the hotkeys to release when you want to switch back to your tasks on the host.
In particular, I have a Flipper Zero that doesn't get real use beyond novelty functions and have been wondering if that (or something like a ESP32/ESP8266 computer) could help facilitate that. My skillset is nowhere near that close to the metal.
At least, re: your post I'm piggybacking, and coming from knowing the capabilities of the Flipper Zero, I wonder if RubberDucky/BadUSB payloads could bring you any closer to meeting the spirit of your goal. Or, some sort of rsync like mechanism baked into the Pi when it (automatically) connects to a detected, saved network. Or, a RubberDucky/BadUSB payload on-demand to fire off an rsync.
For the esp32 there is this official example of what I think is faking a usb drive: https://github.com/espressif/arduino-esp32/blob/master/libra...
Not all ESP32s support USB OTG and I don’t have the correct one here atm to test with. Not sure how much more work would be needed to serve files from sd card.
You could then use a web server on the esp32 to transfer your files
You can buy a cool little PCB that attaches to the Zero and gives it a male USB-A port, turning it into a chunky flash drive or whatever. (They're sometimes referred to as a "BadUSB".)
The Pi 4 is an exception - its USB-C power port works in gadget mode too, unlike its normal USB-A ports, which do not, like all other Pis, because of said hub.
You can also make your own combinations of USB configurations over configfs which is more flexible.
Yes, you have to have either some kind of network configuration, and enable the network interface that appears after you pluging in the USB device. It's no different from using USB-ethernet adapters.
The easiest is probably to rely on link local addresses and mDNS if all you need is local access from the computer you connected the device to. On a systemd based Linux distros, mDNS is enabled by default in systemd-resolved daemon. On my distro, there's no default configuration for usb network adapters, so I have to do that part by myself. Other systems may work differently and auto-enable USB interfaces and at least setup link local addresses on them. The device implementig the gadget has to do the same.
The keymap isn't complete by any means, but it's got enough there to be interesting.
It’s a fairly seamless way to get console/push/pull over USB. Only downside is that it requires the adb tool on the host as well, vs gadget serial/ssh.
maybe the pi zero is ok.
For a pi4 you have to provide power though the usb-c connector and it needs up to 3A.
This is also why implementing pi-kvm is so complicated.
I don't actually know if you could power the zero fully through the OTG port, although I wouldn't be that surprised.
Power on the Zero is connected to the pins, the power USB connector and the OTG USB connector. Afaik, there are no components in-between.
https://shop.pimoroni.com/products/usb-c-pwr-splitter?varian...
https://www.friendlyelec.com/index.php?route=product/product...
It does mean that some devices will power off unexpectedly when others restart but unexpected restarts are something you have to plan for anyway.
Thanks.
Part of it might be that I got tired of dealing with rpilocator just to find a Pi4 at msrp...