Asi hero-dispenser-mod
Hero Health smart pill dispenser after-market firmware mod with scrambled medication indexing, Aptos Hamming swarm contract integration, and nurse approval email automation. Use when working on medication dispensing, Hero device hacking, supply chain tracking, or pill dispenser reverse engineering.
git clone https://github.com/plurigrid/asi
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/hero-dispenser-mod" ~/.claude/skills/plurigrid-asi-hero-dispenser-mod && rm -rf "$T"
skills/hero-dispenser-mod/SKILL.mdHero Dispenser After-Market Firmware Mod
Hardware Profile (Model 100, v3.0 Dec 2024)
Hero is a WiFi-connected smart pill dispenser:
- Connectivity: 2.4GHz WiFi (802.11 b/g/n), cloud-dependent
- Actuators: X/Z steppers, turntable stepper, vacuum pump with rubber tip
- Sensors: Door sensor, carriage position
- Display: LCD with directional arrows
- Capacity: 10 medication cups, up to 90-day supply per cup
- Regulatory: FDA Class I, HIPAA-compliant cloud
Reverse Engineering Entry Points
FCC ID: 2AN4DM115 — Internal photos, RF test reports available.
- Internal Photos PDF — PCB layout, antenna, test points visible
- RF Test Report — 2402-2480 MHz confirmed
- MCU/WiFi module chip markings NOT annotated — need manual high-res inspection
- No public firmware dumps, debug pinouts, or teardowns exist
- Device firmware update path exists (OTA via Settings menu)
Community efforts (Arduino Forum Dec 2024, Home Assistant Feb 2024):
- Device is cloud-locked to Hero subscription ($44.99/mo or $449.90/yr)
- ESP8266 NodeMCU stepper control confirmed working (4-wire, D1-D4)
- Full board redesign stalled due to complexity
- No WiFi sniffing results published
Attack surface (3 tiers):
- Software: mitmproxy on app↔cloud API, decompile Hero iOS app (id1352848484), build custom scheduling layer on top
- Hardware: Inspect FCC internal photos for chip IDs, locate UART/SWD test points, attempt serial console
- Replacement: ESP32 board replacement with direct stepper + vacuum control, custom web UI
Hero Public API: https://developer.herohealth.net/apis/public-api/openapi (REST, x-api-key auth, webhooks) FDA MAUDE report: https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfmaude/detail.cfm?mdrfoi__id=16276816
Scramble Index Architecture
Full derangement mapping (no medication uses its own initial letter):
| Slot | Medication | Natural | GF(3) | Schedule |
|---|---|---|---|---|
| q | Vyvanse | v | -1 | morning |
| x | Magnesium | m | 0 | evening |
| y | Zinc | z | +1 | morning |
| k | Ginkgo | g | -1 | morning |
| u | Caffeine | c | 0 | morning |
Conservation: Q(-1) + X(0) + Y(+1) + K(-1) + U(0) = -1 = H world trit
Categorical Scales
The dispenser operates as a dynamical system across 6 scales:
- Arena (Play/Coplay): Positions = slots, Directions = {dispense, refill, adjust, alert}
- Open Game: Forward = predict supply depletion, Backward = nurse approval utility
- Polynomial Functor: State-dependent interface (controlled slots restricted until approved)
- GF(3) Conservation: Trit sum must equal world H trit (-1)
- Hamming(7,4): Chain 1 (Witness-Bridge: h,w,b), voice: Junior
- Concrete: Slot configs, email automation, Aptos contract
Email Architecture
- Hero registration:
mantissa+hero-h@plurigrid.com - Nurse approval TO:
(primary),mantissa@gmail.com
(backup)ies@plurigrid.com - Automation FROM:
(Gmail MCP)mantissa@plurigrid.com - Monitoring: Gmail MCP search queries for
to:mantissa+hero-h@plurigrid.com
Key Files
All in
/Users/alice/worlds/h/:
- Config with scramble indexhero_dispenser.json
- CLI:hero_scramble.pytable | lookup <letter> | set <letter> <mg> | add <name>
- Categorical diagnostic across all 6 scaleshero_arena.py
- Flox service daemonhero_dispenser_service.py
- Gmail MCP integrationhero_email_monitor.py
- Nurse approval workflownurse_approval.py
- Email routing confignurse_config.json
- Pending approval queuenurse_requests.json
CLI Commands
# Show scramble table python3 hero_scramble.py table # Set dosage for a slot python3 hero_scramble.py set x 400 # Add new medication (auto-picks deranged letter) python3 hero_scramble.py add "Melatonin" # Full categorical diagnostic python3 hero_arena.py # Check email integration status python3 hero_email_monitor.py status # Process nurse approvals python3 nurse_approval.py pending python3 nurse_approval.py approve 0
Aptos Integration
- Contract module:
hamming_swarm::hero_dispenser - Network: testnet
- On-chain: scramble hash, dispense events, encrypted supply levels, nurse approvals
Adding New Medications
When adding a medication, the system:
- Picks a letter maximally distant from both H and the med's natural initial
- Ensures full derangement (no med maps to own letter)
- Recomputes GF(3) conservation
- If controlled substance: queues nurse approval email automatically