Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 217bde7

Browse files
committed
Merge branch 'main' into develop
2 parents aedc249 + 27d8576 commit 217bde7

File tree

4 files changed

+3598
-10
lines changed

4 files changed

+3598
-10
lines changed

.github/workflows/compile.yml

+202
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
---
2+
name: Compile NEMO Firmware
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- "v*"
10+
pull_request:
11+
branches:
12+
- main
13+
workflow_dispatch:
14+
inputs:
15+
board:
16+
description: 'Board to Compile'
17+
type: choice
18+
required: true
19+
default: 'M5Cardputer'
20+
options: ['M5Cardputer', 'M5StickCPlus2', 'M5StickCPlus', 'M5StickC']
21+
22+
jobs:
23+
compile_sketch:
24+
name: Build ${{ matrix.board.name }} (${{ matrix.locale }})
25+
runs-on: ubuntu-latest
26+
strategy:
27+
# max-parallel: 4
28+
fail-fast: false
29+
matrix:
30+
locale:
31+
- en-us
32+
- pt-br
33+
board:
34+
- {
35+
name: "M5Cardputer",
36+
fqbn: "m5stack:esp32:m5stack_cardputer",
37+
extra_flags: "-DCARDPUTER",
38+
libraries: "M5Cardputer IRRemoteESP8266",
39+
partitions: {
40+
bootloader_addr: "0x0000",
41+
},
42+
}
43+
- {
44+
name: "M5StickCPlus2",
45+
fqbn: "m5stack:esp32:m5stack_stickc_plus2",
46+
extra_flags: "-DSTICK_C_PLUS2",
47+
libraries: "M5StickCPlus2 IRRemoteESP8266",
48+
partitions: {
49+
bootloader_addr: "0x1000",
50+
},
51+
}
52+
- {
53+
name: "M5StickCPlus",
54+
fqbn: "m5stack:esp32:m5stack_stickc_plus",
55+
extra_flags: "-DSTICK_C_PLUS",
56+
libraries: "M5StickCPlus IRRemoteESP8266",
57+
partitions: {
58+
bootloader_addr: "0x1000",
59+
},
60+
}
61+
- {
62+
name: "M5StickC",
63+
fqbn: "m5stack:esp32:m5stack_stickc",
64+
extra_flags: "-DSTICK_C",
65+
# TODO: M5StickC's latest version has some dependency issues with M5Hat-JoyC library
66+
libraries: "M5StickC@0.2.8 IRRemoteESP8266",
67+
partitions: {
68+
bootloader_addr: "0x1000",
69+
},
70+
}
71+
72+
steps:
73+
- uses: actions/checkout@v4
74+
75+
- id: nemo_version
76+
name: Get NEMO Version
77+
run: |
78+
set -x
79+
80+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
81+
version=${{ github.ref_name }}
82+
else
83+
version="${GITHUB_SHA::7}"
84+
fi
85+
86+
echo "version=${version}" > $GITHUB_OUTPUT
87+
88+
- name: Setup Arduino CLI
89+
uses: arduino/setup-arduino-cli@v1
90+
91+
- name: Install platform
92+
run: |
93+
set -x
94+
95+
# arduino-cli core install esp32:esp32
96+
arduino-cli core install m5stack:esp32 --additional-urls "file:///${PWD}/package_m5stack_index.json"
97+
98+
arduino-cli core search m5stack
99+
arduino-cli board listall
100+
101+
arduino-cli lib install ${{ matrix.board.libraries }} --log-level warn --verbose
102+
103+
- name: Install esptool
104+
run: |
105+
pip install -U esptool
106+
107+
- name: Compile ${{ matrix.board.name }} Sketch
108+
run: |
109+
set -x
110+
111+
version=${{ steps.nemo_version.outputs.version }}
112+
locale=${{ matrix.locale }}
113+
language=$(echo "LANGUAGE_${locale//-/_}" | tr '[:lower:]' '[:upper:]')
114+
115+
extra_flags="${{ matrix.board.extra_flags }} -DNEMO_VERSION=\"${version}\" -D${language}"
116+
117+
arduino-cli compile --fqbn ${{ matrix.board.fqbn }} -e \
118+
--build-property build.partitions=huge_app \
119+
--build-property upload.maximum_size=3145728 \
120+
--build-property compiler.cpp.extra_flags="${extra_flags}" \
121+
./m5stick-nemo.ino
122+
123+
- name: Create ${{ matrix.board.name }} Firmware Binary
124+
run: |
125+
set -x
126+
127+
version=${{ steps.nemo_version.outputs.version }}
128+
locale=${{ matrix.locale }}
129+
130+
if [[ "${locale}" == "en-us" ]]; then
131+
output_file="M5Nemo-${version}-${{ matrix.board.name }}.bin"
132+
else
133+
output_file="M5Nemo-${version}-${{ matrix.board.name }}.${locale}.bin"
134+
fi
135+
136+
fqbn=${{ matrix.board.fqbn }}
137+
directory="${fqbn//:/.}"
138+
139+
esptool.py --chip esp32s3 merge_bin --output ${output_file} \
140+
${{ matrix.board.partitions.bootloader_addr }} build/${directory}/m5stick-nemo.ino.bootloader.bin \
141+
0x8000 build/${directory}/m5stick-nemo.ino.partitions.bin \
142+
0x10000 build/${directory}/m5stick-nemo.ino.bin
143+
144+
- name: List all files
145+
if: always()
146+
continue-on-error: true
147+
run: |
148+
set -x
149+
pwd
150+
ls -all
151+
tree
152+
153+
# TODO: Validate the firmware
154+
155+
- name: Upload ${{ matrix.board.name }} Firmware Binary
156+
uses: actions/upload-artifact@v4
157+
with:
158+
name: M5Nemo-${{ matrix.board.name }}.${{ matrix.locale }}
159+
path: M5Nemo-*.bin
160+
if-no-files-found: error
161+
162+
create_release:
163+
runs-on: ubuntu-latest
164+
environment: github_release
165+
needs: [compile_sketch]
166+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
167+
168+
steps:
169+
- id: nemo_version
170+
name: Get NEMO Version
171+
run: |
172+
set -x
173+
174+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
175+
version=${{ github.ref_name }}
176+
else
177+
version="${GITHUB_SHA::7}"
178+
fi
179+
180+
echo "version=${version}" > $GITHUB_OUTPUT
181+
182+
- uses: actions/download-artifact@v4
183+
with:
184+
merge-multiple: true
185+
186+
- name: List all files
187+
if: always()
188+
run: |
189+
set -x
190+
pwd
191+
ls -all
192+
tree
193+
194+
- name: Create Release ${{ steps.nemo_version.outputs.version }}
195+
uses: softprops/action-gh-release@v1
196+
with:
197+
name: NEMO Release ${{ steps.nemo_version.outputs.version }}
198+
tag_name: ${{ steps.nemo_version.outputs.version }}
199+
files: |
200+
M5Nemo-*.bin
201+
202+

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,50 @@ If you want to customize NEMO or contribute to the project, you should be famili
8383
* If for some reason the screen jumps from very dim at level 0 to almost fully bright at level 1 and further brightness levels don't affect anything, set the pct_brightness variable to false.
8484
* Compile and upload the project
8585

86+
## Building from Source (with Arduino CLI)
87+
88+
- Install Arduino CLI
89+
- Add M5Stack Index to Arduino Core
90+
- Add M5Stack Libraries
91+
92+
```bash
93+
94+
# Install m5stack boards
95+
arduino-cli core install m5stack:esp32 --additional-urls https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json --log-level warn --verbose
96+
97+
# Install required library
98+
arduino-cli lib install M5Cardputer --log-level warn --verbose
99+
arduino-cli lib install IRRemoteESP8266 --log-level warn --verbose
100+
101+
# Compile sketch
102+
arduino-cli compile --fqbn m5stack:esp32:m5stack_cardputer -e --build-property build.partitions=huge_app --build-property upload.maximum_size=3145728 ./m5stick-nemo.ino
103+
104+
```
105+
106+
- This will create multiple binaries based on partition sketch, you can merge a single binary using `esptool``
107+
- Install esptool - `pip install -U esptool`
108+
109+
```bash
110+
111+
esptool.py --chip esp32s3 merge_bin --output final.bin 0x0000 m5stick-nemo.ino.bootloader.bin 0x8000 m5stick-nemo.ino.partitions.bin 0x10000 m5stick-nemo.ino.bin
112+
```
113+
114+
- You can now flash the merged binary firmware using `esptool`
115+
116+
```bash
117+
118+
esptool.exe write_flash -z 0 final.bin
119+
```
120+
121+
86122
## Troubleshooting
87123
* Several features output debugging information to the serial monitor. Use the Serial Monitor feature in Arduino IDE or M5Burner to gather this information. It may have useful hints. When filing a bug report, it often helps to include serial monitor output.
88124
* Reset the EEPROM. On models with EEPROM settings support, use "Clear Settings" from the settings menu, or hold the "Next" button (Side key on StickC models, Tab or Down Arrow on Cardputer) while powering on.
89125
* TV-B-Gone's IR LED can be observed through a smart phone camera, emitting a pale purple beam of light. If it seems to be on constantly, or if it never flashes at all during TV-B-Gone operations, something is wrong. Report a bug. There's a known issue with TVBG not working after using Bluetooth spam or random wifi spam.
90126
* Try viewing wifi lists from several different devices if you suspect wifi spam isn't working. Sometimes, Linux network manager can see networks that smart phones cannot. Please include the results of this testing if reporting wifi spam problems.
91127
* Apple has patched a lot of Bluetooth stuff since summer 2023. If testing AppleJuice, try some of the AppleTV device types, as they tend to be more reliable due to apple not filtering out weaker bluetooth signals for that platform.
128+
129+
92130
## Reporting Bugs
93131
Please report bugs via GitHub Issues. These are easier to track than comments on social media posts, M5Burner entries, etc. If something isn't working, please include:
94132
* Firmware version

m5stick-nemo.ino

+21-10
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,30 @@
22
// github.com/n0xa | IG: @4x0nn
33

44
// -=-=-=-=-=-=- Uncomment the platform you're building for -=-=-=-=-=-=-
5-
//#define STICK_C_PLUS
6-
#define STICK_C_PLUS2
7-
//#define STICK_C
8-
//#define CARDPUTER
5+
// #define STICK_C_PLUS
6+
// #define STICK_C_PLUS2
7+
// #define STICK_C
8+
// #define CARDPUTER
99
// -=-=- Uncommenting more than one at a time will result in errors -=-=-
1010

11-
String buildver="2.4.0";
11+
// -=-=- NEMO Language for Menu and Portal -=- Thanks, @marivaaldo and @Mmatuda! -=-=-
12+
// #define LANGUAGE_EN_US
13+
// #define LANGUAGE_PT_BR
14+
1215
#define BGCOLOR BLACK
1316
#define FGCOLOR GREEN
1417

15-
// -=-=- NEMO Language for Menu and Portal -=- Thanks, @marivaaldo and @Mmatuda! -=-=-
16-
#define LANGUAGE_EN_US
17-
//#define LANGUAGE_PT_BR
18+
#ifndef NEMO_VERSION
19+
#define NEMO_VERSION "dev"
20+
#endif
21+
22+
#if !defined(CARDPUTER) && !defined(STICK_C_PLUS2) && !defined(STICK_C_PLUS) && !defined(STICK_C)
23+
#define CARDPUTER
24+
#endif
25+
26+
#if !defined(LANGUAGE_EN_US) && !defined(LANGUAGE_PT_BR)
27+
#define LANGUAGE_EN_US
28+
#endif
1829

1930
#if defined(STICK_C_PLUS)
2031
#include <M5StickCPlus.h>
@@ -1356,7 +1367,7 @@ void credits_setup(){
13561367
DISP.setCursor(0, 10);
13571368
DISP.print(" M5-NEMO\n");
13581369
DISP.setTextSize(SMALL_TEXT);
1359-
DISP.printf(" %s\n",buildver);
1370+
DISP.printf(" %s\n",NEMO_VERSION);
13601371
DISP.println(" For M5Stack");
13611372
DISP.printf(" %s\n\n", platformName);
13621373
DISP.println("Contributors:");
@@ -1689,7 +1700,7 @@ void bootScreen(){
16891700
DISP.println("M5-NEMO");
16901701
DISP.setCursor(10, 30);
16911702
DISP.setTextSize(SMALL_TEXT);
1692-
DISP.printf("%s-%s\n",buildver,platformName);
1703+
DISP.printf("%s-%s\n",NEMO_VERSION,platformName);
16931704
#if defined(CARDPUTER)
16941705
DISP.println(TXT_INST_NXT);
16951706
DISP.println(TXT_INST_PRV);

0 commit comments

Comments
 (0)