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.

56 lines
3.1 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. * Paul Stoffregen (et al.) [OneWire](https://github.com/PaulStoffregen/OneWire)
  14. * Miles Burton (et al.) [DallasTemperature](https://github.com/milesburton/Arduino-Temperature-Control-Library)
  15. * The PatternAgents (et al.) [Embedis](https://github.com/thingSoC/embedis)
  16. * German Martin's [NtpCLientLib](https://github.com/gmag11/NtpClient)
  17. * Michael Maregolis & Paul Stoffregen's [Time](https://github.com/PaulStoffregen/Time)
  18. * Randy Simons' [RemoteSwitch](https://github.com/jccprj/RemoteSwitch-arduino-library) (required if using custom RF module: -DENABLE_RF)
  19. And my own libraries:
  20. * [JustWifi](https://bitbucket.org/xoseperez/justwifi.git)
  21. * [FauxmoESP](https://bitbucket.org/xoseperez/fauxmoesp.git) (required if compiling with WeMo emulation support: -DENABLE_FAUXMO)
  22. * [HLW8012](https://bitbucket.org/xoseperez/hlw8012.git) (required if compiling for Sonoff POW: -DENABLE_POW)
  23. * [EmonLiteESP](https://bitbucket.org/xoseperez/emonliteesp.git) (required if compiling with Energy Monitoring support: -DENABLE_EMON)
  24. * [NoFUSS](https://bitbucket.org/xoseperez/nofuss.git) (required if compiling with NoFUSS Automatic OTA support: -DENABLE_NOFUSS)
  25. **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.
  26. Once you have all the code, you can check if it's working by:
  27. ```bash
  28. > pio run -e node-debug
  29. ```
  30. If it compiles you are ready to flash the firmware.
  31. ## Flash your board
  32. Wire your board (check the [Hardware page](Hardware.md)) and flash the firmware (with ```upload```):
  33. ```bash
  34. > pio run -t upload -e sonoff
  35. ```
  36. (or any other environment, depending on the board you are working with).
  37. Library dependencies are automatically managed via PlatformIO Library Manager or included via submodules and linked from the "lib" folder.
  38. Once the firmware is uploaded next step is to upload the web interface. Check how to [build and flash the filesystem](Filesystem.md).
  39. [1]: http://www.platformio.org