For a more detailed writeup, see here.
Text a phone number and get a napkin. Yay!
I should make a fritzing diagram for this, but basically it works like this:
- Text the Twilio number, which posts a webhook to https://fake.url/sms/receive.
- That message is parsed by botkit-sms, which makes sure the texter said the correct phrase.
- The node server calls the dispense function of a Particle Electron with the pertinent stepper index (1-indexed).
- The Electron sends that string via serial to an Arduino Uno with a CNC Shield hooked up to 4 A4988 Stepper Motor Drivers each connected to a stepper.
- The stepper turns a helix which dispenses a Mapkin.
/infogives basic info about installation.
/statusgives the status (number Mapkins left, Electron connected, etc.)
/dispensedispenses to the current stepper
/dispense/numdispenses to a specified stepper
/resetresets the mapkin count to full
mv dotenv .env and fill in yr info. Deploy via Dokku. Hope and pray.