mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-08 19:07:26 +00:00
Compare commits
330 Commits
v2.5.11.8e
...
v2.5.19.f9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cd2ba5479 | ||
|
|
f9876cfe9c | ||
|
|
85de193845 | ||
|
|
fb2c008c89 | ||
|
|
dd9ab7f0e1 | ||
|
|
729c39fb86 | ||
|
|
038430db23 | ||
|
|
d5cd6f87a0 | ||
|
|
de42d96adf | ||
|
|
e2dd845051 | ||
|
|
6366633cd4 | ||
|
|
1c0f43c8e2 | ||
|
|
89a9e0b99d | ||
|
|
4dc8d6e400 | ||
|
|
e0f97c9306 | ||
|
|
6b1c01ce02 | ||
|
|
70296b47bc | ||
|
|
0cf4a2951a | ||
|
|
124936b6cf | ||
|
|
fd60c9b3be | ||
|
|
a0a4c5bc79 | ||
|
|
0fe8d4ccc7 | ||
|
|
00fdf2c9aa | ||
|
|
253ab458ef | ||
|
|
b4a4d2db4e | ||
|
|
6b8cf164e9 | ||
|
|
812aa35f09 | ||
|
|
e7802d960f | ||
|
|
077ee02426 | ||
|
|
46ea39af45 | ||
|
|
25a5f178e1 | ||
|
|
c144ee77a7 | ||
|
|
b62bdbc46a | ||
|
|
f18a92e8c5 | ||
|
|
2e44de262e | ||
|
|
1d756ae574 | ||
|
|
8aac9f2e8e | ||
|
|
33e5a04508 | ||
|
|
6cf3485d07 | ||
|
|
9421eba027 | ||
|
|
27fbfd03d6 | ||
|
|
353740623f | ||
|
|
cdcbf4c615 | ||
|
|
395469d20a | ||
|
|
86170171a7 | ||
|
|
57766d47a8 | ||
|
|
e5dbcf5bce | ||
|
|
4c3a3ca47d | ||
|
|
78371dfdb7 | ||
|
|
ca32889893 | ||
|
|
35cd600c54 | ||
|
|
70076a4b27 | ||
|
|
f1a8900288 | ||
|
|
16bc89ea57 | ||
|
|
6edf74e8f1 | ||
|
|
7f280dd556 | ||
|
|
2396aa77ca | ||
|
|
d3cbbfd345 | ||
|
|
c003ab0eee | ||
|
|
4fcf7fe027 | ||
|
|
9cc79b1d1e | ||
|
|
403fa15a3f | ||
|
|
b0087fd328 | ||
|
|
fb74e1d182 | ||
|
|
29a7866fc1 | ||
|
|
2f552d15e5 | ||
|
|
892e0922ff | ||
|
|
d21d6c1301 | ||
|
|
031aecac66 | ||
|
|
7c10caa78b | ||
|
|
5196ee39cb | ||
|
|
02a5a91da0 | ||
|
|
b2a89b8136 | ||
|
|
15019e8663 | ||
|
|
35814fd4bc | ||
|
|
6aabbedc00 | ||
|
|
eb72ee0fc1 | ||
|
|
7480378aed | ||
|
|
7c21d7761c | ||
|
|
2c654454cf | ||
|
|
9afadde2f4 | ||
|
|
66a961cb75 | ||
|
|
e1aaafb77a | ||
|
|
9d710041c4 | ||
|
|
b41efc17ba | ||
|
|
9bda080e3d | ||
|
|
9f7cbf1b4f | ||
|
|
93e2bc7058 | ||
|
|
7a1c32b89a | ||
|
|
88d8ab53c8 | ||
|
|
183f68ba00 | ||
|
|
9f32995d7f | ||
|
|
c2c06ed0ad | ||
|
|
9abd07bb05 | ||
|
|
fdcc0e12aa | ||
|
|
8b34c4ff05 | ||
|
|
9af8c58c40 | ||
|
|
58ebd5bcdb | ||
|
|
d1e5be515a | ||
|
|
f9e71c3fb9 | ||
|
|
bfcfca2e46 | ||
|
|
a2a6b236b7 | ||
|
|
3c7053c66a | ||
|
|
e45c0e4d40 | ||
|
|
57a9a5ca21 | ||
|
|
6749367a73 | ||
|
|
a8e2446f00 | ||
|
|
89ebafc8b8 | ||
|
|
43d6b31603 | ||
|
|
31a5b9c122 | ||
|
|
ad726ad684 | ||
|
|
b2808063d0 | ||
|
|
2b33be2fea | ||
|
|
5133117936 | ||
|
|
e5accf4e1d | ||
|
|
26a4d6c87a | ||
|
|
ae93f3fa3f | ||
|
|
ed39d14c85 | ||
|
|
8f8e304216 | ||
|
|
cd198fcf3f | ||
|
|
b1d25ac7b7 | ||
|
|
b12ac6d564 | ||
|
|
33d2f78d21 | ||
|
|
b12aa3f360 | ||
|
|
d87b7e49e4 | ||
|
|
cc357df489 | ||
|
|
1281da627e | ||
|
|
835344074c | ||
|
|
13960874ae | ||
|
|
a7d9e8107a | ||
|
|
fbdd6e7223 | ||
|
|
175ff218f1 | ||
|
|
57af51cc18 | ||
|
|
b4b2fd6122 | ||
|
|
143e1d1a0d | ||
|
|
32719f69c9 | ||
|
|
6a2a4ffa2a | ||
|
|
80fc0f2bda | ||
|
|
fa1a1fd869 | ||
|
|
2fd5a4848a | ||
|
|
f4cff33450 | ||
|
|
1c8b165408 | ||
|
|
8e6ef4ea04 | ||
|
|
fb7866fca7 | ||
|
|
d9b287880f | ||
|
|
f39a9c5083 | ||
|
|
398d29064e | ||
|
|
df63423cdc | ||
|
|
9a10907a2d | ||
|
|
5fed679d33 | ||
|
|
58d80b8557 | ||
|
|
960626e498 | ||
|
|
658459aaf3 | ||
|
|
e1de439a7f | ||
|
|
827553f4c7 | ||
|
|
445c641004 | ||
|
|
7075a05bcd | ||
|
|
63091b7838 | ||
|
|
8c6eec52f2 | ||
|
|
68413486e3 | ||
|
|
af79970ad7 | ||
|
|
4edeca5f84 | ||
|
|
b0e3039732 | ||
|
|
92511ab10b | ||
|
|
b0a4087a0c | ||
|
|
1b2fc00b99 | ||
|
|
69d01a8088 | ||
|
|
09c082fd00 | ||
|
|
020e9102a8 | ||
|
|
2d45afafe5 | ||
|
|
56002155c6 | ||
|
|
547a57256d | ||
|
|
ea72abff22 | ||
|
|
4024bfdeeb | ||
|
|
6d8be13266 | ||
|
|
4a1239f811 | ||
|
|
44cf6d388e | ||
|
|
c3f89a6db8 | ||
|
|
332dbaf573 | ||
|
|
92225eb6c3 | ||
|
|
03770b799f | ||
|
|
1790407078 | ||
|
|
7dd3629501 | ||
|
|
cabeb40c30 | ||
|
|
761a99d241 | ||
|
|
cf46e675ca | ||
|
|
438f627e9b | ||
|
|
0e3dae4fec | ||
|
|
d0e3427ec7 | ||
|
|
f3850ee73b | ||
|
|
3ae85e2c82 | ||
|
|
f81d3b045d | ||
|
|
59ed5c9049 | ||
|
|
4a34bf648f | ||
|
|
b99e57a6fa | ||
|
|
46eab20a90 | ||
|
|
39b5fb041e | ||
|
|
fc16d93421 | ||
|
|
bac9fec17f | ||
|
|
de774188c9 | ||
|
|
c3d60342f4 | ||
|
|
d3e3985e39 | ||
|
|
8eca6a2df8 | ||
|
|
e4f53677fc | ||
|
|
10e10450cf | ||
|
|
f846503cbf | ||
|
|
85b2bad275 | ||
|
|
7ad137b56a | ||
|
|
57ea6a265e | ||
|
|
d00e0f6911 | ||
|
|
594af0cacd | ||
|
|
9f4c8a2804 | ||
|
|
43b8972171 | ||
|
|
fe8e0713cc | ||
|
|
ac6b6c8d83 | ||
|
|
79da2365f0 | ||
|
|
b5777beb7d | ||
|
|
5ad30a55ea | ||
|
|
060a3bde4d | ||
|
|
8df7a035e2 | ||
|
|
b00c05012d | ||
|
|
0832388482 | ||
|
|
601d912c6f | ||
|
|
502a83bb8a | ||
|
|
474f9b5bfb | ||
|
|
fe86c40145 | ||
|
|
09286a3beb | ||
|
|
ae4f54224e | ||
|
|
d5af8f0a97 | ||
|
|
58c957f2c7 | ||
|
|
7c2b6778cb | ||
|
|
0048e3cdcb | ||
|
|
6018c0a830 | ||
|
|
37da78919a | ||
|
|
ad9d7a4972 | ||
|
|
932966b896 | ||
|
|
4d69159e75 | ||
|
|
f2ee0df015 | ||
|
|
fcfb197571 | ||
|
|
dd7140b7a1 | ||
|
|
fadcbd597f | ||
|
|
14b9a1a929 | ||
|
|
c51a7b98bd | ||
|
|
fdec95f9c1 | ||
|
|
e6fb6b115a | ||
|
|
d5bb32ff93 | ||
|
|
f5058a9cbb | ||
|
|
dbc5ec27f7 | ||
|
|
1089469f82 | ||
|
|
fd98e9f553 | ||
|
|
ccfc9e5dd9 | ||
|
|
1752caaf19 | ||
|
|
364dead3aa | ||
|
|
154864dfbf | ||
|
|
2ca3cdf837 | ||
|
|
485c371de4 | ||
|
|
a255da3cf5 | ||
|
|
d65dc497f2 | ||
|
|
c641bfd53c | ||
|
|
b947b123fc | ||
|
|
df1f66a6b9 | ||
|
|
70336f7f4f | ||
|
|
de76caca32 | ||
|
|
89469fcb88 | ||
|
|
a8357ebd52 | ||
|
|
0d1f9e915f | ||
|
|
1a06f88dfb | ||
|
|
a174ec7cf9 | ||
|
|
37b29f6899 | ||
|
|
74d0c58576 | ||
|
|
ca3d8da128 | ||
|
|
be6348388e | ||
|
|
fdc473e5fa | ||
|
|
add70b5229 | ||
|
|
1b99543a15 | ||
|
|
90a3050c1f | ||
|
|
9545a10361 | ||
|
|
d4d89447bd | ||
|
|
81172574a4 | ||
|
|
295278bb12 | ||
|
|
ec6949fdc0 | ||
|
|
f4908fadd6 | ||
|
|
528e177c62 | ||
|
|
73430cb582 | ||
|
|
3a66c738bd | ||
|
|
ea150c32f3 | ||
|
|
ac804818de | ||
|
|
8fcfe7f28b | ||
|
|
e866734a25 | ||
|
|
2ec3958cd8 | ||
|
|
f4b0e19a65 | ||
|
|
a49f080bd2 | ||
|
|
e65a754430 | ||
|
|
a84324c4fa | ||
|
|
ff33a27789 | ||
|
|
51ea7ac627 | ||
|
|
606c2e8eb0 | ||
|
|
762ccdc1b9 | ||
|
|
0acccdfe2d | ||
|
|
0e4f7003c7 | ||
|
|
40bc04b521 | ||
|
|
eb8d38a7e9 | ||
|
|
3d5eb34c5c | ||
|
|
3a9a4bbb92 | ||
|
|
6eba2789d0 | ||
|
|
9b4c260a92 | ||
|
|
667b4ef0f2 | ||
|
|
db76561930 | ||
|
|
7bad070891 | ||
|
|
6365fcfdc6 | ||
|
|
ab2cbada75 | ||
|
|
875b8641d3 | ||
|
|
67c2c516a0 | ||
|
|
623203ca3b | ||
|
|
f28f0a9d90 | ||
|
|
893efe4f11 | ||
|
|
2c2213ef9b | ||
|
|
439c1dec08 | ||
|
|
aa184e6d8b | ||
|
|
2eea412f1c | ||
|
|
b0a5a26f58 | ||
|
|
a815a770b4 | ||
|
|
286f3c6458 | ||
|
|
b506f6dcb0 | ||
|
|
bd3755bb33 | ||
|
|
73e2e25eb1 | ||
|
|
3bd3911913 | ||
|
|
982190936d | ||
|
|
8498b175e7 | ||
|
|
255713d23d |
183
.devcontainer/99-platformio-udev.rules
Normal file
183
.devcontainer/99-platformio-udev.rules
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
#####################################################################################
|
||||||
|
#
|
||||||
|
# INSTALLATION
|
||||||
|
#
|
||||||
|
# Please visit > https://docs.platformio.org/en/latest/core/installation/udev-rules.html
|
||||||
|
#
|
||||||
|
#####################################################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# Boards
|
||||||
|
#
|
||||||
|
|
||||||
|
# CP210X USB UART
|
||||||
|
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea[67][013]", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="80a9", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# FT231XS USB UART
|
||||||
|
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Prolific Technology, Inc. PL2303 Serial Port
|
||||||
|
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# QinHeng Electronics HL-340 USB-Serial adapter
|
||||||
|
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
# QinHeng Electronics CH343 USB-Serial adapter
|
||||||
|
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d3", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
# QinHeng Electronics CH9102 USB-Serial adapter
|
||||||
|
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d4", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Arduino boards
|
||||||
|
ATTRS{idVendor}=="2341", ATTRS{idProduct}=="[08][023]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="[08][02]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Arduino SAM-BA
|
||||||
|
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{MTP_NO_PROBE}="1"
|
||||||
|
|
||||||
|
# Digistump boards
|
||||||
|
ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Maple with DFU
|
||||||
|
ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="000[34]", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# USBtiny
|
||||||
|
ATTRS{idProduct}=="0c9f", ATTRS{idVendor}=="1781", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# USBasp V2.0
|
||||||
|
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Teensy boards
|
||||||
|
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
|
||||||
|
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
|
||||||
|
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
|
||||||
|
|
||||||
|
# TI Stellaris Launchpad
|
||||||
|
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# TI MSP430 Launchpad
|
||||||
|
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# GD32V DFU Bootloader
|
||||||
|
ATTRS{idVendor}=="28e9", ATTRS{idProduct}=="0189", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# FireBeetle-ESP32
|
||||||
|
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7522", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Wio Terminal
|
||||||
|
ATTRS{idVendor}=="2886", ATTRS{idProduct}=="[08]02d", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Raspberry Pi Pico
|
||||||
|
ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="[01]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# AIR32F103
|
||||||
|
ATTRS{idVendor}=="0d28", ATTRS{idProduct}=="0204", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# STM32 virtual COM port
|
||||||
|
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Debuggers
|
||||||
|
#
|
||||||
|
|
||||||
|
# Black Magic Probe
|
||||||
|
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic GDB Server", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic UART Port", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# opendous and estick
|
||||||
|
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204f", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Original FT232/FT245/FT2232/FT232H/FT4232
|
||||||
|
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="60[01][104]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# DISTORTEC JTAG-lock-pick Tiny 2
|
||||||
|
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8220", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# TUMPA, TUMPA Lite
|
||||||
|
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a9[89]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# XDS100v2
|
||||||
|
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Xverve Signalyzer Tool (DT-USB-ST), Signalyzer LITE (DT-USB-SLITE)
|
||||||
|
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca[01]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# TI/Luminary Stellaris Evaluation Board FTDI (several)
|
||||||
|
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd[9a]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# egnite Turtelizer 2
|
||||||
|
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Section5 ICEbear
|
||||||
|
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c14[01]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Amontec JTAGkey and JTAGkey-tiny
|
||||||
|
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# TI ICDI
|
||||||
|
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# STLink probes
|
||||||
|
ATTRS{idVendor}=="0483", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Hilscher NXHX Boards
|
||||||
|
ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0028", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Hitex probes
|
||||||
|
ATTRS{idVendor}=="0640", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Altera USB Blaster
|
||||||
|
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Amontec JTAGkey-HiSpeed
|
||||||
|
ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# SEGGER J-Link
|
||||||
|
ATTRS{idVendor}=="1366", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Raisonance RLink
|
||||||
|
ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Debug Board for Neo1973
|
||||||
|
ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Olimex probes
|
||||||
|
ATTRS{idVendor}=="15ba", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# USBprog with OpenOCD firmware
|
||||||
|
ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
|
||||||
|
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Marvell Sheevaplug
|
||||||
|
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Keil Software, Inc. ULink
|
||||||
|
ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2710", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# CMSIS-DAP compatible adapters
|
||||||
|
ATTRS{product}=="*CMSIS-DAP*", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Atmel AVR Dragon
|
||||||
|
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2107", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Espressif USB JTAG/serial debug unit
|
||||||
|
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
|
|
||||||
|
# Zephyr framework USB CDC-ACM
|
||||||
|
ATTRS{idVendor}=="2fe3", ATTRS{idProduct}=="0100", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
FROM mcr.microsoft.com/devcontainers/cpp:1-debian-12
|
FROM mcr.microsoft.com/devcontainers/cpp:1-debian-12
|
||||||
|
|
||||||
# [Optional] Uncomment this section to install additional packages.
|
USER root
|
||||||
|
|
||||||
|
# trunk-ignore(terrascan/AC_DOCKER_0002): Known terrascan issue
|
||||||
|
# trunk-ignore(hadolint/DL3008): Use latest version of packages
|
||||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
&& apt-get -y install --no-install-recommends \
|
&& apt-get -y install --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@@ -20,6 +23,16 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|||||||
python3-wheel \
|
python3-wheel \
|
||||||
wget \
|
wget \
|
||||||
zip \
|
zip \
|
||||||
|
usbutils \
|
||||||
|
hwdata \
|
||||||
|
gpg \
|
||||||
|
gnupg2 \
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN pipx install platformio==6.1.15
|
RUN pipx install platformio==6.1.15
|
||||||
|
|
||||||
|
COPY 99-platformio-udev.rules /etc/udev/rules.d/99-platformio-udev.rules
|
||||||
|
|
||||||
|
USER vscode
|
||||||
|
|
||||||
|
HEALTHCHECK NONE
|
||||||
@@ -13,13 +13,24 @@
|
|||||||
},
|
},
|
||||||
"customizations": {
|
"customizations": {
|
||||||
"vscode": {
|
"vscode": {
|
||||||
"extensions": ["ms-vscode.cpptools", "platformio.platformio-ide"]
|
"extensions": [
|
||||||
|
"ms-vscode.cpptools",
|
||||||
|
"platformio.platformio-ide",
|
||||||
|
"Trunk.io"
|
||||||
|
],
|
||||||
|
"unwantedRecommendations": ["ms-azuretools.vscode-docker"],
|
||||||
|
"settings": {
|
||||||
|
"extensions.ignoreRecommendations": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
"forwardPorts": [4403],
|
"forwardPorts": [4403],
|
||||||
|
|
||||||
|
// Use "--device=" to make a local device available inside the container.
|
||||||
|
// "runArgs": ["--device=/dev/ttyACM0"],
|
||||||
|
|
||||||
// Run commands to prepare the container for use
|
// Run commands to prepare the container for use
|
||||||
"postCreateCommand": ".devcontainer/setup.sh"
|
"postCreateCommand": ".devcontainer/setup.sh"
|
||||||
}
|
}
|
||||||
|
|||||||
4
.env.example
Normal file
4
.env.example
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Absolute path to the local meshtastic config.yaml file
|
||||||
|
CONFIG_PATH=/path/to/meshtastic/config.yaml
|
||||||
|
# USB device to passthrough (`lsusb -t`: look for `ch341`)
|
||||||
|
USB_DEVICE=/dev/bus/usb/001/037
|
||||||
11
.github/actions/build-variant/action.yml
vendored
11
.github/actions/build-variant/action.yml
vendored
@@ -51,6 +51,7 @@ runs:
|
|||||||
file: build.tar
|
file: build.tar
|
||||||
target: build.tar
|
target: build.tar
|
||||||
token: ${{ inputs.github_token }}
|
token: ${{ inputs.github_token }}
|
||||||
|
version: tags/v2.5.3
|
||||||
|
|
||||||
- name: Unpack web ui
|
- name: Unpack web ui
|
||||||
if: inputs.include-web-ui == 'true'
|
if: inputs.include-web-ui == 'true'
|
||||||
@@ -67,6 +68,12 @@ runs:
|
|||||||
sed -i '/DDEBUG_HEAP/d' ${INI_FILE}
|
sed -i '/DDEBUG_HEAP/d' ${INI_FILE}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
- name: PlatformIO ${{ inputs.arch }} download cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.platformio/.cache
|
||||||
|
key: pio-cache-${{ inputs.arch }}-${{ hashFiles('.github/actions/**', '**.ini') }}
|
||||||
|
|
||||||
- name: Build ${{ inputs.board }}
|
- name: Build ${{ inputs.board }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ${{ inputs.build-script-path }} ${{ inputs.board }}
|
run: ${{ inputs.build-script-path }} ${{ inputs.board }}
|
||||||
@@ -82,13 +89,13 @@ runs:
|
|||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
- name: Store binaries as an artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-${{ inputs.arch }}-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
name: firmware-${{ inputs.arch }}-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
${{ inputs.artifact-paths }}
|
${{ inputs.artifact-paths }}
|
||||||
|
|||||||
13
.github/actions/setup-base/action.yml
vendored
13
.github/actions/setup-base/action.yml
vendored
@@ -20,19 +20,16 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get -y update --fix-missing
|
sudo apt-get -y update --fix-missing
|
||||||
sudo apt-get install -y cppcheck libbluetooth-dev libgpiod-dev libyaml-cpp-dev
|
sudo apt-get install -y cppcheck libbluetooth-dev libgpiod-dev libyaml-cpp-dev lsb-release
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
|
cache: pip
|
||||||
# - name: Cache python libs
|
cache-dependency-path: |
|
||||||
# uses: actions/cache@v4
|
.github/actions/**
|
||||||
# id: cache-pip # needed in if test
|
**.ini
|
||||||
# with:
|
|
||||||
# path: ~/.cache/pip
|
|
||||||
# key: ${{ runner.os }}-pip
|
|
||||||
|
|
||||||
- name: Upgrade python tools
|
- name: Upgrade python tools
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
14
.github/actions/setup-native/action.yml
vendored
Normal file
14
.github/actions/setup-native/action.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: Setup native build
|
||||||
|
description: Install libraries needed for building the Native/Portduino build
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Setup base
|
||||||
|
id: base
|
||||||
|
uses: ./.github/actions/setup-base
|
||||||
|
|
||||||
|
- name: Install libs needed for native build
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev libi2c-dev
|
||||||
72
.github/workflows/build_debian_src.yml
vendored
Normal file
72
.github/workflows/build_debian_src.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
name: Build Debian Source Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
PPA_GPG_PRIVATE_KEY:
|
||||||
|
required: true
|
||||||
|
inputs:
|
||||||
|
series:
|
||||||
|
description: Ubuntu/Debian series to target
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
build_location:
|
||||||
|
description: Location where build will execute
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-debian-src:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
path: meshtasticd
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
shell: bash
|
||||||
|
working-directory: meshtasticd
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -y --fix-missing
|
||||||
|
sudo apt-get install -y software-properties-common build-essential devscripts equivs
|
||||||
|
sudo add-apt-repository ppa:meshtastic/build-tools -y
|
||||||
|
sudo apt-get update -y --fix-missing
|
||||||
|
sudo mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
|
||||||
|
|
||||||
|
- name: Import GPG key
|
||||||
|
uses: crazy-max/ghaction-import-gpg@v6
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
||||||
|
id: gpg
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
working-directory: meshtasticd
|
||||||
|
run: |
|
||||||
|
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
||||||
|
env:
|
||||||
|
BUILD_LOCATION: ${{ inputs.build_location }}
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Fetch libdeps, package debian source
|
||||||
|
working-directory: meshtasticd
|
||||||
|
run: debian/ci_pack_sdeb.sh
|
||||||
|
env:
|
||||||
|
SERIES: ${{ inputs.series }}
|
||||||
|
GPG_KEY_ID: ${{ steps.gpg.outputs.keyid }}
|
||||||
|
PKG_VERSION: ${{ steps.version.outputs.deb }}
|
||||||
|
|
||||||
|
- name: Store binaries as an artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
||||||
|
overwrite: true
|
||||||
|
path: |
|
||||||
|
meshtasticd_${{ steps.version.outputs.deb }}*
|
||||||
51
.github/workflows/build_docker.yml
vendored
Normal file
51
.github/workflows/build_docker.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
name: Build Docker
|
||||||
|
|
||||||
|
on: workflow_call
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-native:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Docker login
|
||||||
|
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: meshtastic
|
||||||
|
password: ${{ secrets.DOCKER_FIRMWARE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Docker setup
|
||||||
|
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Docker build and push tagged versions
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: meshtastic/meshtasticd:${{ steps.version.outputs.long }}
|
||||||
|
|
||||||
|
- name: Docker build and push
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: meshtastic/meshtasticd:latest
|
||||||
3
.github/workflows/build_esp32.yml
vendored
3
.github/workflows/build_esp32.yml
vendored
@@ -7,6 +7,8 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-esp32:
|
build-esp32:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -24,6 +26,7 @@ jobs:
|
|||||||
./arch/esp32/esp32s2.ini
|
./arch/esp32/esp32s2.ini
|
||||||
./arch/esp32/esp32s3.ini
|
./arch/esp32/esp32s3.ini
|
||||||
./arch/esp32/esp32c3.ini
|
./arch/esp32/esp32c3.ini
|
||||||
|
./arch/esp32/esp32c6.ini
|
||||||
build-script-path: bin/build-esp32.sh
|
build-script-path: bin/build-esp32.sh
|
||||||
ota-firmware-source: firmware.bin
|
ota-firmware-source: firmware.bin
|
||||||
ota-firmware-target: release/bleota.bin
|
ota-firmware-target: release/bleota.bin
|
||||||
|
|||||||
2
.github/workflows/build_esp32_c3.yml
vendored
2
.github/workflows/build_esp32_c3.yml
vendored
@@ -26,10 +26,12 @@ jobs:
|
|||||||
./arch/esp32/esp32s2.ini
|
./arch/esp32/esp32s2.ini
|
||||||
./arch/esp32/esp32s3.ini
|
./arch/esp32/esp32s3.ini
|
||||||
./arch/esp32/esp32c3.ini
|
./arch/esp32/esp32c3.ini
|
||||||
|
./arch/esp32/esp32c6.ini
|
||||||
build-script-path: bin/build-esp32.sh
|
build-script-path: bin/build-esp32.sh
|
||||||
ota-firmware-source: firmware-c3.bin
|
ota-firmware-source: firmware-c3.bin
|
||||||
ota-firmware-target: release/bleota-c3.bin
|
ota-firmware-target: release/bleota-c3.bin
|
||||||
artifact-paths: |
|
artifact-paths: |
|
||||||
release/*.bin
|
release/*.bin
|
||||||
release/*.elf
|
release/*.elf
|
||||||
|
include-web-ui: true
|
||||||
arch: esp32c3
|
arch: esp32c3
|
||||||
|
|||||||
1
.github/workflows/build_esp32_c6.yml
vendored
1
.github/workflows/build_esp32_c6.yml
vendored
@@ -33,4 +33,5 @@ jobs:
|
|||||||
artifact-paths: |
|
artifact-paths: |
|
||||||
release/*.bin
|
release/*.bin
|
||||||
release/*.elf
|
release/*.elf
|
||||||
|
include-web-ui: true
|
||||||
arch: esp32c6
|
arch: esp32c6
|
||||||
|
|||||||
3
.github/workflows/build_esp32_s3.yml
vendored
3
.github/workflows/build_esp32_s3.yml
vendored
@@ -7,6 +7,8 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-esp32-s3:
|
build-esp32-s3:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -24,6 +26,7 @@ jobs:
|
|||||||
./arch/esp32/esp32s2.ini
|
./arch/esp32/esp32s2.ini
|
||||||
./arch/esp32/esp32s3.ini
|
./arch/esp32/esp32s3.ini
|
||||||
./arch/esp32/esp32c3.ini
|
./arch/esp32/esp32c3.ini
|
||||||
|
./arch/esp32/esp32c6.ini
|
||||||
build-script-path: bin/build-esp32.sh
|
build-script-path: bin/build-esp32.sh
|
||||||
ota-firmware-source: firmware-s3.bin
|
ota-firmware-source: firmware-s3.bin
|
||||||
ota-firmware-target: release/bleota-s3.bin
|
ota-firmware-target: release/bleota-s3.bin
|
||||||
|
|||||||
57
.github/workflows/build_native.yml
vendored
57
.github/workflows/build_native.yml
vendored
@@ -10,12 +10,6 @@ jobs:
|
|||||||
build-native:
|
build-native:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install libs needed for native build
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get update --fix-missing
|
|
||||||
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
|
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -23,63 +17,22 @@ jobs:
|
|||||||
ref: ${{github.event.pull_request.head.ref}}
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
- name: Upgrade python tools
|
- name: Setup native build
|
||||||
shell: bash
|
id: base
|
||||||
run: |
|
uses: ./.github/actions/setup-native
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U platformio adafruit-nrfutil
|
|
||||||
pip install -U meshtastic --pre
|
|
||||||
|
|
||||||
- name: Upgrade platformio
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
pio upgrade
|
|
||||||
|
|
||||||
- name: Build Native
|
- name: Build Native
|
||||||
run: bin/build-native.sh
|
run: bin/build-native.sh
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
- name: Store binaries as an artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-native-${{ steps.version.outputs.version }}.zip
|
name: firmware-native-${{ steps.version.outputs.long }}.zip
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
release/meshtasticd_linux_x86_64
|
release/meshtasticd_linux_x86_64
|
||||||
bin/config-dist.yaml
|
bin/config-dist.yaml
|
||||||
|
|
||||||
- name: Docker login
|
|
||||||
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
continue-on-error: true # FIXME: Failing docker login auth
|
|
||||||
with:
|
|
||||||
username: meshtastic
|
|
||||||
password: ${{ secrets.DOCKER_FIRMWARE_TOKEN }}
|
|
||||||
|
|
||||||
- name: Docker setup
|
|
||||||
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
|
||||||
continue-on-error: true # FIXME: Failing docker login auth
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Docker build and push tagged versions
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
continue-on-error: true # FIXME: Failing docker login auth
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: meshtastic/device-simulator:${{ steps.version.outputs.version }}
|
|
||||||
|
|
||||||
- name: Docker build and push
|
|
||||||
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
|
||||||
continue-on-error: true # FIXME: Failing docker login auth
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: meshtastic/device-simulator:latest
|
|
||||||
|
|||||||
8
.github/workflows/build_raspbian.yml
vendored
8
.github/workflows/build_raspbian.yml
vendored
@@ -13,8 +13,8 @@ jobs:
|
|||||||
- name: Install libbluetooth
|
- name: Install libbluetooth
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
apt-get update -y --fix-missing
|
sudo apt-get update -y --fix-missing
|
||||||
apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
|
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev libi2c-dev
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -39,13 +39,13 @@ jobs:
|
|||||||
run: bin/build-native.sh
|
run: bin/build-native.sh
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
- name: Store binaries as an artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-raspbian-${{ steps.version.outputs.version }}.zip
|
name: firmware-raspbian-${{ steps.version.outputs.long }}.zip
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
release/meshtasticd_linux_aarch64
|
release/meshtasticd_linux_aarch64
|
||||||
|
|||||||
8
.github/workflows/build_raspbian_armv7l.yml
vendored
8
.github/workflows/build_raspbian_armv7l.yml
vendored
@@ -13,8 +13,8 @@ jobs:
|
|||||||
- name: Install libbluetooth
|
- name: Install libbluetooth
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
apt-get update -y --fix-missing
|
sudo apt-get update -y --fix-missing
|
||||||
apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
|
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev libi2c-dev
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -39,13 +39,13 @@ jobs:
|
|||||||
run: bin/build-native.sh
|
run: bin/build-native.sh
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
- name: Store binaries as an artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-raspbian-armv7l-${{ steps.version.outputs.version }}.zip
|
name: firmware-raspbian-armv7l-${{ steps.version.outputs.long }}.zip
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
release/meshtasticd_linux_armv7l
|
release/meshtasticd_linux_armv7l
|
||||||
|
|||||||
45
.github/workflows/daily_packaging.yml
vendored
Normal file
45
.github/workflows/daily_packaging.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
name: Daily Packaging
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: 0 9 * * *
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- debian/**
|
||||||
|
- "*.rpkg"
|
||||||
|
- .github/workflows/nightly_packaging.yml
|
||||||
|
- .github/workflows/build_debian_src.yml
|
||||||
|
- .github/workflows/package_ppa.yml
|
||||||
|
- .github/workflows/package_obs.yml
|
||||||
|
- .github/workflows/hook_copr.yml
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
package-ppa:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
series: [plucky, oracular, noble, jammy]
|
||||||
|
uses: ./.github/workflows/package_ppa.yml
|
||||||
|
with:
|
||||||
|
ppa_repo: ppa:meshtastic/daily
|
||||||
|
series: ${{ matrix.series }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
package-obs:
|
||||||
|
uses: ./.github/workflows/package_obs.yml
|
||||||
|
with:
|
||||||
|
obs_project: home:meshtastic:daily
|
||||||
|
series: unstable
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
hook-copr:
|
||||||
|
uses: ./.github/workflows/hook_copr.yml
|
||||||
|
with:
|
||||||
|
copr_project: daily
|
||||||
|
secrets: inherit
|
||||||
61
.github/workflows/hook_copr.yml
vendored
Normal file
61
.github/workflows/hook_copr.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
name: Trigger COPR build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
COPR_HOOK_DAILY:
|
||||||
|
COPR_HOOK_ALPHA:
|
||||||
|
COPR_HOOK_BETA:
|
||||||
|
inputs:
|
||||||
|
copr_project:
|
||||||
|
description: COPR project to target
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-copr-hook:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
ref: ${{ github.ref }}
|
||||||
|
repository: ${{ github.repository }}
|
||||||
|
|
||||||
|
- name: Install Python dependencies
|
||||||
|
run: |
|
||||||
|
pip install requests
|
||||||
|
|
||||||
|
- name: Trigger COPR build
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import requests
|
||||||
|
|
||||||
|
project_name = "${{ inputs.copr_project }}"
|
||||||
|
if project_name == "daily":
|
||||||
|
hook_secret = "${{ secrets.COPR_HOOK_DAILY }}"
|
||||||
|
project_id = 160277
|
||||||
|
elif project_name == "alpha":
|
||||||
|
hook_secret = "${{ secrets.COPR_HOOK_ALPHA }}"
|
||||||
|
project_id = 160278
|
||||||
|
elif project_name == "beta":
|
||||||
|
hook_secret = "${{ secrets.COPR_HOOK_BETA }}"
|
||||||
|
project_id = 160279
|
||||||
|
else:
|
||||||
|
raise ValueError(f"Unknown COPR project: {project_name}")
|
||||||
|
|
||||||
|
webhook_url = f"https://copr.fedorainfracloud.org/webhooks/github/{project_id}/{hook_secret}/meshtasticd/"
|
||||||
|
copr_payload = {
|
||||||
|
"ref": "${{ github.ref }}",
|
||||||
|
"after": "${{ github.sha }}",
|
||||||
|
"repository": {
|
||||||
|
"clone_url": "${{ github.server_url }}/${{ github.repository }}.git",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
r = requests.post(webhook_url, json=copr_payload, headers={"X-GitHub-Event": "push"})
|
||||||
|
r.raise_for_status()
|
||||||
135
.github/workflows/main_matrix.yml
vendored
135
.github/workflows/main_matrix.yml
vendored
@@ -37,7 +37,7 @@ jobs:
|
|||||||
else
|
else
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} quick)
|
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} quick)
|
||||||
fi
|
fi
|
||||||
echo "Name: ${{ github.ref_name }} Base: ${{ github.base_ref }} Head: ${{ github.head_ref }} Ref: ${{ github.ref }} Targets: $TARGETS"
|
echo "Name: ${{ github.ref_name }} Base: ${{ github.base_ref }} } Ref: ${{ github.ref }} Targets: $TARGETS"
|
||||||
echo "${{matrix.arch}}=$(jq -cn --argjson environments "$TARGETS" '{board: $environments}')" >> $GITHUB_OUTPUT
|
echo "${{matrix.arch}}=$(jq -cn --argjson environments "$TARGETS" '{board: $environments}')" >> $GITHUB_OUTPUT
|
||||||
outputs:
|
outputs:
|
||||||
esp32: ${{ steps.jsonStep.outputs.esp32 }}
|
esp32: ${{ steps.jsonStep.outputs.esp32 }}
|
||||||
@@ -137,6 +137,21 @@ jobs:
|
|||||||
package-native:
|
package-native:
|
||||||
uses: ./.github/workflows/package_amd64.yml
|
uses: ./.github/workflows/package_amd64.yml
|
||||||
|
|
||||||
|
build-debian-src:
|
||||||
|
uses: ./.github/workflows/build_debian_src.yml
|
||||||
|
with:
|
||||||
|
series: UNRELEASED
|
||||||
|
build_location: local
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
test-native:
|
||||||
|
uses: ./.github/workflows/test_native.yml
|
||||||
|
|
||||||
|
build-docker:
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
uses: ./.github/workflows/build_docker.yml
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
after-checks:
|
after-checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
@@ -184,7 +199,7 @@ jobs:
|
|||||||
run: ls -R
|
run: ls -R
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Move files up
|
- name: Move files up
|
||||||
@@ -193,7 +208,7 @@ jobs:
|
|||||||
- name: Repackage in single firmware zip
|
- name: Repackage in single firmware zip
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}
|
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
./firmware-*.bin
|
./firmware-*.bin
|
||||||
@@ -203,13 +218,14 @@ jobs:
|
|||||||
./device-*.sh
|
./device-*.sh
|
||||||
./device-*.bat
|
./device-*.bat
|
||||||
./littlefs-*.bin
|
./littlefs-*.bin
|
||||||
|
./littlefswebui-*.bin
|
||||||
./bleota*bin
|
./bleota*bin
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
./Meshtastic_nRF52_factory_erase*.uf2
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}
|
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: ./output
|
path: ./output
|
||||||
|
|
||||||
@@ -223,12 +239,12 @@ jobs:
|
|||||||
chmod +x ./output/device-update.sh
|
chmod +x ./output/device-update.sh
|
||||||
|
|
||||||
- name: Zip firmware
|
- name: Zip firmware
|
||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip ./output
|
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip ./output
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
- name: Repackage in single elfs zip
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip
|
name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: ./*.elf
|
path: ./*.elf
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
@@ -236,8 +252,8 @@ jobs:
|
|||||||
- uses: scruplelesswizard/comment-artifact@main
|
- uses: scruplelesswizard/comment-artifact@main
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
with:
|
with:
|
||||||
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}
|
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}
|
||||||
description: "Download firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip. This artifact will be available for 90 days from creation"
|
description: "Download firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip. This artifact will be available for 90 days from creation"
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
release-artifacts:
|
release-artifacts:
|
||||||
@@ -251,6 +267,7 @@ jobs:
|
|||||||
package-raspbian,
|
package-raspbian,
|
||||||
package-raspbian-armv7l,
|
package-raspbian-armv7l,
|
||||||
package-native,
|
package-native,
|
||||||
|
build-debian-src,
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -262,73 +279,70 @@ jobs:
|
|||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: |
|
||||||
|
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
env:
|
||||||
|
BUILD_LOCATION: local
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: actions/create-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
id: create_release
|
id: create_release
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
release_name: Meshtastic Firmware ${{ steps.version.outputs.version }} Alpha
|
name: Meshtastic Firmware ${{ steps.version.outputs.long }} Alpha
|
||||||
tag_name: v${{ steps.version.outputs.version }}
|
tag_name: v${{ steps.version.outputs.long }}
|
||||||
body: |
|
body: |
|
||||||
Autogenerated by github action, developer should edit as required before publishing...
|
Autogenerated by github action, developer should edit as required before publishing...
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Download deb files
|
- name: Download deb files
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: meshtasticd_${{ steps.version.outputs.version }}_*.deb
|
pattern: meshtasticd_${{ steps.version.outputs.long }}_*.deb
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: ./output
|
path: ./output
|
||||||
|
|
||||||
|
- name: Download source deb
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: firmware-debian-${{ steps.version.outputs.deb }}~UNRELEASED-src
|
||||||
|
merge-multiple: true
|
||||||
|
path: ./output/debian-src
|
||||||
|
|
||||||
|
- name: Zip source deb
|
||||||
|
working-directory: output
|
||||||
|
run: zip -j -9 -r ./meshtasticd-${{ steps.version.outputs.deb }}-src.zip ./debian-src
|
||||||
|
|
||||||
# For diagnostics
|
# For diagnostics
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
run: ls -lR
|
run: ls -lR
|
||||||
|
|
||||||
- name: Add raspbian aarch64 .deb
|
- name: Add deb files to release
|
||||||
uses: actions/upload-release-asset@v1
|
run: |
|
||||||
|
gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd_${{ steps.version.outputs.long }}_arm64.deb
|
||||||
|
gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd_${{ steps.version.outputs.long }}_armhf.deb
|
||||||
|
gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd_${{ steps.version.outputs.long }}_amd64.deb
|
||||||
|
gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd-${{ steps.version.outputs.deb }}-src.zip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: ./output/meshtasticd_${{ steps.version.outputs.version }}_arm64.deb
|
|
||||||
asset_name: meshtasticd_${{ steps.version.outputs.version }}_arm64.deb
|
|
||||||
asset_content_type: application/vnd.debian.binary-package
|
|
||||||
|
|
||||||
- name: Add raspbian armv7l .deb
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: ./output/meshtasticd_${{ steps.version.outputs.version }}_armhf.deb
|
|
||||||
asset_name: meshtasticd_${{ steps.version.outputs.version }}_armhf.deb
|
|
||||||
asset_content_type: application/vnd.debian.binary-package
|
|
||||||
|
|
||||||
- name: Add raspbian amd64 .deb
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: ./output/meshtasticd_${{ steps.version.outputs.version }}_amd64.deb
|
|
||||||
asset_name: meshtasticd_${{ steps.version.outputs.version }}_amd64.deb
|
|
||||||
asset_content_type: application/vnd.debian.binary-package
|
|
||||||
|
|
||||||
- name: Bump version.properties
|
- name: Bump version.properties
|
||||||
run: >-
|
run: >-
|
||||||
bin/bump_version.py
|
bin/bump_version.py
|
||||||
|
|
||||||
|
- name: Update debian changelog
|
||||||
|
run: >-
|
||||||
|
debian/ci_changelog.sh
|
||||||
|
|
||||||
- name: Create version.properties pull request
|
- name: Create version.properties pull request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v7
|
||||||
with:
|
with:
|
||||||
title: Bump version.properties
|
title: Bump version.properties
|
||||||
add-paths: |
|
add-paths: |
|
||||||
version.properties
|
version.properties
|
||||||
|
debian/changelog
|
||||||
|
|
||||||
release-firmware:
|
release-firmware:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -348,12 +362,12 @@ jobs:
|
|||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}
|
pattern: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: ./output
|
path: ./output
|
||||||
|
|
||||||
@@ -366,37 +380,24 @@ jobs:
|
|||||||
chmod +x ./output/device-update.sh
|
chmod +x ./output/device-update.sh
|
||||||
|
|
||||||
- name: Zip firmware
|
- name: Zip firmware
|
||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip ./output
|
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip ./output
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip
|
name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: ./elfs
|
path: ./elfs
|
||||||
|
|
||||||
- name: Zip firmware
|
- name: Zip debug elfs
|
||||||
run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip ./elfs
|
run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip ./elfs
|
||||||
|
|
||||||
# For diagnostics
|
# For diagnostics
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
run: ls -lR
|
run: ls -lR
|
||||||
|
|
||||||
- name: Add bins to release
|
- name: Add bins and debug elfs to release
|
||||||
uses: actions/upload-release-asset@v1
|
run: |
|
||||||
|
gh release upload v${{ steps.version.outputs.long }} ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip
|
||||||
|
gh release upload v${{ steps.version.outputs.long }} ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
|
||||||
upload_url: ${{needs.release-artifacts.outputs.upload_url}}
|
|
||||||
asset_path: ./firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip
|
|
||||||
asset_name: firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip
|
|
||||||
asset_content_type: application/zip
|
|
||||||
|
|
||||||
- name: Add debug elfs to release
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{needs.release-artifacts.outputs.upload_url}}
|
|
||||||
asset_path: ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip
|
|
||||||
asset_name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip
|
|
||||||
asset_content_type: application/zip
|
|
||||||
|
|||||||
27
.github/workflows/package_amd64.yml
vendored
27
.github/workflows/package_amd64.yml
vendored
@@ -32,13 +32,13 @@ jobs:
|
|||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-native-${{ steps.version.outputs.version }}.zip
|
name: firmware-native-${{ steps.version.outputs.long }}.zip
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
@@ -47,35 +47,44 @@ jobs:
|
|||||||
- name: build .debpkg
|
- name: build .debpkg
|
||||||
run: |
|
run: |
|
||||||
mkdir -p .debpkg/DEBIAN
|
mkdir -p .debpkg/DEBIAN
|
||||||
mkdir -p .debpkg/usr/share/doc/meshtasticd/web
|
mkdir -p .debpkg/usr/share/meshtasticd/web
|
||||||
mkdir -p .debpkg/usr/sbin
|
mkdir -p .debpkg/usr/sbin
|
||||||
mkdir -p .debpkg/etc/meshtasticd
|
mkdir -p .debpkg/etc/meshtasticd
|
||||||
mkdir -p .debpkg/etc/meshtasticd/config.d
|
mkdir -p .debpkg/etc/meshtasticd/config.d
|
||||||
mkdir -p .debpkg/etc/meshtasticd/available.d
|
mkdir -p .debpkg/etc/meshtasticd/available.d
|
||||||
mkdir -p .debpkg/usr/lib/systemd/system/
|
mkdir -p .debpkg/usr/lib/systemd/system/
|
||||||
tar -xf build.tar -C .debpkg/usr/share/doc/meshtasticd/web
|
tar -xf build.tar -C .debpkg/usr/share/meshtasticd/web
|
||||||
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
|
shopt -s dotglob nullglob
|
||||||
|
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then mv .debpkg/usr/share/meshtasticd/web/build/* .debpkg/usr/share/meshtasticd/web/; fi
|
||||||
|
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/meshtasticd/web/build; fi
|
||||||
|
if [ -d .debpkg/usr/share/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/meshtasticd/web/.DS_Store; fi
|
||||||
|
gunzip .debpkg/usr/share/meshtasticd/web/ -r
|
||||||
cp release/meshtasticd_linux_x86_64 .debpkg/usr/sbin/meshtasticd
|
cp release/meshtasticd_linux_x86_64 .debpkg/usr/sbin/meshtasticd
|
||||||
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
|
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
|
||||||
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/
|
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
|
||||||
chmod +x .debpkg/usr/sbin/meshtasticd
|
chmod +x .debpkg/usr/sbin/meshtasticd
|
||||||
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
|
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
|
||||||
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
|
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
|
||||||
chmod +x .debpkg/DEBIAN/conffiles
|
chmod +x .debpkg/DEBIAN/conffiles
|
||||||
|
# Transition /usr/share/doc/meshtasticd to /usr/share/meshtasticd
|
||||||
|
echo "rm -rf /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/preinst
|
||||||
|
chmod +x .debpkg/DEBIAN/preinst
|
||||||
|
echo "ln -sf /usr/share/meshtasticd /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/postinst
|
||||||
|
chmod +x .debpkg/DEBIAN/postinst
|
||||||
|
|
||||||
- uses: jiro4989/build-deb-action@v3
|
- uses: jiro4989/build-deb-action@v3
|
||||||
with:
|
with:
|
||||||
package: meshtasticd
|
package: meshtasticd
|
||||||
package_root: .debpkg
|
package_root: .debpkg
|
||||||
maintainer: Jonathan Bennett
|
maintainer: Jonathan Bennett
|
||||||
version: ${{ steps.version.outputs.version }} # refs/tags/v*.*.*
|
version: ${{ steps.version.outputs.long }} # refs/tags/v*.*.*
|
||||||
arch: amd64
|
arch: amd64
|
||||||
depends: libyaml-cpp0.7, openssl, libulfius2.7
|
depends: libyaml-cpp0.7, openssl, libulfius2.7, libi2c0
|
||||||
desc: Native Linux Meshtastic binary.
|
desc: Native Linux Meshtastic binary.
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: meshtasticd_${{ steps.version.outputs.version }}_amd64.deb
|
name: meshtasticd_${{ steps.version.outputs.long }}_amd64.deb
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
./*.deb
|
./*.deb
|
||||||
|
|||||||
110
.github/workflows/package_obs.yml
vendored
Normal file
110
.github/workflows/package_obs.yml
vendored
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
name: Package for OpenSUSE Build Service
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
OBS_PASSWORD:
|
||||||
|
required: true
|
||||||
|
PPA_GPG_PRIVATE_KEY:
|
||||||
|
required: true
|
||||||
|
inputs:
|
||||||
|
obs_project:
|
||||||
|
description: Meshtastic OBS project to target
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
series:
|
||||||
|
description: Debian series to target
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-debian-src:
|
||||||
|
uses: ./.github/workflows/build_debian_src.yml
|
||||||
|
secrets: inherit
|
||||||
|
with:
|
||||||
|
series: ${{ inputs.series }}
|
||||||
|
build_location: obs
|
||||||
|
|
||||||
|
package-obs:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
needs: build-debian-src
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
path: meshtasticd
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Install OpenSUSE Build Service deps
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo 'deb http://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_24.04/ /' | sudo tee /etc/apt/sources.list.d/openSUSE:Tools.list
|
||||||
|
curl -fsSL https://download.opensuse.org/repositories/openSUSE:Tools/xUbuntu_24.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/openSUSE_Tools.gpg > /dev/null
|
||||||
|
sudo apt-get update -y --fix-missing
|
||||||
|
sudo apt-get install -y osc
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
working-directory: meshtasticd
|
||||||
|
run: |
|
||||||
|
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
||||||
|
env:
|
||||||
|
BUILD_LOCATION: obs
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -lah
|
||||||
|
|
||||||
|
- name: Configure osc
|
||||||
|
env:
|
||||||
|
OBS_USERNAME: meshtastic
|
||||||
|
run: |
|
||||||
|
# Setup OpenSUSE Build Service credentials
|
||||||
|
mkdir -p ~/.config/osc
|
||||||
|
echo "[general]" > ~/.config/osc/oscrc
|
||||||
|
echo "apiurl=https://api.opensuse.org" >> ~/.config/osc/oscrc
|
||||||
|
echo "[https://api.opensuse.org]" >> ~/.config/osc/oscrc
|
||||||
|
echo "user=${{ env.OBS_USERNAME }}" >> ~/.config/osc/oscrc
|
||||||
|
echo "pass=${{ secrets.OBS_PASSWORD }}" >> ~/.config/osc/oscrc
|
||||||
|
echo "credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager" >> ~/.config/osc/oscrc
|
||||||
|
# Create a temporary directory for osc checkout
|
||||||
|
mkdir -p osc
|
||||||
|
|
||||||
|
# Intentionally fail if credentials are invalid
|
||||||
|
# Update secrets if this returns `401`
|
||||||
|
- name: Verify OBS authentication
|
||||||
|
run: osc token
|
||||||
|
|
||||||
|
- name: Upload package to OBS
|
||||||
|
shell: bash
|
||||||
|
working-directory: osc
|
||||||
|
env:
|
||||||
|
OBS_PROJECT: ${{ inputs.obs_project }}
|
||||||
|
OBS_PACKAGE: meshtasticd
|
||||||
|
run: |
|
||||||
|
# Initialize the package in the current directory
|
||||||
|
osc checkout --output-dir . $OBS_PROJECT $OBS_PACKAGE
|
||||||
|
|
||||||
|
# Remove the existing package files
|
||||||
|
rm -rf *.dsc *.tar.xz
|
||||||
|
|
||||||
|
# Copy new package files to the directory
|
||||||
|
cp $GITHUB_WORKSPACE/*.dsc .
|
||||||
|
cp $GITHUB_WORKSPACE/*.tar.xz .
|
||||||
|
|
||||||
|
# Add/Remove the files
|
||||||
|
osc addremove
|
||||||
|
|
||||||
|
# Commit changes and push to OpenSUSE Build Service
|
||||||
|
osc commit -m "GitHub Actions: ${{ steps.version.outputs.deb }}~${{ inputs.series }}"
|
||||||
74
.github/workflows/package_ppa.yml
vendored
Normal file
74
.github/workflows/package_ppa.yml
vendored
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
name: Package for Launchpad PPA
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
PPA_GPG_PRIVATE_KEY:
|
||||||
|
required: true
|
||||||
|
inputs:
|
||||||
|
ppa_repo:
|
||||||
|
description: Meshtastic PPA to target
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
series:
|
||||||
|
description: Ubuntu series to target
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-debian-src:
|
||||||
|
uses: ./.github/workflows/build_debian_src.yml
|
||||||
|
secrets: inherit
|
||||||
|
with:
|
||||||
|
series: ${{ inputs.series }}
|
||||||
|
build_location: ppa
|
||||||
|
|
||||||
|
package-ppa:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
needs: build-debian-src
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
path: meshtasticd
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -y --fix-missing
|
||||||
|
sudo apt-get install -y dput
|
||||||
|
|
||||||
|
- name: Import GPG key
|
||||||
|
uses: crazy-max/ghaction-import-gpg@v6
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
||||||
|
id: gpg
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
working-directory: meshtasticd
|
||||||
|
run: |
|
||||||
|
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
||||||
|
env:
|
||||||
|
BUILD_LOCATION: ppa
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -lah
|
||||||
|
|
||||||
|
- name: Publish with dput
|
||||||
|
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
||||||
|
run: |
|
||||||
|
dput ${{ inputs.ppa_repo }} meshtasticd_${{ steps.version.outputs.deb }}~${{ inputs.series }}_source.changes
|
||||||
27
.github/workflows/package_raspbian.yml
vendored
27
.github/workflows/package_raspbian.yml
vendored
@@ -32,13 +32,13 @@ jobs:
|
|||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-raspbian-${{ steps.version.outputs.version }}.zip
|
name: firmware-raspbian-${{ steps.version.outputs.long }}.zip
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
@@ -47,35 +47,44 @@ jobs:
|
|||||||
- name: build .debpkg
|
- name: build .debpkg
|
||||||
run: |
|
run: |
|
||||||
mkdir -p .debpkg/DEBIAN
|
mkdir -p .debpkg/DEBIAN
|
||||||
mkdir -p .debpkg/usr/share/doc/meshtasticd/web
|
mkdir -p .debpkg/usr/share/meshtasticd/web
|
||||||
mkdir -p .debpkg/usr/sbin
|
mkdir -p .debpkg/usr/sbin
|
||||||
mkdir -p .debpkg/etc/meshtasticd
|
mkdir -p .debpkg/etc/meshtasticd
|
||||||
mkdir -p .debpkg/etc/meshtasticd/config.d
|
mkdir -p .debpkg/etc/meshtasticd/config.d
|
||||||
mkdir -p .debpkg/etc/meshtasticd/available.d
|
mkdir -p .debpkg/etc/meshtasticd/available.d
|
||||||
mkdir -p .debpkg/usr/lib/systemd/system/
|
mkdir -p .debpkg/usr/lib/systemd/system/
|
||||||
tar -xf build.tar -C .debpkg/usr/share/doc/meshtasticd/web
|
tar -xf build.tar -C .debpkg/usr/share/meshtasticd/web
|
||||||
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
|
shopt -s dotglob nullglob
|
||||||
|
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then mv .debpkg/usr/share/meshtasticd/web/build/* .debpkg/usr/share/meshtasticd/web/; fi
|
||||||
|
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/meshtasticd/web/build; fi
|
||||||
|
if [ -d .debpkg/usr/share/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/meshtasticd/web/.DS_Store; fi
|
||||||
|
gunzip .debpkg/usr/share/meshtasticd/web/ -r
|
||||||
cp release/meshtasticd_linux_aarch64 .debpkg/usr/sbin/meshtasticd
|
cp release/meshtasticd_linux_aarch64 .debpkg/usr/sbin/meshtasticd
|
||||||
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
|
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
|
||||||
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/
|
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
|
||||||
chmod +x .debpkg/usr/sbin/meshtasticd
|
chmod +x .debpkg/usr/sbin/meshtasticd
|
||||||
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
|
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
|
||||||
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
|
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
|
||||||
chmod +x .debpkg/DEBIAN/conffiles
|
chmod +x .debpkg/DEBIAN/conffiles
|
||||||
|
# Transition /usr/share/doc/meshtasticd to /usr/share/meshtasticd
|
||||||
|
echo "rm -rf /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/preinst
|
||||||
|
chmod +x .debpkg/DEBIAN/preinst
|
||||||
|
echo "ln -sf /usr/share/meshtasticd /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/postinst
|
||||||
|
chmod +x .debpkg/DEBIAN/postinst
|
||||||
|
|
||||||
- uses: jiro4989/build-deb-action@v3
|
- uses: jiro4989/build-deb-action@v3
|
||||||
with:
|
with:
|
||||||
package: meshtasticd
|
package: meshtasticd
|
||||||
package_root: .debpkg
|
package_root: .debpkg
|
||||||
maintainer: Jonathan Bennett
|
maintainer: Jonathan Bennett
|
||||||
version: ${{ steps.version.outputs.version }} # refs/tags/v*.*.*
|
version: ${{ steps.version.outputs.long }} # refs/tags/v*.*.*
|
||||||
arch: arm64
|
arch: arm64
|
||||||
depends: libyaml-cpp0.7, openssl, libulfius2.7
|
depends: libyaml-cpp0.7, openssl, libulfius2.7, libi2c0
|
||||||
desc: Native Linux Meshtastic binary.
|
desc: Native Linux Meshtastic binary.
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: meshtasticd_${{ steps.version.outputs.version }}_arm64.deb
|
name: meshtasticd_${{ steps.version.outputs.long }}_arm64.deb
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
./*.deb
|
./*.deb
|
||||||
|
|||||||
27
.github/workflows/package_raspbian_armv7l.yml
vendored
27
.github/workflows/package_raspbian_armv7l.yml
vendored
@@ -32,13 +32,13 @@ jobs:
|
|||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-raspbian-armv7l-${{ steps.version.outputs.version }}.zip
|
name: firmware-raspbian-armv7l-${{ steps.version.outputs.long }}.zip
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
@@ -47,35 +47,44 @@ jobs:
|
|||||||
- name: build .debpkg
|
- name: build .debpkg
|
||||||
run: |
|
run: |
|
||||||
mkdir -p .debpkg/DEBIAN
|
mkdir -p .debpkg/DEBIAN
|
||||||
mkdir -p .debpkg/usr/share/doc/meshtasticd/web
|
mkdir -p .debpkg/usr/share/meshtasticd/web
|
||||||
mkdir -p .debpkg/usr/sbin
|
mkdir -p .debpkg/usr/sbin
|
||||||
mkdir -p .debpkg/etc/meshtasticd
|
mkdir -p .debpkg/etc/meshtasticd
|
||||||
mkdir -p .debpkg/etc/meshtasticd/config.d
|
mkdir -p .debpkg/etc/meshtasticd/config.d
|
||||||
mkdir -p .debpkg/etc/meshtasticd/available.d
|
mkdir -p .debpkg/etc/meshtasticd/available.d
|
||||||
mkdir -p .debpkg/usr/lib/systemd/system/
|
mkdir -p .debpkg/usr/lib/systemd/system/
|
||||||
tar -xf build.tar -C .debpkg/usr/share/doc/meshtasticd/web
|
tar -xf build.tar -C .debpkg/usr/share/meshtasticd/web
|
||||||
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
|
shopt -s dotglob nullglob
|
||||||
|
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then mv .debpkg/usr/share/meshtasticd/web/build/* .debpkg/usr/share/meshtasticd/web/; fi
|
||||||
|
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/meshtasticd/web/build; fi
|
||||||
|
if [ -d .debpkg/usr/share/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/meshtasticd/web/.DS_Store; fi
|
||||||
|
gunzip .debpkg/usr/share/meshtasticd/web/ -r
|
||||||
cp release/meshtasticd_linux_armv7l .debpkg/usr/sbin/meshtasticd
|
cp release/meshtasticd_linux_armv7l .debpkg/usr/sbin/meshtasticd
|
||||||
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
|
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
|
||||||
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/
|
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
|
||||||
chmod +x .debpkg/usr/sbin/meshtasticd
|
chmod +x .debpkg/usr/sbin/meshtasticd
|
||||||
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
|
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
|
||||||
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
|
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
|
||||||
chmod +x .debpkg/DEBIAN/conffiles
|
chmod +x .debpkg/DEBIAN/conffiles
|
||||||
|
# Transition /usr/share/doc/meshtasticd to /usr/share/meshtasticd
|
||||||
|
echo "rm -rf /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/preinst
|
||||||
|
chmod +x .debpkg/DEBIAN/preinst
|
||||||
|
echo "ln -sf /usr/share/meshtasticd /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/postinst
|
||||||
|
chmod +x .debpkg/DEBIAN/postinst
|
||||||
|
|
||||||
- uses: jiro4989/build-deb-action@v3
|
- uses: jiro4989/build-deb-action@v3
|
||||||
with:
|
with:
|
||||||
package: meshtasticd
|
package: meshtasticd
|
||||||
package_root: .debpkg
|
package_root: .debpkg
|
||||||
maintainer: Jonathan Bennett
|
maintainer: Jonathan Bennett
|
||||||
version: ${{ steps.version.outputs.version }} # refs/tags/v*.*.*
|
version: ${{ steps.version.outputs.long }} # refs/tags/v*.*.*
|
||||||
arch: armhf
|
arch: armhf
|
||||||
depends: libyaml-cpp0.7, openssl, libulfius2.7
|
depends: libyaml-cpp0.7, openssl, libulfius2.7, libi2c0
|
||||||
desc: Native Linux Meshtastic binary.
|
desc: Native Linux Meshtastic binary.
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: meshtasticd_${{ steps.version.outputs.version }}_armhf.deb
|
name: meshtasticd_${{ steps.version.outputs.long }}_armhf.deb
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
./*.deb
|
./*.deb
|
||||||
|
|||||||
38
.github/workflows/release_channels.yml
vendored
Normal file
38
.github/workflows/release_channels.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: Trigger release workflows upon Publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published, released]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
package-ppa:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
series: [plucky, oracular, noble, jammy]
|
||||||
|
uses: ./.github/workflows/package_ppa.yml
|
||||||
|
with:
|
||||||
|
ppa_repo: |-
|
||||||
|
ppa:meshtastic/${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
||||||
|
series: ${{ matrix.series }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
package-obs:
|
||||||
|
uses: ./.github/workflows/package_obs.yml
|
||||||
|
with:
|
||||||
|
obs_project: |-
|
||||||
|
home:meshtastic:${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
||||||
|
series: |-
|
||||||
|
${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
# hook-copr:
|
||||||
|
# uses: ./.github/workflows/hook_copr.yml
|
||||||
|
# with:
|
||||||
|
# copr_project: |-
|
||||||
|
# ${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
||||||
|
# secrets: inherit
|
||||||
169
.github/workflows/test_native.yml
vendored
Normal file
169
.github/workflows/test_native.yml
vendored
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
name: Run Tests on Native platform
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
env:
|
||||||
|
LCOV_CAPTURE_FLAGS: --quiet --capture --include "${PWD}/src/*" --exclude '*/src/mesh/generated/*' --directory .pio/build/coverage/src --base-directory "${PWD}"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
simulator-tests:
|
||||||
|
name: Native Simulator Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup native build
|
||||||
|
id: base
|
||||||
|
uses: ./.github/actions/setup-native
|
||||||
|
|
||||||
|
- name: Install simulator dependencies
|
||||||
|
run: pip install -U dotmap
|
||||||
|
|
||||||
|
# We now run integration test before other build steps (to quickly see runtime failures)
|
||||||
|
- name: Build for native/coverage
|
||||||
|
run: platformio run -e coverage
|
||||||
|
|
||||||
|
- name: Capture initial coverage information
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y lcov
|
||||||
|
lcov ${{ env.LCOV_CAPTURE_FLAGS }} --initial --output-file coverage_base.info
|
||||||
|
sed -i -e "s#${PWD}#.#" coverage_base.info # Make paths relative.
|
||||||
|
|
||||||
|
- name: Integration test
|
||||||
|
run: |
|
||||||
|
.pio/build/coverage/program &
|
||||||
|
PID=$!
|
||||||
|
timeout 20 bash -c "until ls -al /proc/$PID/fd | grep socket; do sleep 1; done"
|
||||||
|
echo "Simulator started, launching python test..."
|
||||||
|
python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
|
||||||
|
wait
|
||||||
|
|
||||||
|
- name: Capture coverage information
|
||||||
|
if: always() # run this step even if previous step failed
|
||||||
|
run: |
|
||||||
|
lcov ${{ env.LCOV_CAPTURE_FLAGS }} --test-name integration --output-file coverage_integration.info
|
||||||
|
sed -i -e "s#${PWD}#.#" coverage_integration.info # Make paths relative.
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
if: always() # run this step even if previous step failed
|
||||||
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Save coverage information
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
if: always() # run this step even if previous step failed
|
||||||
|
with:
|
||||||
|
name: lcov-coverage-info-native-simulator-test-${{ steps.version.outputs.long }}.zip
|
||||||
|
overwrite: true
|
||||||
|
path: ./coverage_*.info
|
||||||
|
|
||||||
|
platformio-tests:
|
||||||
|
name: Native PlatformIO Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup native build
|
||||||
|
id: base
|
||||||
|
uses: ./.github/actions/setup-native
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
# Disable (comment-out) BUILD_EPOCH. It causes a full rebuild between tests and resets the
|
||||||
|
# coverage information each time.
|
||||||
|
- name: Disable BUILD_EPOCH
|
||||||
|
run: sed -i 's/-DBUILD_EPOCH=$UNIX_TIME/#-DBUILD_EPOCH=$UNIX_TIME/' platformio.ini
|
||||||
|
|
||||||
|
- name: PlatformIO Tests
|
||||||
|
run: platformio test -e coverage -v --junit-output-path testreport.xml
|
||||||
|
|
||||||
|
- name: Save test results
|
||||||
|
if: always() # run this step even if previous step failed
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: platformio-test-report-${{ steps.version.outputs.long }}.zip
|
||||||
|
overwrite: true
|
||||||
|
path: ./testreport.xml
|
||||||
|
|
||||||
|
- name: Capture coverage information
|
||||||
|
if: always() # run this step even if previous step failed
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y lcov
|
||||||
|
lcov ${{ env.LCOV_CAPTURE_FLAGS }} --test-name tests --output-file coverage_tests.info
|
||||||
|
sed -i -e "s#${PWD}#.#" coverage_tests.info # Make paths relative.
|
||||||
|
|
||||||
|
- name: Save coverage information
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
if: always() # run this step even if previous step failed
|
||||||
|
with:
|
||||||
|
name: lcov-coverage-info-native-platformio-tests-${{ steps.version.outputs.long }}.zip
|
||||||
|
overwrite: true
|
||||||
|
path: ./coverage_*.info
|
||||||
|
|
||||||
|
generate-reports:
|
||||||
|
name: Generate Test Reports
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions: # Needed for dorny/test-reporter.
|
||||||
|
contents: read
|
||||||
|
actions: read
|
||||||
|
checks: write
|
||||||
|
needs:
|
||||||
|
- simulator-tests
|
||||||
|
- platformio-tests
|
||||||
|
if: always()
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Download test artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: platformio-test-report-${{ steps.version.outputs.long }}.zip
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Test Report
|
||||||
|
uses: dorny/test-reporter@v1.9.1
|
||||||
|
with:
|
||||||
|
name: PlatformIO Tests
|
||||||
|
path: testreport.xml
|
||||||
|
reporter: java-junit
|
||||||
|
|
||||||
|
- name: Download coverage artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: lcov-coverage-info-native-*-${{ steps.version.outputs.long }}.zip
|
||||||
|
path: code-coverage-report
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Generate Code Coverage Report
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y lcov
|
||||||
|
lcov --quiet --add-tracefile code-coverage-report/coverage_base.info --add-tracefile code-coverage-report/coverage_integration.info --add-tracefile code-coverage-report/coverage_tests.info --output-file code-coverage-report/coverage_src.info
|
||||||
|
genhtml --quiet --legend --prefix "${PWD}" code-coverage-report/coverage_src.info --output-directory code-coverage-report
|
||||||
|
|
||||||
|
- name: Save Code Coverage Report
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: code-coverage-report-${{ steps.version.outputs.long }}.zip
|
||||||
|
path: code-coverage-report
|
||||||
51
.github/workflows/tests.yml
vendored
51
.github/workflows/tests.yml
vendored
@@ -6,55 +6,8 @@ on:
|
|||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-simulator:
|
native-tests:
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/test_native.yml
|
||||||
steps:
|
|
||||||
- name: Install libbluetooth
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get update --fix-missing
|
|
||||||
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
|
|
||||||
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Upgrade python tools
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U platformio adafruit-nrfutil
|
|
||||||
pip install -U meshtastic --pre
|
|
||||||
|
|
||||||
- name: Upgrade platformio
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
pio upgrade
|
|
||||||
|
|
||||||
- name: Build Native
|
|
||||||
run: bin/build-native.sh
|
|
||||||
|
|
||||||
# We now run integration test before other build steps (to quickly see runtime failures)
|
|
||||||
- name: Build for native
|
|
||||||
run: platformio run -e native
|
|
||||||
|
|
||||||
- name: Integration test
|
|
||||||
run: |
|
|
||||||
.pio/build/native/program & sleep 10 # 5 seconds was not enough
|
|
||||||
echo "Simulator started, launching python test..."
|
|
||||||
python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
|
|
||||||
|
|
||||||
- name: PlatformIO Tests
|
|
||||||
run: platformio test -e native --junit-output-path testreport.xml
|
|
||||||
|
|
||||||
- name: Test Report
|
|
||||||
uses: dorny/test-reporter@v1.9.1
|
|
||||||
if: success() || failure() # run this step even if previous step failed
|
|
||||||
with:
|
|
||||||
name: PlatformIO Tests
|
|
||||||
path: testreport.xml
|
|
||||||
reporter: java-junit
|
|
||||||
|
|
||||||
hardware-tests:
|
hardware-tests:
|
||||||
runs-on: test-runner
|
runs-on: test-runner
|
||||||
|
|||||||
6
.github/workflows/trunk_format_pr.yml
vendored
6
.github/workflows/trunk_format_pr.yml
vendored
@@ -22,12 +22,16 @@ jobs:
|
|||||||
- name: Run Trunk Fmt
|
- name: Run Trunk Fmt
|
||||||
run: trunk fmt
|
run: trunk fmt
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
- name: Commit and push changes
|
- name: Commit and push changes
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Add firmware version ${{ steps.version.outputs.version }}"
|
git commit -m "Add firmware version ${{ steps.version.outputs.long }}"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
- name: Comment on PR
|
- name: Comment on PR
|
||||||
|
|||||||
7
.github/workflows/update_protobufs.yml
vendored
7
.github/workflows/update_protobufs.yml
vendored
@@ -12,14 +12,15 @@ jobs:
|
|||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Update submodule
|
- name: Update submodule
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
run: |
|
run: |
|
||||||
git submodule update --remote protobufs
|
git submodule update --remote protobufs
|
||||||
|
|
||||||
- name: Download nanopb
|
- name: Download nanopb
|
||||||
run: |
|
run: |
|
||||||
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.9-linux-x86.tar.gz
|
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.9.1-linux-x86.tar.gz
|
||||||
tar xvzf nanopb-0.4.9-linux-x86.tar.gz
|
tar xvzf nanopb-0.4.9.1-linux-x86.tar.gz
|
||||||
mv nanopb-0.4.9-linux-x86 nanopb-0.4.9
|
mv nanopb-0.4.9.1-linux-x86 nanopb-0.4.9
|
||||||
|
|
||||||
- name: Re-generate protocol buffers
|
- name: Re-generate protocol buffers
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,4 +1,8 @@
|
|||||||
.pio
|
.pio
|
||||||
|
pio
|
||||||
|
pio.tar
|
||||||
|
web
|
||||||
|
web.tar
|
||||||
|
|
||||||
# ignore vscode IDE settings files
|
# ignore vscode IDE settings files
|
||||||
.vscode/*
|
.vscode/*
|
||||||
@@ -30,4 +34,4 @@ release/
|
|||||||
.vscode/extensions.json
|
.vscode/extensions.json
|
||||||
/compile_commands.json
|
/compile_commands.json
|
||||||
src/mesh/raspihttp/certificate.pem
|
src/mesh/raspihttp/certificate.pem
|
||||||
src/mesh/raspihttp/private_key.pem
|
src/mesh/raspihttp/private_key.pem
|
||||||
@@ -1,36 +1,37 @@
|
|||||||
version: 0.1
|
version: 0.1
|
||||||
cli:
|
cli:
|
||||||
version: 1.22.7
|
version: 1.22.8
|
||||||
plugins:
|
plugins:
|
||||||
sources:
|
sources:
|
||||||
- id: trunk
|
- id: trunk
|
||||||
ref: v1.6.4
|
ref: v1.6.6
|
||||||
uri: https://github.com/trunk-io/plugins
|
uri: https://github.com/trunk-io/plugins
|
||||||
lint:
|
lint:
|
||||||
enabled:
|
enabled:
|
||||||
- trufflehog@3.83.2
|
- prettier@3.4.2
|
||||||
|
- trufflehog@3.86.1
|
||||||
- yamllint@1.35.1
|
- yamllint@1.35.1
|
||||||
- bandit@1.7.10
|
- bandit@1.8.0
|
||||||
- checkov@3.2.277
|
- checkov@3.2.334
|
||||||
- terrascan@1.19.9
|
- terrascan@1.19.9
|
||||||
- trivy@0.56.2
|
- trivy@0.58.0
|
||||||
#- trufflehog@3.63.2-rc0
|
#- trufflehog@3.63.2-rc0
|
||||||
- taplo@0.9.3
|
- taplo@0.9.3
|
||||||
- ruff@0.7.2
|
- ruff@0.8.3
|
||||||
- isort@5.13.2
|
- isort@5.13.2
|
||||||
- markdownlint@0.42.0
|
- markdownlint@0.43.0
|
||||||
- oxipng@9.1.2
|
- oxipng@9.1.3
|
||||||
- svgo@3.3.2
|
- svgo@3.3.2
|
||||||
- actionlint@1.7.3
|
- actionlint@1.7.4
|
||||||
- flake8@7.1.1
|
- flake8@7.1.1
|
||||||
- hadolint@2.12.0
|
- hadolint@2.12.1-beta
|
||||||
- shfmt@3.6.0
|
- shfmt@3.6.0
|
||||||
- shellcheck@0.10.0
|
- shellcheck@0.10.0
|
||||||
- black@24.10.0
|
- black@24.10.0
|
||||||
- git-diff-check
|
- git-diff-check
|
||||||
- gitleaks@8.21.1
|
- gitleaks@8.21.2
|
||||||
- clang-format@16.0.3
|
- clang-format@16.0.3
|
||||||
- prettier@3.3.3
|
#- prettier@3.3.3
|
||||||
ignore:
|
ignore:
|
||||||
- linters: [ALL]
|
- linters: [ALL]
|
||||||
paths:
|
paths:
|
||||||
@@ -39,7 +40,7 @@ runtimes:
|
|||||||
enabled:
|
enabled:
|
||||||
- python@3.10.8
|
- python@3.10.8
|
||||||
- go@1.21.0
|
- go@1.21.0
|
||||||
- node@18.12.1
|
- node@18.20.5
|
||||||
actions:
|
actions:
|
||||||
disabled:
|
disabled:
|
||||||
- trunk-announce
|
- trunk-announce
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Contributor Covenant Code of Conduct
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
The Meshtastic Firmware project is subject to the code of conduct for the parent project, which can be found here:
|
The Meshtastic Firmware project is subject to the code of conduct for the parent project, which can be found here:
|
||||||
https://meshtastic.org/docs/legal/conduct/
|
https://meshtastic.org/docs/legal/conduct/
|
||||||
|
|||||||
72
Dockerfile
72
Dockerfile
@@ -1,32 +1,29 @@
|
|||||||
FROM debian:bookworm-slim AS builder
|
# trunk-ignore-all(terrascan/AC_DOCKER_0002): Known terrascan issue
|
||||||
|
# trunk-ignore-all(hadolint/DL3008): Use latest version of apt packages for buildchain
|
||||||
|
# trunk-ignore-all(trivy/DS002): We must run as root for this container
|
||||||
|
# trunk-ignore-all(checkov/CKV_DOCKER_8): We must run as root for this container
|
||||||
|
# trunk-ignore-all(hadolint/DL3002): We must run as root for this container
|
||||||
|
|
||||||
|
FROM python:3.12-bookworm AS builder
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV TZ=Etc/UTC
|
ENV TZ=Etc/UTC
|
||||||
|
|
||||||
# http://bugs.python.org/issue19846
|
# Install Dependencies
|
||||||
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
|
ENV PIP_ROOT_USER_ACTION=ignore
|
||||||
ENV LANG C.UTF-8
|
RUN apt-get update && apt-get install --no-install-recommends -y wget g++ zip git ca-certificates \
|
||||||
|
libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev \
|
||||||
# Install build deps
|
libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev pkg-config && \
|
||||||
USER root
|
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||||
|
pip install --no-cache-dir -U platformio==6.1.16 && \
|
||||||
# trunk-ignore(terrascan/AC_DOCKER_0002): Known terrascan issue
|
mkdir /tmp/firmware
|
||||||
# trunk-ignore(hadolint/DL3008): Use latest version of packages for buildchain
|
|
||||||
RUN apt-get update && apt-get install --no-install-recommends -y wget python3 python3-pip python3-wheel python3-venv g++ zip git \
|
|
||||||
ca-certificates libgpiod-dev libyaml-cpp-dev libbluetooth-dev \
|
|
||||||
libulfius-dev liborcania-dev libssl-dev pkg-config && \
|
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/* && mkdir /tmp/firmware
|
|
||||||
|
|
||||||
RUN groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh && chown mesh:mesh /tmp/firmware
|
|
||||||
USER mesh
|
|
||||||
|
|
||||||
|
# Copy source code
|
||||||
WORKDIR /tmp/firmware
|
WORKDIR /tmp/firmware
|
||||||
RUN python3 -m venv /tmp/firmware
|
COPY . /tmp/firmware
|
||||||
RUN bash -o pipefail -c "source bin/activate; pip3 install --no-cache-dir -U platformio==6.1.15"
|
|
||||||
# trunk-ignore(terrascan/AC_DOCKER_00024): We would actually like these files to be owned by mesh tyvm
|
# Build
|
||||||
COPY --chown=mesh:mesh . /tmp/firmware
|
RUN bash ./bin/build-native.sh && \
|
||||||
RUN bash -o pipefail -c "source ./bin/activate && bash ./bin/build-native.sh"
|
cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"
|
||||||
RUN cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"
|
|
||||||
|
|
||||||
|
|
||||||
##### PRODUCTION BUILD #############
|
##### PRODUCTION BUILD #############
|
||||||
@@ -35,20 +32,25 @@ FROM debian:bookworm-slim
|
|||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV TZ=Etc/UTC
|
ENV TZ=Etc/UTC
|
||||||
|
|
||||||
# trunk-ignore(terrascan/AC_DOCKER_0002): Known terrascan issue
|
# nosemgrep: dockerfile.security.last-user-is-root.last-user-is-root
|
||||||
# trunk-ignore(hadolint/DL3008): Use latest version of packages for buildchain
|
USER root
|
||||||
RUN apt-get update && apt-get --no-install-recommends -y install libc-bin libc6 libgpiod2 libyaml-cpp0.7 libulfius2.7 liborcania2.3 libssl3 && \
|
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh
|
RUN apt-get update && apt-get --no-install-recommends -y install libc-bin libc6 libgpiod2 libyaml-cpp0.7 libi2c0 libulfius2.7 libusb-1.0-0-dev liborcania2.3 libssl3 && \
|
||||||
USER mesh
|
apt-get clean && rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& mkdir -p /var/lib/meshtasticd \
|
||||||
|
&& mkdir -p /etc/meshtasticd/config.d
|
||||||
|
|
||||||
WORKDIR /home/mesh
|
# Fetch compiled binary from the builder
|
||||||
COPY --from=builder /tmp/firmware/release/meshtasticd /home/mesh/
|
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/
|
||||||
|
# Copy config templates
|
||||||
|
COPY ./bin/config.d /etc/meshtasticd/available.d
|
||||||
|
|
||||||
RUN mkdir data
|
WORKDIR /var/lib/meshtasticd
|
||||||
VOLUME /home/mesh/data
|
VOLUME /var/lib/meshtasticd
|
||||||
|
|
||||||
CMD [ "sh", "-cx", "./meshtasticd -d /home/mesh/data --hwid=${HWID:-$RANDOM}" ]
|
# Expose Meshtastic TCP API port from the host
|
||||||
|
EXPOSE 4403
|
||||||
|
|
||||||
HEALTHCHECK NONE
|
CMD [ "sh", "-cx", "meshtasticd -d /var/lib/meshtasticd" ]
|
||||||
|
|
||||||
|
HEALTHCHECK NONE
|
||||||
42
alpine.Dockerfile
Normal file
42
alpine.Dockerfile
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# trunk-ignore-all(trivy/DS002): We must run as root for this container
|
||||||
|
# trunk-ignore-all(checkov/CKV_DOCKER_8): We must run as root for this container
|
||||||
|
# trunk-ignore-all(hadolint/DL3002): We must run as root for this container
|
||||||
|
|
||||||
|
FROM python:3.12-alpine3.21 AS builder
|
||||||
|
|
||||||
|
ENV PIP_ROOT_USER_ACTION=ignore
|
||||||
|
RUN apk add bash g++ libstdc++-dev linux-headers zip git ca-certificates libgpiod-dev yaml-cpp-dev bluez-dev \
|
||||||
|
libusb-dev i2c-tools-dev openssl-dev pkgconf argp-standalone && \
|
||||||
|
pip install --no-cache-dir -U platformio==6.1.16 && \
|
||||||
|
mkdir /tmp/firmware
|
||||||
|
|
||||||
|
WORKDIR /tmp/firmware
|
||||||
|
COPY . /tmp/firmware
|
||||||
|
|
||||||
|
# Create small package (no debugging symbols)
|
||||||
|
# Add `argp` for musl
|
||||||
|
ENV PLATFORMIO_BUILD_FLAGS="-Os -ffunction-sections -fdata-sections -Wl,--gc-sections -largp"
|
||||||
|
|
||||||
|
RUN bash ./bin/build-native.sh && \
|
||||||
|
cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"
|
||||||
|
|
||||||
|
# ##### PRODUCTION BUILD #############
|
||||||
|
|
||||||
|
FROM alpine:3.21
|
||||||
|
|
||||||
|
# nosemgrep: dockerfile.security.last-user-is-root.last-user-is-root
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN apk add libstdc++ libgpiod yaml-cpp libusb i2c-tools \
|
||||||
|
&& mkdir -p /var/lib/meshtasticd \
|
||||||
|
&& mkdir -p /etc/meshtasticd/config.d
|
||||||
|
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/
|
||||||
|
|
||||||
|
WORKDIR /var/lib/meshtasticd
|
||||||
|
VOLUME /var/lib/meshtasticd
|
||||||
|
|
||||||
|
EXPOSE 4403
|
||||||
|
|
||||||
|
CMD [ "sh", "-cx", "meshtasticd --fsdir=/var/lib/meshtasticd" ]
|
||||||
|
|
||||||
|
HEALTHCHECK NONE
|
||||||
@@ -43,9 +43,10 @@ lib_deps =
|
|||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
|
${radiolib_base.lib_deps}
|
||||||
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||||
h2zero/NimBLE-Arduino@^1.4.2
|
h2zero/NimBLE-Arduino@^1.4.2
|
||||||
https://github.com/dbSuS/libpax.git#7bcd3fcab75037505be9b122ab2b24cc5176b587
|
https://github.com/dbinfrago/libpax.git#3cdc0371c375676a97967547f4065607d4c53fd1
|
||||||
lewisxhe/XPowersLib@^0.2.6
|
lewisxhe/XPowersLib@^0.2.6
|
||||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||||
rweather/Crypto@^0.4.0
|
rweather/Crypto@^0.4.0
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ lib_deps =
|
|||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
|
${radiolib_base.lib_deps}
|
||||||
lewisxhe/XPowersLib@^0.2.6
|
lewisxhe/XPowersLib@^0.2.6
|
||||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||||
rweather/Crypto@^0.4.0
|
rweather/Crypto@^0.4.0
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
[nrf52_base]
|
[nrf52_base]
|
||||||
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
|
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
|
||||||
platform = platformio/nordicnrf52@^10.5.0
|
platform = platformio/nordicnrf52@^10.7.0
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform_packages =
|
platform_packages =
|
||||||
; our custom Git version until they merge our PR
|
; our custom Git version until they merge our PR
|
||||||
framework-arduinoadafruitnrf52 @ https://github.com/geeksville/Adafruit_nRF52_Arduino.git
|
framework-arduinoadafruitnrf52 @ https://github.com/geeksville/Adafruit_nRF52_Arduino.git
|
||||||
|
toolchain-gccarmnoneeabi@~1.90301.0
|
||||||
|
|
||||||
build_type = debug
|
build_type = debug
|
||||||
build_flags =
|
build_flags =
|
||||||
@@ -14,14 +15,18 @@ build_flags =
|
|||||||
-Wno-unused-variable
|
-Wno-unused-variable
|
||||||
-Isrc/platform/nrf52
|
-Isrc/platform/nrf52
|
||||||
-DLFS_NO_ASSERT ; Disable LFS assertions , see https://github.com/meshtastic/firmware/pull/3818
|
-DLFS_NO_ASSERT ; Disable LFS assertions , see https://github.com/meshtastic/firmware/pull/3818
|
||||||
|
-DMESHTASTIC_EXCLUDE_AUDIO=1
|
||||||
|
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
|
||||||
|
-DMAX_NUM_NODES=80
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<platform/stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<platform/rp2xx0> -<mesh/eth/> -<mesh/raspihttp>
|
${arduino_base.build_src_filter} -<platform/esp32/> -<platform/stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<platform/rp2xx0> -<mesh/eth/> -<mesh/raspihttp>
|
||||||
|
|
||||||
lib_deps=
|
lib_deps=
|
||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
|
${radiolib_base.lib_deps}
|
||||||
rweather/Crypto@^0.4.0
|
rweather/Crypto@^0.4.0
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
BluetoothOTA
|
BluetoothOTA
|
||||||
lvgl
|
lvgl
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
|
; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated).
|
||||||
[portduino_base]
|
[portduino_base]
|
||||||
platform = https://github.com/meshtastic/platform-native.git#bcd02436cfca91f7d28ad0f7dab977c6aaa781af
|
platform = https://github.com/meshtastic/platform-native.git#562d189828f09fbf4c4093b3c0104bae9d8e9ff9
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
@@ -23,8 +23,10 @@ build_src_filter =
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
|
${radiolib_base.lib_deps}
|
||||||
rweather/Crypto@^0.4.0
|
rweather/Crypto@^0.4.0
|
||||||
https://github.com/lovyan03/LovyanGFX.git#1401c28a47646fe00538d487adcb2eb3c72de805
|
lovyan03/LovyanGFX@^1.2.0
|
||||||
|
https://github.com/pine64/libch341-spi-userspace#a9b17e3452f7fb747000d9b4ad4409155b39f6ef
|
||||||
|
|
||||||
build_flags =
|
build_flags =
|
||||||
${arduino_base.build_flags}
|
${arduino_base.build_flags}
|
||||||
@@ -32,6 +34,10 @@ build_flags =
|
|||||||
-Isrc/platform/portduino
|
-Isrc/platform/portduino
|
||||||
-DRADIOLIB_EEPROM_UNSUPPORTED
|
-DRADIOLIB_EEPROM_UNSUPPORTED
|
||||||
-DPORTDUINO_LINUX_HARDWARE
|
-DPORTDUINO_LINUX_HARDWARE
|
||||||
|
-lpthread
|
||||||
|
-lstdc++fs
|
||||||
-lbluetooth
|
-lbluetooth
|
||||||
-lgpiod
|
-lgpiod
|
||||||
-lyaml-cpp
|
-lyaml-cpp
|
||||||
|
-li2c
|
||||||
|
-std=c++17
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
; Common settings for rp2040 Processor based targets
|
; Common settings for rp2040 Processor based targets
|
||||||
[rp2040_base]
|
[rp2040_base]
|
||||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#v1.2.0-gcc12
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico >=4.2.1
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#4.0.3
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#6024e9a7e82a72e38dd90f42029ba3748835eb2e ; 4.3.0 with fix MDNS
|
||||||
|
|
||||||
board_build.core = earlephilhower
|
board_build.core = earlephilhower
|
||||||
board_build.filesystem_size = 0.5m
|
board_build.filesystem_size = 0.5m
|
||||||
@@ -22,4 +22,5 @@ lib_ignore =
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
|
${radiolib_base.lib_deps}
|
||||||
rweather/Crypto
|
rweather/Crypto
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
; Common settings for rp2040 Processor based targets
|
; Common settings for rp2040 Processor based targets
|
||||||
[rp2350_base]
|
[rp2350_base]
|
||||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#9e55f6db5c56b9867c69fe473f388beea4546672
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico >=4.2.1
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#a6ab6e1f95bc1428d667d55ea7173c0744acc03c ; 4.0.2+
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#6024e9a7e82a72e38dd90f42029ba3748835eb2e ; 4.3.0 with fix MDNS
|
||||||
|
|
||||||
board_build.core = earlephilhower
|
board_build.core = earlephilhower
|
||||||
board_build.filesystem_size = 0.5m
|
board_build.filesystem_size = 0.5m
|
||||||
build_flags =
|
build_flags =
|
||||||
${arduino_base.build_flags} -Wno-unused-variable
|
${arduino_base.build_flags} -Wno-unused-variable -Wcast-align
|
||||||
-Isrc/platform/rp2xx0
|
-Isrc/platform/rp2xx0
|
||||||
-D__PLAT_RP2040__
|
-D__PLAT_RP2350__
|
||||||
# -D _POSIX_THREADS
|
# -D _POSIX_THREADS
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp>
|
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp> -<platform/rp2xx0/pico_sleep> -<platform/rp2xx0/hardware_rosc>
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
BluetoothOTA
|
BluetoothOTA
|
||||||
@@ -21,4 +21,5 @@ lib_ignore =
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
rweather/Crypto
|
${radiolib_base.lib_deps}
|
||||||
|
rweather/Crypto
|
||||||
@@ -30,8 +30,9 @@ upload_protocol = stlink
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
charlesbaynham/OSFS@^1.2.3
|
charlesbaynham/OSFS@^1.2.3
|
||||||
|
jgromes/RadioLib@7.0.2
|
||||||
https://github.com/caveman99/Crypto.git#f61ae26a53f7a2d0ba5511625b8bf8eff3a35d5e
|
https://github.com/caveman99/Crypto.git#f61ae26a53f7a2d0ba5511625b8bf8eff3a35d5e
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
mathertel/OneButton@~2.6.1
|
mathertel/OneButton@2.6.1
|
||||||
Wire
|
Wire
|
||||||
1
bin/.gitignore
vendored
Normal file
1
bin/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
config.yaml
|
||||||
33
bin/base64_to_hex.py
Normal file
33
bin/base64_to_hex.py
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import sys
|
||||||
|
import base64
|
||||||
|
|
||||||
|
def base64_to_hex_string(b64_string):
|
||||||
|
try:
|
||||||
|
# Decode the Base64 string to raw bytes
|
||||||
|
decoded_bytes = base64.b64decode(b64_string)
|
||||||
|
except Exception as e:
|
||||||
|
raise ValueError(f"Invalid Base64 input: {e}")
|
||||||
|
|
||||||
|
# Check if the decoded result is exactly 32 bytes
|
||||||
|
if len(decoded_bytes) != 32:
|
||||||
|
raise ValueError("Decoded Base64 input must be exactly 32 bytes.")
|
||||||
|
|
||||||
|
# Convert each byte to its hex representation
|
||||||
|
hex_values = [f"0x{byte:02x}" for byte in decoded_bytes]
|
||||||
|
|
||||||
|
# Join the formatted hex values with commas
|
||||||
|
formatted_output = "{ " + ", ".join(hex_values) + " };"
|
||||||
|
return formatted_output
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
# Check if a Base64 string was provided in command line arguments
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
print("Usage: python script.py <base64-string>")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
b64_string = sys.argv[1]
|
||||||
|
try:
|
||||||
|
formatted_hex = base64_to_hex_string(b64_string)
|
||||||
|
print(formatted_hex)
|
||||||
|
except ValueError as e:
|
||||||
|
print(e)
|
||||||
@@ -35,6 +35,11 @@ cp $SRCBIN $OUTDIR/$basename-update.bin
|
|||||||
|
|
||||||
echo "Building Filesystem for ESP32 targets"
|
echo "Building Filesystem for ESP32 targets"
|
||||||
pio run --environment $1 -t buildfs
|
pio run --environment $1 -t buildfs
|
||||||
|
cp .pio/build/$1/littlefs.bin $OUTDIR/littlefswebui-$VERSION.bin
|
||||||
|
# Remove webserver files from the filesystem and rebuild
|
||||||
|
ls -l data/static # Diagnostic list of files
|
||||||
|
rm -rf data/static
|
||||||
|
pio run --environment $1 -t buildfs
|
||||||
cp .pio/build/$1/littlefs.bin $OUTDIR/littlefs-$VERSION.bin
|
cp .pio/build/$1/littlefs.bin $OUTDIR/littlefs-$VERSION.bin
|
||||||
cp bin/device-install.* $OUTDIR
|
cp bin/device-install.* $OUTDIR
|
||||||
cp bin/device-update.* $OUTDIR
|
cp bin/device-update.* $OUTDIR
|
||||||
|
|||||||
@@ -27,5 +27,4 @@ rm -r $OUTDIR/* || true
|
|||||||
platformio pkg update --environment native || platformioFailed
|
platformio pkg update --environment native || platformioFailed
|
||||||
pio run --environment native || platformioFailed
|
pio run --environment native || platformioFailed
|
||||||
cp .pio/build/native/program "$OUTDIR/meshtasticd_linux_$(uname -m)"
|
cp .pio/build/native/program "$OUTDIR/meshtasticd_linux_$(uname -m)"
|
||||||
cp bin/device-install.* $OUTDIR
|
cp bin/native-install.* $OUTDIR
|
||||||
cp bin/device-update.* $OUTDIR
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ def write_macros_to_json(macros, output_file):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
header_file = 'userPrefs.h'
|
header_file = 'userPrefs.h'
|
||||||
output_file = 'userPrefs.json'
|
output_file = 'userPrefs.jsonc'
|
||||||
# Uncomment all macros in the header file
|
# Uncomment all macros in the header file
|
||||||
with open(header_file, 'r') as file:
|
with open(header_file, 'r') as file:
|
||||||
lines = file.readlines()
|
lines = file.readlines()
|
||||||
|
|||||||
@@ -12,19 +12,6 @@ Lora:
|
|||||||
# IRQ: 17
|
# IRQ: 17
|
||||||
# Reset: 22
|
# Reset: 22
|
||||||
|
|
||||||
# Module: sx1262 # pinedio
|
|
||||||
# CS: 0
|
|
||||||
# IRQ: 10
|
|
||||||
# Busy: 11
|
|
||||||
# DIO2_AS_RF_SWITCH: true
|
|
||||||
# spidev: spidev0.1
|
|
||||||
|
|
||||||
# Module: RF95 # Adafruit RFM9x
|
|
||||||
# Reset: 25
|
|
||||||
# CS: 7
|
|
||||||
# IRQ: 22
|
|
||||||
# Busy: 23
|
|
||||||
|
|
||||||
# Module: RF95 # Elecrow Lora RFM95 IOT https://www.elecrow.com/lora-rfm95-iot-board-for-rpi.html
|
# Module: RF95 # Elecrow Lora RFM95 IOT https://www.elecrow.com/lora-rfm95-iot-board-for-rpi.html
|
||||||
# Reset: 22
|
# Reset: 22
|
||||||
# CS: 7
|
# CS: 7
|
||||||
@@ -36,6 +23,47 @@ Lora:
|
|||||||
# Busy: 20
|
# Busy: 20
|
||||||
# Reset: 18
|
# Reset: 18
|
||||||
|
|
||||||
|
### The Radxa Zero 3E/W employs multiple gpio chips.
|
||||||
|
### Each gpio pin must be unique, but can be assigned to a specific gpio chip and line.
|
||||||
|
### In case solely a no. is given, the default gpio chip and pin == line will be employed.
|
||||||
|
###
|
||||||
|
# Module: sx1262 # Radxa Zero 3E/W + Ebyte E22-900M30S
|
||||||
|
# DIO2_AS_RF_SWITCH: true
|
||||||
|
# DIO3_TCXO_VOLTAGE: 1.8
|
||||||
|
# CS: # NSS PIN_24 -> chip 4, line 22
|
||||||
|
# pin: 24
|
||||||
|
# gpiochip: 4
|
||||||
|
# line: 22
|
||||||
|
# SCK: # SCK PIN_23 -> chip 4, line 18
|
||||||
|
# pin: 23
|
||||||
|
# gpiochip: 4
|
||||||
|
# line: 18
|
||||||
|
# Busy: # BUSY PIN_29 -> chip 3!, line 11
|
||||||
|
# pin: 29
|
||||||
|
# gpiochip: 3
|
||||||
|
# line: 11
|
||||||
|
# MOSI: # MOSI PIN_19 -> chip 4, line 19
|
||||||
|
# pin: 19
|
||||||
|
# gpiochip: 4
|
||||||
|
# line: 19
|
||||||
|
# MISO: # MISO PIN_21 -> chip 4, line 21
|
||||||
|
# pin: 21
|
||||||
|
# gpiochip: 4
|
||||||
|
# line: 21
|
||||||
|
# Reset: # NRST PIN_27 -> chip 4, line 10
|
||||||
|
# pin: 27
|
||||||
|
# gpiochip: 4
|
||||||
|
# line: 10
|
||||||
|
# IRQ: # DIO1 PIN_28 -> chip 4, line 11
|
||||||
|
# pin: 28
|
||||||
|
# gpiochip: 4
|
||||||
|
# line: 11
|
||||||
|
# RXen: # RXEN PIN_22 -> chip 3!, line 17
|
||||||
|
# pin: 22
|
||||||
|
# gpiochip: 3
|
||||||
|
# line: 17
|
||||||
|
# TXen: RADIOLIB_NC # TXEN no PIN, no line, fallback to default gpio chip
|
||||||
|
|
||||||
# Module: sx1268 # SX1268-based modules, tested with Ebyte E22 400M33S
|
# Module: sx1268 # SX1268-based modules, tested with Ebyte E22 400M33S
|
||||||
# CS: 21
|
# CS: 21
|
||||||
# IRQ: 16
|
# IRQ: 16
|
||||||
@@ -50,11 +78,9 @@ Lora:
|
|||||||
# TXen: x # TX and RX enable pins
|
# TXen: x # TX and RX enable pins
|
||||||
# RXen: x
|
# RXen: x
|
||||||
|
|
||||||
# ch341_quirk: true # Uncomment this to use the chunked SPI transfer that seems to fix the ch341
|
|
||||||
|
|
||||||
# spiSpeed: 2000000
|
# spiSpeed: 2000000
|
||||||
|
|
||||||
### Set gpio chip to use in /dev/. Defaults to 0.
|
### Set default/fallback gpio chip to use in /dev/. Defaults to 0.
|
||||||
### Notably the Raspberry Pi 5 puts the GPIO header on gpiochip4
|
### Notably the Raspberry Pi 5 puts the GPIO header on gpiochip4
|
||||||
# gpiochip: 4
|
# gpiochip: 4
|
||||||
|
|
||||||
@@ -155,9 +181,11 @@ Logging:
|
|||||||
|
|
||||||
Webserver:
|
Webserver:
|
||||||
# Port: 443 # Port for Webserver & Webservices
|
# Port: 443 # Port for Webserver & Webservices
|
||||||
# RootPath: /usr/share/doc/meshtasticd/web # Root Dir of WebServer
|
# RootPath: /usr/share/meshtasticd/web # Root Dir of WebServer
|
||||||
|
|
||||||
General:
|
General:
|
||||||
MaxNodes: 200
|
MaxNodes: 200
|
||||||
MaxMessageQueue: 100
|
MaxMessageQueue: 100
|
||||||
ConfigDirectory: /etc/meshtasticd/config.d/
|
ConfigDirectory: /etc/meshtasticd/config.d/
|
||||||
|
# MACAddress: AA:BB:CC:DD:EE:FF
|
||||||
|
# MACAddressSource: eth0
|
||||||
|
|||||||
9
bin/config.d/OpenWRT-One-mikroBUS-LR-IOT-CLICK.yaml
Normal file
9
bin/config.d/OpenWRT-One-mikroBUS-LR-IOT-CLICK.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
## https://www.mikroe.com/lr-iot-click
|
||||||
|
Lora:
|
||||||
|
Module: lr1110 # OpenWRT ONE mikroBUS with LR-IOT-CLICK
|
||||||
|
# CS: 25
|
||||||
|
IRQ: 10
|
||||||
|
Busy: 12
|
||||||
|
# Reset: 2
|
||||||
|
spidev: spidev2.0
|
||||||
|
DIO3_TCXO_VOLTAGE: 1.6
|
||||||
8
bin/config.d/OpenWRT_One_mikroBUS_sx1262.yaml
Normal file
8
bin/config.d/OpenWRT_One_mikroBUS_sx1262.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Lora:
|
||||||
|
Module: sx1262
|
||||||
|
IRQ: 10
|
||||||
|
Busy: 12
|
||||||
|
# Reset: 2
|
||||||
|
spidev: spidev2.0
|
||||||
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
DIO3_TCXO_VOLTAGE: true
|
||||||
20
bin/config.d/femtofox/femtofox_LR1121_TCXO.yaml
Normal file
20
bin/config.d/femtofox/femtofox_LR1121_TCXO.yaml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
Lora:
|
||||||
|
## Ebyte E80-900M22S
|
||||||
|
## This is a bit experimental
|
||||||
|
##
|
||||||
|
##
|
||||||
|
Module: lr1121
|
||||||
|
gpiochip: 1 # subtract 32 from the gpio numbers
|
||||||
|
DIO3_TCXO_VOLTAGE: 1.8
|
||||||
|
CS: 16 #pin6 / GPIO48 1C0
|
||||||
|
IRQ: 23 #pin17 / GPIO55 1C7
|
||||||
|
Busy: 22 #pin16 / GPIO54 1C6
|
||||||
|
Reset: 25 #pin13 / GPIO57 1D1
|
||||||
|
|
||||||
|
|
||||||
|
spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19)
|
||||||
|
spiSpeed: 2000000
|
||||||
|
|
||||||
|
General:
|
||||||
|
MACAddressSource: eth0
|
||||||
21
bin/config.d/femtofox/femtofox_SX1262_TCXO.yaml
Normal file
21
bin/config.d/femtofox/femtofox_SX1262_TCXO.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
Lora:
|
||||||
|
## Ebyte E22-900M30S, E22-900M22S with or without external RF switching setup
|
||||||
|
## HT-RA62 (Has internal switching, but whatever)
|
||||||
|
## Seeed WIO SX1262 (already has TXEN-DIO2 link, but needs RXEN)
|
||||||
|
## Will work with any module with or without RF switching, and with TCXO
|
||||||
|
Module: sx1262
|
||||||
|
gpiochip: 1 # subtract 32 from the gpio numbers
|
||||||
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
DIO3_TCXO_VOLTAGE: true
|
||||||
|
CS: 16 #pin6 / GPIO48 1C0
|
||||||
|
IRQ: 23 #pin17 / GPIO55 1C7
|
||||||
|
Busy: 22 #pin16 / GPIO54 1C6
|
||||||
|
Reset: 25 #pin13 / GPIO57 1D1
|
||||||
|
RXen: 24 #pin12 / GPIO56 1D0 # Not strictly needed for auto-switching, but why complicate things?
|
||||||
|
# TXen: bridge to DIO2 on E22 module
|
||||||
|
spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19)
|
||||||
|
spiSpeed: 2000000
|
||||||
|
|
||||||
|
General:
|
||||||
|
MACAddressSource: eth0
|
||||||
21
bin/config.d/femtofox/femtofox_SX1262_XTAL.yaml
Normal file
21
bin/config.d/femtofox/femtofox_SX1262_XTAL.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
Lora:
|
||||||
|
## Ebyte E22-900MM22S with no external RF switching setup
|
||||||
|
## Waveshare SX126X XXXM, AI Thinker RA-01SH
|
||||||
|
## Will work with any module with or without RF switching and no TCXO
|
||||||
|
|
||||||
|
Module: sx1262
|
||||||
|
gpiochip: 1 # subtract 32 from the gpio numbers
|
||||||
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
DIO3_TCXO_VOLTAGE: false
|
||||||
|
CS: 16 #pin6 / GPIO48 1C0
|
||||||
|
IRQ: 23 #pin17 / GPIO55 1C7
|
||||||
|
Busy: 22 #pin16 / GPIO54 1C6
|
||||||
|
Reset: 25 #pin13 / GPIO57 1D1
|
||||||
|
RXen: 24 #pin12 / GPIO56 1D0 # Not strictly needed for auto-switching, but why complicate things?
|
||||||
|
# TXen: bridge to DIO2 on E22 module
|
||||||
|
spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19)
|
||||||
|
spiSpeed: 2000000
|
||||||
|
|
||||||
|
General:
|
||||||
|
MACAddressSource: eth0
|
||||||
5
bin/config.d/lora-Adafruit-RFM9x
Normal file
5
bin/config.d/lora-Adafruit-RFM9x
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Module: RF95 # Adafruit RFM9x
|
||||||
|
# Reset: 25
|
||||||
|
# CS: 7
|
||||||
|
# IRQ: 22
|
||||||
|
# Busy: 23
|
||||||
11
bin/config.d/lora-meshstick-1262.yaml
Normal file
11
bin/config.d/lora-meshstick-1262.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Lora:
|
||||||
|
Module: sx1262
|
||||||
|
CS: 0
|
||||||
|
IRQ: 6
|
||||||
|
Reset: 2
|
||||||
|
Busy: 4
|
||||||
|
spidev: ch341
|
||||||
|
DIO3_TCXO_VOLTAGE: true
|
||||||
|
# USB_Serialnum: 12345678
|
||||||
|
USB_PID: 0x5512
|
||||||
|
USB_VID: 0x1A86
|
||||||
5
bin/config.d/lora-pinedio-usb-sx1262.yaml
Normal file
5
bin/config.d/lora-pinedio-usb-sx1262.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Lora:
|
||||||
|
Module: sx1262
|
||||||
|
CS: 0
|
||||||
|
IRQ: 10
|
||||||
|
spidev: ch341
|
||||||
@@ -1,16 +1,26 @@
|
|||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
|
|
||||||
set PYTHON=python
|
set PYTHON=python
|
||||||
|
set WEB_APP=0
|
||||||
|
|
||||||
|
:: Determine the correct esptool command to use
|
||||||
|
where esptool >nul 2>&1
|
||||||
|
if %ERRORLEVEL% EQU 0 (
|
||||||
|
set "ESPTOOL_CMD=esptool"
|
||||||
|
) else (
|
||||||
|
set "ESPTOOL_CMD=%PYTHON% -m esptool"
|
||||||
|
)
|
||||||
|
|
||||||
goto GETOPTS
|
goto GETOPTS
|
||||||
:HELP
|
:HELP
|
||||||
echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME]
|
echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME] [--web]
|
||||||
echo Flash image file to device, but first erasing and writing system information
|
echo Flash image file to device, but first erasing and writing system information
|
||||||
echo.
|
echo.
|
||||||
echo -h Display this help and exit
|
echo -h Display this help and exit
|
||||||
echo -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous).
|
echo -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous).
|
||||||
echo -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: %PYTHON%)
|
echo -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: %PYTHON%)
|
||||||
echo -f FILENAME The .bin file to flash. Custom to your device type and region.
|
echo -f FILENAME The .bin file to flash. Custom to your device type and region.
|
||||||
|
echo --web Flash WEB APP.
|
||||||
goto EOF
|
goto EOF
|
||||||
|
|
||||||
:GETOPTS
|
:GETOPTS
|
||||||
@@ -19,37 +29,44 @@ if /I "%1"=="--help" goto HELP
|
|||||||
if /I "%1"=="-F" set "FILENAME=%2" & SHIFT
|
if /I "%1"=="-F" set "FILENAME=%2" & SHIFT
|
||||||
if /I "%1"=="-p" set ESPTOOL_PORT=%2 & SHIFT
|
if /I "%1"=="-p" set ESPTOOL_PORT=%2 & SHIFT
|
||||||
if /I "%1"=="-P" set PYTHON=%2 & SHIFT
|
if /I "%1"=="-P" set PYTHON=%2 & SHIFT
|
||||||
|
if /I "%1"=="--web" set WEB_APP=1 & SHIFT
|
||||||
SHIFT
|
SHIFT
|
||||||
IF NOT "__%1__"=="____" goto GETOPTS
|
IF NOT "__%1__"=="____" goto GETOPTS
|
||||||
|
|
||||||
IF "__%FILENAME%__" == "____" (
|
IF "__%FILENAME%__" == "____" (
|
||||||
echo "Missing FILENAME"
|
echo "Missing FILENAME"
|
||||||
goto HELP
|
goto HELP
|
||||||
)
|
)
|
||||||
IF EXIST %FILENAME% IF x%FILENAME:update=%==x%FILENAME% (
|
IF EXIST %FILENAME% IF x%FILENAME:update=%==x%FILENAME% (
|
||||||
echo Trying to flash update %FILENAME%, but first erasing and writing system information"
|
echo Trying to flash update %FILENAME%, but first erasing and writing system information"
|
||||||
%PYTHON% -m esptool --baud 115200 erase_flash
|
%ESPTOOL_CMD% --baud 115200 erase_flash
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x00 %FILENAME%
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x00 %FILENAME%
|
||||||
|
|
||||||
@REM Account for S3 and C3 board's different OTA partition
|
@REM Account for S3 and C3 board's different OTA partition
|
||||||
IF x%FILENAME:s3=%==x%FILENAME% IF x%FILENAME:v3=%==x%FILENAME% IF x%FILENAME:t-deck=%==x%FILENAME% IF x%FILENAME:wireless-paper=%==x%FILENAME% IF x%FILENAME:wireless-tracker=%==x%FILENAME% IF x%FILENAME:station-g2=%==x%FILENAME% IF x%FILENAME:unphone=%==x%FILENAME% (
|
IF x%FILENAME:s3=%==x%FILENAME% IF x%FILENAME:v3=%==x%FILENAME% IF x%FILENAME:t-deck=%==x%FILENAME% IF x%FILENAME:wireless-paper=%==x%FILENAME% IF x%FILENAME:wireless-tracker=%==x%FILENAME% IF x%FILENAME:station-g2=%==x%FILENAME% IF x%FILENAME:unphone=%==x%FILENAME% (
|
||||||
IF x%FILENAME:esp32c3=%==x%FILENAME% (
|
IF x%FILENAME:esp32c3=%==x%FILENAME% (
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota.bin
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota.bin
|
||||||
) else (
|
) else (
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota-c3.bin
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota-c3.bin
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota-s3.bin
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota-s3.bin
|
||||||
)
|
)
|
||||||
for %%f in (littlefs-*.bin) do (
|
IF %WEB_APP%==1 (
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x300000 %%f
|
for %%f in (littlefswebui-*.bin) do (
|
||||||
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x300000 %%f
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
for %%f in (littlefs-*.bin) do (
|
||||||
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x300000 %%f
|
||||||
|
)
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
echo "Invalid file: %FILENAME%"
|
echo "Invalid file: %FILENAME%"
|
||||||
goto HELP
|
goto HELP
|
||||||
) else (
|
) else (
|
||||||
echo "Invalid file: %FILENAME%"
|
echo "Invalid file: %FILENAME%"
|
||||||
goto HELP
|
goto HELP
|
||||||
)
|
)
|
||||||
|
|
||||||
:EOF
|
:EOF
|
||||||
|
|||||||
@@ -1,22 +1,45 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PYTHON=${PYTHON:-$(which python3 python | head -n 1)}
|
PYTHON=${PYTHON:-$(which python3 python | head -n 1)}
|
||||||
|
WEB_APP=false
|
||||||
|
|
||||||
|
# Determine the correct esptool command to use
|
||||||
|
if "$PYTHON" -m esptool version >/dev/null 2>&1; then
|
||||||
|
ESPTOOL_CMD="$PYTHON -m esptool"
|
||||||
|
elif command -v esptool >/dev/null 2>&1; then
|
||||||
|
ESPTOOL_CMD="esptool"
|
||||||
|
elif command -v esptool.py >/dev/null 2>&1; then
|
||||||
|
ESPTOOL_CMD="esptool.py"
|
||||||
|
else
|
||||||
|
echo "Error: esptool not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Usage info
|
# Usage info
|
||||||
show_help() {
|
show_help() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME]
|
Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME] [--web]
|
||||||
Flash image file to device, but first erasing and writing system information"
|
Flash image file to device, but first erasing and writing system information"
|
||||||
|
|
||||||
-h Display this help and exit
|
-h Display this help and exit
|
||||||
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous).
|
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous).
|
||||||
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
|
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
|
||||||
-f FILENAME The .bin file to flash. Custom to your device type and region.
|
-f FILENAME The .bin file to flash. Custom to your device type and region.
|
||||||
|
--web Flash WEB APP.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
# Preprocess long options like --web
|
||||||
|
for arg in "$@"; do
|
||||||
|
case "$arg" in
|
||||||
|
--web)
|
||||||
|
WEB_APP=true
|
||||||
|
shift # Remove this argument from the list
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
while getopts ":hp:P:f:" opt; do
|
while getopts ":hp:P:f:" opt; do
|
||||||
case "${opt}" in
|
case "${opt}" in
|
||||||
@@ -49,19 +72,23 @@ shift "$((OPTIND - 1))"
|
|||||||
|
|
||||||
if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then
|
if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then
|
||||||
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
||||||
"$PYTHON" -m esptool erase_flash
|
$ESPTOOL_CMD erase_flash
|
||||||
"$PYTHON" -m esptool write_flash 0x00 ${FILENAME}
|
$ESPTOOL_CMD write_flash 0x00 "${FILENAME}"
|
||||||
# Account for S3 board's different OTA partition
|
# Account for S3 board's different OTA partition
|
||||||
if [ -n "${FILENAME##*"s3"*}" ] && [ -n "${FILENAME##*"-v3"*}" ] && [ -n "${FILENAME##*"t-deck"*}" ] && [ -n "${FILENAME##*"wireless-paper"*}" ] && [ -n "${FILENAME##*"wireless-tracker"*}" ] && [ -n "${FILENAME##*"station-g2"*}" ] && [ -n "${FILENAME##*"unphone"*}" ]; then
|
if [ -n "${FILENAME##*"s3"*}" ] && [ -n "${FILENAME##*"-v3"*}" ] && [ -n "${FILENAME##*"t-deck"*}" ] && [ -n "${FILENAME##*"wireless-paper"*}" ] && [ -n "${FILENAME##*"wireless-tracker"*}" ] && [ -n "${FILENAME##*"station-g2"*}" ] && [ -n "${FILENAME##*"unphone"*}" ]; then
|
||||||
if [ -n "${FILENAME##*"esp32c3"*}" ]; then
|
if [ -n "${FILENAME##*"esp32c3"*}" ]; then
|
||||||
"$PYTHON" -m esptool write_flash 0x260000 bleota.bin
|
$ESPTOOL_CMD write_flash 0x260000 bleota.bin
|
||||||
else
|
else
|
||||||
"$PYTHON" -m esptool write_flash 0x260000 bleota-c3.bin
|
$ESPTOOL_CMD write_flash 0x260000 bleota-c3.bin
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
"$PYTHON" -m esptool write_flash 0x260000 bleota-s3.bin
|
$ESPTOOL_CMD write_flash 0x260000 bleota-s3.bin
|
||||||
|
fi
|
||||||
|
if [ "$WEB_APP" = true ]; then
|
||||||
|
$ESPTOOL_CMD write_flash 0x300000 littlefswebui-*.bin
|
||||||
|
else
|
||||||
|
$ESPTOOL_CMD write_flash 0x300000 littlefs-*.bin
|
||||||
fi
|
fi
|
||||||
"$PYTHON" -m esptool write_flash 0x300000 littlefs-*.bin
|
|
||||||
|
|
||||||
else
|
else
|
||||||
show_help
|
show_help
|
||||||
|
|||||||
@@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
set PYTHON=python
|
set PYTHON=python
|
||||||
|
|
||||||
|
:: Determine the correct esptool command to use
|
||||||
|
where esptool >nul 2>&1
|
||||||
|
if %ERRORLEVEL% EQU 0 (
|
||||||
|
set "ESPTOOL_CMD=esptool"
|
||||||
|
) else (
|
||||||
|
set "ESPTOOL_CMD=%PYTHON% -m esptool"
|
||||||
|
)
|
||||||
|
|
||||||
goto GETOPTS
|
goto GETOPTS
|
||||||
:HELP
|
:HELP
|
||||||
echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME]
|
echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME]
|
||||||
@@ -24,17 +32,17 @@ IF NOT "__%1__"=="____" goto GETOPTS
|
|||||||
|
|
||||||
IF "__%FILENAME%__" == "____" (
|
IF "__%FILENAME%__" == "____" (
|
||||||
echo "Missing FILENAME"
|
echo "Missing FILENAME"
|
||||||
goto HELP
|
goto HELP
|
||||||
)
|
)
|
||||||
IF EXIST %FILENAME% IF NOT x%FILENAME:update=%==x%FILENAME% (
|
IF EXIST %FILENAME% IF NOT x%FILENAME:update=%==x%FILENAME% (
|
||||||
echo Trying to flash update %FILENAME%
|
echo Trying to flash update %FILENAME%
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x10000 %FILENAME%
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x10000 %FILENAME%
|
||||||
) else (
|
) else (
|
||||||
echo "Invalid file: %FILENAME%"
|
echo "Invalid file: %FILENAME%"
|
||||||
goto HELP
|
goto HELP
|
||||||
) else (
|
) else (
|
||||||
echo "Invalid file: %FILENAME%"
|
echo "Invalid file: %FILENAME%"
|
||||||
goto HELP
|
goto HELP
|
||||||
)
|
)
|
||||||
|
|
||||||
:EOF
|
:EOF
|
||||||
|
|||||||
@@ -2,6 +2,18 @@
|
|||||||
|
|
||||||
PYTHON=${PYTHON:-$(which python3 python|head -n 1)}
|
PYTHON=${PYTHON:-$(which python3 python|head -n 1)}
|
||||||
|
|
||||||
|
# Determine the correct esptool command to use
|
||||||
|
if "$PYTHON" -m esptool version >/dev/null 2>&1; then
|
||||||
|
ESPTOOL_CMD="$PYTHON -m esptool"
|
||||||
|
elif command -v esptool >/dev/null 2>&1; then
|
||||||
|
ESPTOOL_CMD="esptool"
|
||||||
|
elif command -v esptool.py >/dev/null 2>&1; then
|
||||||
|
ESPTOOL_CMD="esptool.py"
|
||||||
|
else
|
||||||
|
echo "Error: esptool not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Usage info
|
# Usage info
|
||||||
show_help() {
|
show_help() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@@ -9,7 +21,7 @@ Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME]
|
|||||||
Flash image file to device, leave existing system intact."
|
Flash image file to device, leave existing system intact."
|
||||||
|
|
||||||
-h Display this help and exit
|
-h Display this help and exit
|
||||||
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous).
|
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous).
|
||||||
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
|
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
|
||||||
-f FILENAME The *update.bin file to flash. Custom to your device type.
|
-f FILENAME The *update.bin file to flash. Custom to your device type.
|
||||||
|
|
||||||
@@ -30,7 +42,7 @@ while getopts ":hp:P:f:" opt; do
|
|||||||
f) FILENAME=${OPTARG}
|
f) FILENAME=${OPTARG}
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid flag."
|
echo "Invalid flag."
|
||||||
show_help >&2
|
show_help >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
@@ -45,7 +57,7 @@ shift "$((OPTIND-1))"
|
|||||||
|
|
||||||
if [ -f "${FILENAME}" ] && [ -z "${FILENAME##*"update"*}" ]; then
|
if [ -f "${FILENAME}" ] && [ -z "${FILENAME##*"update"*}" ]; then
|
||||||
printf "Trying to flash update ${FILENAME}"
|
printf "Trying to flash update ${FILENAME}"
|
||||||
$PYTHON -m esptool --baud 115200 write_flash 0x10000 ${FILENAME}
|
$ESPTOOL_CMD --baud 115200 write_flash 0x10000 ${FILENAME}
|
||||||
else
|
else
|
||||||
show_help
|
show_help
|
||||||
echo "Invalid file: ${FILENAME}"
|
echo "Invalid file: ${FILENAME}"
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
# trunk-ignore-all(flake8/F821): For SConstruct imports
|
# trunk-ignore-all(flake8/F821): For SConstruct imports
|
||||||
import sys
|
import sys
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
from readprops import readProps
|
from readprops import readProps
|
||||||
|
|
||||||
@@ -90,11 +92,37 @@ prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
|
|||||||
verObj = readProps(prefsLoc)
|
verObj = readProps(prefsLoc)
|
||||||
print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"] + " on " + env.get("PIOENV"))
|
print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"] + " on " + env.get("PIOENV"))
|
||||||
|
|
||||||
|
jsonLoc = env["PROJECT_DIR"] + "/userPrefs.jsonc"
|
||||||
|
with open(jsonLoc) as f:
|
||||||
|
jsonStr = re.sub("//.*","", f.read(), flags=re.MULTILINE)
|
||||||
|
userPrefs = json.loads(jsonStr)
|
||||||
|
|
||||||
|
pref_flags = []
|
||||||
|
# Pre-process the userPrefs
|
||||||
|
for pref in userPrefs:
|
||||||
|
if userPrefs[pref].startswith("{"):
|
||||||
|
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
|
||||||
|
elif userPrefs[pref].replace(".", "").isdigit():
|
||||||
|
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
|
||||||
|
elif userPrefs[pref] == "true" or userPrefs[pref] == "false":
|
||||||
|
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
|
||||||
|
elif userPrefs[pref].startswith("meshtastic_"):
|
||||||
|
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
|
||||||
|
# If the value is a string, we need to wrap it in quotes
|
||||||
|
else:
|
||||||
|
pref_flags.append("-D" + pref + "=" + env.StringifyMacro(userPrefs[pref]) + "")
|
||||||
|
|
||||||
# General options that are passed to the C and C++ compilers
|
# General options that are passed to the C and C++ compilers
|
||||||
projenv.Append(
|
flags = [
|
||||||
CCFLAGS=[
|
|
||||||
"-DAPP_VERSION=" + verObj["long"],
|
"-DAPP_VERSION=" + verObj["long"],
|
||||||
"-DAPP_VERSION_SHORT=" + verObj["short"],
|
"-DAPP_VERSION_SHORT=" + verObj["short"],
|
||||||
"-DAPP_ENV=" + env.get("PIOENV"),
|
"-DAPP_ENV=" + env.get("PIOENV"),
|
||||||
]
|
] + pref_flags
|
||||||
)
|
|
||||||
|
print ("Using flags:")
|
||||||
|
for flag in flags:
|
||||||
|
print(flag)
|
||||||
|
|
||||||
|
projenv.Append(
|
||||||
|
CCFLAGS=flags,
|
||||||
|
)
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
|
run_number = os.getenv('GITHUB_RUN_NUMBER', '0')
|
||||||
|
build_location = os.getenv('BUILD_LOCATION', 'local')
|
||||||
|
|
||||||
def readProps(prefsLoc):
|
def readProps(prefsLoc):
|
||||||
"""Read the version of our project as a string"""
|
"""Read the version of our project as a string"""
|
||||||
@@ -11,6 +13,7 @@ def readProps(prefsLoc):
|
|||||||
verObj = dict(
|
verObj = dict(
|
||||||
short="{}.{}.{}".format(version["major"], version["minor"], version["build"]),
|
short="{}.{}.{}".format(version["major"], version["minor"], version["build"]),
|
||||||
long="unset",
|
long="unset",
|
||||||
|
deb="unset",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Try to find current build SHA if if the workspace is clean. This could fail if git is not installed
|
# Try to find current build SHA if if the workspace is clean. This could fail if git is not installed
|
||||||
@@ -27,16 +30,16 @@ def readProps(prefsLoc):
|
|||||||
# if isDirty:
|
# if isDirty:
|
||||||
# # short for 'dirty', we want to keep our verstrings source for protobuf reasons
|
# # short for 'dirty', we want to keep our verstrings source for protobuf reasons
|
||||||
# suffix = sha + "-d"
|
# suffix = sha + "-d"
|
||||||
verObj["long"] = "{}.{}.{}.{}".format(
|
verObj["long"] = "{}.{}".format(verObj["short"], suffix)
|
||||||
version["major"], version["minor"], version["build"], suffix
|
verObj["deb"] = "{}.{}~{}{}".format(verObj["short"], run_number, build_location, sha)
|
||||||
)
|
|
||||||
except:
|
except:
|
||||||
# print("Unexpected error:", sys.exc_info()[0])
|
# print("Unexpected error:", sys.exc_info()[0])
|
||||||
# traceback.print_exc()
|
# traceback.print_exc()
|
||||||
verObj["long"] = verObj["short"]
|
verObj["long"] = verObj["short"]
|
||||||
|
verObj["deb"] = "{}.{}~{}".format(verObj["short"], run_number, build_location)
|
||||||
|
|
||||||
# print("firmware version " + verStr)
|
# print("firmware version " + verStr)
|
||||||
return verObj
|
return verObj
|
||||||
|
|
||||||
|
|
||||||
# print("path is" + ','.join(sys.path))
|
# print("path is" + ','.join(sys.path))
|
||||||
12
bin/rpkg.macros
Normal file
12
bin/rpkg.macros
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
function meshtastic_version {
|
||||||
|
meshtastic_version=$(python3 bin/buildinfo.py short)
|
||||||
|
echo -n "$meshtastic_version"
|
||||||
|
}
|
||||||
|
function git_commits_num {
|
||||||
|
total_commits=$(git rev-list --all --count)
|
||||||
|
echo -n "$total_commits"
|
||||||
|
}
|
||||||
|
function git_commit_sha {
|
||||||
|
commit_sha=$(git rev-parse --short HEAD)
|
||||||
|
echo -n "$commit_sha"
|
||||||
|
}
|
||||||
41
boards/esp32-s3-zero.json
Normal file
41
boards/esp32-s3-zero.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"partitions": "default.csv",
|
||||||
|
"memory_type": "qio_qspi"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DARDUINO_ESP32S3_DEV",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DBOARD_HAS_PSRAM"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"psram_type": "qio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "esp32s3"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi", "bluetooth"],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"platforms": ["espressif32"],
|
||||||
|
"name": "Espressif ESP32-S3-FH4R2 (4 MB QD, 2MB PSRAM)",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "4MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 4194304,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
|
||||||
|
"vendor": "Espressif"
|
||||||
|
}
|
||||||
42
boards/mesh-tab.json
Normal file
42
boards/mesh-tab.json
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"partitions": "default_16MB.csv",
|
||||||
|
"memory_type": "qio_qspi"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=0",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x303A", "0x80D6"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "mesh-tab"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi", "bluetooth", "lora"],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "ESP32-S3 WROOM-1 N16R2 (16 MB FLASH, 2 MB PSRAM)",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "16MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 16777216,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 460800
|
||||||
|
},
|
||||||
|
"url": "https://github.com/valzzu/Mesh-Tab",
|
||||||
|
"vendor": "Espressif"
|
||||||
|
}
|
||||||
@@ -15,10 +15,12 @@
|
|||||||
],
|
],
|
||||||
"f_cpu": "240000000L",
|
"f_cpu": "240000000L",
|
||||||
"f_flash": "80000000L",
|
"f_flash": "80000000L",
|
||||||
|
"f_boot": "120000000L",
|
||||||
|
"boot": "qio",
|
||||||
"flash_mode": "qio",
|
"flash_mode": "qio",
|
||||||
"hwids": [["0x1A86", "0x7523"]],
|
"hwids": [["0x1A86", "0x7523"]],
|
||||||
"mcu": "esp32s3",
|
"mcu": "esp32s3",
|
||||||
"variant": "esp32s3r8"
|
"variant": "esp32s3"
|
||||||
},
|
},
|
||||||
"connectivity": ["wifi", "bluetooth", "lora"],
|
"connectivity": ["wifi", "bluetooth", "lora"],
|
||||||
"debug": {
|
"debug": {
|
||||||
@@ -32,9 +34,9 @@
|
|||||||
"flash_size": "8MB",
|
"flash_size": "8MB",
|
||||||
"maximum_ram_size": 327680,
|
"maximum_ram_size": 327680,
|
||||||
"maximum_size": 8388608,
|
"maximum_size": 8388608,
|
||||||
"require_upload_port": true,
|
"require_upload_port": false,
|
||||||
"use_1200bps_touch": true,
|
"use_1200bps_touch": true,
|
||||||
"wait_for_upload_port": true,
|
"wait_for_upload_port": false,
|
||||||
"speed": 921600
|
"speed": 921600
|
||||||
},
|
},
|
||||||
"url": "https://www.seeedstudio.com/Indicator-for-Meshtastic.html",
|
"url": "https://www.seeedstudio.com/Indicator-for-Meshtastic.html",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
"-DARDUINO_USB_MODE=0",
|
"-DARDUINO_USB_MODE=0",
|
||||||
"-DARDUINO_RUNNING_CORE=1",
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
"-DARDUINO_EVENT_RUNNING_CORE=0"
|
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||||
],
|
],
|
||||||
"f_cpu": "240000000L",
|
"f_cpu": "240000000L",
|
||||||
"f_flash": "80000000L",
|
"f_flash": "80000000L",
|
||||||
|
|||||||
@@ -48,6 +48,6 @@
|
|||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"wait_for_upload_port": true
|
"wait_for_upload_port": true
|
||||||
},
|
},
|
||||||
"url": "FIXME",
|
"url": "https://lilygo.cc/products/t-echo-lilygo",
|
||||||
"vendor": "TTGO"
|
"vendor": "LILYGO"
|
||||||
}
|
}
|
||||||
|
|||||||
6
debian/.gitignore
vendored
Normal file
6
debian/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.debhelper
|
||||||
|
debhelper-build-stamp
|
||||||
|
meshtasticd
|
||||||
|
files
|
||||||
|
meshtasticd.substvars
|
||||||
|
meshtasticd.postrm.debhelper
|
||||||
6
debian/changelog
vendored
Normal file
6
debian/changelog
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
meshtasticd (2.5.20.0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* Initial packaging
|
||||||
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
|
-- Austin Lane <github-actions[bot]@users.noreply.github.com> Mon, 13 Jan 2025 19:24:14 +0000
|
||||||
7
debian/ci_changelog.sh
vendored
Executable file
7
debian/ci_changelog.sh
vendored
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
export DEBEMAIL="github-actions[bot]@users.noreply.github.com"
|
||||||
|
PKG_VERSION=$(python3 bin/buildinfo.py short)
|
||||||
|
|
||||||
|
dch --newversion "$PKG_VERSION.0" \
|
||||||
|
--distribution UNRELEASED \
|
||||||
|
"GitHub Actions Automatic version bump"
|
||||||
23
debian/ci_pack_sdeb.sh
vendored
Executable file
23
debian/ci_pack_sdeb.sh
vendored
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
export DEBEMAIL="jbennett@incomsystems.biz"
|
||||||
|
export PLATFORMIO_LIBDEPS_DIR=pio/libdeps
|
||||||
|
export PLATFORMIO_PACKAGES_DIR=pio/packages
|
||||||
|
export PLATFORMIO_CORE_DIR=pio/core
|
||||||
|
|
||||||
|
# Download libraries to `pio`
|
||||||
|
platformio pkg install -e native
|
||||||
|
platformio pkg install -e native -t platformio/tool-scons@4.40502.0
|
||||||
|
# Compress `pio` directory to prevent dh_clean from sanitizing it
|
||||||
|
tar -cf pio.tar pio/
|
||||||
|
rm -rf pio
|
||||||
|
# Download the latest meshtastic/web release build.tar to `web.tar`
|
||||||
|
curl -L https://github.com/meshtastic/web/releases/download/latest/build.tar -o web.tar
|
||||||
|
|
||||||
|
package=$(dpkg-parsechangelog --show-field Source)
|
||||||
|
|
||||||
|
rm -rf debian/changelog
|
||||||
|
dch --create --distribution "$SERIES" --package "$package" --newversion "$PKG_VERSION~$SERIES" \
|
||||||
|
"GitHub Actions Automatic packaging for $PKG_VERSION~$SERIES"
|
||||||
|
|
||||||
|
# Build the source deb
|
||||||
|
debuild -S -nc -k"$GPG_KEY_ID"
|
||||||
32
debian/control
vendored
Normal file
32
debian/control
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
Source: meshtasticd
|
||||||
|
Section: misc
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: Austin Lane <vidplace7@gmail.com>
|
||||||
|
Build-Depends: debhelper-compat (= 13),
|
||||||
|
tar,
|
||||||
|
gzip,
|
||||||
|
platformio,
|
||||||
|
python3-protobuf,
|
||||||
|
python3-grpcio,
|
||||||
|
git,
|
||||||
|
g++,
|
||||||
|
pkg-config,
|
||||||
|
libyaml-cpp-dev,
|
||||||
|
libgpiod-dev,
|
||||||
|
libbluetooth-dev,
|
||||||
|
libusb-1.0-0-dev,
|
||||||
|
libi2c-dev,
|
||||||
|
openssl,
|
||||||
|
libssl-dev,
|
||||||
|
libulfius-dev,
|
||||||
|
liborcania-dev
|
||||||
|
Standards-Version: 4.6.2
|
||||||
|
Homepage: https://github.com/meshtastic/firmware
|
||||||
|
Rules-Requires-Root: no
|
||||||
|
|
||||||
|
Package: meshtasticd
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||||
|
Description: Meshtastic daemon for communicating with Meshtastic devices
|
||||||
|
Meshtastic is an off-grid text communication platform that uses inexpensive
|
||||||
|
LoRa radios.
|
||||||
4
debian/meshtasticd.dirs
vendored
Normal file
4
debian/meshtasticd.dirs
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
etc/meshtasticd
|
||||||
|
etc/meshtasticd/config.d
|
||||||
|
etc/meshtasticd/available.d
|
||||||
|
usr/share/meshtasticd/web
|
||||||
8
debian/meshtasticd.install
vendored
Normal file
8
debian/meshtasticd.install
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
.pio/build/native/meshtasticd usr/sbin
|
||||||
|
|
||||||
|
bin/config.yaml etc/meshtasticd
|
||||||
|
bin/config.d/* etc/meshtasticd/available.d
|
||||||
|
|
||||||
|
bin/meshtasticd.service lib/systemd/system
|
||||||
|
|
||||||
|
web/* usr/share/meshtasticd/web
|
||||||
23
debian/rules
vendored
Executable file
23
debian/rules
vendored
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
# export DH_VERBOSE = 1
|
||||||
|
|
||||||
|
# Use the "dh" sequencer
|
||||||
|
%:
|
||||||
|
dh $@
|
||||||
|
|
||||||
|
# https://docs.platformio.org/en/latest/envvars.html
|
||||||
|
PIO_ENV:=\
|
||||||
|
PLATFORMIO_CORE_DIR=pio/core \
|
||||||
|
PLATFORMIO_LIBDEPS_DIR=pio/libdeps \
|
||||||
|
PLATFORMIO_PACKAGES_DIR=pio/packages
|
||||||
|
|
||||||
|
override_dh_auto_build:
|
||||||
|
# Extract tarballs within source deb
|
||||||
|
tar -xf pio.tar
|
||||||
|
mkdir -p web && tar -xf web.tar -C web
|
||||||
|
gunzip web/ -r
|
||||||
|
# Build with platformio
|
||||||
|
$(PIO_ENV) platformio run -e native
|
||||||
|
# Move the binary and default config to the correct name
|
||||||
|
mv .pio/build/native/program .pio/build/native/meshtasticd
|
||||||
|
cp bin/config-dist.yaml bin/config.yaml
|
||||||
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3.0 (native)
|
||||||
2
debian/source/include-binaries
vendored
Normal file
2
debian/source/include-binaries
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
pio.tar
|
||||||
|
web.tar
|
||||||
1
debian/source/options
vendored
Normal file
1
debian/source/options
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
extend-diff-ignore = "\.pio"
|
||||||
@@ -1,13 +1,26 @@
|
|||||||
version: "3.7"
|
# USB-Based Meshtastic container-node!
|
||||||
|
|
||||||
|
# Copy .env.example to .env and set the USB_DEVICE and CONFIG_PATH variables
|
||||||
|
|
||||||
services:
|
services:
|
||||||
meshtastic-node:
|
meshtastic-node:
|
||||||
build: .
|
build: .
|
||||||
deploy:
|
container_name: meshtasticd
|
||||||
mode: replicated
|
|
||||||
replicas: 4
|
|
||||||
networks:
|
|
||||||
- mesh
|
|
||||||
|
|
||||||
networks:
|
# Pass USB device through to the container
|
||||||
mesh:
|
devices:
|
||||||
|
- "${USB_DEVICE}"
|
||||||
|
|
||||||
|
# Mount local config file and named volume for data persistence
|
||||||
|
volumes:
|
||||||
|
- "${CONFIG_PATH}:/etc/meshtasticd/config.yaml:ro"
|
||||||
|
- meshtastic_data:/var/lib/meshtasticd
|
||||||
|
|
||||||
|
# Forward the container’s port 4403 to the host
|
||||||
|
ports:
|
||||||
|
- 4403:4403
|
||||||
|
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
meshtastic_data:
|
||||||
|
|||||||
91
meshtasticd.spec.rpkg
Normal file
91
meshtasticd.spec.rpkg
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
# meshtasticd spec file for RPM-based distributions
|
||||||
|
#
|
||||||
|
# Build locally with:
|
||||||
|
# ```
|
||||||
|
# sudo dnf install rpkg-util
|
||||||
|
# rpkg local
|
||||||
|
# ```
|
||||||
|
#
|
||||||
|
# See:
|
||||||
|
# - https://docs.pagure.org/rpkg-util/v3/index.html
|
||||||
|
# - https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/
|
||||||
|
|
||||||
|
Name: meshtasticd
|
||||||
|
# Version Ex: 2.5.19
|
||||||
|
Version: {{{ meshtastic_version }}}
|
||||||
|
# Release Ex: 9127.daily.gitd7f5f620.fc41
|
||||||
|
Release: {{{ git_commits_num }}}%{?copr_projectname:.%{copr_projectname}}.git{{{ git_commit_sha }}}%{?dist}
|
||||||
|
VCS: {{{ git_dir_vcs }}}
|
||||||
|
Summary: Meshtastic daemon for communicating with Meshtastic devices
|
||||||
|
|
||||||
|
License: GPL-3.0
|
||||||
|
URL: https://github.com/meshtastic/firmware
|
||||||
|
Source0: {{{ git_dir_pack }}}
|
||||||
|
Source1: https://github.com/meshtastic/web/releases/download/latest/build.tar
|
||||||
|
|
||||||
|
BuildRequires: systemd-rpm-macros
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
BuildRequires: platformio
|
||||||
|
BuildRequires: python3dist(protobuf)
|
||||||
|
BuildRequires: python3dist(grpcio[protobuf])
|
||||||
|
BuildRequires: python3dist(grpcio-tools)
|
||||||
|
BuildRequires: git-core
|
||||||
|
BuildRequires: gcc-c++
|
||||||
|
BuildRequires: pkgconfig(yaml-cpp)
|
||||||
|
BuildRequires: pkgconfig(libgpiod)
|
||||||
|
BuildRequires: pkgconfig(bluez)
|
||||||
|
BuildRequires: pkgconfig(libusb-1.0)
|
||||||
|
BuildRequires: libi2c-devel
|
||||||
|
# Web components:
|
||||||
|
BuildRequires: pkgconfig(openssl)
|
||||||
|
BuildRequires: pkgconfig(liborcania)
|
||||||
|
BuildRequires: pkgconfig(libyder)
|
||||||
|
BuildRequires: pkgconfig(libulfius)
|
||||||
|
|
||||||
|
%description
|
||||||
|
Meshtastic daemon for controlling Meshtastic devices. Meshtastic is an off-grid
|
||||||
|
text communication platform that uses inexpensive LoRa radios.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
{{{ git_dir_setup_macro }}}
|
||||||
|
# Unpack the web files
|
||||||
|
mkdir -p web
|
||||||
|
tar -xf %{SOURCE1} -C web
|
||||||
|
gzip -dr web
|
||||||
|
|
||||||
|
%build
|
||||||
|
# Use the “native” environment from platformio to build a Linux binary
|
||||||
|
platformio run -e native
|
||||||
|
|
||||||
|
%install
|
||||||
|
mkdir -p %{buildroot}%{_sbindir}
|
||||||
|
install -m 0755 .pio/build/native/program %{buildroot}%{_sbindir}/meshtasticd
|
||||||
|
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd
|
||||||
|
install -m 0644 bin/config-dist.yaml %{buildroot}%{_sysconfdir}/meshtasticd/config.yaml
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/config.d
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/available.d
|
||||||
|
cp -r bin/config.d/* %{buildroot}%{_sysconfdir}/meshtasticd/available.d
|
||||||
|
|
||||||
|
install -D -m 0644 bin/meshtasticd.service %{buildroot}%{_unitdir}/meshtasticd.service
|
||||||
|
|
||||||
|
# Install the web files under /usr/share/meshtasticd/web
|
||||||
|
mkdir -p %{buildroot}%{_datadir}/meshtasticd/web
|
||||||
|
cp -r web/* %{buildroot}%{_datadir}/meshtasticd/web
|
||||||
|
|
||||||
|
%files
|
||||||
|
%license LICENSE
|
||||||
|
%doc README.md
|
||||||
|
%{_sbindir}/meshtasticd
|
||||||
|
%dir %{_sysconfdir}/meshtasticd
|
||||||
|
%dir %{_sysconfdir}/meshtasticd/config.d
|
||||||
|
%dir %{_sysconfdir}/meshtasticd/available.d
|
||||||
|
%config(noreplace) %{_sysconfdir}/meshtasticd/config.yaml
|
||||||
|
%config %{_sysconfdir}/meshtasticd/available.d/*
|
||||||
|
%{_unitdir}/meshtasticd.service
|
||||||
|
%dir %{_datadir}/meshtasticd
|
||||||
|
%dir %{_datadir}/meshtasticd/web
|
||||||
|
%{_datadir}/meshtasticd/web/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
%autochangelog
|
||||||
214
platformio.ini
214
platformio.ini
@@ -3,164 +3,130 @@
|
|||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = tbeam
|
default_envs = tbeam
|
||||||
;default_envs = pico
|
|
||||||
;default_envs = tbeam-s3-core
|
|
||||||
;default_envs = tbeam0.7
|
|
||||||
;default_envs = heltec-v1
|
|
||||||
;default_envs = heltec-v2_0
|
|
||||||
;default_envs = heltec-v2_1
|
|
||||||
;default_envs = heltec-wireless-tracker
|
|
||||||
;default_envs = chatter2
|
|
||||||
;default_envs = tlora-v1
|
|
||||||
;default_envs = tlora_v1_3
|
|
||||||
;default_envs = tlora-v2
|
|
||||||
;default_envs = tlora-v2-1-1_6
|
|
||||||
;default_envs = tlora-v2-1-1_6-tcxo
|
|
||||||
;default_envs = tlora-t3s3-v1
|
|
||||||
;default_envs = t-echo
|
|
||||||
;default_envs = canaryone
|
|
||||||
;default_envs = native
|
|
||||||
;default_envs = nano-g1
|
|
||||||
;default_envs = pca10059_diy_eink
|
|
||||||
;default_envs = meshtastic-diy-v1
|
|
||||||
;default_envs = meshtastic-diy-v1_1
|
|
||||||
;default_envs = meshtastic-dr-dev
|
|
||||||
;default_envs = m5stack-coreink
|
|
||||||
;default_envs = rak4631
|
|
||||||
;default_envs = rak4631_eth_gw
|
|
||||||
;default_envs = rak2560
|
|
||||||
;default_envs = rak10701
|
|
||||||
;default_envs = wio-e5
|
|
||||||
;default_envs = radiomaster_900_bandit_nano
|
|
||||||
;default_envs = radiomaster_900_bandit_micro
|
|
||||||
;default_envs = radiomaster_900_bandit
|
|
||||||
;default_envs = heltec_capsule_sensor_v3
|
|
||||||
;default_envs = heltec_vision_master_t190
|
|
||||||
;default_envs = heltec_vision_master_e213
|
|
||||||
;default_envs = heltec_vision_master_e290
|
|
||||||
;default_envs = heltec_mesh_node_t114
|
|
||||||
|
|
||||||
extra_configs =
|
extra_configs =
|
||||||
arch/*/*.ini
|
arch/*/*.ini
|
||||||
variants/*/platformio.ini
|
variants/*/platformio.ini
|
||||||
|
description = Meshtastic
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
test_build_src = true
|
test_build_src = true
|
||||||
extra_scripts = bin/platformio-custom.py
|
extra_scripts = bin/platformio-custom.py
|
||||||
|
|
||||||
; note: we add src to our include search path so that lmic_project_config can override
|
; note: we add src to our include search path so that lmic_project_config can override
|
||||||
; note: TINYGPS_OPTION_NO_CUSTOM_FIELDS is VERY important. We don't use custom fields and somewhere in that pile
|
; note: TINYGPS_OPTION_NO_CUSTOM_FIELDS is VERY important. We don't use custom fields and somewhere in that pile
|
||||||
; of code is a heap corruption bug!
|
; of code is a heap corruption bug!
|
||||||
; FIXME: fix lib/BluetoothOTA dependency back on src/ so we can remove -Isrc
|
; FIXME: fix lib/BluetoothOTA dependency back on src/ so we can remove -Isrc
|
||||||
; The Radiolib stuff will speed up building considerably. Exclud all the stuff we dont need.
|
; The Radiolib stuff will speed up building considerably. Exclud all the stuff we dont need.
|
||||||
build_flags = -Wno-missing-field-initializers
|
build_flags = -Wno-missing-field-initializers
|
||||||
-Wno-format
|
|
||||||
-Isrc -Isrc/mesh -Isrc/mesh/generated -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map
|
-Wno-format
|
||||||
-DUSE_THREAD_NAMES
|
-Isrc -Isrc/mesh -Isrc/mesh/generated -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map
|
||||||
-DTINYGPS_OPTION_NO_CUSTOM_FIELDS
|
-DUSE_THREAD_NAMES
|
||||||
-DPB_ENABLE_MALLOC=1
|
-DTINYGPS_OPTION_NO_CUSTOM_FIELDS
|
||||||
-DRADIOLIB_EXCLUDE_CC1101=1
|
-DPB_ENABLE_MALLOC=1
|
||||||
-DRADIOLIB_EXCLUDE_NRF24=1
|
-DRADIOLIB_EXCLUDE_CC1101=1
|
||||||
-DRADIOLIB_EXCLUDE_RF69=1
|
-DRADIOLIB_EXCLUDE_NRF24=1
|
||||||
-DRADIOLIB_EXCLUDE_SX1231=1
|
-DRADIOLIB_EXCLUDE_RF69=1
|
||||||
-DRADIOLIB_EXCLUDE_SX1233=1
|
-DRADIOLIB_EXCLUDE_SX1231=1
|
||||||
-DRADIOLIB_EXCLUDE_SI443X=1
|
-DRADIOLIB_EXCLUDE_SX1233=1
|
||||||
-DRADIOLIB_EXCLUDE_RFM2X=1
|
-DRADIOLIB_EXCLUDE_SI443X=1
|
||||||
-DRADIOLIB_EXCLUDE_AFSK=1
|
-DRADIOLIB_EXCLUDE_RFM2X=1
|
||||||
-DRADIOLIB_EXCLUDE_BELL=1
|
-DRADIOLIB_EXCLUDE_AFSK=1
|
||||||
-DRADIOLIB_EXCLUDE_HELLSCHREIBER=1
|
-DRADIOLIB_EXCLUDE_BELL=1
|
||||||
-DRADIOLIB_EXCLUDE_MORSE=1
|
-DRADIOLIB_EXCLUDE_HELLSCHREIBER=1
|
||||||
-DRADIOLIB_EXCLUDE_RTTY=1
|
-DRADIOLIB_EXCLUDE_MORSE=1
|
||||||
-DRADIOLIB_EXCLUDE_SSTV=1
|
-DRADIOLIB_EXCLUDE_RTTY=1
|
||||||
-DRADIOLIB_EXCLUDE_AX25=1
|
-DRADIOLIB_EXCLUDE_SSTV=1
|
||||||
-DRADIOLIB_EXCLUDE_DIRECT_RECEIVE=1
|
-DRADIOLIB_EXCLUDE_AX25=1
|
||||||
-DRADIOLIB_EXCLUDE_BELL=1
|
-DRADIOLIB_EXCLUDE_DIRECT_RECEIVE=1
|
||||||
-DRADIOLIB_EXCLUDE_PAGER=1
|
-DRADIOLIB_EXCLUDE_BELL=1
|
||||||
-DRADIOLIB_EXCLUDE_FSK4=1
|
-DRADIOLIB_EXCLUDE_PAGER=1
|
||||||
-DRADIOLIB_EXCLUDE_APRS=1
|
-DRADIOLIB_EXCLUDE_FSK4=1
|
||||||
-DRADIOLIB_EXCLUDE_LORAWAN=1
|
-DRADIOLIB_EXCLUDE_APRS=1
|
||||||
-DMESHTASTIC_EXCLUDE_DROPZONE=1
|
-DRADIOLIB_EXCLUDE_LORAWAN=1
|
||||||
-DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=1
|
-DMESHTASTIC_EXCLUDE_DROPZONE=1
|
||||||
#-DBUILD_EPOCH=$UNIX_TIME
|
-DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=1
|
||||||
;-D OLED_PL
|
-DMESHTASTIC_EXCLUDE_HEALTH_TELEMETRY=1
|
||||||
|
-DMESHTASTIC_EXCLUDE_POWERSTRESS=1 ; exclude power stress test module from main firmware
|
||||||
|
#-DBUILD_EPOCH=$UNIX_TIME
|
||||||
|
#-D OLED_PL=1
|
||||||
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
monitor_filters = direct
|
monitor_filters = direct
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
jgromes/RadioLib@~7.0.2
|
https://github.com/meshtastic/esp8266-oled-ssd1306.git#e16cee124fe26490cb14880c679321ad8ac89c95
|
||||||
https://github.com/meshtastic/esp8266-oled-ssd1306.git#e16cee124fe26490cb14880c679321ad8ac89c95 ; ESP8266_SSD1306
|
mathertel/OneButton@2.6.1
|
||||||
mathertel/OneButton@~2.6.1 ; OneButton library for non-blocking button debounce
|
https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159
|
||||||
https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159
|
https://github.com/meshtastic/TinyGPSPlus.git#71a82db35f3b973440044c476d4bcdc673b104f4
|
||||||
https://github.com/meshtastic/TinyGPSPlus.git#71a82db35f3b973440044c476d4bcdc673b104f4
|
https://github.com/meshtastic/ArduinoThread.git#1ae8778c85d0a2a729f989e0b1e7d7c4dc84eef0
|
||||||
https://github.com/meshtastic/ArduinoThread.git#1ae8778c85d0a2a729f989e0b1e7d7c4dc84eef0
|
nanopb/Nanopb@0.4.9
|
||||||
nanopb/Nanopb@^0.4.9
|
erriez/ErriezCRC32@1.0.1
|
||||||
erriez/ErriezCRC32@^1.0.1
|
|
||||||
|
|
||||||
; Used for the code analysis in PIO Home / Inspect
|
; Used for the code analysis in PIO Home / Inspect
|
||||||
check_tool = cppcheck
|
check_tool = cppcheck
|
||||||
check_skip_packages = yes
|
check_skip_packages = yes
|
||||||
check_flags =
|
check_flags =
|
||||||
-DAPP_VERSION=1.0.0
|
-DAPP_VERSION=1.0.0
|
||||||
--suppressions-list=suppressions.txt
|
--suppressions-list=suppressions.txt
|
||||||
--inline-suppr
|
--inline-suppr
|
||||||
|
|
||||||
; Common settings for conventional (non Portduino) Arduino targets
|
; Common settings for conventional (non Portduino) Arduino targets
|
||||||
[arduino_base]
|
[arduino_base]
|
||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
end2endzone/NonBlockingRTTTL@1.3.0
|
||||||
https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#5cf62b36c6f30bc72a07bdb2c11fc9a22d1e31da
|
|
||||||
|
|
||||||
build_flags = ${env.build_flags} -Os
|
build_flags = ${env.build_flags} -Os
|
||||||
build_src_filter = ${env.build_src_filter} -<platform/portduino/>
|
build_src_filter = ${env.build_src_filter} -<platform/portduino/>
|
||||||
|
|
||||||
; Common libs for communicating over TCP/IP networks such as MQTT
|
; Common libs for communicating over TCP/IP networks such as MQTT
|
||||||
[networking_base]
|
[networking_base]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
knolleary/PubSubClient@^2.8
|
knolleary/PubSubClient@2.8
|
||||||
arduino-libraries/NTPClient@^3.1.0
|
arduino-libraries/NTPClient@3.1.0
|
||||||
arcao/Syslog@^2.0.0
|
arcao/Syslog@2.0.0
|
||||||
|
|
||||||
|
[radiolib_base]
|
||||||
|
lib_deps =
|
||||||
|
jgromes/RadioLib@7.1.2
|
||||||
|
|
||||||
; Common libs for environmental measurements in telemetry module
|
; Common libs for environmental measurements in telemetry module
|
||||||
; (not included in native / portduino)
|
; (not included in native / portduino)
|
||||||
[environmental_base]
|
[environmental_base]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
adafruit/Adafruit BusIO@^1.16.1
|
adafruit/Adafruit BusIO@1.16.2
|
||||||
adafruit/Adafruit Unified Sensor@^1.1.11
|
adafruit/Adafruit Unified Sensor@1.1.14
|
||||||
adafruit/Adafruit BMP280 Library@^2.6.8
|
adafruit/Adafruit BMP280 Library@2.6.8
|
||||||
adafruit/Adafruit BMP085 Library@^1.2.4
|
adafruit/Adafruit BMP085 Library@1.2.4
|
||||||
adafruit/Adafruit BME280 Library@^2.2.2
|
adafruit/Adafruit BME280 Library@2.2.4
|
||||||
adafruit/Adafruit BMP3XX Library@^2.1.5
|
adafruit/Adafruit BMP3XX Library@2.1.5
|
||||||
adafruit/Adafruit MCP9808 Library@^2.0.0
|
adafruit/Adafruit MCP9808 Library@2.0.2
|
||||||
adafruit/Adafruit INA260 Library@^1.5.0
|
adafruit/Adafruit INA260 Library@1.5.2
|
||||||
adafruit/Adafruit INA219@^1.2.0
|
adafruit/Adafruit INA219@1.2.3
|
||||||
adafruit/Adafruit MAX1704X@^1.0.3
|
adafruit/Adafruit MAX1704X@1.0.3
|
||||||
adafruit/Adafruit SHTC3 Library@^1.0.0
|
adafruit/Adafruit SHTC3 Library@1.0.1
|
||||||
adafruit/Adafruit LPS2X@^2.0.4
|
adafruit/Adafruit LPS2X@2.0.6
|
||||||
adafruit/Adafruit SHT31 Library@^2.2.2
|
adafruit/Adafruit SHT31 Library@2.2.2
|
||||||
adafruit/Adafruit PM25 AQI Sensor@^1.1.1
|
adafruit/Adafruit PM25 AQI Sensor@1.1.1
|
||||||
adafruit/Adafruit MPU6050@^2.2.4
|
adafruit/Adafruit MPU6050@2.2.6
|
||||||
adafruit/Adafruit LIS3DH@^1.3.0
|
adafruit/Adafruit LIS3DH@1.3.0
|
||||||
adafruit/Adafruit AHTX0@^2.0.5
|
adafruit/Adafruit AHTX0@2.0.5
|
||||||
adafruit/Adafruit LSM6DS@^4.7.2
|
adafruit/Adafruit LSM6DS@4.7.3
|
||||||
adafruit/Adafruit VEML7700 Library@^2.1.6
|
adafruit/Adafruit VEML7700 Library@2.1.6
|
||||||
adafruit/Adafruit SHT4x Library@^1.0.4
|
adafruit/Adafruit SHT4x Library@1.0.5
|
||||||
adafruit/Adafruit TSL2591 Library@^1.4.5
|
adafruit/Adafruit TSL2591 Library@1.4.5
|
||||||
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@^1.0.5
|
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6
|
||||||
sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@^1.2.13
|
sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.2.13
|
||||||
ClosedCube OPT3001@^1.1.2
|
ClosedCube OPT3001@1.1.2
|
||||||
emotibit/EmotiBit MLX90632@^1.0.8
|
emotibit/EmotiBit MLX90632@1.0.8
|
||||||
dfrobot/DFRobot_RTU@^1.0.3
|
adafruit/Adafruit MLX90614 Library@2.1.5
|
||||||
sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@^1.1.2
|
https://github.com/boschsensortec/Bosch-BSEC2-Library#v1.7.2502
|
||||||
adafruit/Adafruit MLX90614 Library@^2.1.5
|
boschsensortec/BME68x Sensor Library@1.1.40407
|
||||||
|
https://github.com/KodinLanewave/INA3221@1.0.1
|
||||||
|
mprograms/QMC5883LCompass@1.2.3
|
||||||
|
dfrobot/DFRobot_RTU@1.0.3
|
||||||
|
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d
|
||||||
|
robtillaart/INA226@0.6.0
|
||||||
|
|
||||||
https://github.com/boschsensortec/Bosch-BSEC2-Library#v1.7.2502
|
; Health Sensor Libraries
|
||||||
boschsensortec/BME68x Sensor Library@^1.1.40407
|
sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2
|
||||||
https://github.com/KodinLanewave/INA3221@^1.0.1
|
|
||||||
lewisxhe/SensorLib@0.2.0
|
|
||||||
mprograms/QMC5883LCompass@^1.2.0
|
|
||||||
|
|
||||||
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d
|
|
||||||
https://github.com/gjelsoe/STK8xxx-Accelerometer.git#v0.1.1
|
|
||||||
|
|||||||
Submodule protobufs updated: 06cf134e2b...76f806e1bb
1
release/latest/.gitignore
vendored
1
release/latest/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
curfirmwareversion.xml
|
|
||||||
2
rpkg.conf
Normal file
2
rpkg.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[rpkg]
|
||||||
|
user_macros = "${git_props:root}/bin/rpkg.macros"
|
||||||
@@ -64,7 +64,7 @@ class AudioThread : public concurrency::OSThread
|
|||||||
void initOutput()
|
void initOutput()
|
||||||
{
|
{
|
||||||
audioOut = new AudioOutputI2S(1, AudioOutputI2S::EXTERNAL_I2S);
|
audioOut = new AudioOutputI2S(1, AudioOutputI2S::EXTERNAL_I2S);
|
||||||
audioOut->SetPinout(DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT);
|
audioOut->SetPinout(DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT, DAC_I2S_MCLK);
|
||||||
audioOut->SetGain(0.2);
|
audioOut->SetGain(0.2);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "ButtonThread.h"
|
#include "ButtonThread.h"
|
||||||
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#if !MESHTASTIC_EXCLUDE_GPS
|
#if !MESHTASTIC_EXCLUDE_GPS
|
||||||
#include "GPS.h"
|
#include "GPS.h"
|
||||||
@@ -26,12 +27,12 @@ using namespace concurrency;
|
|||||||
ButtonThread *buttonThread; // Declared extern in header
|
ButtonThread *buttonThread; // Declared extern in header
|
||||||
volatile ButtonThread::ButtonEventType ButtonThread::btnEvent = ButtonThread::BUTTON_EVENT_NONE;
|
volatile ButtonThread::ButtonEventType ButtonThread::btnEvent = ButtonThread::BUTTON_EVENT_NONE;
|
||||||
|
|
||||||
#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO)
|
#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO) || defined(USERPREFS_BUTTON_PIN)
|
||||||
OneButton ButtonThread::userButton; // Get reference to static member
|
OneButton ButtonThread::userButton; // Get reference to static member
|
||||||
#endif
|
#endif
|
||||||
ButtonThread::ButtonThread() : OSThread("Button")
|
ButtonThread::ButtonThread() : OSThread("Button")
|
||||||
{
|
{
|
||||||
#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO)
|
#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO) || defined(USERPREFS_BUTTON_PIN)
|
||||||
|
|
||||||
#if defined(ARCH_PORTDUINO)
|
#if defined(ARCH_PORTDUINO)
|
||||||
if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) {
|
if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) {
|
||||||
@@ -39,7 +40,12 @@ ButtonThread::ButtonThread() : OSThread("Button")
|
|||||||
LOG_DEBUG("Use GPIO%02d for button", settingsMap[user]);
|
LOG_DEBUG("Use GPIO%02d for button", settingsMap[user]);
|
||||||
}
|
}
|
||||||
#elif defined(BUTTON_PIN)
|
#elif defined(BUTTON_PIN)
|
||||||
int pin = config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN; // Resolved button pin
|
#if !defined(USERPREFS_BUTTON_PIN)
|
||||||
|
int pin = config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN; // Resolved button pin
|
||||||
|
#endif
|
||||||
|
#ifdef USERPREFS_BUTTON_PIN
|
||||||
|
int pin = config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN; // Resolved button pin
|
||||||
|
#endif
|
||||||
#if defined(HELTEC_CAPSULE_SENSOR_V3)
|
#if defined(HELTEC_CAPSULE_SENSOR_V3)
|
||||||
this->userButton = OneButton(pin, false, false);
|
this->userButton = OneButton(pin, false, false);
|
||||||
#elif defined(BUTTON_ACTIVE_LOW)
|
#elif defined(BUTTON_ACTIVE_LOW)
|
||||||
@@ -59,7 +65,7 @@ ButtonThread::ButtonThread() : OSThread("Button")
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO)
|
#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO) || defined(USERPREFS_BUTTON_PIN)
|
||||||
userButton.attachClick(userButtonPressed);
|
userButton.attachClick(userButtonPressed);
|
||||||
userButton.setClickMs(BUTTON_CLICK_MS);
|
userButton.setClickMs(BUTTON_CLICK_MS);
|
||||||
userButton.setPressMs(BUTTON_LONGPRESS_MS);
|
userButton.setPressMs(BUTTON_LONGPRESS_MS);
|
||||||
@@ -102,7 +108,7 @@ int32_t ButtonThread::runOnce()
|
|||||||
// If the button is pressed we suppress CPU sleep until release
|
// If the button is pressed we suppress CPU sleep until release
|
||||||
canSleep = true; // Assume we should not keep the board awake
|
canSleep = true; // Assume we should not keep the board awake
|
||||||
|
|
||||||
#if defined(BUTTON_PIN)
|
#if defined(BUTTON_PIN) || defined(USERPREFS_BUTTON_PIN)
|
||||||
userButton.tick();
|
userButton.tick();
|
||||||
canSleep &= userButton.isIdle();
|
canSleep &= userButton.isIdle();
|
||||||
#elif defined(ARCH_PORTDUINO)
|
#elif defined(ARCH_PORTDUINO)
|
||||||
@@ -130,7 +136,12 @@ int32_t ButtonThread::runOnce()
|
|||||||
return 50;
|
return 50;
|
||||||
}
|
}
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
|
#if !defined(USERPREFS_BUTTON_PIN)
|
||||||
if (((config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN) !=
|
if (((config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN) !=
|
||||||
|
#endif
|
||||||
|
#if defined(USERPREFS_BUTTON_PIN)
|
||||||
|
if (((config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN) !=
|
||||||
|
#endif
|
||||||
moduleConfig.canned_message.inputbroker_pin_press) ||
|
moduleConfig.canned_message.inputbroker_pin_press) ||
|
||||||
!(moduleConfig.canned_message.updown1_enabled || moduleConfig.canned_message.rotary1_enabled) ||
|
!(moduleConfig.canned_message.updown1_enabled || moduleConfig.canned_message.rotary1_enabled) ||
|
||||||
!moduleConfig.canned_message.enabled) {
|
!moduleConfig.canned_message.enabled) {
|
||||||
@@ -244,7 +255,12 @@ void ButtonThread::attachButtonInterrupts()
|
|||||||
#elif defined(BUTTON_PIN)
|
#elif defined(BUTTON_PIN)
|
||||||
// Interrupt for user button, during normal use. Improves responsiveness.
|
// Interrupt for user button, during normal use. Improves responsiveness.
|
||||||
attachInterrupt(
|
attachInterrupt(
|
||||||
|
#if !defined(USERPREFS_BUTTON_PIN)
|
||||||
config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN,
|
config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN,
|
||||||
|
#endif
|
||||||
|
#if defined(USERPREFS_BUTTON_PIN)
|
||||||
|
config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN,
|
||||||
|
#endif
|
||||||
[]() {
|
[]() {
|
||||||
ButtonThread::userButton.tick();
|
ButtonThread::userButton.tick();
|
||||||
runASAP = true;
|
runASAP = true;
|
||||||
@@ -273,8 +289,13 @@ void ButtonThread::detachButtonInterrupts()
|
|||||||
if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC)
|
if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC)
|
||||||
detachInterrupt(settingsMap[user]);
|
detachInterrupt(settingsMap[user]);
|
||||||
#elif defined(BUTTON_PIN)
|
#elif defined(BUTTON_PIN)
|
||||||
|
#if !defined(USERPREFS_BUTTON_PIN)
|
||||||
detachInterrupt(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN);
|
detachInterrupt(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(USERPREFS_BUTTON_PIN)
|
||||||
|
detachInterrupt(config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BUTTON_PIN_ALT
|
#ifdef BUTTON_PIN_ALT
|
||||||
detachInterrupt(BUTTON_PIN_ALT);
|
detachInterrupt(BUTTON_PIN_ALT);
|
||||||
@@ -315,7 +336,7 @@ void ButtonThread::userButtonMultiPressed(void *callerThread)
|
|||||||
// Non-static method, runs during callback. Grabs info while still valid
|
// Non-static method, runs during callback. Grabs info while still valid
|
||||||
void ButtonThread::storeClickCount()
|
void ButtonThread::storeClickCount()
|
||||||
{
|
{
|
||||||
#ifdef BUTTON_PIN
|
#if defined(BUTTON_PIN) || defined(USERPREFS_BUTTON_PIN)
|
||||||
multipressClickCount = userButton.getNumberClicks();
|
multipressClickCount = userButton.getNumberClicks();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
void storeClickCount();
|
void storeClickCount();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO)
|
#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO) || defined(USERPREFS_BUTTON_PIN)
|
||||||
static OneButton userButton; // Static - accessed from an interrupt
|
static OneButton userButton; // Static - accessed from an interrupt
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUTTON_PIN_ALT
|
#ifdef BUTTON_PIN_ALT
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
#define LOG_CRIT(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
#define LOG_CRIT(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
#define LOG_TRACE(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
#define LOG_TRACE(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) && !defined(PIO_UNIT_TESTING)
|
#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE)
|
||||||
#define LOG_DEBUG(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_DEBUG, __VA_ARGS__)
|
#define LOG_DEBUG(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_DEBUG, __VA_ARGS__)
|
||||||
#define LOG_INFO(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_INFO, __VA_ARGS__)
|
#define LOG_INFO(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_INFO, __VA_ARGS__)
|
||||||
#define LOG_WARN(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_WARN, __VA_ARGS__)
|
#define LOG_WARN(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_WARN, __VA_ARGS__)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "FSCommon.h"
|
#include "FSCommon.h"
|
||||||
|
#include "SPILock.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#ifdef HAS_SDCARD
|
#ifdef HAS_SDCARD
|
||||||
@@ -55,6 +56,15 @@ extern "C" void lfs_assert(const char *reason)
|
|||||||
{
|
{
|
||||||
LOG_ERROR("LFS assert: %s", reason);
|
LOG_ERROR("LFS assert: %s", reason);
|
||||||
lfs_assert_failed = true;
|
lfs_assert_failed = true;
|
||||||
|
|
||||||
|
#ifndef ARCH_PORTDUINO
|
||||||
|
#ifdef FSCom
|
||||||
|
// CORRUPTED FILESYSTEM. This causes bootloop so
|
||||||
|
// might as well try formatting now.
|
||||||
|
LOG_ERROR("Trying FSCom.format()");
|
||||||
|
FSCom.format();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,6 +103,8 @@ bool copyFile(const char *from, const char *to)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
#elif defined(FSCom)
|
#elif defined(FSCom)
|
||||||
|
// take SPI Lock
|
||||||
|
concurrency::LockGuard g(spiLock);
|
||||||
unsigned char cbuffer[16];
|
unsigned char cbuffer[16];
|
||||||
|
|
||||||
File f1 = FSCom.open(from, FILE_O_READ);
|
File f1 = FSCom.open(from, FILE_O_READ);
|
||||||
@@ -136,16 +148,23 @@ bool renameFile(const char *pathFrom, const char *pathTo)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#elif defined(FSCom)
|
#elif defined(FSCom)
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
|
// take SPI Lock
|
||||||
|
spiLock->lock();
|
||||||
// rename was fixed for ESP32 IDF LittleFS in April
|
// rename was fixed for ESP32 IDF LittleFS in April
|
||||||
return FSCom.rename(pathFrom, pathTo);
|
bool result = FSCom.rename(pathFrom, pathTo);
|
||||||
|
spiLock->unlock();
|
||||||
|
return result;
|
||||||
#else
|
#else
|
||||||
|
// copyFile does its own locking.
|
||||||
if (copyFile(pathFrom, pathTo) && FSCom.remove(pathFrom)) {
|
if (copyFile(pathFrom, pathTo) && FSCom.remove(pathFrom)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +174,7 @@ bool renameFile(const char *pathFrom, const char *pathTo)
|
|||||||
* @brief Get the list of files in a directory.
|
* @brief Get the list of files in a directory.
|
||||||
*
|
*
|
||||||
* This function returns a list of files in a directory. The list includes the full path of each file.
|
* This function returns a list of files in a directory. The list includes the full path of each file.
|
||||||
|
* We can't use SPILOCK here because of recursion. Callers of this function should use SPILOCK.
|
||||||
*
|
*
|
||||||
* @param dirname The name of the directory.
|
* @param dirname The name of the directory.
|
||||||
* @param levels The number of levels of subdirectories to list.
|
* @param levels The number of levels of subdirectories to list.
|
||||||
@@ -203,6 +223,7 @@ std::vector<meshtastic_FileInfo> getFiles(const char *dirname, uint8_t levels)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists the contents of a directory.
|
* Lists the contents of a directory.
|
||||||
|
* We can't use SPILOCK here because of recursion. Callers of this function should use SPILOCK.
|
||||||
*
|
*
|
||||||
* @param dirname The name of the directory to list.
|
* @param dirname The name of the directory to list.
|
||||||
* @param levels The number of levels of subdirectories to list.
|
* @param levels The number of levels of subdirectories to list.
|
||||||
@@ -316,20 +337,23 @@ void listDir(const char *dirname, uint8_t levels, bool del)
|
|||||||
void rmDir(const char *dirname)
|
void rmDir(const char *dirname)
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
|
|
||||||
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
listDir(dirname, 10, true);
|
listDir(dirname, 10, true);
|
||||||
#elif defined(ARCH_NRF52)
|
#elif defined(ARCH_NRF52)
|
||||||
// nRF52 implementation of LittleFS has a recursive delete function
|
// nRF52 implementation of LittleFS has a recursive delete function
|
||||||
FSCom.rmdir_r(dirname);
|
FSCom.rmdir_r(dirname);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void fsInit()
|
void fsInit()
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
|
spiLock->lock();
|
||||||
if (!FSBegin()) {
|
if (!FSBegin()) {
|
||||||
LOG_ERROR("Filesystem mount Failed.");
|
LOG_ERROR("Filesystem mount failed");
|
||||||
// assert(0); This auto-formats the partition, so no need to fail here.
|
// assert(0); This auto-formats the partition, so no need to fail here.
|
||||||
}
|
}
|
||||||
#if defined(ARCH_ESP32)
|
#if defined(ARCH_ESP32)
|
||||||
@@ -338,6 +362,7 @@ void fsInit()
|
|||||||
LOG_DEBUG("Filesystem files:");
|
LOG_DEBUG("Filesystem files:");
|
||||||
#endif
|
#endif
|
||||||
listDir("/", 10);
|
listDir("/", 10);
|
||||||
|
spiLock->unlock();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,6 +372,7 @@ void fsInit()
|
|||||||
void setupSDCard()
|
void setupSDCard()
|
||||||
{
|
{
|
||||||
#ifdef HAS_SDCARD
|
#ifdef HAS_SDCARD
|
||||||
|
concurrency::LockGuard g(spiLock);
|
||||||
SDHandler.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
|
SDHandler.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
|
||||||
|
|
||||||
if (!SD.begin(SDCARD_CS, SDHandler)) {
|
if (!SD.begin(SDCARD_CS, SDHandler)) {
|
||||||
@@ -374,4 +400,4 @@ void setupSDCard()
|
|||||||
LOG_DEBUG("Total space: %lu MB", (uint32_t)(SD.totalBytes() / (1024 * 1024)));
|
LOG_DEBUG("Total space: %lu MB", (uint32_t)(SD.totalBytes() / (1024 * 1024)));
|
||||||
LOG_DEBUG("Used space: %lu MB", (uint32_t)(SD.usedBytes() / (1024 * 1024)));
|
LOG_DEBUG("Used space: %lu MB", (uint32_t)(SD.usedBytes() / (1024 * 1024)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,8 +72,9 @@ static const uint8_t ext_chrg_detect_value = EXT_CHRG_DETECT_VALUE;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO)
|
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO)
|
||||||
INA260Sensor ina260Sensor;
|
|
||||||
INA219Sensor ina219Sensor;
|
INA219Sensor ina219Sensor;
|
||||||
|
INA226Sensor ina226Sensor;
|
||||||
|
INA260Sensor ina260Sensor;
|
||||||
INA3221Sensor ina3221Sensor;
|
INA3221Sensor ina3221Sensor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -251,7 +252,6 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
#if HAS_TELEMETRY && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(HAS_PMU) && \
|
#if HAS_TELEMETRY && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(HAS_PMU) && \
|
||||||
!MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
!MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||||
if (hasINA()) {
|
if (hasINA()) {
|
||||||
LOG_DEBUG("Use INA on I2C addr 0x%x for device battery voltage", config.power.device_battery_ina_address);
|
|
||||||
return getINAVoltage();
|
return getINAVoltage();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -271,7 +271,7 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
config.power.adc_multiplier_override > 0 ? config.power.adc_multiplier_override : ADC_MULTIPLIER;
|
config.power.adc_multiplier_override > 0 ? config.power.adc_multiplier_override : ADC_MULTIPLIER;
|
||||||
// Do not call analogRead() often.
|
// Do not call analogRead() often.
|
||||||
const uint32_t min_read_interval = 5000;
|
const uint32_t min_read_interval = 5000;
|
||||||
if (!Throttle::isWithinTimespanMs(last_read_time_ms, min_read_interval)) {
|
if (!initial_read_done || !Throttle::isWithinTimespanMs(last_read_time_ms, min_read_interval)) {
|
||||||
last_read_time_ms = millis();
|
last_read_time_ms = millis();
|
||||||
|
|
||||||
uint32_t raw = 0;
|
uint32_t raw = 0;
|
||||||
@@ -414,7 +414,20 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
#ifdef EXT_CHRG_DETECT
|
#ifdef EXT_CHRG_DETECT
|
||||||
return digitalRead(EXT_CHRG_DETECT) == ext_chrg_detect_value;
|
return digitalRead(EXT_CHRG_DETECT) == ext_chrg_detect_value;
|
||||||
#else
|
#else
|
||||||
|
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && \
|
||||||
|
!defined(DISABLE_INA_CHARGING_DETECTION)
|
||||||
|
if (hasINA()) {
|
||||||
|
// get current flow from INA sensor - negative value means power flowing into the battery
|
||||||
|
// default assuming BATTERY+ <--> INA_VIN+ <--> SHUNT RESISTOR <--> INA_VIN- <--> LOAD
|
||||||
|
LOG_DEBUG("Using INA on I2C addr 0x%x for charging detection", config.power.device_battery_ina_address);
|
||||||
|
#if defined(INA_CHARGING_DETECTION_INVERT)
|
||||||
|
return getINACurrent() > 0;
|
||||||
|
#else
|
||||||
|
return getINACurrent() < 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
return isBatteryConnect() && isVbusIn();
|
return isBatteryConnect() && isVbusIn();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,6 +464,9 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
{
|
{
|
||||||
if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) {
|
if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) {
|
||||||
return ina219Sensor.getBusVoltageMv();
|
return ina219Sensor.getBusVoltageMv();
|
||||||
|
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA226].first ==
|
||||||
|
config.power.device_battery_ina_address) {
|
||||||
|
return ina226Sensor.getBusVoltageMv();
|
||||||
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA260].first ==
|
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA260].first ==
|
||||||
config.power.device_battery_ina_address) {
|
config.power.device_battery_ina_address) {
|
||||||
return ina260Sensor.getBusVoltageMv();
|
return ina260Sensor.getBusVoltageMv();
|
||||||
@@ -461,6 +477,20 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int16_t getINACurrent()
|
||||||
|
{
|
||||||
|
if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) {
|
||||||
|
return ina219Sensor.getCurrentMa();
|
||||||
|
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA226].first ==
|
||||||
|
config.power.device_battery_ina_address) {
|
||||||
|
return ina226Sensor.getCurrentMa();
|
||||||
|
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA3221].first ==
|
||||||
|
config.power.device_battery_ina_address) {
|
||||||
|
return ina3221Sensor.getCurrentMa();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool hasINA()
|
bool hasINA()
|
||||||
{
|
{
|
||||||
if (!config.power.device_battery_ina_address) {
|
if (!config.power.device_battery_ina_address) {
|
||||||
@@ -470,6 +500,10 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
if (!ina219Sensor.isInitialized())
|
if (!ina219Sensor.isInitialized())
|
||||||
return ina219Sensor.runOnce() > 0;
|
return ina219Sensor.runOnce() > 0;
|
||||||
return ina219Sensor.isRunning();
|
return ina219Sensor.isRunning();
|
||||||
|
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA226].first ==
|
||||||
|
config.power.device_battery_ina_address) {
|
||||||
|
if (!ina226Sensor.isInitialized())
|
||||||
|
return ina226Sensor.runOnce() > 0;
|
||||||
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA260].first ==
|
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA260].first ==
|
||||||
config.power.device_battery_ina_address) {
|
config.power.device_battery_ina_address) {
|
||||||
if (!ina260Sensor.isInitialized())
|
if (!ina260Sensor.isInitialized())
|
||||||
@@ -614,7 +648,7 @@ void Power::shutdown()
|
|||||||
#ifdef PIN_LED3
|
#ifdef PIN_LED3
|
||||||
ledOff(PIN_LED3);
|
ledOff(PIN_LED3);
|
||||||
#endif
|
#endif
|
||||||
doDeepSleep(DELAY_FOREVER, false);
|
doDeepSleep(DELAY_FOREVER, false, false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1155,4 +1189,4 @@ bool Power::lipoInit()
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,6 +19,10 @@
|
|||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include "target_specific.h"
|
#include "target_specific.h"
|
||||||
|
|
||||||
|
#if HAS_WIFI && !defined(ARCH_PORTDUINO)
|
||||||
|
#include "mesh/wifi/WiFiAPClient.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef SLEEP_TIME
|
#ifndef SLEEP_TIME
|
||||||
#define SLEEP_TIME 30
|
#define SLEEP_TIME 30
|
||||||
#endif
|
#endif
|
||||||
@@ -55,9 +59,14 @@ static void sdsEnter()
|
|||||||
{
|
{
|
||||||
LOG_DEBUG("State: SDS");
|
LOG_DEBUG("State: SDS");
|
||||||
// FIXME - make sure GPS and LORA radio are off first - because we want close to zero current draw
|
// FIXME - make sure GPS and LORA radio are off first - because we want close to zero current draw
|
||||||
doDeepSleep(Default::getConfiguredOrDefaultMs(config.power.sds_secs), false);
|
doDeepSleep(Default::getConfiguredOrDefaultMs(config.power.sds_secs), false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void lowBattSDSEnter()
|
||||||
|
{
|
||||||
|
LOG_DEBUG("State: Lower batt SDS");
|
||||||
|
doDeepSleep(Default::getConfiguredOrDefaultMs(config.power.sds_secs), false, true);
|
||||||
|
}
|
||||||
extern Power *power;
|
extern Power *power;
|
||||||
|
|
||||||
static void shutdownEnter()
|
static void shutdownEnter()
|
||||||
@@ -247,6 +256,7 @@ static void bootEnter()
|
|||||||
|
|
||||||
State stateSHUTDOWN(shutdownEnter, NULL, NULL, "SHUTDOWN");
|
State stateSHUTDOWN(shutdownEnter, NULL, NULL, "SHUTDOWN");
|
||||||
State stateSDS(sdsEnter, NULL, NULL, "SDS");
|
State stateSDS(sdsEnter, NULL, NULL, "SDS");
|
||||||
|
State stateLowBattSDS(lowBattSDSEnter, NULL, NULL, "SDS");
|
||||||
State stateLS(lsEnter, lsIdle, lsExit, "LS");
|
State stateLS(lsEnter, lsIdle, lsExit, "LS");
|
||||||
State stateNB(nbEnter, NULL, NULL, "NB");
|
State stateNB(nbEnter, NULL, NULL, "NB");
|
||||||
State stateDARK(darkEnter, NULL, NULL, "DARK");
|
State stateDARK(darkEnter, NULL, NULL, "DARK");
|
||||||
@@ -291,12 +301,12 @@ void PowerFSM_setup()
|
|||||||
"Press"); // Allow button to work while in serial API
|
"Press"); // Allow button to work while in serial API
|
||||||
|
|
||||||
// Handle critically low power battery by forcing deep sleep
|
// Handle critically low power battery by forcing deep sleep
|
||||||
powerFSM.add_transition(&stateBOOT, &stateSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
powerFSM.add_transition(&stateBOOT, &stateLowBattSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
||||||
powerFSM.add_transition(&stateLS, &stateSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
powerFSM.add_transition(&stateLS, &stateLowBattSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
||||||
powerFSM.add_transition(&stateNB, &stateSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
powerFSM.add_transition(&stateNB, &stateLowBattSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
||||||
powerFSM.add_transition(&stateDARK, &stateSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
powerFSM.add_transition(&stateDARK, &stateLowBattSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
||||||
powerFSM.add_transition(&stateON, &stateSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
powerFSM.add_transition(&stateON, &stateLowBattSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
||||||
powerFSM.add_transition(&stateSERIAL, &stateSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
powerFSM.add_transition(&stateSERIAL, &stateLowBattSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
||||||
|
|
||||||
// Handle being told to power off
|
// Handle being told to power off
|
||||||
powerFSM.add_transition(&stateBOOT, &stateSHUTDOWN, EVENT_SHUTDOWN, NULL, "Shutdown");
|
powerFSM.add_transition(&stateBOOT, &stateSHUTDOWN, EVENT_SHUTDOWN, NULL, "Shutdown");
|
||||||
@@ -371,9 +381,9 @@ void PowerFSM_setup()
|
|||||||
// We never enter light-sleep or NB states on NRF52 (because the CPU uses so little power normally)
|
// We never enter light-sleep or NB states on NRF52 (because the CPU uses so little power normally)
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
// See: https://github.com/meshtastic/firmware/issues/1071
|
// See: https://github.com/meshtastic/firmware/issues/1071
|
||||||
// Don't add power saving transitions if we are a power saving tracker or sensor. Sleep will be initiated through the
|
// Don't add power saving transitions if we are a power saving tracker or sensor or have Wifi enabled. Sleep will be initiated
|
||||||
// modules
|
// through the modules
|
||||||
if ((isRouter || config.power.is_power_saving) && !isTrackerOrSensor) {
|
if ((isRouter || config.power.is_power_saving) && !isWifiAvailable() && !isTrackerOrSensor) {
|
||||||
powerFSM.add_timed_transition(&stateNB, &stateLS,
|
powerFSM.add_timed_transition(&stateNB, &stateLS,
|
||||||
Default::getConfiguredOrDefaultMs(config.power.min_wake_secs, default_min_wake_secs), NULL,
|
Default::getConfiguredOrDefaultMs(config.power.min_wake_secs, default_min_wake_secs), NULL,
|
||||||
"Min wake timeout");
|
"Min wake timeout");
|
||||||
|
|||||||
@@ -5,6 +5,14 @@
|
|||||||
// Only way to work on both esp32 and nrf52
|
// Only way to work on both esp32 and nrf52
|
||||||
static File openFile(const char *filename, bool fullAtomic)
|
static File openFile(const char *filename, bool fullAtomic)
|
||||||
{
|
{
|
||||||
|
concurrency::LockGuard g(spiLock);
|
||||||
|
LOG_DEBUG("Opening %s, fullAtomic=%d", filename, fullAtomic);
|
||||||
|
#ifdef ARCH_NRF52
|
||||||
|
lfs_assert_failed = false;
|
||||||
|
File file = FSCom.open(filename, FILE_O_WRITE);
|
||||||
|
file.seek(0);
|
||||||
|
return file;
|
||||||
|
#endif
|
||||||
if (!fullAtomic)
|
if (!fullAtomic)
|
||||||
FSCom.remove(filename); // Nuke the old file to make space (ignore if it !exists)
|
FSCom.remove(filename); // Nuke the old file to make space (ignore if it !exists)
|
||||||
|
|
||||||
@@ -13,7 +21,6 @@ static File openFile(const char *filename, bool fullAtomic)
|
|||||||
|
|
||||||
// clear any previous LFS errors
|
// clear any previous LFS errors
|
||||||
lfs_assert_failed = false;
|
lfs_assert_failed = false;
|
||||||
|
|
||||||
return FSCom.open(filenameTmp.c_str(), FILE_O_WRITE);
|
return FSCom.open(filenameTmp.c_str(), FILE_O_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,14 +60,26 @@ bool SafeFile::close()
|
|||||||
if (!f)
|
if (!f)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
spiLock->lock();
|
||||||
|
#ifdef ARCH_NRF52
|
||||||
|
f.truncate();
|
||||||
|
#endif
|
||||||
f.close();
|
f.close();
|
||||||
|
spiLock->unlock();
|
||||||
|
|
||||||
|
#ifdef ARCH_NRF52
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
if (!testReadback())
|
if (!testReadback())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// brief window of risk here ;-)
|
{ // Scope for lock
|
||||||
if (fullAtomic && FSCom.exists(filename.c_str()) && !FSCom.remove(filename.c_str())) {
|
concurrency::LockGuard g(spiLock);
|
||||||
LOG_ERROR("Can't remove old pref file");
|
// brief window of risk here ;-)
|
||||||
return false;
|
if (fullAtomic && FSCom.exists(filename.c_str()) && !FSCom.remove(filename.c_str())) {
|
||||||
|
LOG_ERROR("Can't remove old pref file");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String filenameTmp = filename;
|
String filenameTmp = filename;
|
||||||
@@ -76,6 +95,7 @@ bool SafeFile::close()
|
|||||||
/// Read our (closed) tempfile back in and compare the hash
|
/// Read our (closed) tempfile back in and compare the hash
|
||||||
bool SafeFile::testReadback()
|
bool SafeFile::testReadback()
|
||||||
{
|
{
|
||||||
|
concurrency::LockGuard g(spiLock);
|
||||||
bool lfs_failed = lfs_assert_failed;
|
bool lfs_failed = lfs_assert_failed;
|
||||||
lfs_assert_failed = false;
|
lfs_assert_failed = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "FSCommon.h"
|
#include "FSCommon.h"
|
||||||
|
#include "SPILock.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
|
|||||||
@@ -13,17 +13,17 @@ void AirTime::logAirtime(reportTypes reportType, uint32_t airtime_ms)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (reportType == TX_LOG) {
|
if (reportType == TX_LOG) {
|
||||||
LOG_DEBUG("Packet transmitted : %ums", airtime_ms);
|
LOG_DEBUG("Packet TX: %ums", airtime_ms);
|
||||||
this->airtimes.periodTX[0] = this->airtimes.periodTX[0] + airtime_ms;
|
this->airtimes.periodTX[0] = this->airtimes.periodTX[0] + airtime_ms;
|
||||||
air_period_tx[0] = air_period_tx[0] + airtime_ms;
|
air_period_tx[0] = air_period_tx[0] + airtime_ms;
|
||||||
|
|
||||||
this->utilizationTX[this->getPeriodUtilHour()] = this->utilizationTX[this->getPeriodUtilHour()] + airtime_ms;
|
this->utilizationTX[this->getPeriodUtilHour()] = this->utilizationTX[this->getPeriodUtilHour()] + airtime_ms;
|
||||||
} else if (reportType == RX_LOG) {
|
} else if (reportType == RX_LOG) {
|
||||||
LOG_DEBUG("Packet received : %ums", airtime_ms);
|
LOG_DEBUG("Packet RX: %ums", airtime_ms);
|
||||||
this->airtimes.periodRX[0] = this->airtimes.periodRX[0] + airtime_ms;
|
this->airtimes.periodRX[0] = this->airtimes.periodRX[0] + airtime_ms;
|
||||||
air_period_rx[0] = air_period_rx[0] + airtime_ms;
|
air_period_rx[0] = air_period_rx[0] + airtime_ms;
|
||||||
} else if (reportType == RX_ALL_LOG) {
|
} else if (reportType == RX_ALL_LOG) {
|
||||||
LOG_DEBUG("Packet received (noise?) : %ums", airtime_ms);
|
LOG_DEBUG("Packet RX (noise?) : %ums", airtime_ms);
|
||||||
this->airtimes.periodRX_ALL[0] = this->airtimes.periodRX_ALL[0] + airtime_ms;
|
this->airtimes.periodRX_ALL[0] = this->airtimes.periodRX_ALL[0] + airtime_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ bool AirTime::isTxAllowedChannelUtil(bool polite)
|
|||||||
if (channelUtilizationPercent() < percentage) {
|
if (channelUtilizationPercent() < percentage) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("Channel utilization is >%d percent. Skip opportunity to send.", percentage);
|
LOG_WARN("Ch. util >%d%%. Skip send", percentage);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,8 +137,7 @@ bool AirTime::isTxAllowedAirUtil()
|
|||||||
if (utilizationTXPercent() < myRegion->dutyCycle * polite_duty_cycle_percent / 100) {
|
if (utilizationTXPercent() < myRegion->dutyCycle * polite_duty_cycle_percent / 100) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("Tx air utilization is >%f percent. Skip opportunity to send.",
|
LOG_WARN("TX air util. >%f%%. Skip send", myRegion->dutyCycle * polite_duty_cycle_percent / 100);
|
||||||
myRegion->dutyCycle * polite_duty_cycle_percent / 100);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,13 +148,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define NAU7802_ADDR 0x2A
|
#define NAU7802_ADDR 0x2A
|
||||||
#define MAX30102_ADDR 0x57
|
#define MAX30102_ADDR 0x57
|
||||||
#define MLX90614_ADDR_DEF 0x5A
|
#define MLX90614_ADDR_DEF 0x5A
|
||||||
|
#define CGRADSENS_ADDR 0x66
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// ACCELEROMETER
|
// ACCELEROMETER
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
#define MPU6050_ADDR 0x68
|
#define MPU6050_ADDR 0x68
|
||||||
#define STK8BXX_ADR 0x18
|
#define STK8BXX_ADDR 0x18
|
||||||
#define LIS3DH_ADR 0x18
|
#define LIS3DH_ADDR 0x18
|
||||||
|
#define LIS3DH_ADDR_ALT 0x19
|
||||||
#define BMA423_ADDR 0x19
|
#define BMA423_ADDR 0x19
|
||||||
#define LSM6DS3_ADDR 0x6A
|
#define LSM6DS3_ADDR 0x6A
|
||||||
#define BMX160_ADDR 0x69
|
#define BMX160_ADDR 0x69
|
||||||
@@ -169,7 +171,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Security
|
// Security
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
#define ATECC608B_ADDR 0x35
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// IO Expander
|
// IO Expander
|
||||||
@@ -177,13 +178,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define TCA9535_ADDR 0x20
|
#define TCA9535_ADDR 0x20
|
||||||
#define TCA9555_ADDR 0x26
|
#define TCA9555_ADDR 0x26
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
// GPS
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
#ifndef GPS_THREAD_INTERVAL
|
|
||||||
#define GPS_THREAD_INTERVAL 200
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Touchscreen
|
// Touchscreen
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -205,6 +199,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define VEXT_ON_VALUE LOW
|
#define VEXT_ON_VALUE LOW
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// GPS
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifndef GPS_BAUDRATE
|
#ifndef GPS_BAUDRATE
|
||||||
#define GPS_BAUDRATE 9600
|
#define GPS_BAUDRATE 9600
|
||||||
#define GPS_BAUDRATE_FIXED 0
|
#define GPS_BAUDRATE_FIXED 0
|
||||||
@@ -212,6 +210,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define GPS_BAUDRATE_FIXED 1
|
#define GPS_BAUDRATE_FIXED 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef GPS_THREAD_INTERVAL
|
||||||
|
#define GPS_THREAD_INTERVAL 200
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Step #2: follow with defines common to the architecture;
|
/* Step #2: follow with defines common to the architecture;
|
||||||
also enable HAS_ option not specifically disabled by variant.h */
|
also enable HAS_ option not specifically disabled by variant.h */
|
||||||
#include "architecture.h"
|
#include "architecture.h"
|
||||||
@@ -249,6 +251,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifndef HAS_SCREEN
|
#ifndef HAS_SCREEN
|
||||||
#define HAS_SCREEN 0
|
#define HAS_SCREEN 0
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef HAS_TFT
|
||||||
|
#define HAS_TFT 0
|
||||||
|
#endif
|
||||||
#ifndef HAS_WIRE
|
#ifndef HAS_WIRE
|
||||||
#define HAS_WIRE 0
|
#define HAS_WIRE 0
|
||||||
#endif
|
#endif
|
||||||
@@ -311,6 +316,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define MESHTASTIC_EXCLUDE_AUDIO 1
|
#define MESHTASTIC_EXCLUDE_AUDIO 1
|
||||||
#define MESHTASTIC_EXCLUDE_DETECTIONSENSOR 1
|
#define MESHTASTIC_EXCLUDE_DETECTIONSENSOR 1
|
||||||
#define MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR 1
|
#define MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR 1
|
||||||
|
#define MESHTASTIC_EXCLUDE_HEALTH_TELEMETRY 1
|
||||||
#define MESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION 1
|
#define MESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION 1
|
||||||
#define MESHTASTIC_EXCLUDE_PAXCOUNTER 1
|
#define MESHTASTIC_EXCLUDE_PAXCOUNTER 1
|
||||||
#define MESHTASTIC_EXCLUDE_POWER_TELEMETRY 1
|
#define MESHTASTIC_EXCLUDE_POWER_TELEMETRY 1
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ class ScanI2C
|
|||||||
SCREEN_SH1106,
|
SCREEN_SH1106,
|
||||||
SCREEN_UNKNOWN, // has the same address as the two above but does not respond to the same commands
|
SCREEN_UNKNOWN, // has the same address as the two above but does not respond to the same commands
|
||||||
SCREEN_ST7567,
|
SCREEN_ST7567,
|
||||||
ATECC608B,
|
|
||||||
RTC_RV3028,
|
RTC_RV3028,
|
||||||
RTC_PCF8563,
|
RTC_PCF8563,
|
||||||
CARDKB,
|
CARDKB,
|
||||||
@@ -63,7 +62,10 @@ class ScanI2C
|
|||||||
ICM20948,
|
ICM20948,
|
||||||
MAX30102,
|
MAX30102,
|
||||||
TPS65233,
|
TPS65233,
|
||||||
MPR121KB
|
MPR121KB,
|
||||||
|
CGRADSENS,
|
||||||
|
INA226,
|
||||||
|
NXP_SE050,
|
||||||
} DeviceType;
|
} DeviceType;
|
||||||
|
|
||||||
// typedef uint8_t DeviceAddress;
|
// typedef uint8_t DeviceAddress;
|
||||||
@@ -127,4 +129,4 @@ class ScanI2C
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool shouldSuppressScreen = false;
|
bool shouldSuppressScreen = false;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "linux/LinuxHardwareI2C.h"
|
#include "linux/LinuxHardwareI2C.h"
|
||||||
#endif
|
#endif
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||||
#include "main.h" // atecc
|
|
||||||
#include "meshUtils.h" // vformat
|
#include "meshUtils.h" // vformat
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -72,10 +71,10 @@ ScanI2C::DeviceType ScanI2CTwoWire::probeOLED(ScanI2C::DeviceAddress addr) const
|
|||||||
r &= 0x0f;
|
r &= 0x0f;
|
||||||
|
|
||||||
if (r == 0x08 || r == 0x00) {
|
if (r == 0x08 || r == 0x00) {
|
||||||
LOG_INFO("sh1106 display found");
|
logFoundDevice("SH1106", (uint8_t)addr.address);
|
||||||
o_probe = SCREEN_SH1106; // SH1106
|
o_probe = SCREEN_SH1106; // SH1106
|
||||||
} else if (r == 0x03 || r == 0x04 || r == 0x06 || r == 0x07) {
|
} else if (r == 0x03 || r == 0x04 || r == 0x06 || r == 0x07) {
|
||||||
LOG_INFO("ssd1306 display found");
|
logFoundDevice("SSD1306", (uint8_t)addr.address);
|
||||||
o_probe = SCREEN_SSD1306; // SSD1306
|
o_probe = SCREEN_SSD1306; // SSD1306
|
||||||
}
|
}
|
||||||
c++;
|
c++;
|
||||||
@@ -84,40 +83,6 @@ ScanI2C::DeviceType ScanI2CTwoWire::probeOLED(ScanI2C::DeviceAddress addr) const
|
|||||||
|
|
||||||
return o_probe;
|
return o_probe;
|
||||||
}
|
}
|
||||||
void ScanI2CTwoWire::printATECCInfo() const
|
|
||||||
{
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
|
||||||
atecc.readConfigZone(false);
|
|
||||||
|
|
||||||
std::string atecc_numbers = "ATECC608B Serial Number: ";
|
|
||||||
for (int i = 0; i < 9; i++) {
|
|
||||||
atecc_numbers += vformat("%02x", atecc.serialNumber[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
atecc_numbers += ", Rev Number: ";
|
|
||||||
for (int i = 0; i < 4; i++) {
|
|
||||||
atecc_numbers += vformat("%02x", atecc.revisionNumber[i]);
|
|
||||||
}
|
|
||||||
LOG_DEBUG(atecc_numbers.c_str());
|
|
||||||
|
|
||||||
LOG_DEBUG("ATECC608B Config %s, Data %s, Slot 0 %s", atecc.configLockStatus ? "Locked" : "Unlocked",
|
|
||||||
atecc.dataOTPLockStatus ? "Locked" : "Unlocked", atecc.slot0LockStatus ? "Locked" : "Unlocked");
|
|
||||||
|
|
||||||
std::string atecc_publickey = "";
|
|
||||||
if (atecc.configLockStatus && atecc.dataOTPLockStatus && atecc.slot0LockStatus) {
|
|
||||||
if (atecc.generatePublicKey() == false) {
|
|
||||||
atecc_publickey += "ATECC608B Error generating public key";
|
|
||||||
} else {
|
|
||||||
atecc_publickey += "ATECC608B Public Key: ";
|
|
||||||
for (int i = 0; i < 64; i++) {
|
|
||||||
atecc_publickey += vformat("%02x", atecc.publicKey64Bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LOG_DEBUG(atecc_publickey.c_str());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation ®isterLocation,
|
uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation ®isterLocation,
|
||||||
ScanI2CTwoWire::ResponseWidth responseWidth) const
|
ScanI2CTwoWire::ResponseWidth responseWidth) const
|
||||||
{
|
{
|
||||||
@@ -129,7 +94,6 @@ uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation
|
|||||||
i2cBus->endTransmission();
|
i2cBus->endTransmission();
|
||||||
delay(20);
|
delay(20);
|
||||||
i2cBus->requestFrom(registerLocation.i2cAddress.address, responseWidth);
|
i2cBus->requestFrom(registerLocation.i2cAddress.address, responseWidth);
|
||||||
LOG_DEBUG("Wire.available() = %d", i2cBus->available());
|
|
||||||
if (i2cBus->available() == 2) {
|
if (i2cBus->available() == 2) {
|
||||||
// Read MSB, then LSB
|
// Read MSB, then LSB
|
||||||
value = (uint16_t)i2cBus->read() << 8;
|
value = (uint16_t)i2cBus->read() << 8;
|
||||||
@@ -142,7 +106,7 @@ uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation
|
|||||||
|
|
||||||
#define SCAN_SIMPLE_CASE(ADDR, T, ...) \
|
#define SCAN_SIMPLE_CASE(ADDR, T, ...) \
|
||||||
case ADDR: \
|
case ADDR: \
|
||||||
LOG_INFO(__VA_ARGS__); \
|
logFoundDevice(__VA_ARGS__); \
|
||||||
type = T; \
|
type = T; \
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -184,50 +148,36 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
|
|
||||||
for (addr.address = 8; addr.address < 120; addr.address++) {
|
for (addr.address = 8; addr.address < 120; addr.address++) {
|
||||||
if (asize != 0) {
|
if (asize != 0) {
|
||||||
if (!in_array(address, asize, addr.address))
|
if (!in_array(address, asize, (uint8_t)addr.address))
|
||||||
continue;
|
continue;
|
||||||
LOG_DEBUG("Scan address 0x%x", addr.address);
|
LOG_DEBUG("Scan address 0x%x", (uint8_t)addr.address);
|
||||||
}
|
}
|
||||||
i2cBus->beginTransmission(addr.address);
|
i2cBus->beginTransmission(addr.address);
|
||||||
#ifdef ARCH_PORTDUINO
|
#ifdef ARCH_PORTDUINO
|
||||||
if (i2cBus->read() != -1)
|
err = 2;
|
||||||
err = 0;
|
if ((addr.address >= 0x30 && addr.address <= 0x37) || (addr.address >= 0x50 && addr.address <= 0x5F)) {
|
||||||
else
|
if (i2cBus->read() != -1)
|
||||||
|
err = 0;
|
||||||
|
} else {
|
||||||
|
err = i2cBus->writeQuick((uint8_t)0);
|
||||||
|
}
|
||||||
|
if (err != 0)
|
||||||
err = 2;
|
err = 2;
|
||||||
#else
|
#else
|
||||||
err = i2cBus->endTransmission();
|
err = i2cBus->endTransmission();
|
||||||
#endif
|
#endif
|
||||||
type = NONE;
|
type = NONE;
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
LOG_DEBUG("I2C device found at address 0x%x", addr.address);
|
|
||||||
|
|
||||||
switch (addr.address) {
|
switch (addr.address) {
|
||||||
case SSD1306_ADDRESS:
|
case SSD1306_ADDRESS:
|
||||||
type = probeOLED(addr);
|
type = probeOLED(addr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
|
||||||
case ATECC608B_ADDR:
|
|
||||||
#ifdef RP2040_SLOW_CLOCK
|
|
||||||
if (atecc.begin(addr.address, Wire, Serial2) == true)
|
|
||||||
#else
|
|
||||||
if (atecc.begin(addr.address) == true)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
|
||||||
LOG_INFO("ATECC608B initialized");
|
|
||||||
} else {
|
|
||||||
LOG_WARN("ATECC608B initialization failed");
|
|
||||||
}
|
|
||||||
printATECCInfo();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef RV3028_RTC
|
#ifdef RV3028_RTC
|
||||||
case RV3028_RTC:
|
case RV3028_RTC:
|
||||||
// foundDevices[addr] = RTC_RV3028;
|
// foundDevices[addr] = RTC_RV3028;
|
||||||
type = RTC_RV3028;
|
type = RTC_RV3028;
|
||||||
LOG_INFO("RV3028 RTC found");
|
logFoundDevice("RV3028", (uint8_t)addr.address);
|
||||||
rtc.initI2C(*i2cBus);
|
rtc.initI2C(*i2cBus);
|
||||||
rtc.writeToRegister(0x35, 0x07); // no Clkout
|
rtc.writeToRegister(0x35, 0x07); // no Clkout
|
||||||
rtc.writeToRegister(0x37, 0xB4);
|
rtc.writeToRegister(0x37, 0xB4);
|
||||||
@@ -235,7 +185,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PCF8563_RTC
|
#ifdef PCF8563_RTC
|
||||||
SCAN_SIMPLE_CASE(PCF8563_RTC, RTC_PCF8563, "PCF8563 RTC found")
|
SCAN_SIMPLE_CASE(PCF8563_RTC, RTC_PCF8563, "PCF8563", (uint8_t)addr.address)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case CARDKB_ADDR:
|
case CARDKB_ADDR:
|
||||||
@@ -243,50 +193,50 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x04), 1);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x04), 1);
|
||||||
if (registerValue == 0x02) {
|
if (registerValue == 0x02) {
|
||||||
// KEYPAD_VERSION
|
// KEYPAD_VERSION
|
||||||
LOG_INFO("RAK14004 found");
|
logFoundDevice("RAK14004", (uint8_t)addr.address);
|
||||||
type = RAK14004;
|
type = RAK14004;
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("m5 cardKB found");
|
logFoundDevice("M5 cardKB", (uint8_t)addr.address);
|
||||||
type = CARDKB;
|
type = CARDKB;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
SCAN_SIMPLE_CASE(TDECK_KB_ADDR, TDECKKB, "T-Deck keyboard found");
|
SCAN_SIMPLE_CASE(TDECK_KB_ADDR, TDECKKB, "T-Deck keyboard", (uint8_t)addr.address);
|
||||||
SCAN_SIMPLE_CASE(BBQ10_KB_ADDR, BBQ10KB, "BB Q10 keyboard found");
|
SCAN_SIMPLE_CASE(BBQ10_KB_ADDR, BBQ10KB, "BB Q10", (uint8_t)addr.address);
|
||||||
|
|
||||||
SCAN_SIMPLE_CASE(ST7567_ADDRESS, SCREEN_ST7567, "st7567 display found");
|
SCAN_SIMPLE_CASE(ST7567_ADDRESS, SCREEN_ST7567, "ST7567", (uint8_t)addr.address);
|
||||||
#ifdef HAS_NCP5623
|
#ifdef HAS_NCP5623
|
||||||
SCAN_SIMPLE_CASE(NCP5623_ADDR, NCP5623, "NCP5623 RGB LED found");
|
SCAN_SIMPLE_CASE(NCP5623_ADDR, NCP5623, "NCP5623", (uint8_t)addr.address);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
SCAN_SIMPLE_CASE(XPOWERS_AXP192_AXP2101_ADDRESS, PMU_AXP192_AXP2101, "axp192/axp2101 PMU found")
|
SCAN_SIMPLE_CASE(XPOWERS_AXP192_AXP2101_ADDRESS, PMU_AXP192_AXP2101, "AXP192/AXP2101", (uint8_t)addr.address)
|
||||||
#endif
|
#endif
|
||||||
case BME_ADDR:
|
case BME_ADDR:
|
||||||
case BME_ADDR_ALTERNATE:
|
case BME_ADDR_ALTERNATE:
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xD0), 1); // GET_ID
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xD0), 1); // GET_ID
|
||||||
switch (registerValue) {
|
switch (registerValue) {
|
||||||
case 0x61:
|
case 0x61:
|
||||||
LOG_INFO("BME-680 sensor found at address 0x%x", (uint8_t)addr.address);
|
logFoundDevice("BME680", (uint8_t)addr.address);
|
||||||
type = BME_680;
|
type = BME_680;
|
||||||
break;
|
break;
|
||||||
case 0x60:
|
case 0x60:
|
||||||
LOG_INFO("BME-280 sensor found at address 0x%x", (uint8_t)addr.address);
|
logFoundDevice("BME280", (uint8_t)addr.address);
|
||||||
type = BME_280;
|
type = BME_280;
|
||||||
break;
|
break;
|
||||||
case 0x55:
|
case 0x55:
|
||||||
LOG_INFO("BMP-085 or BMP-180 sensor found at address 0x%x", (uint8_t)addr.address);
|
logFoundDevice("BMP085/BMP180", (uint8_t)addr.address);
|
||||||
type = BMP_085;
|
type = BMP_085;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1); // GET_ID
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1); // GET_ID
|
||||||
switch (registerValue) {
|
switch (registerValue) {
|
||||||
case 0x50: // BMP-388 should be 0x50
|
case 0x50: // BMP-388 should be 0x50
|
||||||
LOG_INFO("BMP-388 sensor found at address 0x%x", (uint8_t)addr.address);
|
logFoundDevice("BMP-388", (uint8_t)addr.address);
|
||||||
type = BMP_3XX;
|
type = BMP_3XX;
|
||||||
break;
|
break;
|
||||||
case 0x58: // BMP-280 should be 0x58
|
case 0x58: // BMP-280 should be 0x58
|
||||||
default:
|
default:
|
||||||
LOG_INFO("BMP-280 sensor found at address 0x%x", (uint8_t)addr.address);
|
logFoundDevice("BMP-280", (uint8_t)addr.address);
|
||||||
type = BMP_280;
|
type = BMP_280;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -295,7 +245,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
break;
|
break;
|
||||||
#ifndef HAS_NCP5623
|
#ifndef HAS_NCP5623
|
||||||
case AHT10_ADDR:
|
case AHT10_ADDR:
|
||||||
LOG_INFO("AHT10 sensor found at address 0x%x", (uint8_t)addr.address);
|
logFoundDevice("AHT10", (uint8_t)addr.address);
|
||||||
type = AHT10;
|
type = AHT10;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@@ -305,41 +255,65 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xFE), 2);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xFE), 2);
|
||||||
LOG_DEBUG("Register MFG_UID: 0x%x", registerValue);
|
LOG_DEBUG("Register MFG_UID: 0x%x", registerValue);
|
||||||
if (registerValue == 0x5449) {
|
if (registerValue == 0x5449) {
|
||||||
LOG_INFO("INA260 sensor found at address 0x%x", (uint8_t)addr.address);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xFF), 2);
|
||||||
type = INA260;
|
LOG_DEBUG("Register DIE_UID: 0x%x", registerValue);
|
||||||
|
|
||||||
|
if (registerValue == 0x2260) {
|
||||||
|
logFoundDevice("INA226", (uint8_t)addr.address);
|
||||||
|
type = INA226;
|
||||||
|
} else {
|
||||||
|
logFoundDevice("INA260", (uint8_t)addr.address);
|
||||||
|
type = INA260;
|
||||||
|
}
|
||||||
} else { // Assume INA219 if INA260 ID is not found
|
} else { // Assume INA219 if INA260 ID is not found
|
||||||
LOG_INFO("INA219 sensor found at address 0x%x", (uint8_t)addr.address);
|
logFoundDevice("INA219", (uint8_t)addr.address);
|
||||||
type = INA219;
|
type = INA219;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case INA3221_ADDR:
|
case INA3221_ADDR:
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xFE), 2);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xFE), 2);
|
||||||
LOG_DEBUG("Register MFG_UID: 0x%x", registerValue);
|
LOG_DEBUG("Register MFG_UID FE: 0x%x", registerValue);
|
||||||
if (registerValue == 0x5449) {
|
if (registerValue == 0x5449) {
|
||||||
LOG_INFO("INA3221 sensor found at address 0x%x", (uint8_t)addr.address);
|
logFoundDevice("INA3221", (uint8_t)addr.address);
|
||||||
type = INA3221;
|
type = INA3221;
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("DFRobot Lark weather station found at address 0x%x", (uint8_t)addr.address);
|
/* check the first 2 bytes of the 6 byte response register
|
||||||
type = DFROBOT_LARK;
|
LARK FW 1.0 should return:
|
||||||
|
RESPONSE_STATUS STATUS_SUCCESS (0x53)
|
||||||
|
RESPONSE_CMD CMD_GET_VERSION (0x05)
|
||||||
|
RESPONSE_LEN_L 0x02
|
||||||
|
RESPONSE_LEN_H 0x00
|
||||||
|
RESPONSE_PAYLOAD 0x01
|
||||||
|
RESPONSE_PAYLOAD+1 0x00
|
||||||
|
*/
|
||||||
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x05), 2);
|
||||||
|
LOG_DEBUG("Register MFG_UID 05: 0x%x", registerValue);
|
||||||
|
if (registerValue == 0x5305) {
|
||||||
|
logFoundDevice("DFRobot Lark", (uint8_t)addr.address);
|
||||||
|
type = DFROBOT_LARK;
|
||||||
|
}
|
||||||
|
// else: probably a RAK12500/UBLOX GPS on I2C
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MCP9808_ADDR:
|
case MCP9808_ADDR:
|
||||||
// We need to check for STK8BAXX first, since register 0x07 is new data flag for the z-axis and can produce some
|
// We need to check for STK8BAXX first, since register 0x07 is new data flag for the z-axis and can produce some
|
||||||
// weird result. and register 0x00 doesn't seems to be colliding with MCP9808 and LIS3DH chips.
|
// weird result. and register 0x00 doesn't seems to be colliding with MCP9808 and LIS3DH chips.
|
||||||
{
|
{
|
||||||
|
#ifdef HAS_STK8XXX
|
||||||
// Check register 0x00 for 0x8700 response to ID STK8BA53 chip.
|
// Check register 0x00 for 0x8700 response to ID STK8BA53 chip.
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 2);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 2);
|
||||||
if (registerValue == 0x8700) {
|
if (registerValue == 0x8700) {
|
||||||
type = STK8BAXX;
|
type = STK8BAXX;
|
||||||
LOG_INFO("STK8BAXX accelerometer found");
|
logFoundDevice("STK8BAXX", (uint8_t)addr.address);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Check register 0x07 for 0x0400 response to ID MCP9808 chip.
|
// Check register 0x07 for 0x0400 response to ID MCP9808 chip.
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x07), 2);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x07), 2);
|
||||||
if (registerValue == 0x0400) {
|
if (registerValue == 0x0400) {
|
||||||
type = MCP9808;
|
type = MCP9808;
|
||||||
LOG_INFO("MCP9808 sensor found");
|
logFoundDevice("MCP9808", (uint8_t)addr.address);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +321,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 2);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 2);
|
||||||
if (registerValue == 0x3300 || registerValue == 0x3333) { // RAK4631 WisBlock has LIS3DH register at 0x3333
|
if (registerValue == 0x3300 || registerValue == 0x3333) { // RAK4631 WisBlock has LIS3DH register at 0x3333
|
||||||
type = LIS3DH;
|
type = LIS3DH;
|
||||||
LOG_INFO("LIS3DH accelerometer found");
|
logFoundDevice("LIS3DH", (uint8_t)addr.address);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -355,83 +329,91 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x89), 2);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x89), 2);
|
||||||
if (registerValue == 0x11a2 || registerValue == 0x11da || registerValue == 0xe9c) {
|
if (registerValue == 0x11a2 || registerValue == 0x11da || registerValue == 0xe9c) {
|
||||||
type = SHT4X;
|
type = SHT4X;
|
||||||
LOG_INFO("SHT4X sensor found");
|
logFoundDevice("SHT4X", (uint8_t)addr.address);
|
||||||
} else if (getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x7E), 2) == 0x5449) {
|
} else if (getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x7E), 2) == 0x5449) {
|
||||||
type = OPT3001;
|
type = OPT3001;
|
||||||
LOG_INFO("OPT3001 light sensor found");
|
logFoundDevice("OPT3001", (uint8_t)addr.address);
|
||||||
} else {
|
} else {
|
||||||
type = SHT31;
|
type = SHT31;
|
||||||
LOG_INFO("SHT31 sensor found");
|
logFoundDevice("SHT31", (uint8_t)addr.address);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
SCAN_SIMPLE_CASE(SHTC3_ADDR, SHTC3, "SHTC3 sensor found")
|
SCAN_SIMPLE_CASE(SHTC3_ADDR, SHTC3, "SHTC3", (uint8_t)addr.address)
|
||||||
case RCWL9620_ADDR:
|
case RCWL9620_ADDR:
|
||||||
// get MAX30102 PARTID
|
// get MAX30102 PARTID
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xFF), 1);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xFF), 1);
|
||||||
if (registerValue == 0x15) {
|
if (registerValue == 0x15) {
|
||||||
type = MAX30102;
|
type = MAX30102;
|
||||||
LOG_INFO("MAX30102 Health sensor found");
|
logFoundDevice("MAX30102", (uint8_t)addr.address);
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
type = RCWL9620;
|
type = RCWL9620;
|
||||||
LOG_INFO("RCWL9620 sensor found");
|
logFoundDevice("RCWL9620", (uint8_t)addr.address);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LPS22HB_ADDR_ALT:
|
case LPS22HB_ADDR_ALT:
|
||||||
SCAN_SIMPLE_CASE(LPS22HB_ADDR, LPS22HB, "LPS22HB sensor found")
|
SCAN_SIMPLE_CASE(LPS22HB_ADDR, LPS22HB, "LPS22HB", (uint8_t)addr.address)
|
||||||
|
SCAN_SIMPLE_CASE(QMC6310_ADDR, QMC6310, "QMC6310", (uint8_t)addr.address)
|
||||||
SCAN_SIMPLE_CASE(QMC6310_ADDR, QMC6310, "QMC6310 Highrate 3-Axis magnetic sensor found")
|
|
||||||
|
|
||||||
case QMI8658_ADDR:
|
case QMI8658_ADDR:
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0A), 1); // get ID
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0A), 1); // get ID
|
||||||
if (registerValue == 0xC0) {
|
if (registerValue == 0xC0) {
|
||||||
type = BQ24295;
|
type = BQ24295;
|
||||||
LOG_INFO("BQ24295 PMU found");
|
logFoundDevice("BQ24295", (uint8_t)addr.address);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 1); // get ID
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 1); // get ID
|
||||||
if (registerValue == 0x6A) {
|
if (registerValue == 0x6A) {
|
||||||
type = LSM6DS3;
|
type = LSM6DS3;
|
||||||
LOG_INFO("LSM6DS3 accelerometer found at address 0x%x", (uint8_t)addr.address);
|
logFoundDevice("LSM6DS3", (uint8_t)addr.address);
|
||||||
} else {
|
} else {
|
||||||
type = QMI8658;
|
type = QMI8658;
|
||||||
LOG_INFO("QMI8658 Highrate 6-Axis inertial measurement sensor found");
|
logFoundDevice("QMI8658", (uint8_t)addr.address);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
SCAN_SIMPLE_CASE(QMC5883L_ADDR, QMC5883L, "QMC5883L Highrate 3-Axis magnetic sensor found")
|
SCAN_SIMPLE_CASE(QMC5883L_ADDR, QMC5883L, "QMC5883L", (uint8_t)addr.address)
|
||||||
SCAN_SIMPLE_CASE(HMC5883L_ADDR, HMC5883L, "HMC5883L 3-Axis digital compass found")
|
SCAN_SIMPLE_CASE(HMC5883L_ADDR, HMC5883L, "HMC5883L", (uint8_t)addr.address)
|
||||||
#ifdef HAS_QMA6100P
|
#ifdef HAS_QMA6100P
|
||||||
SCAN_SIMPLE_CASE(QMA6100P_ADDR, QMA6100P, "QMA6100P accelerometer found")
|
SCAN_SIMPLE_CASE(QMA6100P_ADDR, QMA6100P, "QMA6100P", (uint8_t)addr.address)
|
||||||
#else
|
#else
|
||||||
SCAN_SIMPLE_CASE(PMSA0031_ADDR, PMSA0031, "PMSA0031 air quality sensor found")
|
SCAN_SIMPLE_CASE(PMSA0031_ADDR, PMSA0031, "PMSA0031", (uint8_t)addr.address)
|
||||||
#endif
|
#endif
|
||||||
SCAN_SIMPLE_CASE(BMA423_ADDR, BMA423, "BMA423 accelerometer found");
|
case BMA423_ADDR: // this can also be LIS3DH_ADDR_ALT
|
||||||
SCAN_SIMPLE_CASE(LSM6DS3_ADDR, LSM6DS3, "LSM6DS3 accelerometer found at address 0x%x", (uint8_t)addr.address);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 2);
|
||||||
SCAN_SIMPLE_CASE(TCA9535_ADDR, TCA9535, "TCA9535 I2C expander found");
|
if (registerValue == 0x3300 || registerValue == 0x3333) { // RAK4631 WisBlock has LIS3DH register at 0x3333
|
||||||
SCAN_SIMPLE_CASE(TCA9555_ADDR, TCA9555, "TCA9555 I2C expander found");
|
type = LIS3DH;
|
||||||
SCAN_SIMPLE_CASE(VEML7700_ADDR, VEML7700, "VEML7700 light sensor found");
|
logFoundDevice("LIS3DH", (uint8_t)addr.address);
|
||||||
SCAN_SIMPLE_CASE(TSL25911_ADDR, TSL2591, "TSL2591 light sensor found");
|
} else {
|
||||||
SCAN_SIMPLE_CASE(OPT3001_ADDR, OPT3001, "OPT3001 light sensor found");
|
type = BMA423;
|
||||||
SCAN_SIMPLE_CASE(MLX90632_ADDR, MLX90632, "MLX90632 IR temp sensor found");
|
logFoundDevice("BMA423", (uint8_t)addr.address);
|
||||||
SCAN_SIMPLE_CASE(NAU7802_ADDR, NAU7802, "NAU7802 based scale found");
|
}
|
||||||
SCAN_SIMPLE_CASE(FT6336U_ADDR, FT6336U, "FT6336U touchscreen found");
|
break;
|
||||||
SCAN_SIMPLE_CASE(MAX1704X_ADDR, MAX17048, "MAX17048 lipo fuel gauge found");
|
|
||||||
|
SCAN_SIMPLE_CASE(LSM6DS3_ADDR, LSM6DS3, "LSM6DS3", (uint8_t)addr.address);
|
||||||
|
SCAN_SIMPLE_CASE(TCA9535_ADDR, TCA9535, "TCA9535", (uint8_t)addr.address);
|
||||||
|
SCAN_SIMPLE_CASE(TCA9555_ADDR, TCA9555, "TCA9555", (uint8_t)addr.address);
|
||||||
|
SCAN_SIMPLE_CASE(VEML7700_ADDR, VEML7700, "VEML7700", (uint8_t)addr.address);
|
||||||
|
SCAN_SIMPLE_CASE(TSL25911_ADDR, TSL2591, "TSL2591", (uint8_t)addr.address);
|
||||||
|
SCAN_SIMPLE_CASE(OPT3001_ADDR, OPT3001, "OPT3001", (uint8_t)addr.address);
|
||||||
|
SCAN_SIMPLE_CASE(MLX90632_ADDR, MLX90632, "MLX90632", (uint8_t)addr.address);
|
||||||
|
SCAN_SIMPLE_CASE(NAU7802_ADDR, NAU7802, "NAU7802", (uint8_t)addr.address);
|
||||||
|
SCAN_SIMPLE_CASE(MAX1704X_ADDR, MAX17048, "MAX17048", (uint8_t)addr.address);
|
||||||
#ifdef HAS_TPS65233
|
#ifdef HAS_TPS65233
|
||||||
SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233 BIAS-T found");
|
SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MLX90614_ADDR_DEF:
|
case MLX90614_ADDR_DEF:
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0e), 1);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0e), 1);
|
||||||
if (registerValue == 0x5a) {
|
if (registerValue == 0x5a) {
|
||||||
type = MLX90614;
|
type = MLX90614;
|
||||||
LOG_INFO("MLX90614 IR temp sensor found");
|
logFoundDevice("MLX90614", (uint8_t)addr.address);
|
||||||
} else {
|
} else {
|
||||||
type = MPR121KB;
|
type = MPR121KB;
|
||||||
LOG_INFO("MPR121KB keyboard found");
|
logFoundDevice("MPR121KB", (uint8_t)addr.address);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -440,24 +422,57 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
|
||||||
if (registerValue == 0xEA) {
|
if (registerValue == 0xEA) {
|
||||||
type = ICM20948;
|
type = ICM20948;
|
||||||
LOG_INFO("ICM20948 9-dof motion processor found");
|
logFoundDevice("ICM20948", (uint8_t)addr.address);
|
||||||
break;
|
break;
|
||||||
} else if (addr.address == BMX160_ADDR) {
|
} else if (addr.address == BMX160_ADDR) {
|
||||||
type = BMX160;
|
type = BMX160;
|
||||||
LOG_INFO("BMX160 accelerometer found");
|
logFoundDevice("BMX160", (uint8_t)addr.address);
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
type = MPU6050;
|
type = MPU6050;
|
||||||
LOG_INFO("MPU6050 accelerometer found");
|
logFoundDevice("MPU6050", (uint8_t)addr.address);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CGRADSENS_ADDR:
|
||||||
|
// Register 0x00 of the RadSens sensor contains is product identifier 0x7D
|
||||||
|
// Undocumented, but some devices return a product identifier of 0x7A
|
||||||
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
|
||||||
|
if (registerValue == 0x7D || registerValue == 0x7A) {
|
||||||
|
type = CGRADSENS;
|
||||||
|
logFoundDevice("ClimateGuard RadSens", (uint8_t)addr.address);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
LOG_DEBUG("Unexpected Device ID for RadSense: addr=0x%x id=0x%x", CGRADSENS_ADDR, registerValue);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x48: {
|
||||||
|
i2cBus->beginTransmission(addr.address);
|
||||||
|
uint8_t getInfo[] = {0x5A, 0xC0, 0x00, 0xFF, 0xFC};
|
||||||
|
uint8_t expectedInfo[] = {0xa5, 0xE0, 0x00, 0x3F, 0x19};
|
||||||
|
uint8_t info[5];
|
||||||
|
size_t len = 0;
|
||||||
|
i2cBus->write(getInfo, 5);
|
||||||
|
i2cBus->endTransmission();
|
||||||
|
len = i2cBus->readBytes(info, 5);
|
||||||
|
if (len == 5 && memcmp(expectedInfo, info, len) == 0) {
|
||||||
|
LOG_INFO("NXP SE050 crypto chip found");
|
||||||
|
type = NXP_SE050;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
LOG_INFO("FT6336U touchscreen found");
|
||||||
|
type = FT6336U;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_INFO("Device found at address 0x%x was not able to be enumerated", addr.address);
|
LOG_INFO("Device found at address 0x%x was not able to be enumerated", (uint8_t)addr.address);
|
||||||
}
|
}
|
||||||
} else if (err == 4) {
|
} else if (err == 4) {
|
||||||
LOG_ERROR("Unknown error at address 0x%x", addr.address);
|
LOG_ERROR("Unknown error at address 0x%x", (uint8_t)addr.address);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if a type was found for the enumerated device - save, if so
|
// Check if a type was found for the enumerated device - save, if so
|
||||||
@@ -490,4 +505,9 @@ size_t ScanI2CTwoWire::countDevices() const
|
|||||||
{
|
{
|
||||||
return foundDevices.size();
|
return foundDevices.size();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
void ScanI2CTwoWire::logFoundDevice(const char *device, uint8_t address)
|
||||||
|
{
|
||||||
|
LOG_INFO("%s found at address 0x%x", device, address);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -53,10 +53,10 @@ class ScanI2CTwoWire : public ScanI2C
|
|||||||
|
|
||||||
concurrency::Lock lock;
|
concurrency::Lock lock;
|
||||||
|
|
||||||
void printATECCInfo() const;
|
|
||||||
|
|
||||||
uint16_t getRegisterValue(const RegisterLocation &, ResponseWidth) const;
|
uint16_t getRegisterValue(const RegisterLocation &, ResponseWidth) const;
|
||||||
|
|
||||||
DeviceType probeOLED(ScanI2C::DeviceAddress) const;
|
DeviceType probeOLED(ScanI2C::DeviceAddress) const;
|
||||||
|
|
||||||
|
static void logFoundDevice(const char *device, uint8_t address);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
132
src/gps/GPS.cpp
132
src/gps/GPS.cpp
@@ -28,29 +28,47 @@
|
|||||||
#define GPS_RESET_MODE HIGH
|
#define GPS_RESET_MODE HIGH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Not all platforms have std::size().
|
||||||
|
template <typename T, std::size_t N> std::size_t array_count(const T (&)[N])
|
||||||
|
{
|
||||||
|
return N;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(NRF52840_XXAA) || defined(NRF52833_XXAA) || defined(ARCH_ESP32) || defined(ARCH_PORTDUINO)
|
#if defined(NRF52840_XXAA) || defined(NRF52833_XXAA) || defined(ARCH_ESP32) || defined(ARCH_PORTDUINO)
|
||||||
|
#if defined(RAK2560)
|
||||||
|
HardwareSerial *GPS::_serial_gps = &Serial2;
|
||||||
|
#else
|
||||||
HardwareSerial *GPS::_serial_gps = &Serial1;
|
HardwareSerial *GPS::_serial_gps = &Serial1;
|
||||||
|
#endif
|
||||||
#elif defined(ARCH_RP2040)
|
#elif defined(ARCH_RP2040)
|
||||||
SerialUART *GPS::_serial_gps = &Serial1;
|
SerialUART *GPS::_serial_gps = &Serial1;
|
||||||
#else
|
#else
|
||||||
HardwareSerial *GPS::_serial_gps = NULL;
|
HardwareSerial *GPS::_serial_gps = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GPS *gps = nullptr;
|
GPS *gps = nullptr;
|
||||||
|
|
||||||
GPSUpdateScheduling scheduling;
|
static const char *ACK_SUCCESS_MESSAGE = "Get ack success!";
|
||||||
|
|
||||||
|
static GPSUpdateScheduling scheduling;
|
||||||
|
|
||||||
/// Multiple GPS instances might use the same serial port (in sequence), but we can
|
/// Multiple GPS instances might use the same serial port (in sequence), but we can
|
||||||
/// only init that port once.
|
/// only init that port once.
|
||||||
static bool didSerialInit;
|
static bool didSerialInit;
|
||||||
|
|
||||||
struct uBloxGnssModelInfo info;
|
static struct uBloxGnssModelInfo {
|
||||||
uint8_t uBloxProtocolVersion;
|
char swVersion[30];
|
||||||
|
char hwVersion[10];
|
||||||
|
uint8_t extensionNo;
|
||||||
|
char extension[10][30];
|
||||||
|
uint8_t protocol_version;
|
||||||
|
} ublox_info;
|
||||||
|
|
||||||
#define GPS_SOL_EXPIRY_MS 5000 // in millis. give 1 second time to combine different sentences. NMEA Frequency isn't higher anyway
|
#define GPS_SOL_EXPIRY_MS 5000 // in millis. give 1 second time to combine different sentences. NMEA Frequency isn't higher anyway
|
||||||
#define NMEA_MSG_GXGSA "GNGSA" // GSA message (GPGSA, GNGSA etc)
|
#define NMEA_MSG_GXGSA "GNGSA" // GSA message (GPGSA, GNGSA etc)
|
||||||
|
|
||||||
// For logging
|
// For logging
|
||||||
const char *getGPSPowerStateString(GPSPowerState state)
|
static const char *getGPSPowerStateString(GPSPowerState state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case GPS_ACTIVE:
|
case GPS_ACTIVE:
|
||||||
@@ -69,7 +87,7 @@ const char *getGPSPowerStateString(GPSPowerState state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPS::UBXChecksum(uint8_t *message, size_t length)
|
static void UBXChecksum(uint8_t *message, size_t length)
|
||||||
{
|
{
|
||||||
uint8_t CK_A = 0, CK_B = 0;
|
uint8_t CK_A = 0, CK_B = 0;
|
||||||
|
|
||||||
@@ -85,7 +103,7 @@ void GPS::UBXChecksum(uint8_t *message, size_t length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the checksum for a CAS packet
|
// Calculate the checksum for a CAS packet
|
||||||
void GPS::CASChecksum(uint8_t *message, size_t length)
|
static void CASChecksum(uint8_t *message, size_t length)
|
||||||
{
|
{
|
||||||
uint32_t cksum = ((uint32_t)message[5] << 24); // Message ID
|
uint32_t cksum = ((uint32_t)message[5] << 24); // Message ID
|
||||||
cksum += ((uint32_t)message[4]) << 16; // Class
|
cksum += ((uint32_t)message[4]) << 16; // Class
|
||||||
@@ -410,6 +428,15 @@ int GPS::getACK(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GPS_BAUDRATE_FIXED
|
||||||
|
// if GPS_BAUDRATE is specified in variant, only try that.
|
||||||
|
static const int serialSpeeds[1] = {GPS_BAUDRATE};
|
||||||
|
static const int rareSerialSpeeds[1] = {GPS_BAUDRATE};
|
||||||
|
#else
|
||||||
|
static const int serialSpeeds[3] = {9600, 115200, 38400};
|
||||||
|
static const int rareSerialSpeeds[3] = {4800, 57600, GPS_BAUDRATE};
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the GPS based on the model detected.
|
* @brief Setup the GPS based on the model detected.
|
||||||
* We detect the GPS by cycling through a set of baud rates, first common then rare.
|
* We detect the GPS by cycling through a set of baud rates, first common then rare.
|
||||||
@@ -419,7 +446,6 @@ int GPS::getACK(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t
|
|||||||
*/
|
*/
|
||||||
bool GPS::setup()
|
bool GPS::setup()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!didSerialInit) {
|
if (!didSerialInit) {
|
||||||
int msglen = 0;
|
int msglen = 0;
|
||||||
if (tx_gpio && gnssModel == GNSS_MODEL_UNKNOWN) {
|
if (tx_gpio && gnssModel == GNSS_MODEL_UNKNOWN) {
|
||||||
@@ -427,7 +453,7 @@ bool GPS::setup()
|
|||||||
LOG_DEBUG("Probe for GPS at %d", serialSpeeds[speedSelect]);
|
LOG_DEBUG("Probe for GPS at %d", serialSpeeds[speedSelect]);
|
||||||
gnssModel = probe(serialSpeeds[speedSelect]);
|
gnssModel = probe(serialSpeeds[speedSelect]);
|
||||||
if (gnssModel == GNSS_MODEL_UNKNOWN) {
|
if (gnssModel == GNSS_MODEL_UNKNOWN) {
|
||||||
if (++speedSelect == sizeof(serialSpeeds) / sizeof(int)) {
|
if (++speedSelect == array_count(serialSpeeds)) {
|
||||||
speedSelect = 0;
|
speedSelect = 0;
|
||||||
++probeTries;
|
++probeTries;
|
||||||
}
|
}
|
||||||
@@ -438,7 +464,7 @@ bool GPS::setup()
|
|||||||
LOG_DEBUG("Probe for GPS at %d", rareSerialSpeeds[speedSelect]);
|
LOG_DEBUG("Probe for GPS at %d", rareSerialSpeeds[speedSelect]);
|
||||||
gnssModel = probe(rareSerialSpeeds[speedSelect]);
|
gnssModel = probe(rareSerialSpeeds[speedSelect]);
|
||||||
if (gnssModel == GNSS_MODEL_UNKNOWN) {
|
if (gnssModel == GNSS_MODEL_UNKNOWN) {
|
||||||
if (++speedSelect == sizeof(rareSerialSpeeds) / sizeof(int)) {
|
if (++speedSelect == array_count(rareSerialSpeeds)) {
|
||||||
LOG_WARN("Give up on GPS probe and set to %d", GPS_BAUDRATE);
|
LOG_WARN("Give up on GPS probe and set to %d", GPS_BAUDRATE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -634,7 +660,7 @@ bool GPS::setup()
|
|||||||
SEND_UBX_PACKET(0x06, 0x01, _message_RMC, "enable NMEA RMC", 500);
|
SEND_UBX_PACKET(0x06, 0x01, _message_RMC, "enable NMEA RMC", 500);
|
||||||
SEND_UBX_PACKET(0x06, 0x01, _message_GGA, "enable NMEA GGA", 500);
|
SEND_UBX_PACKET(0x06, 0x01, _message_GGA, "enable NMEA GGA", 500);
|
||||||
|
|
||||||
if (uBloxProtocolVersion >= 18) {
|
if (ublox_info.protocol_version >= 18) {
|
||||||
clearBuffer();
|
clearBuffer();
|
||||||
SEND_UBX_PACKET(0x06, 0x86, _message_PMS, "enable powersave for GPS", 500);
|
SEND_UBX_PACKET(0x06, 0x86, _message_PMS, "enable powersave for GPS", 500);
|
||||||
SEND_UBX_PACKET(0x06, 0x3B, _message_CFG_PM2, "enable powersave details for GPS", 500);
|
SEND_UBX_PACKET(0x06, 0x3B, _message_CFG_PM2, "enable powersave details for GPS", 500);
|
||||||
@@ -718,6 +744,7 @@ GPS::~GPS()
|
|||||||
// we really should unregister our sleep observer
|
// we really should unregister our sleep observer
|
||||||
notifyDeepSleepObserver.unobserve(¬ifyDeepSleep);
|
notifyDeepSleepObserver.unobserve(¬ifyDeepSleep);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put the GPS hardware into a specified state
|
// Put the GPS hardware into a specified state
|
||||||
void GPS::setPowerState(GPSPowerState newState, uint32_t sleepTime)
|
void GPS::setPowerState(GPSPowerState newState, uint32_t sleepTime)
|
||||||
{
|
{
|
||||||
@@ -788,13 +815,14 @@ void GPS::setPowerState(GPSPowerState newState, uint32_t sleepTime)
|
|||||||
void GPS::writePinEN(bool on)
|
void GPS::writePinEN(bool on)
|
||||||
{
|
{
|
||||||
// Abort: if conflict with Canned Messages when using Wisblock(?)
|
// Abort: if conflict with Canned Messages when using Wisblock(?)
|
||||||
if (HW_VENDOR == meshtastic_HardwareModel_RAK4631 && (rotaryEncoderInterruptImpl1 || upDownInterruptImpl1))
|
if ((HW_VENDOR == meshtastic_HardwareModel_RAK4631 || HW_VENDOR == meshtastic_HardwareModel_WISMESH_TAP) &&
|
||||||
|
(rotaryEncoderInterruptImpl1 || upDownInterruptImpl1))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Write and log
|
// Write and log
|
||||||
enablePin->set(on);
|
enablePin->set(on);
|
||||||
#ifdef GPS_DEBUG
|
#ifdef GPS_DEBUG
|
||||||
LOG_DEBUG("Pin EN %s", val == HIGH ? "HI" : "LOW");
|
LOG_DEBUG("Pin EN %s", on == HIGH ? "HI" : "LOW");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -881,17 +909,17 @@ void GPS::setPowerUBLOX(bool on, uint32_t sleepMs)
|
|||||||
if (gnssModel != GNSS_MODEL_UBLOX10) {
|
if (gnssModel != GNSS_MODEL_UBLOX10) {
|
||||||
// Encode the sleep time in millis into the packet
|
// Encode the sleep time in millis into the packet
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
gps->_message_PMREQ[0 + i] = sleepMs >> (i * 8);
|
_message_PMREQ[0 + i] = sleepMs >> (i * 8);
|
||||||
|
|
||||||
// Record the message length
|
// Record the message length
|
||||||
msglen = gps->makeUBXPacket(0x02, 0x41, sizeof(_message_PMREQ), gps->_message_PMREQ);
|
msglen = gps->makeUBXPacket(0x02, 0x41, sizeof(_message_PMREQ), _message_PMREQ);
|
||||||
} else {
|
} else {
|
||||||
// Encode the sleep time in millis into the packet
|
// Encode the sleep time in millis into the packet
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
gps->_message_PMREQ_10[4 + i] = sleepMs >> (i * 8);
|
_message_PMREQ_10[4 + i] = sleepMs >> (i * 8);
|
||||||
|
|
||||||
// Record the message length
|
// Record the message length
|
||||||
msglen = gps->makeUBXPacket(0x02, 0x41, sizeof(_message_PMREQ_10), gps->_message_PMREQ_10);
|
msglen = gps->makeUBXPacket(0x02, 0x41, sizeof(_message_PMREQ_10), _message_PMREQ_10);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send the UBX packet
|
// Send the UBX packet
|
||||||
@@ -1098,17 +1126,19 @@ int GPS::prepareDeepSleep(void *unused)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *PROBE_MESSAGE = "Trying %s (%s)...";
|
static const char *PROBE_MESSAGE = "Trying %s (%s)...";
|
||||||
const char *DETECTED_MESSAGE = "%s detected, using %s Module";
|
static const char *DETECTED_MESSAGE = "%s detected, using %s Module";
|
||||||
|
|
||||||
#define PROBE_SIMPLE(CHIP, TOWRITE, RESPONSE, DRIVER, TIMEOUT, ...) \
|
#define PROBE_SIMPLE(CHIP, TOWRITE, RESPONSE, DRIVER, TIMEOUT, ...) \
|
||||||
LOG_DEBUG(PROBE_MESSAGE, TOWRITE, CHIP); \
|
do { \
|
||||||
clearBuffer(); \
|
LOG_DEBUG(PROBE_MESSAGE, TOWRITE, CHIP); \
|
||||||
_serial_gps->write(TOWRITE "\r\n"); \
|
clearBuffer(); \
|
||||||
if (getACK(RESPONSE, TIMEOUT) == GNSS_RESPONSE_OK) { \
|
_serial_gps->write(TOWRITE "\r\n"); \
|
||||||
LOG_INFO(DETECTED_MESSAGE, CHIP, #DRIVER); \
|
if (getACK(RESPONSE, TIMEOUT) == GNSS_RESPONSE_OK) { \
|
||||||
return DRIVER; \
|
LOG_INFO(DETECTED_MESSAGE, CHIP, #DRIVER); \
|
||||||
}
|
return DRIVER; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
GnssModel_t GPS::probe(int serialSpeed)
|
GnssModel_t GPS::probe(int serialSpeed)
|
||||||
{
|
{
|
||||||
@@ -1126,7 +1156,7 @@ GnssModel_t GPS::probe(int serialSpeed)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
memset(&info, 0, sizeof(struct uBloxGnssModelInfo));
|
memset(&ublox_info, 0, sizeof(ublox_info));
|
||||||
uint8_t buffer[768] = {0};
|
uint8_t buffer[768] = {0};
|
||||||
delay(100);
|
delay(100);
|
||||||
|
|
||||||
@@ -1164,6 +1194,8 @@ GnssModel_t GPS::probe(int serialSpeed)
|
|||||||
PROBE_SIMPLE("L76B", "$PMTK605*31", "Quectel-L76B", GNSS_MODEL_MTK_L76B, 500);
|
PROBE_SIMPLE("L76B", "$PMTK605*31", "Quectel-L76B", GNSS_MODEL_MTK_L76B, 500);
|
||||||
PROBE_SIMPLE("PA1616S", "$PMTK605*31", "1616S", GNSS_MODEL_MTK_PA1616S, 500);
|
PROBE_SIMPLE("PA1616S", "$PMTK605*31", "1616S", GNSS_MODEL_MTK_PA1616S, 500);
|
||||||
|
|
||||||
|
PROBE_SIMPLE("LS20031", "$PMTK605*31", "MC-1513", GNSS_MODEL_LS20031, 500);
|
||||||
|
|
||||||
uint8_t cfg_rate[] = {0xB5, 0x62, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00};
|
uint8_t cfg_rate[] = {0xB5, 0x62, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00};
|
||||||
UBXChecksum(cfg_rate, sizeof(cfg_rate));
|
UBXChecksum(cfg_rate, sizeof(cfg_rate));
|
||||||
clearBuffer();
|
clearBuffer();
|
||||||
@@ -1193,64 +1225,64 @@ GnssModel_t GPS::probe(int serialSpeed)
|
|||||||
if (len) {
|
if (len) {
|
||||||
uint16_t position = 0;
|
uint16_t position = 0;
|
||||||
for (int i = 0; i < 30; i++) {
|
for (int i = 0; i < 30; i++) {
|
||||||
info.swVersion[i] = buffer[position];
|
ublox_info.swVersion[i] = buffer[position];
|
||||||
position++;
|
position++;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
info.hwVersion[i] = buffer[position];
|
ublox_info.hwVersion[i] = buffer[position];
|
||||||
position++;
|
position++;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (len >= position + 30) {
|
while (len >= position + 30) {
|
||||||
for (int i = 0; i < 30; i++) {
|
for (int i = 0; i < 30; i++) {
|
||||||
info.extension[info.extensionNo][i] = buffer[position];
|
ublox_info.extension[ublox_info.extensionNo][i] = buffer[position];
|
||||||
position++;
|
position++;
|
||||||
}
|
}
|
||||||
info.extensionNo++;
|
ublox_info.extensionNo++;
|
||||||
if (info.extensionNo > 9)
|
if (ublox_info.extensionNo > 9)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG("Module Info : ");
|
LOG_DEBUG("Module Info : ");
|
||||||
LOG_DEBUG("Soft version: %s", info.swVersion);
|
LOG_DEBUG("Soft version: %s", ublox_info.swVersion);
|
||||||
LOG_DEBUG("Hard version: %s", info.hwVersion);
|
LOG_DEBUG("Hard version: %s", ublox_info.hwVersion);
|
||||||
LOG_DEBUG("Extensions:%d", info.extensionNo);
|
LOG_DEBUG("Extensions:%d", ublox_info.extensionNo);
|
||||||
for (int i = 0; i < info.extensionNo; i++) {
|
for (int i = 0; i < ublox_info.extensionNo; i++) {
|
||||||
LOG_DEBUG(" %s", info.extension[i]);
|
LOG_DEBUG(" %s", ublox_info.extension[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(buffer, 0, sizeof(buffer));
|
memset(buffer, 0, sizeof(buffer));
|
||||||
|
|
||||||
// tips: extensionNo field is 0 on some 6M GNSS modules
|
// tips: extensionNo field is 0 on some 6M GNSS modules
|
||||||
for (int i = 0; i < info.extensionNo; ++i) {
|
for (int i = 0; i < ublox_info.extensionNo; ++i) {
|
||||||
if (!strncmp(info.extension[i], "MOD=", 4)) {
|
if (!strncmp(ublox_info.extension[i], "MOD=", 4)) {
|
||||||
strncpy((char *)buffer, &(info.extension[i][4]), sizeof(buffer));
|
strncpy((char *)buffer, &(ublox_info.extension[i][4]), sizeof(buffer));
|
||||||
} else if (!strncmp(info.extension[i], "PROTVER", 7)) {
|
} else if (!strncmp(ublox_info.extension[i], "PROTVER", 7)) {
|
||||||
char *ptr = nullptr;
|
char *ptr = nullptr;
|
||||||
memset(buffer, 0, sizeof(buffer));
|
memset(buffer, 0, sizeof(buffer));
|
||||||
strncpy((char *)buffer, &(info.extension[i][8]), sizeof(buffer));
|
strncpy((char *)buffer, &(ublox_info.extension[i][8]), sizeof(buffer));
|
||||||
LOG_DEBUG("Protocol Version:%s", (char *)buffer);
|
LOG_DEBUG("Protocol Version:%s", (char *)buffer);
|
||||||
if (strlen((char *)buffer)) {
|
if (strlen((char *)buffer)) {
|
||||||
uBloxProtocolVersion = strtoul((char *)buffer, &ptr, 10);
|
ublox_info.protocol_version = strtoul((char *)buffer, &ptr, 10);
|
||||||
LOG_DEBUG("ProtVer=%d", uBloxProtocolVersion);
|
LOG_DEBUG("ProtVer=%d", ublox_info.protocol_version);
|
||||||
} else {
|
} else {
|
||||||
uBloxProtocolVersion = 0;
|
ublox_info.protocol_version = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strncmp(info.hwVersion, "00040007", 8) == 0) {
|
if (strncmp(ublox_info.hwVersion, "00040007", 8) == 0) {
|
||||||
LOG_INFO(DETECTED_MESSAGE, "U-blox 6", "6");
|
LOG_INFO(DETECTED_MESSAGE, "U-blox 6", "6");
|
||||||
return GNSS_MODEL_UBLOX6;
|
return GNSS_MODEL_UBLOX6;
|
||||||
} else if (strncmp(info.hwVersion, "00070000", 8) == 0) {
|
} else if (strncmp(ublox_info.hwVersion, "00070000", 8) == 0) {
|
||||||
LOG_INFO(DETECTED_MESSAGE, "U-blox 7", "7");
|
LOG_INFO(DETECTED_MESSAGE, "U-blox 7", "7");
|
||||||
return GNSS_MODEL_UBLOX7;
|
return GNSS_MODEL_UBLOX7;
|
||||||
} else if (strncmp(info.hwVersion, "00080000", 8) == 0) {
|
} else if (strncmp(ublox_info.hwVersion, "00080000", 8) == 0) {
|
||||||
LOG_INFO(DETECTED_MESSAGE, "U-blox 8", "8");
|
LOG_INFO(DETECTED_MESSAGE, "U-blox 8", "8");
|
||||||
return GNSS_MODEL_UBLOX8;
|
return GNSS_MODEL_UBLOX8;
|
||||||
} else if (strncmp(info.hwVersion, "00190000", 8) == 0) {
|
} else if (strncmp(ublox_info.hwVersion, "00190000", 8) == 0) {
|
||||||
LOG_INFO(DETECTED_MESSAGE, "U-blox 9", "9");
|
LOG_INFO(DETECTED_MESSAGE, "U-blox 9", "9");
|
||||||
return GNSS_MODEL_UBLOX9;
|
return GNSS_MODEL_UBLOX9;
|
||||||
} else if (strncmp(info.hwVersion, "000A0000", 8) == 0) {
|
} else if (strncmp(ublox_info.hwVersion, "000A0000", 8) == 0) {
|
||||||
LOG_INFO(DETECTED_MESSAGE, "U-blox 10", "10");
|
LOG_INFO(DETECTED_MESSAGE, "U-blox 10", "10");
|
||||||
return GNSS_MODEL_UBLOX10;
|
return GNSS_MODEL_UBLOX10;
|
||||||
}
|
}
|
||||||
|
|||||||
224
src/gps/GPS.h
224
src/gps/GPS.h
@@ -16,13 +16,6 @@
|
|||||||
#define GPS_EN_ACTIVE 1
|
#define GPS_EN_ACTIVE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct uBloxGnssModelInfo {
|
|
||||||
char swVersion[30];
|
|
||||||
char hwVersion[10];
|
|
||||||
uint8_t extensionNo;
|
|
||||||
char extension[10][30];
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GNSS_MODEL_ATGM336H,
|
GNSS_MODEL_ATGM336H,
|
||||||
GNSS_MODEL_MTK,
|
GNSS_MODEL_MTK,
|
||||||
@@ -36,7 +29,8 @@ typedef enum {
|
|||||||
GNSS_MODEL_MTK_L76B,
|
GNSS_MODEL_MTK_L76B,
|
||||||
GNSS_MODEL_MTK_PA1616S,
|
GNSS_MODEL_MTK_PA1616S,
|
||||||
GNSS_MODEL_AG3335,
|
GNSS_MODEL_AG3335,
|
||||||
GNSS_MODEL_AG3352
|
GNSS_MODEL_AG3352,
|
||||||
|
GNSS_MODEL_LS20031
|
||||||
} GnssModel_t;
|
} GnssModel_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -54,9 +48,6 @@ enum GPSPowerState : uint8_t {
|
|||||||
GPS_OFF // Powered off indefinitely
|
GPS_OFF // Powered off indefinitely
|
||||||
};
|
};
|
||||||
|
|
||||||
// Generate a string representation of DOP
|
|
||||||
const char *getDOPString(uint32_t dop);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A gps class that only reads from the GPS periodically and keeps the gps powered down except when reading
|
* A gps class that only reads from the GPS periodically and keeps the gps powered down except when reading
|
||||||
*
|
*
|
||||||
@@ -64,109 +55,7 @@ const char *getDOPString(uint32_t dop);
|
|||||||
*/
|
*/
|
||||||
class GPS : private concurrency::OSThread
|
class GPS : private concurrency::OSThread
|
||||||
{
|
{
|
||||||
TinyGPSPlus reader;
|
|
||||||
uint8_t fixQual = 0; // fix quality from GPGGA
|
|
||||||
uint32_t lastChecksumFailCount = 0;
|
|
||||||
|
|
||||||
#ifndef TINYGPS_OPTION_NO_CUSTOM_FIELDS
|
|
||||||
// (20210908) TinyGps++ can only read the GPGSA "FIX TYPE" field
|
|
||||||
// via optional feature "custom fields", currently disabled (bug #525)
|
|
||||||
TinyGPSCustom gsafixtype; // custom extract fix type from GPGSA
|
|
||||||
TinyGPSCustom gsapdop; // custom extract PDOP from GPGSA
|
|
||||||
uint8_t fixType = 0; // fix type from GPGSA
|
|
||||||
#endif
|
|
||||||
private:
|
|
||||||
#if GPS_BAUDRATE_FIXED
|
|
||||||
// if GPS_BAUDRATE is specified in variant, only try that.
|
|
||||||
const int serialSpeeds[1] = {GPS_BAUDRATE};
|
|
||||||
const int rareSerialSpeeds[1] = {GPS_BAUDRATE};
|
|
||||||
#else
|
|
||||||
const int serialSpeeds[3] = {9600, 115200, 38400};
|
|
||||||
const int rareSerialSpeeds[3] = {4800, 57600, GPS_BAUDRATE};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint32_t lastWakeStartMsec = 0, lastSleepStartMsec = 0, lastFixStartMsec = 0;
|
|
||||||
uint32_t rx_gpio = 0;
|
|
||||||
uint32_t tx_gpio = 0;
|
|
||||||
|
|
||||||
int speedSelect = 0;
|
|
||||||
int probeTries = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hasValidLocation - indicates that the position variables contain a complete
|
|
||||||
* GPS location, valid and fresh (< gps_update_interval + position_broadcast_secs)
|
|
||||||
*/
|
|
||||||
bool hasValidLocation = false; // default to false, until we complete our first read
|
|
||||||
|
|
||||||
bool isInPowersave = false;
|
|
||||||
|
|
||||||
bool shouldPublish = false; // If we've changed GPS state, this will force a publish the next loop()
|
|
||||||
|
|
||||||
bool hasGPS = false; // Do we have a GPS we are talking to
|
|
||||||
|
|
||||||
bool GPSInitFinished = false; // Init thread finished?
|
|
||||||
bool GPSInitStarted = false; // Init thread finished?
|
|
||||||
|
|
||||||
GPSPowerState powerState = GPS_OFF; // GPS_ACTIVE if we want a location right now
|
|
||||||
|
|
||||||
uint8_t numSatellites = 0;
|
|
||||||
|
|
||||||
CallbackObserver<GPS, void *> notifyDeepSleepObserver = CallbackObserver<GPS, void *>(this, &GPS::prepareDeepSleep);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** If !NULL we will use this serial port to construct our GPS */
|
|
||||||
#if defined(ARCH_RP2040)
|
|
||||||
static SerialUART *_serial_gps;
|
|
||||||
#else
|
|
||||||
static HardwareSerial *_serial_gps;
|
|
||||||
#endif
|
|
||||||
static uint8_t _message_PMREQ[];
|
|
||||||
static uint8_t _message_PMREQ_10[];
|
|
||||||
static const uint8_t _message_CFG_RXM_PSM[];
|
|
||||||
static const uint8_t _message_CFG_RXM_ECO[];
|
|
||||||
static const uint8_t _message_CFG_PM2[];
|
|
||||||
static const uint8_t _message_GNSS_7[];
|
|
||||||
static const uint8_t _message_GNSS_8[];
|
|
||||||
static const uint8_t _message_JAM_6_7[];
|
|
||||||
static const uint8_t _message_JAM_8[];
|
|
||||||
static const uint8_t _message_NAVX5[];
|
|
||||||
static const uint8_t _message_NAVX5_8[];
|
|
||||||
static const uint8_t _message_NMEA[];
|
|
||||||
static const uint8_t _message_DISABLE_TXT_INFO[];
|
|
||||||
static const uint8_t _message_1HZ[];
|
|
||||||
static const uint8_t _message_GLL[];
|
|
||||||
static const uint8_t _message_GSA[];
|
|
||||||
static const uint8_t _message_GSV[];
|
|
||||||
static const uint8_t _message_VTG[];
|
|
||||||
static const uint8_t _message_RMC[];
|
|
||||||
static const uint8_t _message_AID[];
|
|
||||||
static const uint8_t _message_GGA[];
|
|
||||||
static const uint8_t _message_PMS[];
|
|
||||||
static const uint8_t _message_SAVE[];
|
|
||||||
static const uint8_t _message_SAVE_10[];
|
|
||||||
|
|
||||||
// VALSET Commands for M10
|
|
||||||
static const uint8_t _message_VALSET_PM[];
|
|
||||||
static const uint8_t _message_VALSET_PM_RAM[];
|
|
||||||
static const uint8_t _message_VALSET_PM_BBR[];
|
|
||||||
static const uint8_t _message_VALSET_ITFM_RAM[];
|
|
||||||
static const uint8_t _message_VALSET_ITFM_BBR[];
|
|
||||||
static const uint8_t _message_VALSET_DISABLE_NMEA_RAM[];
|
|
||||||
static const uint8_t _message_VALSET_DISABLE_NMEA_BBR[];
|
|
||||||
static const uint8_t _message_VALSET_DISABLE_TXT_INFO_RAM[];
|
|
||||||
static const uint8_t _message_VALSET_DISABLE_TXT_INFO_BBR[];
|
|
||||||
static const uint8_t _message_VALSET_ENABLE_NMEA_RAM[];
|
|
||||||
static const uint8_t _message_VALSET_ENABLE_NMEA_BBR[];
|
|
||||||
static const uint8_t _message_VALSET_DISABLE_SBAS_RAM[];
|
|
||||||
static const uint8_t _message_VALSET_DISABLE_SBAS_BBR[];
|
|
||||||
|
|
||||||
// CASIC commands for ATGM336H
|
|
||||||
static const uint8_t _message_CAS_CFG_RST_FACTORY[];
|
|
||||||
static const uint8_t _message_CAS_CFG_NAVX_CONF[];
|
|
||||||
static const uint8_t _message_CAS_CFG_RATE_1HZ[];
|
|
||||||
|
|
||||||
const char *ACK_SUCCESS_MESSAGE = "Get ack success!";
|
|
||||||
|
|
||||||
meshtastic_Position p = meshtastic_Position_init_default;
|
meshtastic_Position p = meshtastic_Position_init_default;
|
||||||
|
|
||||||
/** This is normally bound to config.position.gps_en_gpio but some rare boards (like heltec tracker) need more advanced
|
/** This is normally bound to config.position.gps_en_gpio but some rare boards (like heltec tracker) need more advanced
|
||||||
@@ -176,8 +65,6 @@ class GPS : private concurrency::OSThread
|
|||||||
*/
|
*/
|
||||||
GpioVirtPin *enablePin = NULL;
|
GpioVirtPin *enablePin = NULL;
|
||||||
|
|
||||||
GPS() : concurrency::OSThread("GPS") {}
|
|
||||||
|
|
||||||
virtual ~GPS();
|
virtual ~GPS();
|
||||||
|
|
||||||
/** We will notify this observable anytime GPS state has changed meaningfully */
|
/** We will notify this observable anytime GPS state has changed meaningfully */
|
||||||
@@ -214,21 +101,6 @@ class GPS : private concurrency::OSThread
|
|||||||
// Empty the input buffer as quickly as possible
|
// Empty the input buffer as quickly as possible
|
||||||
void clearBuffer();
|
void clearBuffer();
|
||||||
|
|
||||||
// Create a ublox packet for editing in memory
|
|
||||||
uint8_t makeUBXPacket(uint8_t class_id, uint8_t msg_id, uint8_t payload_size, const uint8_t *msg);
|
|
||||||
uint8_t makeCASPacket(uint8_t class_id, uint8_t msg_id, uint8_t payload_size, const uint8_t *msg);
|
|
||||||
|
|
||||||
// scratch space for creating ublox packets
|
|
||||||
uint8_t UBXscratch[250] = {0};
|
|
||||||
|
|
||||||
int rebootsSeen = 0;
|
|
||||||
|
|
||||||
int getACK(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t requestedID, uint32_t waitMillis);
|
|
||||||
GPS_RESPONSE getACK(uint8_t c, uint8_t i, uint32_t waitMillis);
|
|
||||||
GPS_RESPONSE getACK(const char *message, uint32_t waitMillis);
|
|
||||||
|
|
||||||
GPS_RESPONSE getACKCas(uint8_t class_id, uint8_t msg_id, uint32_t waitMillis);
|
|
||||||
|
|
||||||
virtual bool factoryReset();
|
virtual bool factoryReset();
|
||||||
|
|
||||||
// Creates an instance of the GPS class.
|
// Creates an instance of the GPS class.
|
||||||
@@ -241,20 +113,8 @@ class GPS : private concurrency::OSThread
|
|||||||
// Let the GPS hardware save power between updates
|
// Let the GPS hardware save power between updates
|
||||||
void down();
|
void down();
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
/**
|
GPS() : concurrency::OSThread("GPS") {}
|
||||||
* Perform any processing that should be done only while the GPS is awake and looking for a fix.
|
|
||||||
* Override this method to check for new locations
|
|
||||||
*
|
|
||||||
* @return true if we've acquired a time
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform any processing that should be done only while the GPS is awake and looking for a fix.
|
|
||||||
* Override this method to check for new locations
|
|
||||||
*
|
|
||||||
* @return true if we've acquired a new location
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// Record that we have a GPS
|
/// Record that we have a GPS
|
||||||
void setConnected();
|
void setConnected();
|
||||||
@@ -281,15 +141,74 @@ class GPS : private concurrency::OSThread
|
|||||||
*/
|
*/
|
||||||
virtual bool lookForLocation();
|
virtual bool lookForLocation();
|
||||||
|
|
||||||
private:
|
GnssModel_t gnssModel = GNSS_MODEL_UNKNOWN;
|
||||||
|
|
||||||
|
TinyGPSPlus reader;
|
||||||
|
uint8_t fixQual = 0; // fix quality from GPGGA
|
||||||
|
uint32_t lastChecksumFailCount = 0;
|
||||||
|
|
||||||
|
#ifndef TINYGPS_OPTION_NO_CUSTOM_FIELDS
|
||||||
|
// (20210908) TinyGps++ can only read the GPGSA "FIX TYPE" field
|
||||||
|
// via optional feature "custom fields", currently disabled (bug #525)
|
||||||
|
TinyGPSCustom gsafixtype; // custom extract fix type from GPGSA
|
||||||
|
TinyGPSCustom gsapdop; // custom extract PDOP from GPGSA
|
||||||
|
uint8_t fixType = 0; // fix type from GPGSA
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint32_t lastWakeStartMsec = 0, lastSleepStartMsec = 0, lastFixStartMsec = 0;
|
||||||
|
uint32_t rx_gpio = 0;
|
||||||
|
uint32_t tx_gpio = 0;
|
||||||
|
|
||||||
|
uint8_t speedSelect = 0;
|
||||||
|
uint8_t probeTries = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hasValidLocation - indicates that the position variables contain a complete
|
||||||
|
* GPS location, valid and fresh (< gps_update_interval + position_broadcast_secs)
|
||||||
|
*/
|
||||||
|
bool hasValidLocation = false; // default to false, until we complete our first read
|
||||||
|
|
||||||
|
bool isInPowersave = false;
|
||||||
|
|
||||||
|
bool shouldPublish = false; // If we've changed GPS state, this will force a publish the next loop()
|
||||||
|
|
||||||
|
bool hasGPS = false; // Do we have a GPS we are talking to
|
||||||
|
|
||||||
|
bool GPSInitFinished = false; // Init thread finished?
|
||||||
|
bool GPSInitStarted = false; // Init thread finished?
|
||||||
|
|
||||||
|
GPSPowerState powerState = GPS_OFF; // GPS_ACTIVE if we want a location right now
|
||||||
|
|
||||||
|
uint8_t numSatellites = 0;
|
||||||
|
|
||||||
|
CallbackObserver<GPS, void *> notifyDeepSleepObserver = CallbackObserver<GPS, void *>(this, &GPS::prepareDeepSleep);
|
||||||
|
|
||||||
|
/** If !NULL we will use this serial port to construct our GPS */
|
||||||
|
#if defined(ARCH_RP2040)
|
||||||
|
static SerialUART *_serial_gps;
|
||||||
|
#else
|
||||||
|
static HardwareSerial *_serial_gps;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Create a ublox packet for editing in memory
|
||||||
|
uint8_t makeUBXPacket(uint8_t class_id, uint8_t msg_id, uint8_t payload_size, const uint8_t *msg);
|
||||||
|
uint8_t makeCASPacket(uint8_t class_id, uint8_t msg_id, uint8_t payload_size, const uint8_t *msg);
|
||||||
|
|
||||||
|
// scratch space for creating ublox packets
|
||||||
|
uint8_t UBXscratch[250] = {0};
|
||||||
|
|
||||||
|
int rebootsSeen = 0;
|
||||||
|
|
||||||
|
int getACK(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t requestedID, uint32_t waitMillis);
|
||||||
|
GPS_RESPONSE getACK(uint8_t c, uint8_t i, uint32_t waitMillis);
|
||||||
|
GPS_RESPONSE getACK(const char *message, uint32_t waitMillis);
|
||||||
|
|
||||||
|
GPS_RESPONSE getACKCas(uint8_t class_id, uint8_t msg_id, uint32_t waitMillis);
|
||||||
|
|
||||||
/// Prepare the GPS for the cpu entering deep sleep, expect to be gone for at least 100s of msecs
|
/// Prepare the GPS for the cpu entering deep sleep, expect to be gone for at least 100s of msecs
|
||||||
/// always returns 0 to indicate okay to sleep
|
/// always returns 0 to indicate okay to sleep
|
||||||
int prepareDeepSleep(void *unused);
|
int prepareDeepSleep(void *unused);
|
||||||
|
|
||||||
// Calculate checksum
|
|
||||||
void UBXChecksum(uint8_t *message, size_t length);
|
|
||||||
void CASChecksum(uint8_t *message, size_t length);
|
|
||||||
|
|
||||||
/** Set power with EN pin, if relevant
|
/** Set power with EN pin, if relevant
|
||||||
*/
|
*/
|
||||||
void writePinEN(bool on);
|
void writePinEN(bool on);
|
||||||
@@ -318,12 +237,7 @@ class GPS : private concurrency::OSThread
|
|||||||
|
|
||||||
// delay counter to allow more sats before fixed position stops GPS thread
|
// delay counter to allow more sats before fixed position stops GPS thread
|
||||||
uint8_t fixeddelayCtr = 0;
|
uint8_t fixeddelayCtr = 0;
|
||||||
|
|
||||||
const char *powerStateToString();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
GnssModel_t gnssModel = GNSS_MODEL_UNKNOWN;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern GPS *gps;
|
extern GPS *gps;
|
||||||
#endif // Exclude GPS
|
#endif // Exclude GPS
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user