← Back to context

Comment by gcoakes

5 hours ago

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 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.

> 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.

  • To add on to this for the SD card, you can buy an “SD card extender” that has an SD card on one end and a slot on the other, with a cable in between. Something like that might make it physically easier to get in between the signals by modifying the cable. Nice big wires on this one: https://a.co/d/0cPVVsLE

    • I bet we'll see more KVM-for-X type products appearing, basically multiplexers for various storage devices and peripherals, as ways of giving agents control over them.

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.

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.

Automation wins, every single time.

  • Until it doesn't.

    Wild, unexpected failure modes can really kick you in the junk sometimes. Sometimes you just end up doing very bad things very quickly :-)

    Signed,

       big automation fan

    • It can also just turn into a waste if you build all the automation to turn around and only use it once, recalling https://xkcd.com/1205/

      Now that said, the economics have changed in a world where many trivial automations can be thrown together by agents themselves in a fraction of the time it would have taken a human.