I'm working on a IoT device at work and have been the "hands in the lab" for my agent this week. It's been a really weird experience. Making changes to the update/recovery process, so I have to validate several permutations of fault injection (i.e.: abrupt power loss during update step X while on starting version Y).
I would love to give it unattended "hands". I just thought it was more time efficient to do it manually rather than spend days trying to figure out how to automate SD card pull/plug. X and Y are relatively small, and I expect this validation to be too costly to do at a regular cadence in CI. I can trivially use a MCCI USB-C switch for the power though.
Tips would be appreciated if anyone here has thoughts.
> I just thought it was more time efficient to do it manually rather than spend days trying to figure out how to automate SD card pull/plug
Heres the thing. You only have to build the automation once. While it will only take you seconds at most to pull a card, you gotta sit around and be ready for the card to be pulled.
For your problem I see 2 quick things that came to minq very quickly that could do SD card pulling for you.
1) shove a level shifter in between the SD card and device under test and have a micro enable/disable the level shifter when you want to pull/unpull. ( you can even get multiplexer IC that will do the same thing as the level shifter as acting as a switch for the SD card lines, but would allow you to connect the SD card to a 2nd device (the testing pc) to allow you to write/read data from the card when its "pulled" from the DUT.
2) 3D print a jig that will insert/remove the SD card and use a cheap RC servo to handle the movement - again using a mirco to control the servo. gives a more real world test of pulling the SD card. but only gives the the ability to pull/insert. Still required manual effort if you need to read/write to the SD card
Once you have build the jig, you can reuse the jig on the next project, so while it will take some time to do/setup it could save you time later down the road.
Edit: As for the code driving the ICs or Servo, I'm presuming you already know embedded programing, but even so, a simple Arduino sketch will be able to handle it for you, fuck ton of example code already exists for it, and can be easily controlled over USB.
> I just thought it was more time efficient to do it manually rather than spend days trying to figure out how to automate SD card pull/plug.
If you control the bootloader and firmware, or you can talk to the team that does, then look into network filesystems and network booting. The SD card would only exist to bootstrap the system and then everything else happens over the network.
There is hardware available for SD card automation; see the USB-SD-Mux by Linux Automation GmbH / Pengutronix. https://linux-automation.com/en/products/usb-sd-mux-fast.htm...
IDK about cheap options to do this, but fancy ones could be: Keysight has bench power supplies that can be controlled via USB, i did some scripts with python a few years ago to characterize a pcb using the psu and an oscilloscope. The scope charts saved as images. I imagine that an agent could easily run the script to control the PSU and look at the images to debug the board or run characterization tests.
For the SD card pull/plug, maybe a pcb sd card extender that cuts off data or power lines to the SD card driven by a MCU that your agent could control?
Sounds interesting!
So far most of my automation has been optical (tweaking display output to show correctly under a lens with odd optical characteristics, hard to simulate computationally), so pointing cameras at the device and letting the LLM iterate and tune display output has been useful.
As with any automation, it all depends on scale. Setting up a harness to repeatedly mess with microSD cards seems way more prone to failure (and false positives) than just doing it yourself, but if you're testing thousands of devices, would probably be worthwhile.
I use an SDwire device - connect the USB end to your build host, and the SD card end to the DUT.
For an extremely temporary setup for a push-push card slot, you can maybe just put the device on an Ender-3 and poke it with the cold nozzle. Bed flex can become a problem if it's heavy.
I built a little harness for an x86 SBC for Claude to do osdev a few months ago.
Janky setup with two ESPs for the serial terminal and to control a servo taped to some microswitches to power cycle the board.
It worked very well, allowing Claude to spend all day and night debugging quirks with the NIC until it was able to get the driver working.
So, I think giving your IoT device some "hands" is probably worth it. For SD card automation, you can find "wireless SD cards" on Amazon/AliExpress that have a microcontroller pretending to be sd card, eg FYSETC SD-Wifi.