Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
#+TITLE: Wemos QA keypad * Device install To setup a new device you can use the arduino software, you will need a plugin to upload the files in the =data= folder to your wemos device. ** Deploy requirements https://github.com/esp8266/Arduino.git https://github.com/esp8266/arduino-esp8266fs-plugin/releases/tag/0.4.0 ** Build Requirements You will also need various 3rd party libaries. keypad.h 3.1.1 by Mark Stanley, Alexander Brevig https://wiring.uniandes.edu.co/source/trunk/wiring/ LiquidCrystal I2C by frank de Bradander https://github.com/johnrickman/LiquidCrystal_I2C ESPAsyncWebServer https://github.com/me-no-dev/ESPAsyncWebServer/archive/master.zip ESPAsyncTCP https://github.com/me-no-dev/ESPAsyncTCP Extract and copy to arduino libries folder * Device Setup When switching on the device for the first time it will launch in access point mode to allow you to setup the device, connect to =weeeecfg= from a phone and enter password =weeeecfg= to setup the device. If the device can not connect to a local network it will relaunch the setup interface. subsequent usage of the device will reuse the same settings as long as the device can connect. The interfacing is using a simple web interface generated from this repository. https://gitlab.com/olymk2/weecfg #+RESULTS: : None * API example ** Keypad startup endpoint #+BEGIN_SRC http :pretty :exports both POST http://ng.snapwire-portal.co.uk/api/Startup Content-Type: application/json {"ControllerId": "DID1"} #+END_SRC #+RESULTS: : { : "ControllerId": "DID1", : "AssignedName": "Bob" : } ** Poll to determine when ready for next answer #+BEGIN_SRC http :pretty :exports both POST http://ng.snapwire-portal.co.uk/api/Poll Content-Type: application/json {} #+END_SRC #+RESULTS: : { : "Timestamp": 132149528062145583, : "ReadyToAcceptAnswers": true : } ** Example sending answer to api. #+BEGIN_SRC http :pretty :exports both POST http://ng.snapwire-portal.co.uk/api/SubmitAnswer Content-Type: application/json {"ControllerId": "sample string 1", "Answer": "A"} #+END_SRC #+RESULTS: : { : "ConfirmReceived": true : } http://ng.snapwire-portal.co.uk/api/SubmitAnswer * Later ** TODO gzip the html The wemos is by no means fast so gzip so there is less data to send. ** TODO http error message on api failure.