Inspiration
In a disaster, the network is usually the first thing to go, and most tech stops working without a server. We wanted a group of cheap devices that keep doing rescue work with no leader, even when the WiFi dies or a device crashes.
What it does
Four devices (laptop webcam, Arduino UNO Q, Raspberry Pi Zero, Nicla Vision) work as a swarm. Each printed card is a trapped person, and their message is locked with a PIN. The devices share the job of cracking the PINs. You can cut the WiFi or kill a device from the dashboard and the rest carry on from where it stopped. Judges can also type their own message and watch it get cracked.
How we built it
Devices gossip their list of jobs to each other every 0.3 s over UDP. There's no master; each device decides for itself. When two copies of a job meet, they merge in a way that gives the same result in any order, so every device ends up agreeing even if packets get lost.
Faster devices bid lower and can take over jobs from slow ones. One of us did the core, laptop, UNO Q and Pi; the other did the dashboard and Nicla.
Challenges
- With no jobs, devices sent nothing, so they all thought they were alone. Now gossip is always sent.
- The Nicla can't handle big packets, so we split them up.
- A device without the PIN files would make fake progress and skip the right PIN. We had to make devices ignore work that couldn't be real.
- IP addresses kept changing, so devices now learn each other's address from the messages they get.
- The uni network blocked our plan to let judges use their phones.
What we learned
Agreeing on data is easier than coordinating devices, and testing failures on purpose found most of our bugs.
Built With
- apriltag
- arduino
- arduino-uno-q
- micropython
- nicla-vision
- opencv
- openmv
- python
- qr4-qr-code
- raspberry-pi
- udp