Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
2.9 KiB

  1. # Firmware
  2. ## Build the firmware
  3. The project is ready to be build using [PlatformIO][1].
  4. Please refer to their web page for instructions on how to install the builder.
  5. If you are using PlatformIO /strongly recommended) it will take care of the library dependencies. Otherwise you will have to install them manually:
  6. * Benoit Blanchon's [ArduinoJson](https://github.com/bblanchon/ArduinoJson)
  7. * Hristo Gochkov's [ESPAsyncTCP](https://github.com/me-no-dev/ESPAsyncTCP)
  8. * Hristo Gochkov's [ESPAsyncUDP](https://github.com/me-no-dev/ESPAsyncUDP)
  9. * Hristo Gochkov's [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer)
  10. * Marvin Roger's [AyncMqttClient](https://github.com/marvinroger/async-mqtt-client)
  11. * Adafruit's [DHT Sensor Library](https://github.com/adafruit/DHT-sensor-library) (required if compiling with DHT support: -DENABLE_DHT)
  12. * Adafruit's [Unified Sensor Library](https://github.com/adafruit/Adafruit_Sensor) (required if compiling with DHT support: -DENABLE_DHT)
  13. * The PatternAgents (et al.) [Embedis](https://github.com/thingSoC/embedis)
  14. * German Martin's [NtpCLientLib](https://github.com/gmag11/NtpClient)
  15. * Michael Maregolis & Paul Stoffregen's [Time](https://github.com/PaulStoffregen/Time)
  16. * Randy Simons' [RemoteSwitch](https://github.com/jccprj/RemoteSwitch-arduino-library) (required if using custom RF module: -DENABLE_RF)
  17. And my own libraries:
  18. * [JustWifi](https://bitbucket.org/xoseperez/justwifi.git)
  19. * [FauxmoESP](https://bitbucket.org/xoseperez/fauxmoesp.git) (required if compiling with WeMo emulation support: -DENABLE_FAUXMO)
  20. * [HLW8012](https://bitbucket.org/xoseperez/hlw8012.git) (required if compiling for Sonoff POW: -DENABLE_POW)
  21. * [EmonLiteESP](https://bitbucket.org/xoseperez/emonliteesp.git) (required if compiling with Energy Monitoring support: -DENABLE_EMON)
  22. * [NoFUSS](https://bitbucket.org/xoseperez/nofuss.git) (required if compiling with NoFUSS Automatic OTA support: -DENABLE_NOFUSS)
  23. **Note**: The fauxmoESP library requires the staging version of Arduino Core for ESP8266. Either you are using Arduino IDE or PlatformIO you will have to manually install this. Check the [documentation for the fauxmoESP library](https://bitbucket.org/xoseperez/fauxmoesp) for more info.
  24. Once you have all the code, you can check if it's working by:
  25. ```bash
  26. > pio run -e node-debug
  27. ```
  28. If it compiles you are ready to flash the firmware.
  29. ## Flash your board
  30. Wire your board (check the [Hardware page](Hardware.md)) and flash the firmware (with ```upload```):
  31. ```bash
  32. > pio run -t upload -e sonoff
  33. ```
  34. (or any other environment, depending on the board you are woring with).
  35. Library dependencies are automatically managed via PlatformIO Library Manager or included via submodules and linked from the "lib" folder.
  36. Once the firmware is uploaded next step is to upload the web interface. Check how to [build and flash the filesystem](Filesystem.md).
  37. [1]: http://www.platformio.org