Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,36 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: arduino/compile-sketches@v1
- name: Cache pip
uses: actions/cache@v2
with:
verbose: true
fqbn: esp8266:esp8266:nodemcu
platforms: |
- name: esp8266:esp8266
source-url: http://arduino.esp8266.com/stable/package_esp8266com_index.json
version: 2.7.4
libraries: |
- name: WiFiManager
version: 2.0.3-alpha
- name: FastLED
version: 3.4.0
- name: TM1637
version: 1.2.0
sketch-paths: |
- firmware/firmware.ino
cli-compile-flags: |
- --export-binaries
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

- name: Set up Python
uses: actions/setup-python@v2

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio

- name: Run PlatformIO
working-directory: ${{github.workspace}}/firmware
run: pio run

- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: firmware/build/esp8266.esp8266.nodemcu/firmware.ino.bin
asset_name: firmware-$tag.ino.nodemcu.bin
file: firmware/.pio/build/nodemcu/firmware.bin
asset_name: firmware-$tag.nodemcu.bin
tag: ${{ github.ref }}
prerelease: true
46 changes: 25 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [ push, pull_request ]

env:
BUILD_TYPE: Debug
Expand Down Expand Up @@ -33,20 +29,28 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: arduino/compile-sketches@v1
- name: Cache pip
uses: actions/cache@v2
with:
verbose: true
fqbn: esp8266:esp8266:nodemcu
platforms: |
- name: esp8266:esp8266
source-url: http://arduino.esp8266.com/stable/package_esp8266com_index.json
version: 2.7.4
libraries: |
- name: WiFiManager
version: 2.0.3-alpha
- name: FastLED
version: 3.4.0
- name: TM1637
version: 1.2.0
sketch-paths: |
- firmware/firmware.ino
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

- name: Set up Python
uses: actions/setup-python@v2

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio

- name: Run PlatformIO
working-directory: ${{github.workspace}}/firmware
run: pio run
9 changes: 6 additions & 3 deletions doc/QuickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This will be referred to `<PORT>` below.

#### Option 1: Download firmware from Releases page

1. Download `firmware-vXXX.ino.nodemcu.bin` from the [Releases] page.
1. Download `firmware-vXXX.nodemcu.bin` from the [Releases] page.
2. Install esptool by running `pip3 install esptool`
3. Run the following command (replacing `<PORT>` and `<FIRMWARE_FILE_NAME>` with the appropriate values):

Expand All @@ -37,8 +37,11 @@ esptool.py --chip esp8266 --port <PORT> --baud 115200 --before default_reset --a
#### Option 2: Compile firmware manually

1. Set up the development environment as described in [this document](../firmware/README.md).
2. Open `firmware.ino` in the Arduino IDE.
3. `Menu` / `Sketch` / `Upload`
2. Run the command

```
pio run --target upload --upload-port <PORT>
```

### Connect the device to your Wi-Fi network

Expand Down
1 change: 1 addition & 0 deletions firmware/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.pio
6 changes: 3 additions & 3 deletions firmware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ endif()
add_library (lib_firmware INTERFACE)
target_sources (lib_firmware
INTERFACE
stdextra.h
lib_firmware.h
ArduinoJson-v6.18.0.h
include/stdextra.h
include/lib_firmware.h
include/ArduinoJson-v6.18.0.h
)
target_include_directories (lib_firmware INTERFACE "${CMAKE_CURRENT_SOURCE_DIRECTORY}")

Expand Down
22 changes: 16 additions & 6 deletions firmware/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
## Setting up arduino for development
## Setting up the development environment

https://www.instructables.com/Steps-to-Setup-Arduino-IDE-for-NODEMCU-ESP8266-WiF/
The first step is to install PlatformIO by following [this article][platformio-install].

Libraries to install:
- [WiFiManager by tzapu,tablatronix](https://github.com/tzapu/WiFiManager)
- [FastLED by Daniel Garcia](http://fastled.io)
- [TM1637 by Avishay Orpaz](https://github.com/avishorp/TM1637)
PlatformIO takes care of the following:

- install cross compiler environment for nodemcu
- install libraries CheckMeet depends on
- compile the project

The following command needs to be issued to achieve this after PlatformIO
was installed.

```
pio run
```

The bootloaders seem to communicate using 74880 baud so we use it as well.

Expand All @@ -19,6 +27,8 @@ https://github.com/nodemcu/nodemcu-devkit/blob/master/Drivers/CH341SER_WINDOWS.z

Note: board is NodeMCU v0.9

[platformio-install]: https://docs.platformio.org/en/latest//core/installation.html

## Running the unit tests

For Mac (and probably Linux) run the helper script `test.sh`.
Expand Down
2 changes: 1 addition & 1 deletion firmware/catch/catch_firmware.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "catch.hpp"

#include "lib_firmware.h"
#include "include/lib_firmware.h"

TEST_CASE( "rnd() returns 4" ) {
REQUIRE( rnd() == 4 );
Expand Down
2 changes: 1 addition & 1 deletion firmware/catch/catch_serialnames.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "catch.hpp"

#include "serialnames.h"
#include "include/serialnames.h"

TEST_CASE( "computeNameForId() works" ) {
REQUIRE( computeNameForId(0xa451be) == "TealFrenchCuteLion");
Expand Down
2 changes: 1 addition & 1 deletion firmware/catch/catch_stdextra.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "catch.hpp"

#include "stdextra.h"
#include "include/stdextra.h"

TEST_CASE( "fmt() works" ) {
REQUIRE( fmt("Hello, %s!", "World") == "Hello, World!" );
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions firmware/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:nodemcu]
platform = [email protected]
board = nodemcu
framework = arduino
lib_deps =
tzapu/[email protected]
fastled/[email protected]
smougenot/[email protected]+sha.9486982048
File renamed without changes.