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.

49 lines
1.7 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. PlatformIO will take care of some of the library dependencies, but not all the required libraries are available in the platform library manager. Some dependencies are thus checked out as submodules in GIT. So the normal initial checkout should be:
  6. ```
  7. git clone https://bitbucket.org/xoseperez/espurna.git
  8. git submodule init
  9. git submodule update
  10. ```
  11. On linux/max systems the libraries are soft linked to the code/lib folder and you are ready to go. Windows systems do not have this feature so you will have to copy them manually like this (ONLY WINDOWS):
  12. ```
  13. cd espurna/code
  14. copy vendor/emonliteesp/code/lib/EmonLiteESP lib/EmonLiteESP
  15. copy vendor/nofuss/client/lib/NoFUSSClient lib/NoFUSSClient
  16. copy vendor/RemoteSwitch-arduino-library lib/RemoteSwitch
  17. ```
  18. This libraries are optional at the moment and will only be linked if you set ENABLE_NOFUSS, ENABLE_EMON or ENABLE_RF from your build flag.
  19. Once you have all the code, you can check if it's working by:
  20. ```bash
  21. > pio run -e node-debug
  22. ```
  23. If it compiles you are ready to flash the firmware.
  24. ## Flash your board
  25. Wire your board (check the [Hardware page](Hardware.md)) and flash the firmware (with ```upload```):
  26. ```bash
  27. > pio run -t upload -e sonoff
  28. ```
  29. (or any other environment, depending on the board you are woring with).
  30. Library dependencies are automatically managed via PlatformIO Library Manager or included via submodules and linked from the "lib" folder.
  31. Once the firmware is uploaded next step is to upload the web interface. Check how to [build and flash the filesystem](Filesystem.md).
  32. [1]: http://www.platformio.org