Resources
- Git repository: https://codeberg.org/jacklund/ouispy-rs
- Git repo for ouispy-detector: https://github.com/colonelpanichacks/ouispy-detector
Background
I had been looking around for a project to get back into embedded programming again. In a previous life, I had worked in an “Internet of Things” startup, and really enjoyed it. I have also decided that I needed to get some exposure to some real, hands-on hardware work, i.e. breadboarding, soldering, and so on, which I hadn’t had much experience with.
If you’re unfamiliar with Colonel Panic, he’s a hardware hacker who has put together a variety of hardware, anti-surveillance projects, including ouispy-detector and flock-you, which he sells on his tindie page (Benn Jordan has a great video featuring some of his projects as well, not to mention providing a really great discussion about anarchism, another thing I’m interested in).
Anyway, being an admirer of the Colonel’s fine work, I decided that attempting to first work with his ouispy-detector, then porting it to Rust, would be, well, a lot of fun. After that, I could try putting together a hardware prototype of my own, just to get the experience
Hence, “ouispy-rs”.
Status
The original ouispy-detector code was in C++, so moving it to Rust was interesting. All of the code, 2000+ lines, were in a single file, so I had to refactor it in a way that made sense. Also, the Colonel is fond of global data structures without locking, which obviously works for his stuff, but which isn’t something Rust will allow.
For the ESP32 interface, I used some of the libraries provided by Espressif under the esp-rs github group. His code, like many ESP32-based apps, makes use of the ESP32’s ability to serve as a WiFi AP to serve up a website for configuration. I don’t like putting raw HTML out if I can avoid it, so I used maud to generate the HTML. To handle the global configuration variable, I used arc-swap to help with the global locking. To serialize data to non-volatile memory, I used postcard, which seemed like a decent choice.
I’ve got the code working on my little ESP32-WROOM development card, with a buzzer breadboarded in. All in all it works well.
What’s Next
- In the Colonel’s version, it pops up a configuration web server for about 30 seconds before stopping it and running with the existing configs, which is too short for me to get to the site on my base ESP32 (he’s using a much speedier ESP32-S3 chip). For now, I’m leaving the site up, but going forward I’d like to think through the configuration issue, and how to solve it in a less semi-janky way.
- I still need to hook up an external LED to it, like he does (shouldn’t be an issue, however)
- I’d like to try out a vibrating motor to give tactile feedback in those cases where you don’t want it to make noise
- I’ll try it out with the ESP32-S3 chip, which I recently acquired.
- I’d like to make the setup of the GPIO pins configurable, but that’s a difficult problem to solve.
- Breadboard the whole setup, then look at prototyping on an actual board 😬