The original source code for the GASsistant can be downloaded from here.
For coding on ESP, we use the ESP8266 Addon on Arduino IDE.
With this approach, we can reuse most Arduino libraries for ESP. You can find the instruction how to setup here.
We use the Arduino Uno as the bridge to upload the source code to ESP. The setup as following:
Arduino Uno Reset |
Arduino GND |
ESP8266 |
Arduino Uno |
RX |
RX |
TX |
TX |
VCC |
3.3V |
CH_PD |
3.3V |
GND |
GND |
GPIO_15 |
GND |
GPIO_0 |
GND |
Also, make sure that you choose the correct board type for the ESP (like the attached photo).
Find the ESP8266 chip ID (We use it as a unique ID for the scale):
Upload the ESP_chip_id sketch from
https://github.com/aavn/Gassistant/tree/master/design
to your ESP board, and note the chip ID printed on the Serial monitor. This ID will be used later when you add your scale to the cloud server.
Note:
If you want to re-upload to ESP board while it is still connecting to bridge, just unplug ESP's VCC and GPIO_0, then re-plug them before uploading new code.