Compare commits
674 Commits
meshtastic
...
apollo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b97ca2c834 | ||
|
|
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 | ||
|
|
b78978156e | ||
|
|
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 | ||
|
|
8e2a3e5728 | ||
|
|
f769c50fa5 | ||
|
|
7ba6d97e99 | ||
|
|
f3b698905d | ||
|
|
50dac38a1b | ||
|
|
bf944e78d8 | ||
|
|
e71be778dd | ||
|
|
276067065e | ||
|
|
a628c93125 | ||
|
|
03aaaafa13 | ||
|
|
0a82fd28b3 | ||
|
|
89c186e662 | ||
|
|
8c99f913c1 | ||
|
|
d00acc5d7b | ||
|
|
6860717c68 | ||
|
|
9415254dda | ||
|
|
448c754882 | ||
|
|
da7424a604 | ||
|
|
1bec23b6bb | ||
|
|
bee474ee54 | ||
|
|
7d9b2ef3c4 | ||
|
|
93bc61c855 | ||
|
|
0fc5c9b0d7 | ||
|
|
b0c924f185 | ||
|
|
8801bc5ce9 | ||
|
|
cf476eb87c | ||
|
|
ba2f25293b | ||
|
|
2d4d36c605 | ||
|
|
cbe74009a9 | ||
|
|
701421b50a | ||
|
|
336cdc0efe | ||
|
|
a1ac358b0a | ||
|
|
8462d65f76 | ||
|
|
10dd8af614 | ||
|
|
9c06c492d9 | ||
|
|
7e3c369e87 | ||
|
|
732cf4832a | ||
|
|
545ebf9b17 | ||
|
|
7912c214c7 | ||
|
|
600208ab0b | ||
|
|
462a0718cf | ||
|
|
aae346aef7 | ||
|
|
28b469dbf0 | ||
|
|
5f6e19d971 | ||
|
|
0726eaa678 | ||
|
|
50fb575caa | ||
|
|
cc59a50cba | ||
|
|
b3ba23b4e8 | ||
|
|
936260fca3 | ||
|
|
2945b9cfbe | ||
|
|
ed03d28a83 | ||
|
|
850f61d2d0 | ||
|
|
e12fd27b49 | ||
|
|
77dfc92f1e | ||
|
|
c4eb9a6d7f | ||
|
|
195f109ef7 | ||
|
|
3c8ca39eff | ||
|
|
c071eed6a3 | ||
|
|
d14d42ba2c | ||
|
|
82145e0661 | ||
|
|
1334d07c6a | ||
|
|
bf760a44ba | ||
|
|
94ff67e927 | ||
|
|
e37369a25f | ||
|
|
a8bd1ee0da | ||
|
|
2568d4fcd8 | ||
|
|
adf1bc4b0e | ||
|
|
7a3f30f99e | ||
|
|
ea63f035d1 | ||
|
|
e394bc6f8f | ||
|
|
a0e468b16e | ||
|
|
93318b4f56 | ||
|
|
0c0da3909f | ||
|
|
701293c2d3 | ||
|
|
6485f037ec | ||
|
|
ca5f71f774 | ||
|
|
57667f1028 | ||
|
|
3f1c86f953 | ||
|
|
4416ac57cf | ||
|
|
a4705d2c19 | ||
|
|
5ff8c904c8 | ||
|
|
09c8642aa6 | ||
|
|
82bcd503a3 | ||
|
|
18ca5b4449 | ||
|
|
2ba72c154a | ||
|
|
7e3931b05d | ||
|
|
4575352d8c | ||
|
|
b1b6bce6b7 | ||
|
|
304f26b909 | ||
|
|
a27f9fcdbd | ||
|
|
dfeb33d46e | ||
|
|
b8b6894d58 | ||
|
|
934be69663 | ||
|
|
ec9e562a77 | ||
|
|
fbb6778415 | ||
|
|
2ea2b47690 | ||
|
|
f77c87dca8 | ||
|
|
198b62f3fc | ||
|
|
02e258d5e9 | ||
|
|
3e5f129fce | ||
|
|
ad214ea42a | ||
|
|
25b557cf46 | ||
|
|
7fd1c334d3 | ||
|
|
696bcc60af | ||
|
|
af0db8a29f | ||
|
|
ea20bb1836 | ||
|
|
420ab89f8d | ||
|
|
1212969ff7 | ||
|
|
e49e584ae1 | ||
|
|
89c1e041e1 | ||
|
|
655e58f424 | ||
|
|
0ec1684718 | ||
|
|
05e4a639a1 | ||
|
|
fb9f361052 | ||
|
|
37448205b5 | ||
|
|
015f7335b0 | ||
|
|
48d8b85a3b | ||
|
|
363fd8ab98 | ||
|
|
323e7503ea | ||
|
|
4e4431560e | ||
|
|
a8c216f4f8 | ||
|
|
9d0729c83f | ||
|
|
3c89716074 | ||
|
|
ec96256bcd | ||
|
|
1f2d972e18 | ||
|
|
cc87002a8a | ||
|
|
8ab772221d | ||
|
|
d55c08d5cd | ||
|
|
e8f287a36f | ||
|
|
b769799410 | ||
|
|
f5f9fd54a1 | ||
|
|
f82585d9b0 | ||
|
|
1b04d41b9a | ||
|
|
3b21856a76 | ||
|
|
519ca9c0aa | ||
|
|
23a52ee625 | ||
|
|
7ff4bafe22 | ||
|
|
149620f071 | ||
|
|
0cbade989e | ||
|
|
411834afba | ||
|
|
1096973828 | ||
|
|
dc9aa6aff7 | ||
|
|
ad8747d914 | ||
|
|
ddd4a45bc3 | ||
|
|
4f8f96ab29 | ||
|
|
19bcb60120 | ||
|
|
f0c97b8806 | ||
|
|
ee5091fee5 | ||
|
|
876993f095 | ||
|
|
a05b009379 | ||
|
|
5db4918413 | ||
|
|
a0dd7b43d5 | ||
|
|
b1f045cab8 | ||
|
|
2e5399dbe4 | ||
|
|
d005b1e49c | ||
|
|
9d9258a59b | ||
|
|
37f294d0a6 | ||
|
|
411aedaf5d | ||
|
|
1c54388bb8 | ||
|
|
94ecbad904 | ||
|
|
53f189fff4 | ||
|
|
93d874b013 | ||
|
|
234a56446b | ||
|
|
830281803f | ||
|
|
bb9f003c24 | ||
|
|
001a845ac3 | ||
|
|
7febb41727 | ||
|
|
ad031dd69f | ||
|
|
ebc3a66d10 | ||
|
|
553e572eb5 | ||
|
|
01df3ff477 | ||
|
|
a3a97d3025 | ||
|
|
0952d1b252 | ||
|
|
8a370c5381 | ||
|
|
a6f96cb9b4 | ||
|
|
d650001caa | ||
|
|
0c90a2274f | ||
|
|
dac433ed2f | ||
|
|
8acc9ccf5f | ||
|
|
243421b2a5 | ||
|
|
6d6ed55ed7 | ||
|
|
783466f116 | ||
|
|
55049ed547 | ||
|
|
e182ae75c2 | ||
|
|
7e946d15ca | ||
|
|
c3b9d493b6 | ||
|
|
4db0c75c8e | ||
|
|
e7cfadacd8 | ||
|
|
673fe294f3 | ||
|
|
236374491b | ||
|
|
d6f26c682d | ||
|
|
befc2ece6f | ||
|
|
b2b60eccdb | ||
|
|
07d4e6f5be | ||
|
|
0a93261c06 | ||
|
|
00f15459ec | ||
|
|
b8044c4983 | ||
|
|
18f12584ab | ||
|
|
e1e7bbc420 | ||
|
|
5f974d2961 | ||
|
|
cae2e43dc6 | ||
|
|
0d175a918c | ||
|
|
3440c640c3 | ||
|
|
b769d9f854 | ||
|
|
8d288d5a3c | ||
|
|
dc55d7dd98 | ||
|
|
553514e3b7 | ||
|
|
1dace9a508 | ||
|
|
dd587419c7 | ||
|
|
bce7d73cc6 | ||
|
|
810a79668c | ||
|
|
51ee6c11ea | ||
|
|
cb06ab10da | ||
|
|
199566a996 | ||
|
|
5fcad1d8c5 | ||
|
|
a5bcf48240 | ||
|
|
8ad89ba724 | ||
|
|
fd6e8613c6 | ||
|
|
b529099f90 | ||
|
|
3896009e55 | ||
|
|
6f506cead5 | ||
|
|
3492c9aa99 | ||
|
|
19f45d282f | ||
|
|
d73cbf14d5 | ||
|
|
d41d4c930e | ||
|
|
403e5c304e | ||
|
|
dcb2707d94 | ||
|
|
2e935fd943 | ||
|
|
88af23319c | ||
|
|
42a3301188 | ||
|
|
57b8b55fc5 | ||
|
|
d0440f3cac | ||
|
|
ef2035a60c | ||
|
|
fa29386eb7 | ||
|
|
7e0665a5cd | ||
|
|
233962104c | ||
|
|
a70d5ee9d8 | ||
|
|
a542d41ac7 | ||
|
|
9513c68544 | ||
|
|
448afb8345 | ||
|
|
22ecbcb046 | ||
|
|
7963ca6171 | ||
|
|
6a355616c7 | ||
|
|
ec23189407 | ||
|
|
479b0856b4 | ||
|
|
7289f36600 | ||
|
|
ef1f0cb074 | ||
|
|
1e8d089c4e | ||
|
|
06dab4fa13 | ||
|
|
12efedec42 | ||
|
|
e530ceb566 | ||
|
|
da346159f7 | ||
|
|
c650e7d273 | ||
|
|
f3213a5b2f | ||
|
|
1dc0cc0d05 | ||
|
|
f28f5e07b7 | ||
|
|
62c306a14b | ||
|
|
5a2c58197b | ||
|
|
cc101f9cd2 | ||
|
|
016e1005df | ||
|
|
6e1aa52723 | ||
|
|
5ff265c196 | ||
|
|
1f08401070 | ||
|
|
d1d6bfe693 | ||
|
|
a39280e9df | ||
|
|
48fa9f2242 | ||
|
|
7f59cb54ef | ||
|
|
36a66df923 | ||
|
|
8efc15f4d9 | ||
|
|
884e3f2e35 | ||
|
|
0e0811eccd | ||
|
|
fd1b68513a | ||
|
|
2798946176 | ||
|
|
4ee1ae429b | ||
|
|
482361b252 | ||
|
|
cb1cf055b1 | ||
|
|
6c2e60d415 | ||
|
|
ef223b1195 | ||
|
|
ae14ca7870 | ||
|
|
747046d335 | ||
|
|
e02a7d1c68 | ||
|
|
bdb998c763 | ||
|
|
c35d780236 | ||
|
|
39febad630 | ||
|
|
40932ea06c | ||
|
|
f37b88b55e | ||
|
|
743fc2e812 | ||
|
|
30356dcd97 | ||
|
|
5f6d9c3e27 | ||
|
|
4794cdb120 | ||
|
|
a32233bb92 | ||
|
|
fff2e435b5 | ||
|
|
8f84a96b69 | ||
|
|
11c17ec78c | ||
|
|
b4bdf604f5 | ||
|
|
833d7f65bc | ||
|
|
9bebad2dbe | ||
|
|
14019f2afa | ||
|
|
12481b568a | ||
|
|
3072b2a444 | ||
|
|
5c77e29d66 | ||
|
|
118809fbfc | ||
|
|
baf9cf5a59 | ||
|
|
51e4b364b0 | ||
|
|
581686c7b7 | ||
|
|
3a2fa118a2 | ||
|
|
ac5edf867c | ||
|
|
d4e8452c60 | ||
|
|
4128d75ad4 | ||
|
|
ed4527cfa5 | ||
|
|
26112ba001 | ||
|
|
9dd769586f | ||
|
|
6e1616375e | ||
|
|
a7c379961a | ||
|
|
02d9d8b76c | ||
|
|
d1138d51e5 | ||
|
|
31e952c72e | ||
|
|
9d7938f570 | ||
|
|
9456c42fc0 | ||
|
|
40b3dbaa70 | ||
|
|
1129c92974 | ||
|
|
1293c5cdd4 | ||
|
|
bebd2bb9e0 | ||
|
|
f73aa8aa82 | ||
|
|
e6e05dda1e | ||
|
|
c50df710ba | ||
|
|
65104d5d8c | ||
|
|
881f133021 | ||
|
|
10c51d8a05 | ||
|
|
453b3a59b2 | ||
|
|
67fd4b64af | ||
|
|
1d0013918b | ||
|
|
cac640ea97 | ||
|
|
e7569838c7 | ||
|
|
64b2bf5f93 | ||
|
|
d6a008500a | ||
|
|
a9d636c025 | ||
|
|
292027f40f | ||
|
|
3c126212d5 | ||
|
|
9710ac79d3 | ||
|
|
f2801a660b | ||
|
|
4d269501dd | ||
|
|
752192b09a | ||
|
|
f8f9329529 | ||
|
|
c3e53d916d | ||
|
|
c679932248 | ||
|
|
5488c8f579 | ||
|
|
6c488fe816 | ||
|
|
771cb52616 | ||
|
|
10869ea10a | ||
|
|
e4d0e38f37 | ||
|
|
d7badcc9cb | ||
|
|
4fbf666cd9 | ||
|
|
adb094ebc9 | ||
|
|
b709d47832 | ||
|
|
01d42d4728 | ||
|
|
ce480ae626 | ||
|
|
139686d639 | ||
|
|
4fde1ca2a8 | ||
|
|
c72612d826 | ||
|
|
682133501a | ||
|
|
b4c09ace23 | ||
|
|
c39d270f40 | ||
|
|
428a567078 | ||
|
|
0ad1f776ae | ||
|
|
e78c706999 | ||
|
|
c442cd7267 | ||
|
|
9cbabb0468 | ||
|
|
9a7a4d3814 | ||
|
|
fa1cc59841 | ||
|
|
d4dc4dec76 | ||
|
|
be01c18c74 | ||
|
|
e8829b8f52 | ||
|
|
1afd61698b | ||
|
|
3ff9398b92 | ||
|
|
76900555e8 | ||
|
|
1487ca2a30 | ||
|
|
f960164c0e | ||
|
|
11598beb16 | ||
|
|
1f8aa1efc7 | ||
|
|
18aac0ba25 | ||
|
|
2e24d244be | ||
|
|
7db98ca1da | ||
|
|
9f8d86cb25 | ||
|
|
2ff0af55b1 | ||
|
|
51af747508 | ||
|
|
893bbe09d1 | ||
|
|
d21087f639 | ||
|
|
01203eb854 | ||
|
|
2072ebd196 | ||
|
|
202699239f | ||
|
|
906b0233d2 | ||
|
|
d584031d10 | ||
|
|
f324ab7de7 | ||
|
|
54f56438da | ||
|
|
e6c7c80b3f | ||
|
|
c053c7d9ae | ||
|
|
953beb56b1 | ||
|
|
acd044fdea | ||
|
|
de706523f5 | ||
|
|
52cef05c70 | ||
|
|
6490cadd35 | ||
|
|
8e5928276b | ||
|
|
5dcaceccdd | ||
|
|
f1cf2bf413 | ||
|
|
3882841283 | ||
|
|
74e6470439 | ||
|
|
dca711ac24 | ||
|
|
7368cb99dc | ||
|
|
ec848bab52 | ||
|
|
ed13105aec | ||
|
|
c2272ce5a1 | ||
|
|
0664c09f9d | ||
|
|
ba31a7c753 | ||
|
|
1bca8de042 | ||
|
|
6ffdc9875b | ||
|
|
b84cf55659 | ||
|
|
85d722232e | ||
|
|
921d92c649 | ||
|
|
82f1be33aa | ||
|
|
0f3450ad44 | ||
|
|
114df8cb1b | ||
|
|
d3a293a0d8 | ||
|
|
91b4199f9d | ||
|
|
6473cf0b69 | ||
|
|
84e197574b | ||
|
|
5c4c0965af | ||
|
|
7289b295e8 | ||
|
|
7c32ab3023 | ||
|
|
2bc036f9eb | ||
|
|
cc89e85e71 | ||
|
|
da45cb8557 | ||
|
|
2ebfcea94e | ||
|
|
deada41cee | ||
|
|
777bcf691a | ||
|
|
35e1c401e2 | ||
|
|
19c57e8ec6 | ||
|
|
db4a793aa9 | ||
|
|
c6196b2260 | ||
|
|
3eebdcefa4 | ||
|
|
4289cb089b | ||
|
|
2d52803dbd | ||
|
|
c78302a2ee | ||
|
|
923458bc18 | ||
|
|
50fb4ab22a | ||
|
|
f5016763fd | ||
|
|
2a6921292e | ||
|
|
a47570d65a | ||
|
|
db4dc88d6f | ||
|
|
be306cc384 | ||
|
|
a967dd52f3 | ||
|
|
11378325e0 | ||
|
|
4b5bcf52d2 | ||
|
|
5ba418b2cd | ||
|
|
bc753e6903 | ||
|
|
34a543ec74 | ||
|
|
06cd9abd81 | ||
|
|
af30485611 | ||
|
|
cd6bd1e9a3 | ||
|
|
b025eeb13c | ||
|
|
21eb54e58a | ||
|
|
6f1db6fc63 | ||
|
|
a5118787b3 | ||
|
|
39c90dd581 | ||
|
|
33e6f7f6e0 | ||
|
|
97fd189f43 | ||
|
|
1e665d5181 | ||
|
|
b3343303a9 | ||
|
|
f37276d5fc | ||
|
|
905194c604 | ||
|
|
ea6f6c3668 | ||
|
|
51b22630b4 | ||
|
|
5d831ef461 | ||
|
|
4e8672cce4 | ||
|
|
41a769aa06 | ||
|
|
8d57b6164a | ||
|
|
dc3eba9100 | ||
|
|
ff8baa1c85 | ||
|
|
3a10a27851 | ||
|
|
8893529653 | ||
|
|
1ab5bf4355 | ||
|
|
ae791ca7e1 | ||
|
|
35cfe4318a | ||
|
|
b59bd6fee9 | ||
|
|
8b911f14cf | ||
|
|
d36c69396b | ||
|
|
b39aca8d11 | ||
|
|
6c327d960d | ||
|
|
9527874815 | ||
|
|
cd480846e9 | ||
|
|
3d72fbb19e | ||
|
|
9f3a1c1214 | ||
|
|
625254cf90 | ||
|
|
c4c85777d0 | ||
|
|
ca8d2204ba | ||
|
|
a388e78842 | ||
|
|
35cdc81d45 | ||
|
|
910b6b7512 | ||
|
|
371c3e05bf | ||
|
|
f37df4d6bf | ||
|
|
ba9a3cd719 | ||
|
|
9ac0e26d42 | ||
|
|
1ba4f6e222 | ||
|
|
e8e9826adc | ||
|
|
6724f1f7ea | ||
|
|
013021941e | ||
|
|
4e850296b6 | ||
|
|
0c42f79038 | ||
|
|
4fc3782ea3 | ||
|
|
9ac4a0114f | ||
|
|
9188786581 | ||
|
|
f1602ee3f6 | ||
|
|
5537f98dd6 | ||
|
|
4ed12bf21d | ||
|
|
106dab23db | ||
|
|
2f9dcee954 | ||
|
|
68d6ff8c24 | ||
|
|
dc8cc122a6 | ||
|
|
e9d55de3cb | ||
|
|
dacb452d47 | ||
|
|
b2e2f1dba3 | ||
|
|
b2417f651a | ||
|
|
d02ba45109 | ||
|
|
c6bffd7d7f | ||
|
|
a5b79528b3 | ||
|
|
6217e97c41 | ||
|
|
047b8a587d | ||
|
|
c1a493fb35 | ||
|
|
0e93470e34 | ||
|
|
074ccbaa0c | ||
|
|
3765b9f3af | ||
|
|
652441fcc0 | ||
|
|
688385fd75 | ||
|
|
f2116a06a7 | ||
|
|
7cbf66949b | ||
|
|
ed9bdf0e05 | ||
|
|
011cff2fe1 | ||
|
|
f50f61a52d | ||
|
|
72664b04f1 | ||
|
|
9be3b7bdc5 | ||
|
|
93d7f24d74 | ||
|
|
a7c0109349 | ||
|
|
a9fc31c026 | ||
|
|
4996e2aace | ||
|
|
b2a313780f | ||
|
|
55a75d2f58 | ||
|
|
dcae45d287 | ||
|
|
7d5716d3af | ||
|
|
81a783291d | ||
|
|
47b522fae4 | ||
|
|
c29b49f320 | ||
|
|
71645c029f | ||
|
|
acbbc95ebf | ||
|
|
a7bf7f47b5 | ||
|
|
2b074e60d9 | ||
|
|
c31476d3e8 | ||
|
|
b6b52d89df | ||
|
|
534845450b | ||
|
|
7e2d729434 | ||
|
|
de21b31ab0 | ||
|
|
db9cb3325f | ||
|
|
b8965d27bb | ||
|
|
72b1fa3889 | ||
|
|
ed432749e2 | ||
|
|
1369630292 | ||
|
|
b467ee09b8 | ||
|
|
8e088df363 | ||
|
|
9a79d34bce | ||
|
|
784381bae8 | ||
|
|
f826a85b0a | ||
|
|
a54ad6ba75 | ||
|
|
4b053ddd73 | ||
|
|
681377cc97 | ||
|
|
1eff8fdba8 | ||
|
|
516fc5ceed | ||
|
|
a7f9e5ddb4 |
@@ -13,16 +13,13 @@
|
|||||||
},
|
},
|
||||||
"customizations": {
|
"customizations": {
|
||||||
"vscode": {
|
"vscode": {
|
||||||
"extensions": [
|
"extensions": ["ms-vscode.cpptools", "platformio.platformio-ide"]
|
||||||
"ms-vscode.cpptools",
|
|
||||||
"platformio.platformio-ide",
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 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],
|
||||||
|
|
||||||
// Run commands to prepare the container for use
|
// Run commands to prepare the container for use
|
||||||
"postCreateCommand": ".devcontainer/setup.sh",
|
"postCreateCommand": ".devcontainer/setup.sh"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
|||||||
14
.github/ISSUE_TEMPLATE/Bug Report.yml
vendored
@@ -49,10 +49,24 @@ body:
|
|||||||
- Heltec V3
|
- Heltec V3
|
||||||
- Heltec Wireless Paper
|
- Heltec Wireless Paper
|
||||||
- Heltec Wireless Tracker
|
- Heltec Wireless Tracker
|
||||||
|
- Heltec Mesh Node T114
|
||||||
|
- Heltec Vision Master E213
|
||||||
|
- Heltec Vision Master E290
|
||||||
|
- Heltec Vision Master T190
|
||||||
|
- Nano G1
|
||||||
|
- Nano G1 Explorer
|
||||||
|
- Nano G2 Ultra
|
||||||
- Raspberry Pi Pico (W)
|
- Raspberry Pi Pico (W)
|
||||||
- Relay v1
|
- Relay v1
|
||||||
- Relay v2
|
- Relay v2
|
||||||
- Seeed Wio Tracker 1110
|
- Seeed Wio Tracker 1110
|
||||||
|
- Seeed Card Tracker T1000-E
|
||||||
|
- Station G1
|
||||||
|
- Station G2
|
||||||
|
- unPhone
|
||||||
|
- CanaryOne
|
||||||
|
- Chatter
|
||||||
|
- Linux Native
|
||||||
- DIY
|
- DIY
|
||||||
- Other
|
- Other
|
||||||
validations:
|
validations:
|
||||||
|
|||||||
1
.github/ISSUE_TEMPLATE/feature.yml
vendored
@@ -18,6 +18,7 @@ body:
|
|||||||
- ESP32
|
- ESP32
|
||||||
- RP2040
|
- RP2040
|
||||||
- Linux Native
|
- Linux Native
|
||||||
|
- Cross-Platform
|
||||||
- other
|
- other
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
95
.github/actions/build-variant/action.yml
vendored
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
name: Setup Build Variant Composite Action
|
||||||
|
description: Variant build actions for Meshtastic Platform IO steps
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
description: The board to build for
|
||||||
|
required: true
|
||||||
|
github_token:
|
||||||
|
description: GitHub token
|
||||||
|
required: true
|
||||||
|
build-script-path:
|
||||||
|
description: Path to the build script
|
||||||
|
required: true
|
||||||
|
remove-debug-flags:
|
||||||
|
description: A space separated list of files to remove debug flags from
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
ota-firmware-source:
|
||||||
|
description: The OTA firmware file to pull
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
ota-firmware-target:
|
||||||
|
description: The target path to store the OTA firmware file
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
artifact-paths:
|
||||||
|
description: A newline separated list of paths to store as artifacts
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
include-web-ui:
|
||||||
|
description: Include the web UI in the build
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
arch:
|
||||||
|
description: Processor arch name
|
||||||
|
required: true
|
||||||
|
default: "esp32"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Build base
|
||||||
|
id: base
|
||||||
|
uses: ./.github/actions/setup-base
|
||||||
|
|
||||||
|
- name: Pull web ui
|
||||||
|
if: inputs.include-web-ui == 'true'
|
||||||
|
uses: dsaltares/fetch-gh-release-asset@master
|
||||||
|
with:
|
||||||
|
repo: meshtastic/web
|
||||||
|
file: build.tar
|
||||||
|
target: build.tar
|
||||||
|
token: ${{ inputs.github_token }}
|
||||||
|
version: tags/v2.5.3
|
||||||
|
|
||||||
|
- name: Unpack web ui
|
||||||
|
if: inputs.include-web-ui == 'true'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
tar -xf build.tar -C data/static
|
||||||
|
rm build.tar
|
||||||
|
|
||||||
|
- name: Remove debug flags for release
|
||||||
|
shell: bash
|
||||||
|
if: inputs.remove-debug-flags != ''
|
||||||
|
run: |
|
||||||
|
for INI_FILE in ${{ inputs.remove-debug-flags }}; do
|
||||||
|
sed -i '/DDEBUG_HEAP/d' ${INI_FILE}
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Build ${{ inputs.board }}
|
||||||
|
shell: bash
|
||||||
|
run: ${{ inputs.build-script-path }} ${{ inputs.board }}
|
||||||
|
|
||||||
|
- name: Pull OTA Firmware
|
||||||
|
if: inputs.ota-firmware-source != '' && inputs.ota-firmware-target != ''
|
||||||
|
uses: dsaltares/fetch-gh-release-asset@master
|
||||||
|
with:
|
||||||
|
repo: meshtastic/firmware-ota
|
||||||
|
file: ${{ inputs.ota-firmware-source }}
|
||||||
|
target: ${{ inputs.ota-firmware-target }}
|
||||||
|
token: ${{ inputs.github_token }}
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
shell: bash
|
||||||
|
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Store binaries as an artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: firmware-${{ inputs.arch }}-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
||||||
|
overwrite: true
|
||||||
|
path: |
|
||||||
|
${{ inputs.artifact-paths }}
|
||||||
5
.github/actions/setup-base/action.yml
vendored
@@ -11,6 +11,11 @@ runs:
|
|||||||
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: Uncomment build epoch
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sed -i 's/#-DBUILD_EPOCH=$UNIX_TIME/-DBUILD_EPOCH=$UNIX_TIME/' platformio.ini
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
26
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directory: devcontainer
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "05:00" # trunk-ignore(yamllint/quoted-strings): required by dependabot syntax check
|
||||||
|
timezone: US/Pacific
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "05:00" # trunk-ignore(yamllint/quoted-strings): required by dependabot syntax check
|
||||||
|
timezone: US/Pacific
|
||||||
|
- package-ecosystem: gitsubmodule
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "05:00" # trunk-ignore(yamllint/quoted-strings): required by dependabot syntax check
|
||||||
|
timezone: US/Pacific
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /.github/workflows
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "05:00" # trunk-ignore(yamllint/quoted-strings): required by dependabot syntax check
|
||||||
|
timezone: US/Pacific
|
||||||
62
.github/workflows/build_esp32.yml
vendored
@@ -7,57 +7,31 @@ 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
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
|
|
||||||
- name: Pull web ui
|
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
|
||||||
with:
|
|
||||||
repo: meshtastic/web
|
|
||||||
file: build.tar
|
|
||||||
target: build.tar
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Unpack web ui
|
|
||||||
run: |
|
|
||||||
tar -xf build.tar -C data/static
|
|
||||||
rm build.tar
|
|
||||||
|
|
||||||
- name: Remove debug flags for release
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
run: |
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32.ini
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32s2.ini
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32s3.ini
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32c3.ini
|
|
||||||
|
|
||||||
- name: Build ESP32
|
- name: Build ESP32
|
||||||
run: bin/build-esp32.sh ${{ inputs.board }}
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
- name: Pull OTA Firmware
|
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
|
||||||
with:
|
with:
|
||||||
repo: meshtastic/firmware-ota
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: firmware.bin
|
board: ${{ inputs.board }}
|
||||||
target: release/bleota.bin
|
remove-debug-flags: >-
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
./arch/esp32/esp32.ini
|
||||||
|
./arch/esp32/esp32s2.ini
|
||||||
- name: Get release version string
|
./arch/esp32/esp32s3.ini
|
||||||
shell: bash
|
./arch/esp32/esp32c3.ini
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
./arch/esp32/esp32c6.ini
|
||||||
id: version
|
build-script-path: bin/build-esp32.sh
|
||||||
|
ota-firmware-source: firmware.bin
|
||||||
- name: Store binaries as an artifact
|
ota-firmware-target: release/bleota.bin
|
||||||
uses: actions/upload-artifact@v4
|
artifact-paths: |
|
||||||
with:
|
|
||||||
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
release/*.bin
|
release/*.bin
|
||||||
release/*.elf
|
release/*.elf
|
||||||
|
include-web-ui: true
|
||||||
|
arch: esp32
|
||||||
|
|||||||
60
.github/workflows/build_esp32_c3.yml
vendored
@@ -14,50 +14,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
|
|
||||||
- name: Pull web ui
|
- name: Build ESP32-C3
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
with:
|
with:
|
||||||
repo: meshtastic/web
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: build.tar
|
board: ${{ inputs.board }}
|
||||||
target: build.tar
|
remove-debug-flags: >-
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
./arch/esp32/esp32.ini
|
||||||
|
./arch/esp32/esp32s2.ini
|
||||||
- name: Unpack web ui
|
./arch/esp32/esp32s3.ini
|
||||||
run: |
|
./arch/esp32/esp32c3.ini
|
||||||
tar -xf build.tar -C data/static
|
./arch/esp32/esp32c6.ini
|
||||||
rm build.tar
|
build-script-path: bin/build-esp32.sh
|
||||||
- name: Remove debug flags for release
|
ota-firmware-source: firmware-c3.bin
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
ota-firmware-target: release/bleota-c3.bin
|
||||||
run: |
|
artifact-paths: |
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32.ini
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32s2.ini
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32s3.ini
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32c3.ini
|
|
||||||
- name: Build ESP32
|
|
||||||
run: bin/build-esp32.sh ${{ inputs.board }}
|
|
||||||
|
|
||||||
- name: Pull OTA Firmware
|
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
|
||||||
with:
|
|
||||||
repo: meshtastic/firmware-ota
|
|
||||||
file: firmware-c3.bin
|
|
||||||
target: release/bleota-c3.bin
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
shell: bash
|
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
release/*.bin
|
release/*.bin
|
||||||
release/*.elf
|
release/*.elf
|
||||||
|
include-web-ui: true
|
||||||
|
arch: esp32c3
|
||||||
|
|||||||
37
.github/workflows/build_esp32_c6.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Build ESP32-C6
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-esp32-c6:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build ESP32-C6
|
||||||
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
board: ${{ inputs.board }}
|
||||||
|
remove-debug-flags: >-
|
||||||
|
./arch/esp32/esp32.ini
|
||||||
|
./arch/esp32/esp32s2.ini
|
||||||
|
./arch/esp32/esp32s3.ini
|
||||||
|
./arch/esp32/esp32c3.ini
|
||||||
|
./arch/esp32/esp32c6.ini
|
||||||
|
build-script-path: bin/build-esp32.sh
|
||||||
|
ota-firmware-source: firmware-c3.bin
|
||||||
|
ota-firmware-target: release/bleota-c3.bin
|
||||||
|
artifact-paths: |
|
||||||
|
release/*.bin
|
||||||
|
release/*.elf
|
||||||
|
include-web-ui: true
|
||||||
|
arch: esp32c6
|
||||||
62
.github/workflows/build_esp32_s3.yml
vendored
@@ -7,55 +7,31 @@ 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
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
|
|
||||||
- name: Pull web ui
|
- name: Build ESP32-S3
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
with:
|
with:
|
||||||
repo: meshtastic/web
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: build.tar
|
board: ${{ inputs.board }}
|
||||||
target: build.tar
|
remove-debug-flags: >-
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
./arch/esp32/esp32.ini
|
||||||
|
./arch/esp32/esp32s2.ini
|
||||||
- name: Unpack web ui
|
./arch/esp32/esp32s3.ini
|
||||||
run: |
|
./arch/esp32/esp32c3.ini
|
||||||
tar -xf build.tar -C data/static
|
./arch/esp32/esp32c6.ini
|
||||||
rm build.tar
|
build-script-path: bin/build-esp32.sh
|
||||||
- name: Remove debug flags for release
|
ota-firmware-source: firmware-s3.bin
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
ota-firmware-target: release/bleota-s3.bin
|
||||||
run: |
|
artifact-paths: |
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32.ini
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32s2.ini
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32s3.ini
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32c3.ini
|
|
||||||
- name: Build ESP32
|
|
||||||
run: bin/build-esp32.sh ${{ inputs.board }}
|
|
||||||
|
|
||||||
- name: Pull OTA Firmware
|
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
|
||||||
with:
|
|
||||||
repo: meshtastic/firmware-ota
|
|
||||||
file: firmware-s3.bin
|
|
||||||
target: release/bleota-s3.bin
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
shell: bash
|
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
release/*.bin
|
release/*.bin
|
||||||
release/*.elf
|
release/*.elf
|
||||||
|
include-web-ui: true
|
||||||
|
arch: esp32s3
|
||||||
|
|||||||
4
.github/workflows/build_native.yml
vendored
@@ -67,7 +67,7 @@ jobs:
|
|||||||
- name: Docker build and push tagged versions
|
- name: Docker build and push tagged versions
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
continue-on-error: true # FIXME: Failing docker login auth
|
continue-on-error: true # FIXME: Failing docker login auth
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
@@ -77,7 +77,7 @@ jobs:
|
|||||||
- name: Docker build and push
|
- name: Docker build and push
|
||||||
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
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
|
continue-on-error: true # FIXME: Failing docker login auth
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
|||||||
21
.github/workflows/build_nrf52.yml
vendored
@@ -12,24 +12,17 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
|
|
||||||
- name: Build NRF52
|
- name: Build NRF52
|
||||||
run: bin/build-nrf52.sh ${{ inputs.board }}
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
- name: Get release version string
|
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
overwrite: true
|
board: ${{ inputs.board }}
|
||||||
path: |
|
build-script-path: bin/build-nrf52.sh
|
||||||
|
artifact-paths: |
|
||||||
release/*.hex
|
release/*.hex
|
||||||
release/*.uf2
|
release/*.uf2
|
||||||
release/*.elf
|
release/*.elf
|
||||||
release/*.zip
|
release/*.zip
|
||||||
|
arch: nrf52840
|
||||||
|
|||||||
4
.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
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
4
.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
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
21
.github/workflows/build_rpi2040.yml
vendored
@@ -12,22 +12,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
|
|
||||||
- name: Build Raspberry Pi 2040
|
- name: Build Raspberry Pi 2040
|
||||||
run: ./bin/build-rpi2040.sh ${{ inputs.board }}
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
- name: Get release version string
|
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
overwrite: true
|
board: ${{ inputs.board }}
|
||||||
path: |
|
build-script-path: bin/build-rpi2040.sh
|
||||||
|
artifact-paths: |
|
||||||
release/*.uf2
|
release/*.uf2
|
||||||
release/*.elf
|
release/*.elf
|
||||||
|
arch: rp2040
|
||||||
|
|||||||
24
.github/workflows/build_stm32.yml
vendored
@@ -12,22 +12,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
|
|
||||||
- name: Build STM32
|
- name: Build STM32WL
|
||||||
run: bin/build-stm32.sh ${{ inputs.board }}
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
- name: Get release version string
|
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
overwrite: true
|
board: ${{ inputs.board }}
|
||||||
path: |
|
build-script-path: bin/build-stm32.sh
|
||||||
|
artifact-paths: |
|
||||||
release/*.hex
|
release/*.hex
|
||||||
release/*.bin
|
release/*.bin
|
||||||
|
release/*.elf
|
||||||
|
arch: stm32
|
||||||
|
|||||||
35
.github/workflows/generate-userprefs.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: Generate UsersPrefs JSON manifest
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- userPrefs.h
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate-userprefs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Clang
|
||||||
|
run: sudo apt-get install -y clang
|
||||||
|
|
||||||
|
- name: Install trunk
|
||||||
|
run: curl https://get.trunk.io -fsSL | bash
|
||||||
|
|
||||||
|
- name: Generate userPrefs.jsom
|
||||||
|
run: python3 ./bin/build-userprefs-json.py
|
||||||
|
|
||||||
|
- name: Trunk format json
|
||||||
|
run: trunk format userPrefs.json
|
||||||
|
|
||||||
|
- name: Commit userPrefs.json
|
||||||
|
run: |
|
||||||
|
git config --global user.email "actions@github.com"
|
||||||
|
git config --global user.name "GitHub Actions"
|
||||||
|
git add userPrefs.json
|
||||||
|
git commit -m "Update userPrefs.json"
|
||||||
|
git push
|
||||||
212
.github/workflows/main_matrix.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: CI
|
name: CI
|
||||||
#concurrency:
|
concurrency:
|
||||||
# group: ${{ github.ref }}
|
group: ci-${{ github.head_ref || github.run_id }}
|
||||||
# cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
cancel-in-progress: true
|
||||||
on:
|
on:
|
||||||
# # Triggers the workflow on push but only for the master branch
|
# # Triggers the workflow on push but only for the master branch
|
||||||
push:
|
push:
|
||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
arch: [esp32, esp32s3, esp32c3, nrf52840, rp2040, stm32, check]
|
arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32, check]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- id: checkout
|
- id: checkout
|
||||||
@@ -32,13 +32,18 @@ jobs:
|
|||||||
name: Checkout base
|
name: Checkout base
|
||||||
- id: jsonStep
|
- id: jsonStep
|
||||||
run: |
|
run: |
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}})
|
if [[ "${{ github.head_ref }}" == "" ]]; then
|
||||||
echo "$TARGETS"
|
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}})
|
||||||
|
else
|
||||||
|
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} quick)
|
||||||
|
fi
|
||||||
|
echo "Name: ${{ github.ref_name }} Base: ${{ github.base_ref }} Head: ${{ github.head_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 }}
|
||||||
esp32s3: ${{ steps.jsonStep.outputs.esp32s3 }}
|
esp32s3: ${{ steps.jsonStep.outputs.esp32s3 }}
|
||||||
esp32c3: ${{ steps.jsonStep.outputs.esp32c3 }}
|
esp32c3: ${{ steps.jsonStep.outputs.esp32c3 }}
|
||||||
|
esp32c6: ${{ steps.jsonStep.outputs.esp32c6 }}
|
||||||
nrf52840: ${{ steps.jsonStep.outputs.nrf52840 }}
|
nrf52840: ${{ steps.jsonStep.outputs.nrf52840 }}
|
||||||
rp2040: ${{ steps.jsonStep.outputs.rp2040 }}
|
rp2040: ${{ steps.jsonStep.outputs.rp2040 }}
|
||||||
stm32: ${{ steps.jsonStep.outputs.stm32 }}
|
stm32: ${{ steps.jsonStep.outputs.stm32 }}
|
||||||
@@ -51,6 +56,7 @@ jobs:
|
|||||||
matrix: ${{ fromJson(needs.setup.outputs.check) }}
|
matrix: ${{ fromJson(needs.setup.outputs.check) }}
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build base
|
- name: Build base
|
||||||
@@ -86,6 +92,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
board: ${{ matrix.board }}
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
|
build-esp32-c6:
|
||||||
|
needs: setup
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.setup.outputs.esp32c6) }}
|
||||||
|
uses: ./.github/workflows/build_esp32_c6.yml
|
||||||
|
with:
|
||||||
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
build-nrf52:
|
build-nrf52:
|
||||||
needs: setup
|
needs: setup
|
||||||
strategy:
|
strategy:
|
||||||
@@ -124,6 +139,7 @@ jobs:
|
|||||||
|
|
||||||
after-checks:
|
after-checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
needs: [check]
|
needs: [check]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -136,18 +152,20 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
[
|
[
|
||||||
build-esp32,
|
build-esp32,
|
||||||
build-esp32-s3,
|
build-esp32-s3,
|
||||||
build-esp32-c3,
|
build-esp32-c3,
|
||||||
|
build-esp32-c6,
|
||||||
build-nrf52,
|
build-nrf52,
|
||||||
build-rpi2040,
|
build-rpi2040,
|
||||||
build-stm32,
|
build-stm32,
|
||||||
package-raspbian,
|
|
||||||
package-raspbian-armv7l,
|
|
||||||
package-native,
|
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -159,6 +177,7 @@ jobs:
|
|||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ./
|
path: ./
|
||||||
|
pattern: firmware-${{matrix.arch}}-*
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
@@ -169,12 +188,12 @@ jobs:
|
|||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Move files up
|
- name: Move files up
|
||||||
run: mv -b -t ./ ./release/meshtasticd_linux_* ./bin/config-dist.yaml ./bin/device-*.sh ./bin/device-*.bat
|
run: mv -b -t ./ ./bin/device-*.sh ./bin/device-*.bat
|
||||||
|
|
||||||
- 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-${{ steps.version.outputs.version }}
|
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
./firmware-*.bin
|
./firmware-*.bin
|
||||||
@@ -183,16 +202,15 @@ jobs:
|
|||||||
./firmware-*-ota.zip
|
./firmware-*-ota.zip
|
||||||
./device-*.sh
|
./device-*.sh
|
||||||
./device-*.bat
|
./device-*.bat
|
||||||
./meshtasticd_linux_*
|
|
||||||
./config-dist.yaml
|
|
||||||
./littlefs-*.bin
|
./littlefs-*.bin
|
||||||
|
./littlefswebui-*.bin
|
||||||
./bleota*bin
|
./bleota*bin
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
./Meshtastic_nRF52_factory_erase*.uf2
|
||||||
retention-days: 90
|
retention-days: 30
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-${{ steps.version.outputs.version }}
|
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: ./output
|
path: ./output
|
||||||
|
|
||||||
@@ -206,32 +224,35 @@ 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-${{ steps.version.outputs.version }}.zip ./output
|
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}.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-${{ steps.version.outputs.version }}.zip
|
name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: ./*.elf
|
path: ./*.elf
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- name: Create request artifacts
|
- uses: scruplelesswizard/comment-artifact@main
|
||||||
continue-on-error: true # FIXME: Why are we getting 502, but things still work?
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
|
|
||||||
uses: gavv/pull-request-artifacts@v2.1.0
|
|
||||||
with:
|
with:
|
||||||
commit: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}
|
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
description: "Download firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip. This artifact will be available for 90 days from creation"
|
||||||
artifacts-token: ${{ secrets.ARTIFACTS_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
artifacts-repo: meshtastic/artifacts
|
|
||||||
artifacts-branch: device
|
|
||||||
artifacts: ./firmware-${{ steps.version.outputs.version }}.zip
|
|
||||||
|
|
||||||
release-artifacts:
|
release-artifacts:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
needs: [gather-artifacts, after-checks]
|
outputs:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
needs:
|
||||||
|
[
|
||||||
|
gather-artifacts,
|
||||||
|
package-raspbian,
|
||||||
|
package-raspbian-armv7l,
|
||||||
|
package-native,
|
||||||
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -245,42 +266,6 @@ jobs:
|
|||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: firmware-${{ steps.version.outputs.version }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: meshtasticd_${{ steps.version.outputs.version }}_*.deb
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -R
|
|
||||||
|
|
||||||
- name: Device scripts permissions
|
|
||||||
run: |
|
|
||||||
chmod +x ./output/device-install.sh
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output -x *.deb
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{ steps.version.outputs.version }}.zip
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./elfs
|
|
||||||
|
|
||||||
- name: Zip Elfs
|
|
||||||
run: zip -j -9 -r ./debug-elfs-${{ steps.version.outputs.version }}.zip ./elfs
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Show artifacts
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
id: create_release
|
id: create_release
|
||||||
@@ -294,25 +279,16 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
- name: Add bins to release
|
- name: Download deb files
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/download-artifact@v4
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
pattern: meshtasticd_${{ steps.version.outputs.version }}_*.deb
|
||||||
asset_path: ./firmware-${{ steps.version.outputs.version }}.zip
|
merge-multiple: true
|
||||||
asset_name: firmware-${{ steps.version.outputs.version }}.zip
|
path: ./output
|
||||||
asset_content_type: application/zip
|
|
||||||
|
|
||||||
- name: Add debug elfs to release
|
# For diagnostics
|
||||||
uses: actions/upload-release-asset@v1
|
- name: Display structure of downloaded files
|
||||||
env:
|
run: ls -lR
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: ./debug-elfs-${{ steps.version.outputs.version }}.zip
|
|
||||||
asset_name: debug-elfs-${{ steps.version.outputs.version }}.zip
|
|
||||||
asset_content_type: application/zip
|
|
||||||
|
|
||||||
- name: Add raspbian aarch64 .deb
|
- name: Add raspbian aarch64 .deb
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
@@ -349,7 +325,79 @@ jobs:
|
|||||||
bin/bump_version.py
|
bin/bump_version.py
|
||||||
|
|
||||||
- name: Create version.properties pull request
|
- name: Create version.properties pull request
|
||||||
uses: peter-evans/create-pull-request@v6
|
uses: peter-evans/create-pull-request@v7
|
||||||
with:
|
with:
|
||||||
|
title: Bump version.properties
|
||||||
add-paths: |
|
add-paths: |
|
||||||
version.properties
|
version.properties
|
||||||
|
|
||||||
|
release-firmware:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
needs: [release-artifacts]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}
|
||||||
|
merge-multiple: true
|
||||||
|
path: ./output
|
||||||
|
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -lR
|
||||||
|
|
||||||
|
- name: Device scripts permissions
|
||||||
|
run: |
|
||||||
|
chmod +x ./output/device-install.sh
|
||||||
|
chmod +x ./output/device-update.sh
|
||||||
|
|
||||||
|
- name: Zip firmware
|
||||||
|
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip ./output
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip
|
||||||
|
merge-multiple: true
|
||||||
|
path: ./elfs
|
||||||
|
|
||||||
|
- name: Zip firmware
|
||||||
|
run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.version }}.zip ./elfs
|
||||||
|
|
||||||
|
# For diagnostics
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -lR
|
||||||
|
|
||||||
|
- name: Add bins to release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ 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
|
||||||
|
|||||||
9
.github/workflows/package_amd64.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
uses: ./.github/workflows/build_native.yml
|
uses: ./.github/workflows/build_native.yml
|
||||||
|
|
||||||
package-native:
|
package-native:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
needs: build-native
|
needs: build-native
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -50,11 +50,18 @@ jobs:
|
|||||||
mkdir -p .debpkg/usr/share/doc/meshtasticd/web
|
mkdir -p .debpkg/usr/share/doc/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/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/doc/meshtasticd/web
|
||||||
|
shopt -s dotglob nullglob
|
||||||
|
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
|
||||||
|
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
|
||||||
|
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
|
||||||
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
|
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
|
||||||
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/
|
||||||
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
|
||||||
|
|||||||
9
.github/workflows/package_raspbian.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
uses: ./.github/workflows/build_raspbian.yml
|
uses: ./.github/workflows/build_raspbian.yml
|
||||||
|
|
||||||
package-raspbian:
|
package-raspbian:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
needs: build-raspbian
|
needs: build-raspbian
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -50,11 +50,18 @@ jobs:
|
|||||||
mkdir -p .debpkg/usr/share/doc/meshtasticd/web
|
mkdir -p .debpkg/usr/share/doc/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/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/doc/meshtasticd/web
|
||||||
|
shopt -s dotglob nullglob
|
||||||
|
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
|
||||||
|
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
|
||||||
|
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
|
||||||
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
|
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
|
||||||
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/
|
||||||
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
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
uses: ./.github/workflows/build_raspbian_armv7l.yml
|
uses: ./.github/workflows/build_raspbian_armv7l.yml
|
||||||
|
|
||||||
package-raspbian_armv7l:
|
package-raspbian_armv7l:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
needs: build-raspbian_armv7l
|
needs: build-raspbian_armv7l
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -50,11 +50,18 @@ jobs:
|
|||||||
mkdir -p .debpkg/usr/share/doc/meshtasticd/web
|
mkdir -p .debpkg/usr/share/doc/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/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/doc/meshtasticd/web
|
||||||
|
shopt -s dotglob nullglob
|
||||||
|
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
|
||||||
|
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
|
||||||
|
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
|
||||||
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
|
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
|
||||||
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/
|
||||||
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
|
||||||
|
|||||||
2
.github/workflows/sec_sast_semgrep_cron.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
semgrep-full:
|
semgrep-full:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: returntocorp/semgrep
|
image: semgrep/semgrep
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# step 1
|
# step 1
|
||||||
|
|||||||
4
.github/workflows/sec_sast_semgrep_pull.yml
vendored
@@ -4,9 +4,9 @@ on: pull_request
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
semgrep-diff:
|
semgrep-diff:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
image: returntocorp/semgrep
|
image: semgrep/semgrep
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# step 1
|
# step 1
|
||||||
|
|||||||
22
.github/workflows/stale_bot.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
name: process stale Issues and PR's
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: 0 6 * * *
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
actions: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale_issues:
|
||||||
|
name: Close Stale Issues
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Stale PR+Issues
|
||||||
|
uses: actions/stale@v9.0.0
|
||||||
|
with:
|
||||||
|
exempt-issue-labels: pinned,3.0
|
||||||
|
exempt-pr-labels: pinned,3.0
|
||||||
45
.github/workflows/tests.yml
vendored
@@ -57,35 +57,50 @@ jobs:
|
|||||||
reporter: java-junit
|
reporter: java-junit
|
||||||
|
|
||||||
hardware-tests:
|
hardware-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: test-runner
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# - uses: actions/setup-python@v5
|
||||||
|
# with:
|
||||||
|
# python-version: '3.10'
|
||||||
|
|
||||||
|
# pipx install "setuptools<72"
|
||||||
- name: Upgrade python tools
|
- name: Upgrade python tools
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
pipx install adafruit-nrfutil
|
||||||
pip install -U --no-build-isolation --no-cache-dir "setuptools<72"
|
pipx install poetry
|
||||||
pip install -U platformio adafruit-nrfutil --no-build-isolation
|
pipx install meshtastic --pip-args=--pre
|
||||||
pip install -U poetry --no-build-isolation
|
|
||||||
pip install -U meshtastic --pre --no-build-isolation
|
- name: Install PlatformIO from script
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
|
||||||
|
python3 get-platformio.py
|
||||||
|
|
||||||
- name: Upgrade platformio
|
- name: Upgrade platformio
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
export PATH=$PATH:$HOME/.local/bin
|
||||||
pio upgrade
|
pio upgrade
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v2
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install dependencies, setup devices and run
|
||||||
run: pnpm install
|
shell: bash
|
||||||
|
run: |
|
||||||
- name: Setup devices
|
git submodule update --init --recursive
|
||||||
run: pnpm run setup
|
cd meshtestic/
|
||||||
|
pnpm install
|
||||||
- name: Execute end to end tests on connected hardware
|
pnpm run setup
|
||||||
run: pnpm run test
|
pnpm run test
|
||||||
|
|||||||
43
.github/workflows/trunk_format_pr.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
name: Run Trunk Fmt on PR Comment
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
trunk-fmt:
|
||||||
|
if: github.event.issue.pull_request != null && contains(github.event.comment.body, 'trunk fmt')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Install trunk
|
||||||
|
run: curl https://get.trunk.io -fsSL | bash
|
||||||
|
|
||||||
|
- name: Run Trunk Fmt
|
||||||
|
run: trunk fmt
|
||||||
|
|
||||||
|
- name: Commit and push changes
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add .
|
||||||
|
git commit -m "Add firmware version ${{ steps.version.outputs.version }}"
|
||||||
|
git push
|
||||||
|
|
||||||
|
- name: Comment on PR
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
github.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: '`trunk fmt` has been run on this PR.'
|
||||||
|
})
|
||||||
11
.github/workflows/update_protobufs.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: "Update protobufs and regenerate classes"
|
name: Update protobufs and regenerate classes
|
||||||
on: workflow_dispatch
|
on: workflow_dispatch
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -17,17 +17,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Download nanopb
|
- name: Download nanopb
|
||||||
run: |
|
run: |
|
||||||
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.8-linux-x86.tar.gz
|
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.9-linux-x86.tar.gz
|
||||||
tar xvzf nanopb-0.4.8-linux-x86.tar.gz
|
tar xvzf nanopb-0.4.9-linux-x86.tar.gz
|
||||||
mv nanopb-0.4.8-linux-x86 nanopb-0.4.8
|
mv nanopb-0.4.9-linux-x86 nanopb-0.4.9
|
||||||
|
|
||||||
- name: Re-generate protocol buffers
|
- name: Re-generate protocol buffers
|
||||||
run: |
|
run: |
|
||||||
./bin/regen-protos.sh
|
./bin/regen-protos.sh
|
||||||
|
|
||||||
- name: Create pull request
|
- name: Create pull request
|
||||||
uses: peter-evans/create-pull-request@v6
|
uses: peter-evans/create-pull-request@v7
|
||||||
with:
|
with:
|
||||||
|
title: Update protobufs and classes
|
||||||
add-paths: |
|
add-paths: |
|
||||||
protobufs
|
protobufs
|
||||||
src/mesh
|
src/mesh
|
||||||
|
|||||||
4
.gitignore
vendored
@@ -1,6 +1,4 @@
|
|||||||
.pio
|
.pio
|
||||||
main/configuration.h
|
|
||||||
main/credentials.h
|
|
||||||
|
|
||||||
# ignore vscode IDE settings files
|
# ignore vscode IDE settings files
|
||||||
.vscode/*
|
.vscode/*
|
||||||
@@ -32,4 +30,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,34 +1,34 @@
|
|||||||
version: 0.1
|
version: 0.1
|
||||||
cli:
|
cli:
|
||||||
version: 1.22.3
|
version: 1.22.8
|
||||||
plugins:
|
plugins:
|
||||||
sources:
|
sources:
|
||||||
- id: trunk
|
- id: trunk
|
||||||
ref: v1.6.2
|
ref: v1.6.4
|
||||||
uri: https://github.com/trunk-io/plugins
|
uri: https://github.com/trunk-io/plugins
|
||||||
lint:
|
lint:
|
||||||
enabled:
|
enabled:
|
||||||
- trufflehog@3.81.9
|
- trufflehog@3.83.6
|
||||||
- yamllint@1.35.1
|
- yamllint@1.35.1
|
||||||
- bandit@1.7.9
|
- bandit@1.7.10
|
||||||
- checkov@3.2.238
|
- checkov@3.2.287
|
||||||
- terrascan@1.19.1
|
- terrascan@1.19.9
|
||||||
- trivy@0.54.1
|
- trivy@0.56.2
|
||||||
#- trufflehog@3.63.2-rc0
|
#- trufflehog@3.63.2-rc0
|
||||||
- taplo@0.9.3
|
- taplo@0.9.3
|
||||||
- ruff@0.6.2
|
- ruff@0.7.3
|
||||||
- isort@5.13.2
|
- isort@5.13.2
|
||||||
- markdownlint@0.41.0
|
- markdownlint@0.42.0
|
||||||
- oxipng@9.1.2
|
- oxipng@9.1.2
|
||||||
- svgo@3.3.2
|
- svgo@3.3.2
|
||||||
- actionlint@1.7.1
|
- actionlint@1.7.4
|
||||||
- flake8@7.1.1
|
- flake8@7.1.1
|
||||||
- hadolint@2.12.0
|
- hadolint@2.12.0
|
||||||
- shfmt@3.6.0
|
- shfmt@3.6.0
|
||||||
- shellcheck@0.10.0
|
- shellcheck@0.10.0
|
||||||
- black@24.8.0
|
- black@24.10.0
|
||||||
- git-diff-check
|
- git-diff-check
|
||||||
- gitleaks@8.18.4
|
- gitleaks@8.21.1
|
||||||
- clang-format@16.0.3
|
- clang-format@16.0.3
|
||||||
- prettier@3.3.3
|
- prettier@3.3.3
|
||||||
ignore:
|
ignore:
|
||||||
|
|||||||
7
.vscode/extensions.json
vendored
@@ -2,9 +2,8 @@
|
|||||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
// for the documentation about the extensions.json format
|
// for the documentation about the extensions.json format
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"platformio.platformio-ide"
|
"ms-vscode.cpptools",
|
||||||
|
"platformio.platformio-ide",
|
||||||
|
"trunk.io"
|
||||||
],
|
],
|
||||||
"unwantedRecommendations": [
|
|
||||||
"ms-vscode.cpptools-extension-pack"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
4
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# 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:
|
||||||
|
https://meshtastic.org/docs/legal/conduct/
|
||||||
12
SECURITY.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
| Firmware Version | Supported |
|
||||||
|
| ---------------- | ------------------ |
|
||||||
|
| 2.5.x | :white_check_mark: |
|
||||||
|
| <= 2.4.x | :x: |
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
We support the private reporting of potential security vulnerabilities. Please go to the Security tab to file a report with a description of the potential vulnerability and reproduction scripts (preferred) or steps, and our developers will review.
|
||||||
33
arch/apollo3/apollo3.ini
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
[apollo3_base]
|
||||||
|
extends = arduino_base
|
||||||
|
platform = https://github.com/nigelb/platform-apollo3blue.git#2e8a9895cf82f2836c483885e6f89b3f83d3ade4
|
||||||
|
platform_packages=framework-arduinoapollo3@https://github.com/sparkfun/Arduino_Apollo3#a0d99c5fc9b1112d46a9d11c1339898d01e586c9
|
||||||
|
build_type = debug
|
||||||
|
build_flags =
|
||||||
|
${arduino_base.build_flags}
|
||||||
|
-Isrc/platform/apollo3 -g
|
||||||
|
-I"${platformio.packages_dir}/framework-arduinoapollo3/libraries/SPI/src"
|
||||||
|
-DRADIOLIB_EEPROM_UNSUPPORTED
|
||||||
|
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||||
|
build_src_filter =
|
||||||
|
${arduino_base.build_src_filter}
|
||||||
|
-<platform/nrf52>
|
||||||
|
-<platform/esp32/>
|
||||||
|
-<platform/rp2040>
|
||||||
|
-<platform/portduino>
|
||||||
|
-<platform/stm32wl>
|
||||||
|
-<nimble/>
|
||||||
|
-<mesh/api/>
|
||||||
|
-<mesh/http/>
|
||||||
|
-<mesh/wifi/>
|
||||||
|
-<modules/esp32>
|
||||||
|
-<mesh/eth/>
|
||||||
|
-<input>
|
||||||
|
-<buzz>
|
||||||
|
-<modules/Telemetry>
|
||||||
|
lib_deps =
|
||||||
|
${env.lib_deps}
|
||||||
|
charlesbaynham/OSFS@^1.2.3
|
||||||
|
rweather/Crypto
|
||||||
|
lib_ignore =
|
||||||
|
mathertel/OneButton
|
||||||
@@ -2,10 +2,16 @@
|
|||||||
[esp32_base]
|
[esp32_base]
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
custom_esp32_kind = esp32
|
custom_esp32_kind = esp32
|
||||||
platform = platformio/espressif32@6.7.0
|
platform = platformio/espressif32@6.9.0
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040> -<mesh/eth/> -<mesh/raspihttp>
|
${arduino_base.build_src_filter}
|
||||||
|
-<platform/nrf52/>
|
||||||
|
-<platform/stm32wl>
|
||||||
|
-<platform/rp2xx0>
|
||||||
|
-<platform/apollo3>
|
||||||
|
-<mesh/eth/>
|
||||||
|
-<mesh/raspihttp>
|
||||||
|
|
||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
debug_init_break = tbreak setup
|
debug_init_break = tbreak setup
|
||||||
@@ -31,7 +37,7 @@ build_flags =
|
|||||||
-DCONFIG_BT_NIMBLE_ENABLED
|
-DCONFIG_BT_NIMBLE_ENABLED
|
||||||
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
||||||
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
||||||
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=5120
|
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
|
||||||
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
||||||
-DSERIAL_BUFFER_SIZE=4096
|
-DSERIAL_BUFFER_SIZE=4096
|
||||||
-DLIBPAX_ARDUINO
|
-DLIBPAX_ARDUINO
|
||||||
@@ -43,10 +49,11 @@ 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
|
||||||
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
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,5 +1,6 @@
|
|||||||
[esp32c3_base]
|
[esp32c3_base]
|
||||||
extends = esp32_base
|
extends = esp32_base
|
||||||
|
|
||||||
custom_esp32_kind = esp32c3
|
custom_esp32_kind = esp32c3
|
||||||
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
|||||||
41
arch/esp32/esp32c6.ini
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
[esp32c6_base]
|
||||||
|
extends = esp32_base
|
||||||
|
platform = https://github.com/Jason2866/platform-espressif32.git#22faa566df8c789000f8136cd8d0aca49617af55
|
||||||
|
build_flags =
|
||||||
|
${arduino_base.build_flags}
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Isrc/platform/esp32
|
||||||
|
-std=c++11
|
||||||
|
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
||||||
|
-DSERIAL_BUFFER_SIZE=4096
|
||||||
|
-DLIBPAX_ARDUINO
|
||||||
|
-DLIBPAX_WIFI
|
||||||
|
-DLIBPAX_BLE
|
||||||
|
-DMESHTASTIC_EXCLUDE_WEBSERVER
|
||||||
|
;-DDEBUG_HEAP
|
||||||
|
; TEMP
|
||||||
|
-DHAS_BLUETOOTH=0
|
||||||
|
-DMESHTASTIC_EXCLUDE_PAXCOUNTER
|
||||||
|
-DMESHTASTIC_EXCLUDE_BLUETOOTH
|
||||||
|
|
||||||
|
lib_deps =
|
||||||
|
${arduino_base.lib_deps}
|
||||||
|
${networking_base.lib_deps}
|
||||||
|
${environmental_base.lib_deps}
|
||||||
|
${radiolib_base.lib_deps}
|
||||||
|
lewisxhe/XPowersLib@^0.2.6
|
||||||
|
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||||
|
rweather/Crypto@^0.4.0
|
||||||
|
|
||||||
|
build_src_filter =
|
||||||
|
${esp32_base.build_src_filter} -<mesh/http>
|
||||||
|
|
||||||
|
monitor_speed = 460800
|
||||||
|
monitor_filters = esp32_c3_exception_decoder
|
||||||
|
|
||||||
|
lib_ignore =
|
||||||
|
NonBlockingRTTTL
|
||||||
|
NimBLE-Arduino
|
||||||
|
libpax
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[esp32s3_base]
|
[esp32s3_base]
|
||||||
extends = esp32_base
|
extends = esp32_base
|
||||||
|
|
||||||
custom_esp32_kind = esp32s3
|
custom_esp32_kind = esp32s3
|
||||||
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
|
||||||
|
|||||||
@@ -14,13 +14,29 @@ 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/rp2040> -<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>
|
||||||
|
-<platform/apollo3>
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
|
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
|
||||||
[portduino_base]
|
[portduino_base]
|
||||||
platform = https://github.com/meshtastic/platform-native.git#ad8112adf82ce1f5b917092cf32be07a077801a0
|
platform = https://github.com/meshtastic/platform-native.git#bcd02436cfca91f7d28ad0f7dab977c6aaa781af
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
@@ -9,7 +9,8 @@ build_src_filter =
|
|||||||
-<nimble/>
|
-<nimble/>
|
||||||
-<platform/nrf52/>
|
-<platform/nrf52/>
|
||||||
-<platform/stm32wl/>
|
-<platform/stm32wl/>
|
||||||
-<platform/rp2040>
|
-<platform/rp2xx0>
|
||||||
|
-<platform/apollo3>
|
||||||
-<mesh/wifi/>
|
-<mesh/wifi/>
|
||||||
-<mesh/http/>
|
-<mesh/http/>
|
||||||
+<mesh/raspihttp/>
|
+<mesh/raspihttp/>
|
||||||
@@ -23,8 +24,9 @@ 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#5a39989aa2c9492572255b22f033843ec8900233
|
https://github.com/lovyan03/LovyanGFX.git#1401c28a47646fe00538d487adcb2eb3c72de805
|
||||||
|
|
||||||
build_flags =
|
build_flags =
|
||||||
${arduino_base.build_flags}
|
${arduino_base.build_flags}
|
||||||
@@ -32,6 +34,7 @@ build_flags =
|
|||||||
-Isrc/platform/portduino
|
-Isrc/platform/portduino
|
||||||
-DRADIOLIB_EEPROM_UNSUPPORTED
|
-DRADIOLIB_EEPROM_UNSUPPORTED
|
||||||
-DPORTDUINO_LINUX_HARDWARE
|
-DPORTDUINO_LINUX_HARDWARE
|
||||||
|
-lstdc++fs
|
||||||
-lbluetooth
|
-lbluetooth
|
||||||
-lgpiod
|
-lgpiod
|
||||||
-lyaml-cpp
|
-lyaml-cpp
|
||||||
26
arch/rp2xx0/rp2040.ini
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
; Common settings for rp2040 Processor based targets
|
||||||
|
[rp2040_base]
|
||||||
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico 4.2.1
|
||||||
|
extends = arduino_base
|
||||||
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#996c3bfab9758f12c07aa20cc6d352e630c16987 ; 4.2.1 with fix for sporadic hangs
|
||||||
|
|
||||||
|
board_build.core = earlephilhower
|
||||||
|
board_build.filesystem_size = 0.5m
|
||||||
|
build_flags =
|
||||||
|
${arduino_base.build_flags} -Wno-unused-variable -Wcast-align
|
||||||
|
-Isrc/platform/rp2xx0
|
||||||
|
-Isrc/platform/rp2xx0/hardware_rosc/include
|
||||||
|
-Isrc/platform/rp2xx0/pico_sleep/include
|
||||||
|
-D__PLAT_RP2040__
|
||||||
|
# -D _POSIX_THREADS
|
||||||
|
build_src_filter =
|
||||||
|
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/apollo3> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp>
|
||||||
|
|
||||||
|
lib_ignore =
|
||||||
|
BluetoothOTA
|
||||||
|
|
||||||
|
lib_deps =
|
||||||
|
${arduino_base.lib_deps}
|
||||||
|
${environmental_base.lib_deps}
|
||||||
|
${radiolib_base.lib_deps}
|
||||||
|
rweather/Crypto
|
||||||
@@ -1,23 +1,35 @@
|
|||||||
; Common settings for rp2040 Processor based targets
|
; Common settings for rp2040 Processor based targets
|
||||||
[rp2040_base]
|
[rp2350_base]
|
||||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#60d6ae81fcc73c34b1493ca9e261695e471bc0c2
|
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#3.7.2
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#96c3bfab9758f12c07aa20cc6d352e630c16987 ; 4.2.1 with fix for sporadic hangs
|
||||||
|
|
||||||
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
|
||||||
-Isrc/platform/rp2040
|
-Isrc/platform/rp2xx0
|
||||||
-D__PLAT_RP2040__
|
-D__PLAT_RP2040__
|
||||||
# -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/>
|
||||||
|
-<platform/apollo3>
|
||||||
|
-<mesh/raspihttp>
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
BluetoothOTA
|
BluetoothOTA
|
||||||
|
lvgl
|
||||||
|
|
||||||
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,7 +1,7 @@
|
|||||||
[stm32_base]
|
[stm32_base]
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform = ststm32
|
platform = ststm32
|
||||||
platform_packages = platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32.git#361a7fdb67e2a7104e99b4f42a802469eef8b129
|
platform_packages = platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32.git#ea74156acd823b6d14739f389e6cdc648f8ee36e
|
||||||
|
|
||||||
build_type = release
|
build_type = release
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ build_flags =
|
|||||||
-fdata-sections
|
-fdata-sections
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<input> -<buzz> -<modules/RemoteHardwareModule.cpp> -<platform/nrf52> -<platform/portduino> -<platform/rp2040> -<mesh/raspihttp>
|
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<input> -<buzz> -<modules/RemoteHardwareModule.cpp> -<platform/nrf52> -<platform/portduino> -<platform/rp2xx0> -<platform/apollo3> -<mesh/raspihttp>
|
||||||
|
|
||||||
board_upload.offset_address = 0x08000000
|
board_upload.offset_address = 0x08000000
|
||||||
upload_protocol = stlink
|
upload_protocol = stlink
|
||||||
@@ -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 =
|
||||||
https://github.com/mathertel/OneButton@~2.6.1
|
mathertel/OneButton@2.6.1
|
||||||
Wire
|
Wire
|
||||||
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
|
|
||||||
|
|||||||
48
bin/build-userprefs-json.py
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import json
|
||||||
|
import subprocess
|
||||||
|
import re
|
||||||
|
|
||||||
|
def get_macros_from_header(header_file):
|
||||||
|
# Run clang to preprocess the header file and capture the output
|
||||||
|
result = subprocess.run(['clang', '-E', '-dM', header_file], capture_output=True, text=True)
|
||||||
|
if result.returncode != 0:
|
||||||
|
raise RuntimeError(f"Clang preprocessing failed: {result.stderr}")
|
||||||
|
|
||||||
|
# Extract macros from the output
|
||||||
|
macros = {}
|
||||||
|
macro_pattern = re.compile(r'#define\s+(\w+)\s+(.*)')
|
||||||
|
for line in result.stdout.splitlines():
|
||||||
|
match = macro_pattern.match(line)
|
||||||
|
if match and 'USERPREFS_' in line and '_USERPREFS_' not in line:
|
||||||
|
macros[match.group(1)] = match.group(2)
|
||||||
|
|
||||||
|
return macros
|
||||||
|
|
||||||
|
def write_macros_to_json(macros, output_file):
|
||||||
|
with open(output_file, 'w') as f:
|
||||||
|
json.dump(macros, f, indent=4)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
header_file = 'userPrefs.h'
|
||||||
|
output_file = 'userPrefs.json'
|
||||||
|
# Uncomment all macros in the header file
|
||||||
|
with open(header_file, 'r') as file:
|
||||||
|
lines = file.readlines()
|
||||||
|
|
||||||
|
uncommented_lines = []
|
||||||
|
for line in lines:
|
||||||
|
stripped_line = line.strip().replace('/*', '').replace('*/', '')
|
||||||
|
if stripped_line.startswith('//') and 'USERPREFS_' in stripped_line:
|
||||||
|
# Replace "//"
|
||||||
|
stripped_line = stripped_line.replace('//', '')
|
||||||
|
uncommented_lines.append(stripped_line + '\n')
|
||||||
|
|
||||||
|
with open(header_file, 'w') as file:
|
||||||
|
for line in uncommented_lines:
|
||||||
|
file.write(line)
|
||||||
|
macros = get_macros_from_header(header_file)
|
||||||
|
write_macros_to_json(macros, output_file)
|
||||||
|
print(f"Macros have been written to {output_file}")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -1,14 +1,11 @@
|
|||||||
|
### Many device configs have been moved to /etc/meshtasticd/available.d
|
||||||
|
### To activate, simply copy or link the appropriate file into /etc/meshtasticd/config.d
|
||||||
|
|
||||||
### Define your devices here using Broadcom pin numbering
|
### Define your devices here using Broadcom pin numbering
|
||||||
### Uncomment the block that corresponds to your hardware
|
### Uncomment the block that corresponds to your hardware
|
||||||
### Including the "Module:" line!
|
### Including the "Module:" line!
|
||||||
---
|
---
|
||||||
Lora:
|
Lora:
|
||||||
# Module: sx1262 # Waveshare SX126X XXXM
|
|
||||||
# DIO2_AS_RF_SWITCH: true
|
|
||||||
# CS: 21
|
|
||||||
# IRQ: 16
|
|
||||||
# Busy: 20
|
|
||||||
# Reset: 18
|
|
||||||
|
|
||||||
# Module: sx1262 # Waveshare SX1302 LISTEN ONLY AT THIS TIME!
|
# Module: sx1262 # Waveshare SX1302 LISTEN ONLY AT THIS TIME!
|
||||||
# CS: 7
|
# CS: 7
|
||||||
@@ -19,6 +16,7 @@ Lora:
|
|||||||
# CS: 0
|
# CS: 0
|
||||||
# IRQ: 10
|
# IRQ: 10
|
||||||
# Busy: 11
|
# Busy: 11
|
||||||
|
# DIO2_AS_RF_SWITCH: true
|
||||||
# spidev: spidev0.1
|
# spidev: spidev0.1
|
||||||
|
|
||||||
# Module: RF95 # Adafruit RFM9x
|
# Module: RF95 # Adafruit RFM9x
|
||||||
@@ -83,17 +81,6 @@ I2C:
|
|||||||
|
|
||||||
Display:
|
Display:
|
||||||
|
|
||||||
### Waveshare 2.8inch RPi LCD
|
|
||||||
# Panel: ST7789
|
|
||||||
# CS: 8
|
|
||||||
# DC: 22 # Data/Command pin
|
|
||||||
# Backlight: 18
|
|
||||||
# Width: 240
|
|
||||||
# Height: 320
|
|
||||||
# Reset: 27
|
|
||||||
# Rotate: true
|
|
||||||
# Invert: true
|
|
||||||
|
|
||||||
### Waveshare 1.44inch LCD HAT
|
### Waveshare 1.44inch LCD HAT
|
||||||
# Panel: ST7735S
|
# Panel: ST7735S
|
||||||
# CS: 8 #Chip Select
|
# CS: 8 #Chip Select
|
||||||
@@ -113,6 +100,29 @@ Display:
|
|||||||
# Height: 320
|
# Height: 320
|
||||||
# Rotate: true
|
# Rotate: true
|
||||||
|
|
||||||
|
### SHCHV 3.5 RPi TFT+Touchscreen
|
||||||
|
# Panel: ILI9486
|
||||||
|
# spidev: spidev0.0
|
||||||
|
# BusFrequency: 30000000
|
||||||
|
# DC: 24
|
||||||
|
# Reset: 25
|
||||||
|
# Width: 320
|
||||||
|
# Height: 480
|
||||||
|
# OffsetRotate: 2
|
||||||
|
|
||||||
|
### TZT 2.0 Inch TFT Display ST7789V 240RGBx320
|
||||||
|
# Panel: ST7789
|
||||||
|
# spidev: spidev0.0
|
||||||
|
# # CS: 8 # can be freely chosen
|
||||||
|
# BusFrequency: 80000000
|
||||||
|
# DC: 24 # can be freely chosen
|
||||||
|
# Width: 320
|
||||||
|
# Height: 240
|
||||||
|
# Reset: 25 # can be freely chosen
|
||||||
|
# Rotate: true
|
||||||
|
# OffsetRotate: 1
|
||||||
|
# Invert: true
|
||||||
|
|
||||||
### You can also specify the spi device for the display to use
|
### You can also specify the spi device for the display to use
|
||||||
# spidev: spidev0.0
|
# spidev: spidev0.0
|
||||||
|
|
||||||
@@ -127,10 +137,6 @@ Touchscreen:
|
|||||||
# IRQ: 24
|
# IRQ: 24
|
||||||
# I2CAddr: 0x38
|
# I2CAddr: 0x38
|
||||||
|
|
||||||
# Module: XPT2046 # Waveshare 2.8inch
|
|
||||||
# CS: 7
|
|
||||||
# IRQ: 17
|
|
||||||
|
|
||||||
### You can also specify the spi device for the touchscreen to use
|
### You can also specify the spi device for the touchscreen to use
|
||||||
# spidev: spidev0.0
|
# spidev: spidev0.0
|
||||||
|
|
||||||
@@ -154,3 +160,4 @@ Webserver:
|
|||||||
General:
|
General:
|
||||||
MaxNodes: 200
|
MaxNodes: 200
|
||||||
MaxMessageQueue: 100
|
MaxMessageQueue: 100
|
||||||
|
ConfigDirectory: /etc/meshtasticd/config.d/
|
||||||
18
bin/config.d/display-waveshare-2.8.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
Display:
|
||||||
|
|
||||||
|
### Waveshare 2.8inch RPi LCD
|
||||||
|
Panel: ST7789
|
||||||
|
CS: 8
|
||||||
|
DC: 22 # Data/Command pin
|
||||||
|
Backlight: 18
|
||||||
|
Width: 240
|
||||||
|
Height: 320
|
||||||
|
Reset: 27
|
||||||
|
Rotate: true
|
||||||
|
Invert: true
|
||||||
|
|
||||||
|
Touchscreen:
|
||||||
|
### Note, at least for now, the touchscreen must have a CS pin defined, even if you let Linux manage the CS switching.
|
||||||
|
Module: XPT2046 # Waveshare 2.8inch
|
||||||
|
CS: 7
|
||||||
|
IRQ: 17
|
||||||
9
bin/config.d/lora-MeshAdv-900M30S.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Lora:
|
||||||
|
Module: sx1262
|
||||||
|
CS: 21
|
||||||
|
IRQ: 16
|
||||||
|
Busy: 20
|
||||||
|
Reset: 18
|
||||||
|
TXen: 13
|
||||||
|
RXen: 12
|
||||||
|
DIO3_TCXO_VOLTAGE: true
|
||||||
8
bin/config.d/lora-waveshare-sxxx.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Lora:
|
||||||
|
Module: sx1262 # Waveshare SX126X XXXM
|
||||||
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
CS: 21
|
||||||
|
IRQ: 16
|
||||||
|
Busy: 20
|
||||||
|
Reset: 18
|
||||||
|
SX126X_ANT_SW: 6
|
||||||
@@ -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}"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import configparser
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import random
|
||||||
|
|
||||||
rootdir = "variants/"
|
rootdir = "variants/"
|
||||||
|
|
||||||
@@ -39,5 +40,7 @@ for subdir, dirs, files in os.walk(rootdir):
|
|||||||
"check" in options
|
"check" in options
|
||||||
):
|
):
|
||||||
outlist.append(section)
|
outlist.append(section)
|
||||||
|
if ("quick" in options) & (len(outlist) > 3):
|
||||||
print(json.dumps(outlist))
|
print(json.dumps(random.sample(outlist, 3)))
|
||||||
|
else:
|
||||||
|
print(json.dumps(outlist))
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Meshtastic Native Daemon
|
Description=Meshtastic Native Daemon
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
StartLimitInterval=200
|
||||||
|
StartLimitBurst=5
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
User=root
|
||||||
Group=root
|
Group=root
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/sbin/meshtasticd
|
ExecStart=/usr/sbin/meshtasticd
|
||||||
|
Restart=always
|
||||||
|
RestartSec=3
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
cp "release/meshtasticd_linux_$(uname -m)" /usr/sbin/meshtasticd
|
cp "release/meshtasticd_linux_$(uname -m)" /usr/sbin/meshtasticd
|
||||||
mkdir /etc/meshtasticd
|
mkdir -p /etc/meshtasticd
|
||||||
if [[ -f "/etc/meshtasticd/config.yaml" ]]; then
|
if [[ -f "/etc/meshtasticd/config.yaml" ]]; then
|
||||||
cp bin/config-dist.yaml /etc/meshtasticd/config-upgrade.yaml
|
cp bin/config-dist.yaml /etc/meshtasticd/config-upgrade.yaml
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -88,12 +88,13 @@ Import("projenv")
|
|||||||
|
|
||||||
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
|
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
|
||||||
verObj = readProps(prefsLoc)
|
verObj = readProps(prefsLoc)
|
||||||
print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"])
|
print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"] + " on " + env.get("PIOENV"))
|
||||||
|
|
||||||
# General options that are passed to the C and C++ compilers
|
# General options that are passed to the C and C++ compilers
|
||||||
projenv.Append(
|
projenv.Append(
|
||||||
CCFLAGS=[
|
CCFLAGS=[
|
||||||
"-DAPP_VERSION=" + verObj["long"],
|
"-DAPP_VERSION=" + verObj["long"],
|
||||||
"-DAPP_VERSION_SHORT=" + verObj["short"],
|
"-DAPP_VERSION_SHORT=" + verObj["short"],
|
||||||
|
"-DAPP_ENV=" + env.get("PIOENV"),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
cd protobufs && ..\nanopb-0.4.8\generator-bin\protoc.exe --experimental_allow_proto3_optional "--nanopb_out=-S.cpp -v:..\src\mesh\generated" -I=..\protobufs\ ..\protobufs\meshtastic\*.proto
|
cd protobufs && ..\nanopb-0.4.9\generator-bin\protoc.exe --experimental_allow_proto3_optional "--nanopb_out=-S.cpp -v:..\src\mesh\generated" -I=..\protobufs\ ..\protobufs\meshtastic\*.proto
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.8 to be located in the"
|
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.9 to be located in the"
|
||||||
echo "firmware root directory if the following step fails, you should download the correct"
|
echo "firmware root directory if the following step fails, you should download the correct"
|
||||||
echo "prebuilt binaries for your computer into nanopb-0.4.8"
|
echo "prebuilt binaries for your computer into nanopb-0.4.9"
|
||||||
|
|
||||||
# the nanopb tool seems to require that the .options file be in the current directory!
|
# the nanopb tool seems to require that the .options file be in the current directory!
|
||||||
cd protobufs
|
cd protobufs
|
||||||
../nanopb-0.4.8/generator-bin/protoc --experimental_allow_proto3_optional "--nanopb_out=-S.cpp -v:../src/mesh/generated/" -I=../protobufs meshtastic/*.proto
|
../nanopb-0.4.9/generator-bin/protoc --experimental_allow_proto3_optional "--nanopb_out=-S.cpp -v:../src/mesh/generated/" -I=../protobufs meshtastic/*.proto
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
"flash_size": "8MB",
|
"flash_size": "8MB",
|
||||||
"maximum_ram_size": 327680,
|
"maximum_ram_size": 327680,
|
||||||
"maximum_size": 8388608,
|
"maximum_size": 8388608,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"speed": 921600
|
"speed": 921600
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
},
|
},
|
||||||
"core": "nRF5",
|
"core": "nRF5",
|
||||||
"cpu": "cortex-m4",
|
"cpu": "cortex-m4",
|
||||||
"extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA",
|
"extra_flags": "-DHELTEC_T114 -DNRF52840_XXAA",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
["0x239A", "0x4405"],
|
["0x239A", "0x4405"],
|
||||||
|
|||||||
41
boards/icarus.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"memory_type": "qio_opi"
|
||||||
|
},
|
||||||
|
"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=0"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x2886", "0x0059"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "icarus"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi", "bluetooth", "lora"],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "icarus",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "8MB",
|
||||||
|
"maximum_ram_size": 8388608,
|
||||||
|
"maximum_size": 8388608,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://icarus.azlan.works",
|
||||||
|
"vendor": "Muhammad Shah"
|
||||||
|
}
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "nrf52840_s140_v6.ld"
|
|
||||||
},
|
|
||||||
"core": "nRF5",
|
|
||||||
"cpu": "cortex-m4",
|
|
||||||
"extra_flags": "-DARDUINO_NRF52840_LORA_RELAY_V1 -DNRF52840_XXAA",
|
|
||||||
"f_cpu": "64000000L",
|
|
||||||
"hwids": [["0x239A", "0x4404"]],
|
|
||||||
"usb_product": "LORA_RELAY",
|
|
||||||
"mcu": "nrf52840",
|
|
||||||
"variant": "lora_relay_v1",
|
|
||||||
"variants_dir": "variants",
|
|
||||||
"bsp": {
|
|
||||||
"name": "adafruit"
|
|
||||||
},
|
|
||||||
"softdevice": {
|
|
||||||
"sd_flags": "-DS140",
|
|
||||||
"sd_name": "s140",
|
|
||||||
"sd_version": "6.1.1",
|
|
||||||
"sd_fwid": "0x00B6"
|
|
||||||
},
|
|
||||||
"bootloader": {
|
|
||||||
"settings_addr": "0xFF000"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"connectivity": ["bluetooth"],
|
|
||||||
"debug": {
|
|
||||||
"jlink_device": "nRF52840_xxAA",
|
|
||||||
"onboard_tools": ["jlink"],
|
|
||||||
"svd_path": "nrf52840.svd",
|
|
||||||
"openocd_target": "nrf52840-mdk-rs"
|
|
||||||
},
|
|
||||||
"frameworks": ["arduino"],
|
|
||||||
"name": "Meshtastic Lora Relay V1 (Adafruit BSP)",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 248832,
|
|
||||||
"maximum_size": 815104,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 115200,
|
|
||||||
"protocol": "jlink",
|
|
||||||
"protocols": ["jlink", "nrfjprog", "stlink"]
|
|
||||||
},
|
|
||||||
"url": "https://github.com/BigCorvus/SX1262-LoRa-BLE-Relay",
|
|
||||||
"vendor": "BigCorvus"
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "nrf52840_s140_v6.ld"
|
|
||||||
},
|
|
||||||
"core": "nRF5",
|
|
||||||
"cpu": "cortex-m4",
|
|
||||||
"extra_flags": "-DARDUINO_NRF52840_LORA_RELAY_V2 -DNRF52840_XXAA",
|
|
||||||
"f_cpu": "64000000L",
|
|
||||||
"hwids": [["0x239A", "0x4406"]],
|
|
||||||
"usb_product": "LORA_RELAY",
|
|
||||||
"mcu": "nrf52840",
|
|
||||||
"variant": "lora_relay_v2",
|
|
||||||
"variants_dir": "variants",
|
|
||||||
"bsp": {
|
|
||||||
"name": "adafruit"
|
|
||||||
},
|
|
||||||
"softdevice": {
|
|
||||||
"sd_flags": "-DS140",
|
|
||||||
"sd_name": "s140",
|
|
||||||
"sd_version": "6.1.1",
|
|
||||||
"sd_fwid": "0x00B6"
|
|
||||||
},
|
|
||||||
"bootloader": {
|
|
||||||
"settings_addr": "0xFF000"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"connectivity": ["bluetooth"],
|
|
||||||
"debug": {
|
|
||||||
"jlink_device": "nRF52840_xxAA",
|
|
||||||
"onboard_tools": ["jlink"],
|
|
||||||
"svd_path": "nrf52840.svd",
|
|
||||||
"openocd_target": "nrf52840-mdk-rs"
|
|
||||||
},
|
|
||||||
"frameworks": ["arduino"],
|
|
||||||
"name": "Meshtastic Lora Relay V1 (Adafruit BSP)",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 248832,
|
|
||||||
"maximum_size": 815104,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 115200,
|
|
||||||
"protocol": "jlink",
|
|
||||||
"protocols": ["jlink", "nrfjprog", "stlink"]
|
|
||||||
},
|
|
||||||
"url": "https://github.com/BigCorvus/SX1262-LoRa-BLE-Relay",
|
|
||||||
"vendor": "BigCorvus"
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "nrf52832_s132_v6.ld"
|
|
||||||
},
|
|
||||||
"core": "nRF5",
|
|
||||||
"cpu": "cortex-m4",
|
|
||||||
"extra_flags": "-DNRF52832_XXAA -DNRF52",
|
|
||||||
"f_cpu": "64000000L",
|
|
||||||
"mcu": "nrf52832",
|
|
||||||
"variant": "lora_isp4520",
|
|
||||||
"bsp": {
|
|
||||||
"name": "adafruit"
|
|
||||||
},
|
|
||||||
"softdevice": {
|
|
||||||
"sd_flags": "-DS132",
|
|
||||||
"sd_name": "s132",
|
|
||||||
"sd_version": "6.1.1",
|
|
||||||
"sd_fwid": "0x00B7"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"connectivity": ["bluetooth"],
|
|
||||||
"debug": {
|
|
||||||
"jlink_device": "nRF52832_xxAA",
|
|
||||||
"svd_path": "nrf52.svd",
|
|
||||||
"openocd_target": "nrf52840-mdk-rs"
|
|
||||||
},
|
|
||||||
"frameworks": ["arduino"],
|
|
||||||
"name": "lora ISP4520",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 65536,
|
|
||||||
"maximum_size": 524288,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 115200,
|
|
||||||
"protocol": "nrfutil",
|
|
||||||
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"]
|
|
||||||
},
|
|
||||||
"url": "",
|
|
||||||
"vendor": "PsiSoft"
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
},
|
},
|
||||||
"core": "nRF5",
|
"core": "nRF5",
|
||||||
"cpu": "cortex-m4",
|
"cpu": "cortex-m4",
|
||||||
"extra_flags": "-DARDUINO_WIO_WM1110 -DNRF52840_XXAA",
|
"extra_flags": "-DME25LS01_4Y10TD -DNRF52840_XXAA",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
["0x239A", "0x8029"],
|
["0x239A", "0x8029"],
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
},
|
},
|
||||||
"core": "nRF5",
|
"core": "nRF5",
|
||||||
"cpu": "cortex-m4",
|
"cpu": "cortex-m4",
|
||||||
"extra_flags": "-DARDUINO_WIO_WM1110 -DNRF52840_XXAA",
|
"extra_flags": "-DMS24SF1 -DNRF52840_XXAA",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
["0x239A", "0x8029"],
|
["0x239A", "0x8029"],
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
},
|
},
|
||||||
"core": "nRF5",
|
"core": "nRF5",
|
||||||
"cpu": "cortex-m4",
|
"cpu": "cortex-m4",
|
||||||
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
|
"extra_flags": "-DNORDIC_PCA10059 -DNRF52840_XXAA",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
["0x239A", "0x8029"],
|
["0x239A", "0x8029"],
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "nrf52840_s113_v7.ld"
|
|
||||||
},
|
|
||||||
"core": "nRF5",
|
|
||||||
"cpu": "cortex-m4",
|
|
||||||
"extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA",
|
|
||||||
"f_cpu": "64000000L",
|
|
||||||
"hwids": [["0x239A", "0x4404"]],
|
|
||||||
"usb_product": "nrf52840dk",
|
|
||||||
"mcu": "nrf52840",
|
|
||||||
"variant": "pca10056-rc-clock",
|
|
||||||
"variants_dir": "variants",
|
|
||||||
"bsp": {
|
|
||||||
"name": "adafruit"
|
|
||||||
},
|
|
||||||
"softdevice": {
|
|
||||||
"sd_flags": "-DS140",
|
|
||||||
"sd_name": "s140",
|
|
||||||
"sd_version": "6.1.1",
|
|
||||||
"sd_fwid": "0x00B6"
|
|
||||||
},
|
|
||||||
"bootloader": {
|
|
||||||
"settings_addr": "0xFF000"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"connectivity": ["bluetooth"],
|
|
||||||
"debug": {
|
|
||||||
"jlink_device": "nRF52840_xxAA",
|
|
||||||
"onboard_tools": ["jlink"],
|
|
||||||
"svd_path": "nrf52840.svd",
|
|
||||||
"openocd_target": "nrf52840-mdk-rs"
|
|
||||||
},
|
|
||||||
"frameworks": ["arduino"],
|
|
||||||
"name": "A modified NRF52840-DK devboard (Adafruit BSP)",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 248832,
|
|
||||||
"maximum_size": 815104,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 115200,
|
|
||||||
"protocol": "jlink",
|
|
||||||
"protocols": ["jlink", "nrfjprog", "stlink"]
|
|
||||||
},
|
|
||||||
"url": "https://meshtastic.org/",
|
|
||||||
"vendor": "Nordic Semi"
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "nrf52840_s140_v6.ld"
|
|
||||||
},
|
|
||||||
"core": "nRF5",
|
|
||||||
"cpu": "cortex-m4",
|
|
||||||
"extra_flags": "-DARDUINO_NRF52840_PPR -DNRF52840_XXAA",
|
|
||||||
"f_cpu": "64000000L",
|
|
||||||
"hwids": [["0x239A", "0x4403"]],
|
|
||||||
"usb_product": "PPR",
|
|
||||||
"mcu": "nrf52840",
|
|
||||||
"variant": "ppr",
|
|
||||||
"variants_dir": "variants",
|
|
||||||
"bsp": {
|
|
||||||
"name": "adafruit"
|
|
||||||
},
|
|
||||||
"softdevice": {
|
|
||||||
"sd_flags": "-DS140",
|
|
||||||
"sd_name": "s140",
|
|
||||||
"sd_version": "6.1.1",
|
|
||||||
"sd_fwid": "0x00B6"
|
|
||||||
},
|
|
||||||
"bootloader": {
|
|
||||||
"settings_addr": "0xFF000"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"connectivity": ["bluetooth"],
|
|
||||||
"debug": {
|
|
||||||
"jlink_device": "nRF52840_xxAA",
|
|
||||||
"onboard_tools": ["jlink"],
|
|
||||||
"svd_path": "nrf52840.svd",
|
|
||||||
"openocd_target": "nrf52840-mdk-rs"
|
|
||||||
},
|
|
||||||
"frameworks": ["arduino"],
|
|
||||||
"name": "Meshtastic PPR (Adafruit BSP)",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 248832,
|
|
||||||
"maximum_size": 815104,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 115200,
|
|
||||||
"protocol": "jlink",
|
|
||||||
"protocols": ["jlink", "nrfjprog", "stlink"]
|
|
||||||
},
|
|
||||||
"url": "https://meshtastic.org/",
|
|
||||||
"vendor": "Othernet"
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "nrf52833_s113_v7.ld"
|
|
||||||
},
|
|
||||||
"core": "nRF5",
|
|
||||||
"cpu": "cortex-m4",
|
|
||||||
"extra_flags": "-DARDUINO_NRF52833_PPR -DNRF52833_XXAA",
|
|
||||||
"f_cpu": "64000000L",
|
|
||||||
"hwids": [["0x239A", "0x4406"]],
|
|
||||||
"usb_product": "PPR",
|
|
||||||
"mcu": "nrf52833",
|
|
||||||
"variant": "ppr",
|
|
||||||
"variants_dir": "variants",
|
|
||||||
"bsp": {
|
|
||||||
"name": "adafruit"
|
|
||||||
},
|
|
||||||
"softdevice": {
|
|
||||||
"sd_flags": "-DS113",
|
|
||||||
"sd_name": "s113",
|
|
||||||
"sd_version": "7.2.0",
|
|
||||||
"sd_fwid": "0x00b6"
|
|
||||||
},
|
|
||||||
"bootloader": {
|
|
||||||
"settings_addr": "0xFF000"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"connectivity": ["bluetooth"],
|
|
||||||
"debug": {
|
|
||||||
"jlink_device": "nRF52833_xxAA",
|
|
||||||
"onboard_tools": ["jlink"],
|
|
||||||
"svd_path": "nrf52833.svd",
|
|
||||||
"openocd_target": "nrf52840-mdk-rs"
|
|
||||||
},
|
|
||||||
"frameworks": ["arduino"],
|
|
||||||
"name": "Meshtastic PPR1 (Adafruit BSP)",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 248832,
|
|
||||||
"maximum_size": 815104,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 115200,
|
|
||||||
"protocol": "jlink",
|
|
||||||
"protocols": ["jlink", "nrfjprog", "stlink"]
|
|
||||||
},
|
|
||||||
"url": "https://meshtastic.org/",
|
|
||||||
"vendor": "Othernet"
|
|
||||||
}
|
|
||||||
42
boards/seeed-sensecap-indicator.json
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"partitions": "default_8MB.csv",
|
||||||
|
"memory_type": "qio_opi"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=0",
|
||||||
|
"-DARDUINO_USB_MODE=1",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x1A86", "0x7523"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "esp32s3r8"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi", "bluetooth", "lora"],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "Seeed Studio SenseCAP Indicator",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "8MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 8388608,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://www.seeedstudio.com/Indicator-for-Meshtastic.html",
|
||||||
|
"vendor": "Seeed Studio"
|
||||||
|
}
|
||||||
41
boards/seeed-xiao-s3.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"memory_type": "qio_opi"
|
||||||
|
},
|
||||||
|
"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=0"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x2886", "0x0059"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "seeed-xiao-s3"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi", "bluetooth", "lora"],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "seeed-xiao-s3",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "8MB",
|
||||||
|
"maximum_ram_size": 8388608,
|
||||||
|
"maximum_size": 8388608,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html",
|
||||||
|
"vendor": "Seeed Studio"
|
||||||
|
}
|
||||||
46
boards/unphone.json
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"memory_type": "qio_opi",
|
||||||
|
"partitions": "default_8MB.csv"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DUNPHONE_SPIN=9",
|
||||||
|
"-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": [
|
||||||
|
["0x16D0", "0x1178"],
|
||||||
|
["0x303a", "0x1001"]
|
||||||
|
],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "unphone"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi", "bluetooth", "lora"],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "unPhone",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "8MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 8323072,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://unphone.net/",
|
||||||
|
"vendor": "University of Sheffield"
|
||||||
|
}
|
||||||
45
boards/wiscore_rak11720.json
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"cpu": "cortex-m4",
|
||||||
|
"f_cpu": "48000000L",
|
||||||
|
"mcu": "AMA3B1KK",
|
||||||
|
"part": "apollo3",
|
||||||
|
"fabi": "hard",
|
||||||
|
"specs": "nosys.specs",
|
||||||
|
"framework": {
|
||||||
|
"arduino": {
|
||||||
|
"v1": {
|
||||||
|
"variant": "artemis",
|
||||||
|
"extra_flags": "-DSFE_ARTEMIS"
|
||||||
|
},
|
||||||
|
"v2": {
|
||||||
|
"variant": "rak11720",
|
||||||
|
"extra_flags": "-DARDUINO_RAK_11720_MODULE"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ambiqsdk-sfe": {
|
||||||
|
"variant": ["boards_sfe", "artemis_module"],
|
||||||
|
"extra_flags": "",
|
||||||
|
"variant_lib_src_filter": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"debug": {
|
||||||
|
"jlink_device": "AMA3B1KK-KBR",
|
||||||
|
"svd_path": "apollo3.svd",
|
||||||
|
"swo_freq": 12000000,
|
||||||
|
"init": {
|
||||||
|
"break": "tbreak setup"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "ambiqsdk-sfe"],
|
||||||
|
"name": "WisCore RAK11720 Board",
|
||||||
|
"upload": {
|
||||||
|
"maximum_ram_size": 393216,
|
||||||
|
"maximum_size": 983040,
|
||||||
|
"protocol": "svl",
|
||||||
|
"protocols": ["svl", "asb", "jlink"]
|
||||||
|
},
|
||||||
|
"url": "https://www.rakwireless.com",
|
||||||
|
"vendor": "RAKwireless"
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 845 B After Width: | Height: | Size: 594 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M9 11.75a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5m6 0a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37a9.97 9.97 0 0 0 10.41 3.97c.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8"/><path fill="none" d="M0 0h24v24H0z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 445 B |
BIN
images/face.png
|
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 225 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M20.94 11A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"/></svg>
|
||||||
|
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 348 B |
BIN
images/pin.png
|
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 203 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5"/><path fill="none" d="M0 0h24v24H0z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 250 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM9 11H7V9h2v2zm4 0h-2V9h2v2zm4 0h-2V9h2v2z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M9 11H7V9h2zm4 0h-2V9h2zm4 0h-2V9h2z"/><path fill="none" d="M0 0h24v24H0z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 246 B |
179
platformio.ini
@@ -17,11 +17,9 @@ default_envs = tbeam
|
|||||||
;default_envs = tlora-v2-1-1_6
|
;default_envs = tlora-v2-1-1_6
|
||||||
;default_envs = tlora-v2-1-1_6-tcxo
|
;default_envs = tlora-v2-1-1_6-tcxo
|
||||||
;default_envs = tlora-t3s3-v1
|
;default_envs = tlora-t3s3-v1
|
||||||
;default_envs = lora-relay-v1 # nrf board
|
|
||||||
;default_envs = t-echo
|
;default_envs = t-echo
|
||||||
;default_envs = canaryone
|
;default_envs = canaryone
|
||||||
;default_envs = nrf52840dk-geeksville
|
;default_envs = native
|
||||||
;default_envs = native # lora-relay-v1 # nrf52840dk-geeksville # linux # or if you'd like to change the default to something like lora-relay-v1 put that here
|
|
||||||
;default_envs = nano-g1
|
;default_envs = nano-g1
|
||||||
;default_envs = pca10059_diy_eink
|
;default_envs = pca10059_diy_eink
|
||||||
;default_envs = meshtastic-diy-v1
|
;default_envs = meshtastic-diy-v1
|
||||||
@@ -29,8 +27,9 @@ default_envs = tbeam
|
|||||||
;default_envs = meshtastic-dr-dev
|
;default_envs = meshtastic-dr-dev
|
||||||
;default_envs = m5stack-coreink
|
;default_envs = m5stack-coreink
|
||||||
;default_envs = rak4631
|
;default_envs = rak4631
|
||||||
|
;default_envs = rak4631_eth_gw
|
||||||
;default_envs = rak2560
|
;default_envs = rak2560
|
||||||
;default_envs = rak10701
|
;default_envs = rak_wismeshtap
|
||||||
;default_envs = wio-e5
|
;default_envs = wio-e5
|
||||||
;default_envs = radiomaster_900_bandit_nano
|
;default_envs = radiomaster_900_bandit_nano
|
||||||
;default_envs = radiomaster_900_bandit_micro
|
;default_envs = radiomaster_900_bandit_micro
|
||||||
@@ -40,124 +39,126 @@ default_envs = tbeam
|
|||||||
;default_envs = heltec_vision_master_e213
|
;default_envs = heltec_vision_master_e213
|
||||||
;default_envs = heltec_vision_master_e290
|
;default_envs = heltec_vision_master_e290
|
||||||
;default_envs = heltec_mesh_node_t114
|
;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
|
-DPB_ENABLE_MALLOC=1
|
||||||
-DRADIOLIB_EXCLUDE_NRF24
|
-DRADIOLIB_EXCLUDE_CC1101=1
|
||||||
-DRADIOLIB_EXCLUDE_RF69
|
-DRADIOLIB_EXCLUDE_NRF24=1
|
||||||
-DRADIOLIB_EXCLUDE_SX1231
|
-DRADIOLIB_EXCLUDE_RF69=1
|
||||||
-DRADIOLIB_EXCLUDE_SX1233
|
-DRADIOLIB_EXCLUDE_SX1231=1
|
||||||
-DRADIOLIB_EXCLUDE_SI443X
|
-DRADIOLIB_EXCLUDE_SX1233=1
|
||||||
-DRADIOLIB_EXCLUDE_RFM2X
|
-DRADIOLIB_EXCLUDE_SI443X=1
|
||||||
-DRADIOLIB_EXCLUDE_AFSK
|
-DRADIOLIB_EXCLUDE_RFM2X=1
|
||||||
-DRADIOLIB_EXCLUDE_BELL
|
-DRADIOLIB_EXCLUDE_AFSK=1
|
||||||
-DRADIOLIB_EXCLUDE_HELLSCHREIBER
|
-DRADIOLIB_EXCLUDE_BELL=1
|
||||||
-DRADIOLIB_EXCLUDE_MORSE
|
-DRADIOLIB_EXCLUDE_HELLSCHREIBER=1
|
||||||
-DRADIOLIB_EXCLUDE_RTTY
|
-DRADIOLIB_EXCLUDE_MORSE=1
|
||||||
-DRADIOLIB_EXCLUDE_SSTV
|
-DRADIOLIB_EXCLUDE_RTTY=1
|
||||||
-DRADIOLIB_EXCLUDE_AX25
|
-DRADIOLIB_EXCLUDE_SSTV=1
|
||||||
-DRADIOLIB_EXCLUDE_DIRECT_RECEIVE
|
-DRADIOLIB_EXCLUDE_AX25=1
|
||||||
-DRADIOLIB_EXCLUDE_BELL
|
-DRADIOLIB_EXCLUDE_DIRECT_RECEIVE=1
|
||||||
-DRADIOLIB_EXCLUDE_PAGER
|
-DRADIOLIB_EXCLUDE_BELL=1
|
||||||
-DRADIOLIB_EXCLUDE_FSK4
|
-DRADIOLIB_EXCLUDE_PAGER=1
|
||||||
-DRADIOLIB_EXCLUDE_APRS
|
-DRADIOLIB_EXCLUDE_FSK4=1
|
||||||
-DRADIOLIB_EXCLUDE_LORAWAN
|
-DRADIOLIB_EXCLUDE_APRS=1
|
||||||
-DMESHTASTIC_EXCLUDE_DROPZONE=1
|
-DRADIOLIB_EXCLUDE_LORAWAN=1
|
||||||
;-D OLED_PL
|
-DMESHTASTIC_EXCLUDE_DROPZONE=1
|
||||||
|
-DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=1
|
||||||
|
-DMESHTASTIC_EXCLUDE_POWERSTRESS=1 ; exclude power stress test module from main firmware
|
||||||
|
#-DBUILD_EPOCH=$UNIX_TIME
|
||||||
|
;-D OLED_PL
|
||||||
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
monitor_filters = direct
|
monitor_filters = direct
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
; jgromes/RadioLib@~6.6.0
|
https://github.com/meshtastic/esp8266-oled-ssd1306.git#e16cee124fe26490cb14880c679321ad8ac89c95
|
||||||
https://github.com/jgromes/RadioLib.git#3115fc2d6700a9aee05888791ac930a910f2628f
|
mathertel/OneButton@2.6.1
|
||||||
https://github.com/meshtastic/esp8266-oled-ssd1306.git#e16cee124fe26490cb14880c679321ad8ac89c95 ; ESP8266_SSD1306
|
https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159
|
||||||
https://github.com/mathertel/OneButton@~2.6.1 ; OneButton library for non-blocking button debounce
|
https://github.com/meshtastic/TinyGPSPlus.git#71a82db35f3b973440044c476d4bcdc673b104f4
|
||||||
https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159
|
https://github.com/meshtastic/ArduinoThread.git#1ae8778c85d0a2a729f989e0b1e7d7c4dc84eef0
|
||||||
https://github.com/meshtastic/TinyGPSPlus.git#71a82db35f3b973440044c476d4bcdc673b104f4
|
nanopb/Nanopb@0.4.9
|
||||||
https://github.com/meshtastic/ArduinoThread.git#1ae8778c85d0a2a729f989e0b1e7d7c4dc84eef0
|
erriez/ErriezCRC32@1.0.1
|
||||||
nanopb/Nanopb@^0.4.8
|
|
||||||
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
|
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.0
|
||||||
|
|
||||||
; 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.15.0
|
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 SHTC3 Library@^1.0.0
|
adafruit/Adafruit MAX1704X@1.0.3
|
||||||
adafruit/Adafruit LPS2X@^2.0.4
|
adafruit/Adafruit SHTC3 Library@1.0.1
|
||||||
adafruit/Adafruit SHT31 Library@^2.2.2
|
adafruit/Adafruit LPS2X@2.0.6
|
||||||
adafruit/Adafruit PM25 AQI Sensor@^1.0.6
|
adafruit/Adafruit SHT31 Library@2.2.2
|
||||||
adafruit/Adafruit MPU6050@^2.2.4
|
adafruit/Adafruit PM25 AQI Sensor@1.1.1
|
||||||
adafruit/Adafruit LIS3DH@^1.2.4
|
adafruit/Adafruit MPU6050@2.2.6
|
||||||
adafruit/Adafruit AHTX0@^2.0.5
|
adafruit/Adafruit LIS3DH@1.3.0
|
||||||
adafruit/Adafruit LSM6DS@^4.7.2
|
adafruit/Adafruit AHTX0@2.0.5
|
||||||
adafruit/Adafruit VEML7700 Library@^2.1.6
|
adafruit/Adafruit LSM6DS@4.7.3
|
||||||
adafruit/Adafruit SHT4x Library@^1.0.4
|
adafruit/Adafruit VEML7700 Library@2.1.6
|
||||||
adafruit/Adafruit TSL2591 Library@^1.4.5
|
adafruit/Adafruit SHT4x Library@1.0.5
|
||||||
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@^1.0.5
|
adafruit/Adafruit TSL2591 Library@1.4.5
|
||||||
ClosedCube OPT3001@^1.1.2
|
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6
|
||||||
emotibit/EmotiBit MLX90632@^1.0.8
|
sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.2.13
|
||||||
dfrobot/DFRobot_RTU@^1.0.3
|
ClosedCube OPT3001@1.1.2
|
||||||
|
emotibit/EmotiBit MLX90632@1.0.8
|
||||||
|
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/boschsensortec/Bosch-BSEC2-Library#v1.7.2502
|
||||||
https://github.com/KodinLanewave/INA3221@^1.0.0
|
boschsensortec/BME68x Sensor Library@1.1.40407
|
||||||
lewisxhe/SensorLib@^0.2.0
|
https://github.com/KodinLanewave/INA3221@1.0.1
|
||||||
mprograms/QMC5883LCompass@^1.2.0
|
mprograms/QMC5883LCompass@1.2.3
|
||||||
|
dfrobot/DFRobot_RTU@1.0.3
|
||||||
|
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d
|
||||||
https://github.com/meshtastic/DFRobot_LarkWeatherStation#dee914270dc7cb3e43fbf034edd85a63a16a12ee
|
|
||||||
|
|||||||
1
release/latest/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
curfirmwareversion.xml
|
|
||||||
@@ -1,297 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "configuration.h"
|
|
||||||
|
|
||||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
|
||||||
|
|
||||||
#include "PowerFSM.h"
|
|
||||||
#include "concurrency/OSThread.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "power.h"
|
|
||||||
|
|
||||||
#include <Adafruit_LIS3DH.h>
|
|
||||||
#include <Adafruit_LSM6DS3TRC.h>
|
|
||||||
#include <Adafruit_MPU6050.h>
|
|
||||||
#include <Arduino.h>
|
|
||||||
#include <SensorBMA423.hpp>
|
|
||||||
#include <Wire.h>
|
|
||||||
#ifdef RAK_4631
|
|
||||||
#include "Fusion/Fusion.h"
|
|
||||||
#include "graphics/Screen.h"
|
|
||||||
#include "graphics/ScreenFonts.h"
|
|
||||||
#include <Rak_BMX160.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ACCELEROMETER_CHECK_INTERVAL_MS 100
|
|
||||||
#define ACCELEROMETER_CLICK_THRESHOLD 40
|
|
||||||
|
|
||||||
static inline int readRegister(uint8_t address, uint8_t reg, uint8_t *data, uint8_t len)
|
|
||||||
{
|
|
||||||
Wire.beginTransmission(address);
|
|
||||||
Wire.write(reg);
|
|
||||||
Wire.endTransmission();
|
|
||||||
Wire.requestFrom((uint8_t)address, (uint8_t)len);
|
|
||||||
uint8_t i = 0;
|
|
||||||
while (Wire.available()) {
|
|
||||||
data[i++] = Wire.read();
|
|
||||||
}
|
|
||||||
return 0; // Pass
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int writeRegister(uint8_t address, uint8_t reg, uint8_t *data, uint8_t len)
|
|
||||||
{
|
|
||||||
Wire.beginTransmission(address);
|
|
||||||
Wire.write(reg);
|
|
||||||
Wire.write(data, len);
|
|
||||||
return (0 != Wire.endTransmission());
|
|
||||||
}
|
|
||||||
|
|
||||||
class AccelerometerThread : public concurrency::OSThread
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit AccelerometerThread(ScanI2C::DeviceType type) : OSThread("AccelerometerThread")
|
|
||||||
{
|
|
||||||
if (accelerometer_found.port == ScanI2C::I2CPort::NO_I2C) {
|
|
||||||
LOG_DEBUG("AccelerometerThread disabling due to no sensors found\n");
|
|
||||||
disable();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
acceleremoter_type = type;
|
|
||||||
#ifndef RAK_4631
|
|
||||||
if (!config.display.wake_on_tap_or_motion && !config.device.double_tap_as_button_press) {
|
|
||||||
LOG_DEBUG("AccelerometerThread disabling due to no interested configurations\n");
|
|
||||||
disable();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
void start()
|
|
||||||
{
|
|
||||||
init();
|
|
||||||
setIntervalFromNow(0);
|
|
||||||
};
|
|
||||||
|
|
||||||
protected:
|
|
||||||
int32_t runOnce() override
|
|
||||||
{
|
|
||||||
canSleep = true; // Assume we should not keep the board awake
|
|
||||||
|
|
||||||
if (acceleremoter_type == ScanI2C::DeviceType::MPU6050 && mpu.getMotionInterruptStatus()) {
|
|
||||||
wakeScreen();
|
|
||||||
} else if (acceleremoter_type == ScanI2C::DeviceType::LIS3DH && lis.getClick() > 0) {
|
|
||||||
uint8_t click = lis.getClick();
|
|
||||||
if (!config.device.double_tap_as_button_press) {
|
|
||||||
wakeScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.device.double_tap_as_button_press && (click & 0x20)) {
|
|
||||||
buttonPress();
|
|
||||||
return 500;
|
|
||||||
}
|
|
||||||
} else if (acceleremoter_type == ScanI2C::DeviceType::BMA423 && bmaSensor.readIrqStatus() != DEV_WIRE_NONE) {
|
|
||||||
if (bmaSensor.isTilt() || bmaSensor.isDoubleTap()) {
|
|
||||||
wakeScreen();
|
|
||||||
return 500;
|
|
||||||
}
|
|
||||||
#ifdef RAK_4631
|
|
||||||
} else if (acceleremoter_type == ScanI2C::DeviceType::BMX160) {
|
|
||||||
sBmx160SensorData_t magAccel;
|
|
||||||
sBmx160SensorData_t gAccel;
|
|
||||||
|
|
||||||
/* Get a new sensor event */
|
|
||||||
bmx160.getAllData(&magAccel, NULL, &gAccel);
|
|
||||||
|
|
||||||
// expirimental calibrate routine. Limited to between 10 and 30 seconds after boot
|
|
||||||
if (millis() > 12 * 1000 && millis() < 30 * 1000) {
|
|
||||||
if (!showingScreen) {
|
|
||||||
showingScreen = true;
|
|
||||||
screen->startAlert((FrameCallback)drawFrameCalibration);
|
|
||||||
}
|
|
||||||
if (magAccel.x > highestX)
|
|
||||||
highestX = magAccel.x;
|
|
||||||
if (magAccel.x < lowestX)
|
|
||||||
lowestX = magAccel.x;
|
|
||||||
if (magAccel.y > highestY)
|
|
||||||
highestY = magAccel.y;
|
|
||||||
if (magAccel.y < lowestY)
|
|
||||||
lowestY = magAccel.y;
|
|
||||||
if (magAccel.z > highestZ)
|
|
||||||
highestZ = magAccel.z;
|
|
||||||
if (magAccel.z < lowestZ)
|
|
||||||
lowestZ = magAccel.z;
|
|
||||||
} else if (showingScreen && millis() >= 30 * 1000) {
|
|
||||||
showingScreen = false;
|
|
||||||
screen->endAlert();
|
|
||||||
}
|
|
||||||
|
|
||||||
int highestRealX = highestX - (highestX + lowestX) / 2;
|
|
||||||
|
|
||||||
magAccel.x -= (highestX + lowestX) / 2;
|
|
||||||
magAccel.y -= (highestY + lowestY) / 2;
|
|
||||||
magAccel.z -= (highestZ + lowestZ) / 2;
|
|
||||||
FusionVector ga, ma;
|
|
||||||
ga.axis.x = -gAccel.x; // default location for the BMX160 is on the rear of the board
|
|
||||||
ga.axis.y = -gAccel.y;
|
|
||||||
ga.axis.z = gAccel.z;
|
|
||||||
ma.axis.x = -magAccel.x;
|
|
||||||
ma.axis.y = -magAccel.y;
|
|
||||||
ma.axis.z = magAccel.z * 3;
|
|
||||||
|
|
||||||
// If we're set to one of the inverted positions
|
|
||||||
if (config.display.compass_orientation > meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270) {
|
|
||||||
ma = FusionAxesSwap(ma, FusionAxesAlignmentNXNYPZ);
|
|
||||||
ga = FusionAxesSwap(ga, FusionAxesAlignmentNXNYPZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
float heading = FusionCompassCalculateHeading(FusionConventionNed, ga, ma);
|
|
||||||
|
|
||||||
switch (config.display.compass_orientation) {
|
|
||||||
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_0_INVERTED:
|
|
||||||
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_0:
|
|
||||||
break;
|
|
||||||
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_90:
|
|
||||||
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_90_INVERTED:
|
|
||||||
heading += 90;
|
|
||||||
break;
|
|
||||||
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_180:
|
|
||||||
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_180_INVERTED:
|
|
||||||
heading += 180;
|
|
||||||
break;
|
|
||||||
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270:
|
|
||||||
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270_INVERTED:
|
|
||||||
heading += 270;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
screen->setHeading(heading);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
} else if (acceleremoter_type == ScanI2C::DeviceType::LSM6DS3 && lsm.shake()) {
|
|
||||||
wakeScreen();
|
|
||||||
return 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ACCELEROMETER_CHECK_INTERVAL_MS;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
void init()
|
|
||||||
{
|
|
||||||
LOG_DEBUG("AccelerometerThread initializing\n");
|
|
||||||
|
|
||||||
if (acceleremoter_type == ScanI2C::DeviceType::MPU6050 && mpu.begin(accelerometer_found.address)) {
|
|
||||||
LOG_DEBUG("MPU6050 initializing\n");
|
|
||||||
// setup motion detection
|
|
||||||
mpu.setHighPassFilter(MPU6050_HIGHPASS_0_63_HZ);
|
|
||||||
mpu.setMotionDetectionThreshold(1);
|
|
||||||
mpu.setMotionDetectionDuration(20);
|
|
||||||
mpu.setInterruptPinLatch(true); // Keep it latched. Will turn off when reinitialized.
|
|
||||||
mpu.setInterruptPinPolarity(true);
|
|
||||||
} else if (acceleremoter_type == ScanI2C::DeviceType::LIS3DH && lis.begin(accelerometer_found.address)) {
|
|
||||||
LOG_DEBUG("LIS3DH initializing\n");
|
|
||||||
lis.setRange(LIS3DH_RANGE_2_G);
|
|
||||||
// Adjust threshold, higher numbers are less sensitive
|
|
||||||
lis.setClick(config.device.double_tap_as_button_press ? 2 : 1, ACCELEROMETER_CLICK_THRESHOLD);
|
|
||||||
} else if (acceleremoter_type == ScanI2C::DeviceType::BMA423 &&
|
|
||||||
bmaSensor.begin(accelerometer_found.address, &readRegister, &writeRegister)) {
|
|
||||||
LOG_DEBUG("BMA423 initializing\n");
|
|
||||||
bmaSensor.configAccelerometer(bmaSensor.RANGE_2G, bmaSensor.ODR_100HZ, bmaSensor.BW_NORMAL_AVG4,
|
|
||||||
bmaSensor.PERF_CONTINUOUS_MODE);
|
|
||||||
bmaSensor.enableAccelerometer();
|
|
||||||
bmaSensor.configInterrupt(BMA4_LEVEL_TRIGGER, BMA4_ACTIVE_HIGH, BMA4_PUSH_PULL, BMA4_OUTPUT_ENABLE,
|
|
||||||
BMA4_INPUT_DISABLE);
|
|
||||||
|
|
||||||
#ifdef BMA423_INT
|
|
||||||
pinMode(BMA4XX_INT, INPUT);
|
|
||||||
attachInterrupt(
|
|
||||||
BMA4XX_INT,
|
|
||||||
[] {
|
|
||||||
// Set interrupt to set irq value to true
|
|
||||||
BMA_IRQ = true;
|
|
||||||
},
|
|
||||||
RISING); // Select the interrupt mode according to the actual circuit
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
|
||||||
// Need to raise the wrist function, need to set the correct axis
|
|
||||||
bmaSensor.setReampAxes(bmaSensor.REMAP_TOP_LAYER_RIGHT_CORNER);
|
|
||||||
#else
|
|
||||||
bmaSensor.setReampAxes(bmaSensor.REMAP_BOTTOM_LAYER_BOTTOM_LEFT_CORNER);
|
|
||||||
#endif
|
|
||||||
// bmaSensor.enableFeature(bmaSensor.FEATURE_STEP_CNTR, true);
|
|
||||||
bmaSensor.enableFeature(bmaSensor.FEATURE_TILT, true);
|
|
||||||
bmaSensor.enableFeature(bmaSensor.FEATURE_WAKEUP, true);
|
|
||||||
// bmaSensor.resetPedometer();
|
|
||||||
|
|
||||||
// Turn on feature interrupt
|
|
||||||
bmaSensor.enablePedometerIRQ();
|
|
||||||
bmaSensor.enableTiltIRQ();
|
|
||||||
// It corresponds to isDoubleClick interrupt
|
|
||||||
bmaSensor.enableWakeupIRQ();
|
|
||||||
#ifdef RAK_4631
|
|
||||||
} else if (acceleremoter_type == ScanI2C::DeviceType::BMX160 && bmx160.begin()) {
|
|
||||||
bmx160.ODR_Config(BMX160_ACCEL_ODR_100HZ, BMX160_GYRO_ODR_100HZ); // set output data rate
|
|
||||||
|
|
||||||
#endif
|
|
||||||
} else if (acceleremoter_type == ScanI2C::DeviceType::LSM6DS3 && lsm.begin_I2C(accelerometer_found.address)) {
|
|
||||||
LOG_DEBUG("LSM6DS3 initializing\n");
|
|
||||||
// Default threshold of 2G, less sensitive options are 4, 8 or 16G
|
|
||||||
lsm.setAccelRange(LSM6DS_ACCEL_RANGE_2_G);
|
|
||||||
#ifndef LSM6DS3_WAKE_THRESH
|
|
||||||
#define LSM6DS3_WAKE_THRESH 20
|
|
||||||
#endif
|
|
||||||
lsm.enableWakeup(config.display.wake_on_tap_or_motion, 1, LSM6DS3_WAKE_THRESH);
|
|
||||||
// Duration is number of occurances needed to trigger, higher threshold is less sensitive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void wakeScreen()
|
|
||||||
{
|
|
||||||
if (powerFSM.getState() == &stateDARK) {
|
|
||||||
LOG_INFO("Tap or motion detected. Turning on screen\n");
|
|
||||||
powerFSM.trigger(EVENT_INPUT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void buttonPress()
|
|
||||||
{
|
|
||||||
LOG_DEBUG("Double-tap detected. Firing button press\n");
|
|
||||||
powerFSM.trigger(EVENT_PRESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
ScanI2C::DeviceType acceleremoter_type;
|
|
||||||
Adafruit_MPU6050 mpu;
|
|
||||||
Adafruit_LIS3DH lis;
|
|
||||||
Adafruit_LSM6DS3TRC lsm;
|
|
||||||
SensorBMA423 bmaSensor;
|
|
||||||
bool BMA_IRQ = false;
|
|
||||||
#ifdef RAK_4631
|
|
||||||
bool showingScreen = false;
|
|
||||||
RAK_BMX160 bmx160;
|
|
||||||
float highestX = 0, lowestX = 0, highestY = 0, lowestY = 0, highestZ = 0, lowestZ = 0;
|
|
||||||
|
|
||||||
static void drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
|
||||||
{
|
|
||||||
int x_offset = display->width() / 2;
|
|
||||||
int y_offset = display->height() <= 80 ? 0 : 32;
|
|
||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
|
||||||
display->setFont(FONT_MEDIUM);
|
|
||||||
display->drawString(x, y, "Calibrating\nCompass");
|
|
||||||
int16_t compassX = 0, compassY = 0;
|
|
||||||
uint16_t compassDiam = graphics::Screen::getCompassDiam(display->getWidth(), display->getHeight());
|
|
||||||
|
|
||||||
// coordinates for the center of the compass/circle
|
|
||||||
if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) {
|
|
||||||
compassX = x + display->getWidth() - compassDiam / 2 - 5;
|
|
||||||
compassY = y + display->getHeight() / 2;
|
|
||||||
} else {
|
|
||||||
compassX = x + display->getWidth() - compassDiam / 2 - 5;
|
|
||||||
compassY = y + FONT_HEIGHT_SMALL + (display->getHeight() - FONT_HEIGHT_SMALL) / 2;
|
|
||||||
}
|
|
||||||
display->drawCircle(compassX, compassY, compassDiam / 2);
|
|
||||||
screen->drawCompassNorth(display, compassX, compassY, screen->getHeading() * PI / 180);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -21,7 +21,7 @@ namespace concurrency
|
|||||||
class AmbientLightingThread : public concurrency::OSThread
|
class AmbientLightingThread : public concurrency::OSThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit AmbientLightingThread(ScanI2C::DeviceType type) : OSThread("AmbientLightingThread")
|
explicit AmbientLightingThread(ScanI2C::DeviceType type) : OSThread("AmbientLighting")
|
||||||
{
|
{
|
||||||
notifyDeepSleepObserver.observe(¬ifyDeepSleep); // Let us know when shutdown() is issued.
|
notifyDeepSleepObserver.observe(¬ifyDeepSleep); // Let us know when shutdown() is issued.
|
||||||
|
|
||||||
@@ -42,18 +42,18 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
#ifdef HAS_NCP5623
|
#ifdef HAS_NCP5623
|
||||||
_type = type;
|
_type = type;
|
||||||
if (_type == ScanI2C::DeviceType::NONE) {
|
if (_type == ScanI2C::DeviceType::NONE) {
|
||||||
LOG_DEBUG("AmbientLightingThread disabling due to no RGB leds found on I2C bus\n");
|
LOG_DEBUG("AmbientLighting Disable due to no RGB leds found on I2C bus");
|
||||||
disable();
|
disable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAS_NCP5623) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE)
|
#if defined(HAS_NCP5623) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE)
|
||||||
if (!moduleConfig.ambient_lighting.led_state) {
|
if (!moduleConfig.ambient_lighting.led_state) {
|
||||||
LOG_DEBUG("AmbientLightingThread disabling due to moduleConfig.ambient_lighting.led_state OFF\n");
|
LOG_DEBUG("AmbientLighting Disable due to moduleConfig.ambient_lighting.led_state OFF");
|
||||||
disable();
|
disable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG_DEBUG("AmbientLightingThread initializing\n");
|
LOG_DEBUG("AmbientLighting init");
|
||||||
#ifdef HAS_NCP5623
|
#ifdef HAS_NCP5623
|
||||||
if (_type == ScanI2C::NCP5623) {
|
if (_type == ScanI2C::NCP5623) {
|
||||||
rgb.begin();
|
rgb.begin();
|
||||||
@@ -106,27 +106,27 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
rgb.setRed(0);
|
rgb.setRed(0);
|
||||||
rgb.setGreen(0);
|
rgb.setGreen(0);
|
||||||
rgb.setBlue(0);
|
rgb.setBlue(0);
|
||||||
LOG_INFO("Turn Off NCP5623 Ambient lighting.\n");
|
LOG_INFO("OFF: NCP5623 Ambient lighting");
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_NEOPIXEL
|
#ifdef HAS_NEOPIXEL
|
||||||
pixels.clear();
|
pixels.clear();
|
||||||
pixels.show();
|
pixels.show();
|
||||||
LOG_INFO("Turn Off NeoPixel Ambient lighting.\n");
|
LOG_INFO("OFF: NeoPixel Ambient lighting");
|
||||||
#endif
|
#endif
|
||||||
#ifdef RGBLED_CA
|
#ifdef RGBLED_CA
|
||||||
analogWrite(RGBLED_RED, 255 - 0);
|
analogWrite(RGBLED_RED, 255 - 0);
|
||||||
analogWrite(RGBLED_GREEN, 255 - 0);
|
analogWrite(RGBLED_GREEN, 255 - 0);
|
||||||
analogWrite(RGBLED_BLUE, 255 - 0);
|
analogWrite(RGBLED_BLUE, 255 - 0);
|
||||||
LOG_INFO("Turn Off Ambient lighting RGB Common Anode.\n");
|
LOG_INFO("OFF: Ambient light RGB Common Anode");
|
||||||
#elif defined(RGBLED_RED)
|
#elif defined(RGBLED_RED)
|
||||||
analogWrite(RGBLED_RED, 0);
|
analogWrite(RGBLED_RED, 0);
|
||||||
analogWrite(RGBLED_GREEN, 0);
|
analogWrite(RGBLED_GREEN, 0);
|
||||||
analogWrite(RGBLED_BLUE, 0);
|
analogWrite(RGBLED_BLUE, 0);
|
||||||
LOG_INFO("Turn Off Ambient lighting RGB Common Cathode.\n");
|
LOG_INFO("OFF: Ambient light RGB Common Cathode");
|
||||||
#endif
|
#endif
|
||||||
#ifdef UNPHONE
|
#ifdef UNPHONE
|
||||||
unphone.rgb(0, 0, 0);
|
unphone.rgb(0, 0, 0);
|
||||||
LOG_INFO("Turn Off unPhone Ambient lighting.\n");
|
LOG_INFO("OFF: unPhone Ambient lighting");
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -138,9 +138,8 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
rgb.setRed(moduleConfig.ambient_lighting.red);
|
rgb.setRed(moduleConfig.ambient_lighting.red);
|
||||||
rgb.setGreen(moduleConfig.ambient_lighting.green);
|
rgb.setGreen(moduleConfig.ambient_lighting.green);
|
||||||
rgb.setBlue(moduleConfig.ambient_lighting.blue);
|
rgb.setBlue(moduleConfig.ambient_lighting.blue);
|
||||||
LOG_DEBUG("Initializing NCP5623 Ambient lighting w/ current=%d, red=%d, green=%d, blue=%d\n",
|
LOG_DEBUG("Init NCP5623 Ambient light w/ current=%d, red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.current,
|
||||||
moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green,
|
moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
||||||
moduleConfig.ambient_lighting.blue);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_NEOPIXEL
|
#ifdef HAS_NEOPIXEL
|
||||||
pixels.fill(pixels.Color(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green,
|
pixels.fill(pixels.Color(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green,
|
||||||
@@ -158,7 +157,7 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
pixels.show();
|
pixels.show();
|
||||||
LOG_DEBUG("Initializing NeoPixel Ambient lighting w/ brightness(current)=%d, red=%d, green=%d, blue=%d\n",
|
LOG_DEBUG("Init NeoPixel Ambient light w/ brightness(current)=%d, red=%d, green=%d, blue=%d",
|
||||||
moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green,
|
moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green,
|
||||||
moduleConfig.ambient_lighting.blue);
|
moduleConfig.ambient_lighting.blue);
|
||||||
#endif
|
#endif
|
||||||
@@ -166,21 +165,21 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
analogWrite(RGBLED_RED, 255 - moduleConfig.ambient_lighting.red);
|
analogWrite(RGBLED_RED, 255 - moduleConfig.ambient_lighting.red);
|
||||||
analogWrite(RGBLED_GREEN, 255 - moduleConfig.ambient_lighting.green);
|
analogWrite(RGBLED_GREEN, 255 - moduleConfig.ambient_lighting.green);
|
||||||
analogWrite(RGBLED_BLUE, 255 - moduleConfig.ambient_lighting.blue);
|
analogWrite(RGBLED_BLUE, 255 - moduleConfig.ambient_lighting.blue);
|
||||||
LOG_DEBUG("Initializing Ambient lighting RGB Common Anode w/ red=%d, green=%d, blue=%d\n",
|
LOG_DEBUG("Init Ambient light RGB Common Anode w/ red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.red,
|
||||||
moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
||||||
#elif defined(RGBLED_RED)
|
#elif defined(RGBLED_RED)
|
||||||
analogWrite(RGBLED_RED, moduleConfig.ambient_lighting.red);
|
analogWrite(RGBLED_RED, moduleConfig.ambient_lighting.red);
|
||||||
analogWrite(RGBLED_GREEN, moduleConfig.ambient_lighting.green);
|
analogWrite(RGBLED_GREEN, moduleConfig.ambient_lighting.green);
|
||||||
analogWrite(RGBLED_BLUE, moduleConfig.ambient_lighting.blue);
|
analogWrite(RGBLED_BLUE, moduleConfig.ambient_lighting.blue);
|
||||||
LOG_DEBUG("Initializing Ambient lighting RGB Common Cathode w/ red=%d, green=%d, blue=%d\n",
|
LOG_DEBUG("Init Ambient light RGB Common Cathode w/ red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.red,
|
||||||
moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
||||||
#endif
|
#endif
|
||||||
#ifdef UNPHONE
|
#ifdef UNPHONE
|
||||||
unphone.rgb(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
unphone.rgb(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
||||||
LOG_DEBUG("Initializing unPhone Ambient lighting w/ red=%d, green=%d, blue=%d\n", moduleConfig.ambient_lighting.red,
|
LOG_DEBUG("Init unPhone Ambient light w/ red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.red,
|
||||||
moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace concurrency
|
} // namespace concurrency
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
class AudioThread : public concurrency::OSThread
|
class AudioThread : public concurrency::OSThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AudioThread() : OSThread("AudioThread") { initOutput(); }
|
AudioThread() : OSThread("Audio") { initOutput(); }
|
||||||
|
|
||||||
void beginRttl(const void *data, uint32_t len)
|
void beginRttl(const void *data, uint32_t len)
|
||||||
{
|
{
|
||||||
@@ -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 "../userPrefs.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#if !MESHTASTIC_EXCLUDE_GPS
|
#if !MESHTASTIC_EXCLUDE_GPS
|
||||||
#include "GPS.h"
|
#include "GPS.h"
|
||||||
@@ -26,20 +27,25 @@ 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) {
|
||||||
this->userButton = OneButton(settingsMap[user], true, true);
|
this->userButton = OneButton(settingsMap[user], true, true);
|
||||||
LOG_DEBUG("Using GPIO%02d for button\n", 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)
|
||||||
@@ -47,7 +53,7 @@ ButtonThread::ButtonThread() : OSThread("Button")
|
|||||||
#else
|
#else
|
||||||
this->userButton = OneButton(pin, true, true);
|
this->userButton = OneButton(pin, true, true);
|
||||||
#endif
|
#endif
|
||||||
LOG_DEBUG("Using GPIO%02d for button\n", pin);
|
LOG_DEBUG("Use GPIO%02d for button", pin);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef INPUT_PULLUP_SENSE
|
#ifdef INPUT_PULLUP_SENSE
|
||||||
@@ -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)
|
||||||
@@ -123,9 +129,19 @@ int32_t ButtonThread::runOnce()
|
|||||||
if (btnEvent != BUTTON_EVENT_NONE) {
|
if (btnEvent != BUTTON_EVENT_NONE) {
|
||||||
switch (btnEvent) {
|
switch (btnEvent) {
|
||||||
case BUTTON_EVENT_PRESSED: {
|
case BUTTON_EVENT_PRESSED: {
|
||||||
LOG_BUTTON("press!\n");
|
LOG_BUTTON("press!");
|
||||||
|
// If a nag notification is running, stop it and prevent other actions
|
||||||
|
if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) {
|
||||||
|
externalNotificationModule->stopNow();
|
||||||
|
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) {
|
||||||
@@ -143,7 +159,7 @@ int32_t ButtonThread::runOnce()
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BUTTON_EVENT_DOUBLE_PRESSED: {
|
case BUTTON_EVENT_DOUBLE_PRESSED: {
|
||||||
LOG_BUTTON("Double press!\n");
|
LOG_BUTTON("Double press!");
|
||||||
service->refreshLocalMeshNode();
|
service->refreshLocalMeshNode();
|
||||||
auto sentPosition = service->trySendPosition(NODENUM_BROADCAST, true);
|
auto sentPosition = service->trySendPosition(NODENUM_BROADCAST, true);
|
||||||
if (screen) {
|
if (screen) {
|
||||||
@@ -157,7 +173,7 @@ int32_t ButtonThread::runOnce()
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BUTTON_EVENT_MULTI_PRESSED: {
|
case BUTTON_EVENT_MULTI_PRESSED: {
|
||||||
LOG_BUTTON("Mulitipress! %hux\n", multipressClickCount);
|
LOG_BUTTON("Mulitipress! %hux", multipressClickCount);
|
||||||
switch (multipressClickCount) {
|
switch (multipressClickCount) {
|
||||||
#if HAS_GPS
|
#if HAS_GPS
|
||||||
// 3 clicks: toggle GPS
|
// 3 clicks: toggle GPS
|
||||||
@@ -184,7 +200,7 @@ int32_t ButtonThread::runOnce()
|
|||||||
} // end multipress event
|
} // end multipress event
|
||||||
|
|
||||||
case BUTTON_EVENT_LONG_PRESSED: {
|
case BUTTON_EVENT_LONG_PRESSED: {
|
||||||
LOG_BUTTON("Long press!\n");
|
LOG_BUTTON("Long press!");
|
||||||
powerFSM.trigger(EVENT_PRESS);
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
if (screen) {
|
if (screen) {
|
||||||
screen->startAlert("Shutting down...");
|
screen->startAlert("Shutting down...");
|
||||||
@@ -196,7 +212,7 @@ int32_t ButtonThread::runOnce()
|
|||||||
// Do actual shutdown when button released, otherwise the button release
|
// Do actual shutdown when button released, otherwise the button release
|
||||||
// may wake the board immediatedly.
|
// may wake the board immediatedly.
|
||||||
case BUTTON_EVENT_LONG_RELEASED: {
|
case BUTTON_EVENT_LONG_RELEASED: {
|
||||||
LOG_INFO("Shutdown from long press\n");
|
LOG_INFO("Shutdown from long press");
|
||||||
playShutdownMelody();
|
playShutdownMelody();
|
||||||
delay(3000);
|
delay(3000);
|
||||||
power->shutdown();
|
power->shutdown();
|
||||||
@@ -205,7 +221,7 @@ int32_t ButtonThread::runOnce()
|
|||||||
|
|
||||||
#ifdef BUTTON_PIN_TOUCH
|
#ifdef BUTTON_PIN_TOUCH
|
||||||
case BUTTON_EVENT_TOUCH_LONG_PRESSED: {
|
case BUTTON_EVENT_TOUCH_LONG_PRESSED: {
|
||||||
LOG_BUTTON("Touch press!\n");
|
LOG_BUTTON("Touch press!");
|
||||||
if (screen) {
|
if (screen) {
|
||||||
// Wake if asleep
|
// Wake if asleep
|
||||||
if (powerFSM.getState() == &stateDARK)
|
if (powerFSM.getState() == &stateDARK)
|
||||||
@@ -239,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;
|
||||||
@@ -268,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);
|
||||||
@@ -310,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
|
||||||
|
|||||||
@@ -24,11 +24,16 @@ SPIClass SPI1(HSPI);
|
|||||||
|
|
||||||
#endif // HAS_SDCARD
|
#endif // HAS_SDCARD
|
||||||
|
|
||||||
#if defined(ARCH_STM32WL)
|
#if defined(ARCH_APOLLO3)
|
||||||
|
// Apollo series 2 Kbytes (8 rows of 256 bytes)
|
||||||
|
|
||||||
uint16_t OSFS::startOfEEPROM = 1;
|
uint16_t OSFS::startOfEEPROM = 1;
|
||||||
uint16_t OSFS::endOfEEPROM = 2048;
|
uint16_t OSFS::endOfEEPROM = 2048;
|
||||||
|
|
||||||
|
// Useful consts
|
||||||
|
const OSFS::result noerr = OSFS::result::NO_ERROR;
|
||||||
|
const OSFS::result notfound = OSFS::result::FILE_NOT_FOUND;
|
||||||
|
|
||||||
// 3) How do I read from the medium?
|
// 3) How do I read from the medium?
|
||||||
void OSFS::readNBytes(uint16_t address, unsigned int num, byte *output)
|
void OSFS::readNBytes(uint16_t address, unsigned int num, byte *output)
|
||||||
{
|
{
|
||||||
@@ -53,7 +58,7 @@ bool lfs_assert_failed =
|
|||||||
|
|
||||||
extern "C" void lfs_assert(const char *reason)
|
extern "C" void lfs_assert(const char *reason)
|
||||||
{
|
{
|
||||||
LOG_ERROR("LFS assert: %s\n", reason);
|
LOG_ERROR("LFS assert: %s", reason);
|
||||||
lfs_assert_failed = true;
|
lfs_assert_failed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +71,7 @@ extern "C" void lfs_assert(const char *reason)
|
|||||||
*/
|
*/
|
||||||
bool copyFile(const char *from, const char *to)
|
bool copyFile(const char *from, const char *to)
|
||||||
{
|
{
|
||||||
#ifdef ARCH_STM32WL
|
#if defined(ARCH_STM32WL) || defined(ARCH_APOLLO3)
|
||||||
unsigned char cbuffer[2048];
|
unsigned char cbuffer[2048];
|
||||||
|
|
||||||
// Var to hold the result of actions
|
// Var to hold the result of actions
|
||||||
@@ -75,19 +80,19 @@ bool copyFile(const char *from, const char *to)
|
|||||||
r = OSFS::getFile(from, cbuffer);
|
r = OSFS::getFile(from, cbuffer);
|
||||||
|
|
||||||
if (r == notfound) {
|
if (r == notfound) {
|
||||||
LOG_ERROR("Failed to open source file %s\n", from);
|
LOG_ERROR("Failed to open source file %s", from);
|
||||||
return false;
|
return false;
|
||||||
} else if (r == noerr) {
|
} else if (r == noerr) {
|
||||||
r = OSFS::newFile(to, cbuffer, true);
|
r = OSFS::newFile(to, cbuffer, true);
|
||||||
if (r == noerr) {
|
if (r == noerr) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR("OSFS Error %d\n", r);
|
LOG_ERROR("OSFS Error %d", r);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR("OSFS Error %d\n", r);
|
LOG_ERROR("OSFS Error %d", r);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -97,13 +102,13 @@ bool copyFile(const char *from, const char *to)
|
|||||||
|
|
||||||
File f1 = FSCom.open(from, FILE_O_READ);
|
File f1 = FSCom.open(from, FILE_O_READ);
|
||||||
if (!f1) {
|
if (!f1) {
|
||||||
LOG_ERROR("Failed to open source file %s\n", from);
|
LOG_ERROR("Failed to open source file %s", from);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
File f2 = FSCom.open(to, FILE_O_WRITE);
|
File f2 = FSCom.open(to, FILE_O_WRITE);
|
||||||
if (!f2) {
|
if (!f2) {
|
||||||
LOG_ERROR("Failed to open destination file %s\n", to);
|
LOG_ERROR("Failed to open destination file %s", to);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +134,7 @@ bool copyFile(const char *from, const char *to)
|
|||||||
*/
|
*/
|
||||||
bool renameFile(const char *pathFrom, const char *pathTo)
|
bool renameFile(const char *pathFrom, const char *pathTo)
|
||||||
{
|
{
|
||||||
#ifdef ARCH_STM32WL
|
#if defined(ARCH_STM32WL) || defined(ARCH_APOLLO3)
|
||||||
if (copyFile(pathFrom, pathTo) && (OSFS::deleteFile(pathFrom) == OSFS::result::NO_ERROR)) {
|
if (copyFile(pathFrom, pathTo) && (OSFS::deleteFile(pathFrom) == OSFS::result::NO_ERROR)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -231,7 +236,7 @@ void listDir(const char *dirname, uint8_t levels, bool del)
|
|||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
listDir(file.path(), levels - 1, del);
|
listDir(file.path(), levels - 1, del);
|
||||||
if (del) {
|
if (del) {
|
||||||
LOG_DEBUG("Removing %s\n", file.path());
|
LOG_DEBUG("Remove %s", file.path());
|
||||||
strncpy(buffer, file.path(), sizeof(buffer));
|
strncpy(buffer, file.path(), sizeof(buffer));
|
||||||
file.close();
|
file.close();
|
||||||
FSCom.rmdir(buffer);
|
FSCom.rmdir(buffer);
|
||||||
@@ -241,7 +246,7 @@ void listDir(const char *dirname, uint8_t levels, bool del)
|
|||||||
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
listDir(file.name(), levels - 1, del);
|
listDir(file.name(), levels - 1, del);
|
||||||
if (del) {
|
if (del) {
|
||||||
LOG_DEBUG("Removing %s\n", file.name());
|
LOG_DEBUG("Remove %s", file.name());
|
||||||
strncpy(buffer, file.name(), sizeof(buffer));
|
strncpy(buffer, file.name(), sizeof(buffer));
|
||||||
file.close();
|
file.close();
|
||||||
FSCom.rmdir(buffer);
|
FSCom.rmdir(buffer);
|
||||||
@@ -249,7 +254,7 @@ void listDir(const char *dirname, uint8_t levels, bool del)
|
|||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
LOG_DEBUG(" %s (directory)\n", file.name());
|
LOG_DEBUG(" %s (directory)", file.name());
|
||||||
listDir(file.name(), levels - 1, del);
|
listDir(file.name(), levels - 1, del);
|
||||||
file.close();
|
file.close();
|
||||||
#endif
|
#endif
|
||||||
@@ -257,26 +262,26 @@ void listDir(const char *dirname, uint8_t levels, bool del)
|
|||||||
} else {
|
} else {
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
if (del) {
|
if (del) {
|
||||||
LOG_DEBUG("Deleting %s\n", file.path());
|
LOG_DEBUG("Delete %s", file.path());
|
||||||
strncpy(buffer, file.path(), sizeof(buffer));
|
strncpy(buffer, file.path(), sizeof(buffer));
|
||||||
file.close();
|
file.close();
|
||||||
FSCom.remove(buffer);
|
FSCom.remove(buffer);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG(" %s (%i Bytes)\n", file.path(), file.size());
|
LOG_DEBUG(" %s (%i Bytes)", file.path(), file.size());
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
if (del) {
|
if (del) {
|
||||||
LOG_DEBUG("Deleting %s\n", file.name());
|
LOG_DEBUG("Delete %s", file.name());
|
||||||
strncpy(buffer, file.name(), sizeof(buffer));
|
strncpy(buffer, file.name(), sizeof(buffer));
|
||||||
file.close();
|
file.close();
|
||||||
FSCom.remove(buffer);
|
FSCom.remove(buffer);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG(" %s (%i Bytes)\n", file.name(), file.size());
|
LOG_DEBUG(" %s (%i Bytes)", file.name(), file.size());
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
LOG_DEBUG(" %s (%i Bytes)\n", file.name(), file.size());
|
LOG_DEBUG(" %s (%i Bytes)", file.name(), file.size());
|
||||||
file.close();
|
file.close();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -284,7 +289,7 @@ void listDir(const char *dirname, uint8_t levels, bool del)
|
|||||||
}
|
}
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
if (del) {
|
if (del) {
|
||||||
LOG_DEBUG("Removing %s\n", root.path());
|
LOG_DEBUG("Remove %s", root.path());
|
||||||
strncpy(buffer, root.path(), sizeof(buffer));
|
strncpy(buffer, root.path(), sizeof(buffer));
|
||||||
root.close();
|
root.close();
|
||||||
FSCom.rmdir(buffer);
|
FSCom.rmdir(buffer);
|
||||||
@@ -293,7 +298,7 @@ void listDir(const char *dirname, uint8_t levels, bool del)
|
|||||||
}
|
}
|
||||||
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
if (del) {
|
if (del) {
|
||||||
LOG_DEBUG("Removing %s\n", root.name());
|
LOG_DEBUG("Remove %s", root.name());
|
||||||
strncpy(buffer, root.name(), sizeof(buffer));
|
strncpy(buffer, root.name(), sizeof(buffer));
|
||||||
root.close();
|
root.close();
|
||||||
FSCom.rmdir(buffer);
|
FSCom.rmdir(buffer);
|
||||||
@@ -329,13 +334,13 @@ void fsInit()
|
|||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
if (!FSBegin()) {
|
if (!FSBegin()) {
|
||||||
LOG_ERROR("Filesystem mount Failed.\n");
|
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)
|
||||||
LOG_DEBUG("Filesystem files (%d/%d Bytes):\n", FSCom.usedBytes(), FSCom.totalBytes());
|
LOG_DEBUG("Filesystem files (%d/%d Bytes):", FSCom.usedBytes(), FSCom.totalBytes());
|
||||||
#else
|
#else
|
||||||
LOG_DEBUG("Filesystem files:\n");
|
LOG_DEBUG("Filesystem files:");
|
||||||
#endif
|
#endif
|
||||||
listDir("/", 10);
|
listDir("/", 10);
|
||||||
#endif
|
#endif
|
||||||
@@ -350,28 +355,28 @@ void setupSDCard()
|
|||||||
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)) {
|
||||||
LOG_DEBUG("No SD_MMC card detected\n");
|
LOG_DEBUG("No SD_MMC card detected");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint8_t cardType = SD.cardType();
|
uint8_t cardType = SD.cardType();
|
||||||
if (cardType == CARD_NONE) {
|
if (cardType == CARD_NONE) {
|
||||||
LOG_DEBUG("No SD_MMC card attached\n");
|
LOG_DEBUG("No SD_MMC card attached");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG_DEBUG("SD_MMC Card Type: ");
|
LOG_DEBUG("SD_MMC Card Type: ");
|
||||||
if (cardType == CARD_MMC) {
|
if (cardType == CARD_MMC) {
|
||||||
LOG_DEBUG("MMC\n");
|
LOG_DEBUG("MMC");
|
||||||
} else if (cardType == CARD_SD) {
|
} else if (cardType == CARD_SD) {
|
||||||
LOG_DEBUG("SDSC\n");
|
LOG_DEBUG("SDSC");
|
||||||
} else if (cardType == CARD_SDHC) {
|
} else if (cardType == CARD_SDHC) {
|
||||||
LOG_DEBUG("SDHC\n");
|
LOG_DEBUG("SDHC");
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("UNKNOWN\n");
|
LOG_DEBUG("UNKNOWN");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
|
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
|
||||||
LOG_DEBUG("SD Card Size: %lluMB\n", cardSize);
|
LOG_DEBUG("SD Card Size: %lu MB", (uint32_t)cardSize);
|
||||||
LOG_DEBUG("Total space: %llu MB\n", SD.totalBytes() / (1024 * 1024));
|
LOG_DEBUG("Total space: %lu MB", (uint32_t)(SD.totalBytes() / (1024 * 1024)));
|
||||||
LOG_DEBUG("Used space: %llu MB\n", SD.usedBytes() / (1024 * 1024));
|
LOG_DEBUG("Used space: %lu MB", (uint32_t)(SD.usedBytes() / (1024 * 1024)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -24,6 +24,25 @@ const OSFS::result noerr = OSFS::result::NO_ERROR;
|
|||||||
const OSFS::result notfound = OSFS::result::FILE_NOT_FOUND;
|
const OSFS::result notfound = OSFS::result::FILE_NOT_FOUND;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ARCH_APOLLO3)
|
||||||
|
// Apollo series 2 Kbytes (8 rows of 256 bytes)
|
||||||
|
#include <EEPROM.h>
|
||||||
|
#include <OSFS.h>
|
||||||
|
|
||||||
|
extern uint16_t OSFS::startOfEEPROM;
|
||||||
|
extern uint16_t OSFS::endOfEEPROM;
|
||||||
|
|
||||||
|
// Useful consts
|
||||||
|
extern const OSFS::result noerr;
|
||||||
|
extern const OSFS::result notfound;
|
||||||
|
|
||||||
|
// 3) How do I read from the medium?
|
||||||
|
void OSFS::readNBytes(uint16_t address, unsigned int num, byte *output);
|
||||||
|
|
||||||
|
// 4) How to I write to the medium?
|
||||||
|
void OSFS::writeNBytes(uint16_t address, unsigned int num, const byte *input);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(ARCH_RP2040)
|
#if defined(ARCH_RP2040)
|
||||||
// RP2040
|
// RP2040
|
||||||
#include "LittleFS.h"
|
#include "LittleFS.h"
|
||||||
|
|||||||
@@ -50,9 +50,6 @@ class GPSStatus : public Status
|
|||||||
int32_t getLatitude() const
|
int32_t getLatitude() const
|
||||||
{
|
{
|
||||||
if (config.position.fixed_position) {
|
if (config.position.fixed_position) {
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
|
||||||
LOG_WARN("Using fixed latitude\n");
|
|
||||||
#endif
|
|
||||||
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
||||||
return node->position.latitude_i;
|
return node->position.latitude_i;
|
||||||
} else {
|
} else {
|
||||||
@@ -63,9 +60,6 @@ class GPSStatus : public Status
|
|||||||
int32_t getLongitude() const
|
int32_t getLongitude() const
|
||||||
{
|
{
|
||||||
if (config.position.fixed_position) {
|
if (config.position.fixed_position) {
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
|
||||||
LOG_WARN("Using fixed longitude\n");
|
|
||||||
#endif
|
|
||||||
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
||||||
return node->position.longitude_i;
|
return node->position.longitude_i;
|
||||||
} else {
|
} else {
|
||||||
@@ -76,9 +70,6 @@ class GPSStatus : public Status
|
|||||||
int32_t getAltitude() const
|
int32_t getAltitude() const
|
||||||
{
|
{
|
||||||
if (config.position.fixed_position) {
|
if (config.position.fixed_position) {
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
|
||||||
LOG_WARN("Using fixed altitude\n");
|
|
||||||
#endif
|
|
||||||
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
||||||
return node->position.altitude;
|
return node->position.altitude;
|
||||||
} else {
|
} else {
|
||||||
@@ -94,8 +85,8 @@ class GPSStatus : public Status
|
|||||||
|
|
||||||
bool matches(const GPSStatus *newStatus) const
|
bool matches(const GPSStatus *newStatus) const
|
||||||
{
|
{
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
#ifdef GPS_DEBUG
|
||||||
LOG_DEBUG("GPSStatus.match() new pos@%x to old pos@%x\n", newStatus->p.timestamp, p.timestamp);
|
LOG_DEBUG("GPSStatus.match() new pos@%x to old pos@%x", newStatus->p.timestamp, p.timestamp);
|
||||||
#endif
|
#endif
|
||||||
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected ||
|
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected ||
|
||||||
newStatus->isPowerSaving != isPowerSaving || newStatus->p.latitude_i != p.latitude_i ||
|
newStatus->isPowerSaving != isPowerSaving || newStatus->p.latitude_i != p.latitude_i ||
|
||||||
@@ -112,7 +103,7 @@ class GPSStatus : public Status
|
|||||||
|
|
||||||
if (isDirty && p.timestamp && (newStatus->p.timestamp == p.timestamp)) {
|
if (isDirty && p.timestamp && (newStatus->p.timestamp == p.timestamp)) {
|
||||||
// We can NEVER be in two locations at the same time! (also PR #886)
|
// We can NEVER be in two locations at the same time! (also PR #886)
|
||||||
LOG_ERROR("BUG: Positional timestamp unchanged from prev solution\n");
|
LOG_ERROR("BUG: Positional timestamp unchanged from prev solution");
|
||||||
}
|
}
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
@@ -124,11 +115,11 @@ class GPSStatus : public Status
|
|||||||
if (isDirty) {
|
if (isDirty) {
|
||||||
if (hasLock) {
|
if (hasLock) {
|
||||||
// In debug logs, identify position by @timestamp:stage (stage 3 = notify)
|
// In debug logs, identify position by @timestamp:stage (stage 3 = notify)
|
||||||
LOG_DEBUG("New GPS pos@%x:3 lat=%f lon=%f alt=%d pdop=%.2f track=%.2f speed=%.2f sats=%d\n", p.timestamp,
|
LOG_DEBUG("New GPS pos@%x:3 lat=%f lon=%f alt=%d pdop=%.2f track=%.2f speed=%.2f sats=%d", p.timestamp,
|
||||||
p.latitude_i * 1e-7, p.longitude_i * 1e-7, p.altitude, p.PDOP * 1e-2, p.ground_track * 1e-5,
|
p.latitude_i * 1e-7, p.longitude_i * 1e-7, p.altitude, p.PDOP * 1e-2, p.ground_track * 1e-5,
|
||||||
p.ground_speed * 1e-2, p.sats_in_view);
|
p.ground_speed * 1e-2, p.sats_in_view);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("No GPS lock\n");
|
LOG_DEBUG("No GPS lock");
|
||||||
}
|
}
|
||||||
onNewStatus.notifyObservers(this);
|
onNewStatus.notifyObservers(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ void GpioVirtPin::set(bool value)
|
|||||||
|
|
||||||
void GpioHwPin::set(bool value)
|
void GpioHwPin::set(bool value)
|
||||||
{
|
{
|
||||||
// if (num == 3) LOG_DEBUG("Setting pin %d to %d\n", num, value);
|
|
||||||
pinMode(num, OUTPUT);
|
pinMode(num, OUTPUT);
|
||||||
digitalWrite(num, value);
|
digitalWrite(num, value);
|
||||||
}
|
}
|
||||||
@@ -66,7 +65,7 @@ GpioBinaryTransformer::GpioBinaryTransformer(GpioVirtPin *inPin1, GpioVirtPin *i
|
|||||||
assert(!inPin2->dependentPin); // We only allow one dependent pin
|
assert(!inPin2->dependentPin); // We only allow one dependent pin
|
||||||
inPin2->dependentPin = this;
|
inPin2->dependentPin = this;
|
||||||
|
|
||||||
// Don't update at construction time, because various GpioPins might be global constructor based not yet initied because
|
// Don't update at construction time, because various GpioPins might be global constructor based not yet initiated because
|
||||||
// order of operations for global constructors is not defined.
|
// order of operations for global constructors is not defined.
|
||||||
// update();
|
// update();
|
||||||
}
|
}
|
||||||
@@ -88,7 +87,6 @@ void GpioBinaryTransformer::update()
|
|||||||
newValue = (GpioVirtPin::PinState)(p1 && p2);
|
newValue = (GpioVirtPin::PinState)(p1 && p2);
|
||||||
break;
|
break;
|
||||||
case Or:
|
case Or:
|
||||||
// LOG_DEBUG("Doing GPIO OR\n");
|
|
||||||
newValue = (GpioVirtPin::PinState)(p1 || p2);
|
newValue = (GpioVirtPin::PinState)(p1 || p2);
|
||||||
break;
|
break;
|
||||||
case Xor:
|
case Xor:
|
||||||
@@ -101,4 +99,4 @@ void GpioBinaryTransformer::update()
|
|||||||
set(newValue);
|
set(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
GpioSplitter::GpioSplitter(GpioPin *outPin1, GpioPin *outPin2) : outPin1(outPin1), outPin2(outPin2) {}
|
GpioSplitter::GpioSplitter(GpioPin *outPin1, GpioPin *outPin2) : outPin1(outPin1), outPin2(outPin2) {}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class NodeStatus : public Status
|
|||||||
numTotal = newStatus->getNumTotal();
|
numTotal = newStatus->getNumTotal();
|
||||||
}
|
}
|
||||||
if (isDirty || newStatus->forceUpdate) {
|
if (isDirty || newStatus->forceUpdate) {
|
||||||
LOG_DEBUG("Node status update: %d online, %d total\n", numOnline, numTotal);
|
LOG_DEBUG("Node status update: %d online, %d total", numOnline, numTotal);
|
||||||
onNewStatus.notifyObservers(this);
|
onNewStatus.notifyObservers(this);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
212
src/Power.cpp
@@ -13,6 +13,7 @@
|
|||||||
#include "power.h"
|
#include "power.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
|
#include "Throttle.h"
|
||||||
#include "buzz/buzz.h"
|
#include "buzz/buzz.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
#if HAS_WIFI
|
#if HAS_WIFI
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DELAY_FOREVER
|
#ifndef DELAY_FOREVER
|
||||||
@@ -75,6 +77,15 @@ INA219Sensor ina219Sensor;
|
|||||||
INA3221Sensor ina3221Sensor;
|
INA3221Sensor ina3221Sensor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||||
|
#include "modules/Telemetry/Sensor/MAX17048Sensor.h"
|
||||||
|
#include <utility>
|
||||||
|
extern std::pair<uint8_t, TwoWire *> nodeTelemetrySensorsMap[_meshtastic_TelemetrySensorType_MAX + 1];
|
||||||
|
#if HAS_TELEMETRY && (!MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR || !MESHTASTIC_EXCLUDE_POWER_TELEMETRY)
|
||||||
|
MAX17048Sensor max17048Sensor;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_RAKPROT && !defined(ARCH_PORTDUINO)
|
#if HAS_RAKPROT && !defined(ARCH_PORTDUINO)
|
||||||
RAK9154Sensor rak9154Sensor;
|
RAK9154Sensor rak9154Sensor;
|
||||||
#endif
|
#endif
|
||||||
@@ -136,14 +147,23 @@ using namespace meshtastic;
|
|||||||
*/
|
*/
|
||||||
static HasBatteryLevel *batteryLevel; // Default to NULL for no battery level sensor
|
static HasBatteryLevel *batteryLevel; // Default to NULL for no battery level sensor
|
||||||
|
|
||||||
|
#ifdef BATTERY_PIN
|
||||||
|
|
||||||
static void adcEnable()
|
static void adcEnable()
|
||||||
{
|
{
|
||||||
#ifdef ADC_CTRL // enable adc voltage divider when we need to read
|
#ifdef ADC_CTRL // enable adc voltage divider when we need to read
|
||||||
#ifdef ADC_USE_PULLUP
|
#ifdef ADC_USE_PULLUP
|
||||||
pinMode(ADC_CTRL, INPUT_PULLUP);
|
pinMode(ADC_CTRL, INPUT_PULLUP);
|
||||||
|
#else
|
||||||
|
#ifdef HELTEC_V3
|
||||||
|
pinMode(ADC_CTRL, INPUT);
|
||||||
|
uint8_t adc_ctl_enable_value = !(digitalRead(ADC_CTRL));
|
||||||
|
pinMode(ADC_CTRL, OUTPUT);
|
||||||
|
digitalWrite(ADC_CTRL, adc_ctl_enable_value);
|
||||||
#else
|
#else
|
||||||
pinMode(ADC_CTRL, OUTPUT);
|
pinMode(ADC_CTRL, OUTPUT);
|
||||||
digitalWrite(ADC_CTRL, ADC_CTRL_ENABLED);
|
digitalWrite(ADC_CTRL, ADC_CTRL_ENABLED);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
delay(10);
|
delay(10);
|
||||||
#endif
|
#endif
|
||||||
@@ -154,17 +174,24 @@ static void adcDisable()
|
|||||||
#ifdef ADC_CTRL // disable adc voltage divider when we need to read
|
#ifdef ADC_CTRL // disable adc voltage divider when we need to read
|
||||||
#ifdef ADC_USE_PULLUP
|
#ifdef ADC_USE_PULLUP
|
||||||
pinMode(ADC_CTRL, INPUT_PULLDOWN);
|
pinMode(ADC_CTRL, INPUT_PULLDOWN);
|
||||||
|
#else
|
||||||
|
#ifdef HELTEC_V3
|
||||||
|
pinMode(ADC_CTRL, ANALOG);
|
||||||
#else
|
#else
|
||||||
digitalWrite(ADC_CTRL, !ADC_CTRL_ENABLED);
|
digitalWrite(ADC_CTRL, !ADC_CTRL_ENABLED);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple battery level sensor that assumes the battery voltage is attached via a voltage-divider to an analog input
|
* A simple battery level sensor that assumes the battery voltage is attached via a voltage-divider to an analog input
|
||||||
*/
|
*/
|
||||||
class AnalogBatteryLevel : public HasBatteryLevel
|
class AnalogBatteryLevel : public HasBatteryLevel
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
/**
|
/**
|
||||||
* Battery state of charge, from 0 to 100 or -1 for unknown
|
* Battery state of charge, from 0 to 100 or -1 for unknown
|
||||||
*/
|
*/
|
||||||
@@ -224,7 +251,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("Using INA on I2C addr 0x%x for device battery voltage\n", config.power.device_battery_ina_address);
|
|
||||||
return getINAVoltage();
|
return getINAVoltage();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -244,7 +270,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 (millis() - 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;
|
||||||
@@ -274,7 +300,7 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
last_read_value += (scaled - last_read_value) * 0.5; // Virtual LPF
|
last_read_value += (scaled - last_read_value) * 0.5; // Virtual LPF
|
||||||
}
|
}
|
||||||
|
|
||||||
// LOG_DEBUG("battery gpio %d raw val=%u scaled=%u filtered=%u\n", BATTERY_PIN, raw, (uint32_t)(scaled), (uint32_t)
|
// LOG_DEBUG("battery gpio %d raw val=%u scaled=%u filtered=%u", BATTERY_PIN, raw, (uint32_t)(scaled), (uint32_t)
|
||||||
// (last_read_value));
|
// (last_read_value));
|
||||||
}
|
}
|
||||||
return last_read_value;
|
return last_read_value;
|
||||||
@@ -319,7 +345,7 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
raw += adc_buf;
|
raw += adc_buf;
|
||||||
raw_c++; // Count valid samples
|
raw_c++; // Count valid samples
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("An attempt to sample ADC2 failed\n");
|
LOG_DEBUG("An attempt to sample ADC2 failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,7 +370,12 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
/**
|
/**
|
||||||
* return true if there is a battery installed in this unit
|
* return true if there is a battery installed in this unit
|
||||||
*/
|
*/
|
||||||
|
// if we have a integrated device with a battery, we can assume that the battery is always connected
|
||||||
|
#ifdef BATTERY_IMMUTABLE
|
||||||
|
virtual bool isBatteryConnect() override { return true; }
|
||||||
|
#else
|
||||||
virtual bool isBatteryConnect() override { return getBatteryPercent() != -1; }
|
virtual bool isBatteryConnect() override { return getBatteryPercent() != -1; }
|
||||||
|
#endif
|
||||||
|
|
||||||
/// If we see a battery voltage higher than physics allows - assume charger is pumping
|
/// If we see a battery voltage higher than physics allows - assume charger is pumping
|
||||||
/// in power
|
/// in power
|
||||||
@@ -479,7 +510,7 @@ bool Power::analogInit()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BATTERY_PIN
|
#ifdef BATTERY_PIN
|
||||||
LOG_DEBUG("Using analog input %d for battery level\n", BATTERY_PIN);
|
LOG_DEBUG("Use analog input %d for battery level", BATTERY_PIN);
|
||||||
|
|
||||||
// disable any internal pullups
|
// disable any internal pullups
|
||||||
pinMode(BATTERY_PIN, INPUT);
|
pinMode(BATTERY_PIN, INPUT);
|
||||||
@@ -510,18 +541,18 @@ bool Power::analogInit()
|
|||||||
esp_adc_cal_value_t val_type = esp_adc_cal_characterize(unit, atten, width, DEFAULT_VREF, adc_characs);
|
esp_adc_cal_value_t val_type = esp_adc_cal_characterize(unit, atten, width, DEFAULT_VREF, adc_characs);
|
||||||
// show ADC characterization base
|
// show ADC characterization base
|
||||||
if (val_type == ESP_ADC_CAL_VAL_EFUSE_TP) {
|
if (val_type == ESP_ADC_CAL_VAL_EFUSE_TP) {
|
||||||
LOG_INFO("ADCmod: ADC characterization based on Two Point values stored in eFuse\n");
|
LOG_INFO("ADC config based on Two Point values stored in eFuse");
|
||||||
} else if (val_type == ESP_ADC_CAL_VAL_EFUSE_VREF) {
|
} else if (val_type == ESP_ADC_CAL_VAL_EFUSE_VREF) {
|
||||||
LOG_INFO("ADCmod: ADC characterization based on reference voltage stored in eFuse\n");
|
LOG_INFO("ADC config based on reference voltage stored in eFuse");
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32S3
|
#ifdef CONFIG_IDF_TARGET_ESP32S3
|
||||||
// ESP32S3
|
// ESP32S3
|
||||||
else if (val_type == ESP_ADC_CAL_VAL_EFUSE_TP_FIT) {
|
else if (val_type == ESP_ADC_CAL_VAL_EFUSE_TP_FIT) {
|
||||||
LOG_INFO("ADCmod: ADC Characterization based on Two Point values and fitting curve coefficients stored in eFuse\n");
|
LOG_INFO("ADC config based on Two Point values and fitting curve coefficients stored in eFuse");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
LOG_INFO("ADCmod: ADC characterization based on default reference voltage\n");
|
LOG_INFO("ADC config based on default reference voltage");
|
||||||
}
|
}
|
||||||
#endif // ARCH_ESP32
|
#endif // ARCH_ESP32
|
||||||
|
|
||||||
@@ -551,7 +582,12 @@ bool Power::analogInit()
|
|||||||
*/
|
*/
|
||||||
bool Power::setup()
|
bool Power::setup()
|
||||||
{
|
{
|
||||||
bool found = axpChipInit() || analogInit();
|
// initialise one power sensor (only)
|
||||||
|
bool found = axpChipInit();
|
||||||
|
if (!found)
|
||||||
|
found = lipoInit();
|
||||||
|
if (!found)
|
||||||
|
found = analogInit();
|
||||||
|
|
||||||
#ifdef NRF_APM
|
#ifdef NRF_APM
|
||||||
found = true;
|
found = true;
|
||||||
@@ -565,9 +601,9 @@ bool Power::setup()
|
|||||||
|
|
||||||
void Power::shutdown()
|
void Power::shutdown()
|
||||||
{
|
{
|
||||||
LOG_INFO("Shutting down\n");
|
LOG_INFO("Shutting down");
|
||||||
|
|
||||||
#if defined(ARCH_NRF52) || defined(ARCH_ESP32)
|
#if defined(ARCH_NRF52) || defined(ARCH_ESP32) || defined(ARCH_RP2040)
|
||||||
#ifdef PIN_LED1
|
#ifdef PIN_LED1
|
||||||
ledOff(PIN_LED1);
|
ledOff(PIN_LED1);
|
||||||
#endif
|
#endif
|
||||||
@@ -577,7 +613,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
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -603,7 +639,7 @@ void Power::readPowerStatus()
|
|||||||
batteryChargePercent = batteryLevel->getBatteryPercent();
|
batteryChargePercent = batteryLevel->getBatteryPercent();
|
||||||
} else {
|
} else {
|
||||||
// If the AXP192 returns a percentage less than 0, the feature is either not supported or there is an error
|
// If the AXP192 returns a percentage less than 0, the feature is either not supported or there is an error
|
||||||
// In that case, we compute an estimate of the charge percent based on open circuite voltage table defined
|
// In that case, we compute an estimate of the charge percent based on open circuit voltage table defined
|
||||||
// in power.h
|
// in power.h
|
||||||
batteryChargePercent = clamp((int)(((batteryVoltageMv - (OCV[NUM_OCV_POINTS - 1] * NUM_CELLS)) * 1e2) /
|
batteryChargePercent = clamp((int)(((batteryVoltageMv - (OCV[NUM_OCV_POINTS - 1] * NUM_CELLS)) * 1e2) /
|
||||||
((OCV[0] * NUM_CELLS) - (OCV[NUM_OCV_POINTS - 1] * NUM_CELLS))),
|
((OCV[0] * NUM_CELLS) - (OCV[NUM_OCV_POINTS - 1] * NUM_CELLS))),
|
||||||
@@ -620,7 +656,7 @@ void Power::readPowerStatus()
|
|||||||
// changes.
|
// changes.
|
||||||
|
|
||||||
nrfx_power_usb_state_t nrf_usb_state = nrfx_power_usbstatus_get();
|
nrfx_power_usb_state_t nrf_usb_state = nrfx_power_usbstatus_get();
|
||||||
// LOG_DEBUG("NRF Power %d\n", nrf_usb_state);
|
// LOG_DEBUG("NRF Power %d", nrf_usb_state);
|
||||||
|
|
||||||
// If changed to DISCONNECTED
|
// If changed to DISCONNECTED
|
||||||
if (nrf_usb_state == NRFX_POWER_USB_STATE_DISCONNECTED)
|
if (nrf_usb_state == NRFX_POWER_USB_STATE_DISCONNECTED)
|
||||||
@@ -633,22 +669,22 @@ void Power::readPowerStatus()
|
|||||||
|
|
||||||
// Notify any status instances that are observing us
|
// Notify any status instances that are observing us
|
||||||
const PowerStatus powerStatus2 = PowerStatus(hasBattery, usbPowered, isCharging, batteryVoltageMv, batteryChargePercent);
|
const PowerStatus powerStatus2 = PowerStatus(hasBattery, usbPowered, isCharging, batteryVoltageMv, batteryChargePercent);
|
||||||
LOG_DEBUG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d\n", powerStatus2.getHasUSB(),
|
LOG_DEBUG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d", powerStatus2.getHasUSB(), powerStatus2.getIsCharging(),
|
||||||
powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent());
|
powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent());
|
||||||
newStatus.notifyObservers(&powerStatus2);
|
newStatus.notifyObservers(&powerStatus2);
|
||||||
#ifdef DEBUG_HEAP
|
#ifdef DEBUG_HEAP
|
||||||
if (lastheap != memGet.getFreeHeap()) {
|
if (lastheap != memGet.getFreeHeap()) {
|
||||||
LOG_DEBUG("Threads running:");
|
std::string threadlist = "Threads running:";
|
||||||
int running = 0;
|
int running = 0;
|
||||||
for (int i = 0; i < MAX_THREADS; i++) {
|
for (int i = 0; i < MAX_THREADS; i++) {
|
||||||
auto thread = concurrency::mainController.get(i);
|
auto thread = concurrency::mainController.get(i);
|
||||||
if ((thread != nullptr) && (thread->enabled)) {
|
if ((thread != nullptr) && (thread->enabled)) {
|
||||||
LOG_DEBUG(" %s", thread->ThreadName.c_str());
|
threadlist += vformat(" %s", thread->ThreadName.c_str());
|
||||||
running++;
|
running++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG_DEBUG("\n");
|
LOG_DEBUG(threadlist.c_str());
|
||||||
LOG_DEBUG("Heap status: %d/%d bytes free (%d), running %d/%d threads\n", memGet.getFreeHeap(), memGet.getHeapSize(),
|
LOG_DEBUG("Heap status: %d/%d bytes free (%d), running %d/%d threads", memGet.getFreeHeap(), memGet.getHeapSize(),
|
||||||
memGet.getFreeHeap() - lastheap, running, concurrency::mainController.size(false));
|
memGet.getFreeHeap() - lastheap, running, concurrency::mainController.size(false));
|
||||||
lastheap = memGet.getFreeHeap();
|
lastheap = memGet.getFreeHeap();
|
||||||
}
|
}
|
||||||
@@ -681,13 +717,13 @@ void Power::readPowerStatus()
|
|||||||
if (batteryLevel && powerStatus2.getHasBattery() && !powerStatus2.getHasUSB()) {
|
if (batteryLevel && powerStatus2.getHasBattery() && !powerStatus2.getHasUSB()) {
|
||||||
if (batteryLevel->getBattVoltage() < OCV[NUM_OCV_POINTS - 1]) {
|
if (batteryLevel->getBattVoltage() < OCV[NUM_OCV_POINTS - 1]) {
|
||||||
low_voltage_counter++;
|
low_voltage_counter++;
|
||||||
LOG_DEBUG("Low voltage counter: %d/10\n", low_voltage_counter);
|
LOG_DEBUG("Low voltage counter: %d/10", low_voltage_counter);
|
||||||
if (low_voltage_counter > 10) {
|
if (low_voltage_counter > 10) {
|
||||||
#ifdef ARCH_NRF52
|
#ifdef ARCH_NRF52
|
||||||
// We can't trigger deep sleep on NRF52, it's freezing the board
|
// We can't trigger deep sleep on NRF52, it's freezing the board
|
||||||
LOG_DEBUG("Low voltage detected, but not triggering deep sleep\n");
|
LOG_DEBUG("Low voltage detected, but not trigger deep sleep");
|
||||||
#else
|
#else
|
||||||
LOG_INFO("Low voltage detected, triggering deep sleep\n");
|
LOG_INFO("Low voltage detected, trigger deep sleep");
|
||||||
powerFSM.trigger(EVENT_LOW_BATTERY);
|
powerFSM.trigger(EVENT_LOW_BATTERY);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -709,12 +745,12 @@ int32_t Power::runOnce()
|
|||||||
PMU->getIrqStatus();
|
PMU->getIrqStatus();
|
||||||
|
|
||||||
if (PMU->isVbusRemoveIrq()) {
|
if (PMU->isVbusRemoveIrq()) {
|
||||||
LOG_INFO("USB unplugged\n");
|
LOG_INFO("USB unplugged");
|
||||||
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PMU->isVbusInsertIrq()) {
|
if (PMU->isVbusInsertIrq()) {
|
||||||
LOG_INFO("USB plugged In\n");
|
LOG_INFO("USB plugged In");
|
||||||
powerFSM.trigger(EVENT_POWER_CONNECTED);
|
powerFSM.trigger(EVENT_POWER_CONNECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,21 +758,21 @@ int32_t Power::runOnce()
|
|||||||
Other things we could check if we cared...
|
Other things we could check if we cared...
|
||||||
|
|
||||||
if (PMU->isBatChagerStartIrq()) {
|
if (PMU->isBatChagerStartIrq()) {
|
||||||
LOG_DEBUG("Battery start charging\n");
|
LOG_DEBUG("Battery start charging");
|
||||||
}
|
}
|
||||||
if (PMU->isBatChagerDoneIrq()) {
|
if (PMU->isBatChagerDoneIrq()) {
|
||||||
LOG_DEBUG("Battery fully charged\n");
|
LOG_DEBUG("Battery fully charged");
|
||||||
}
|
}
|
||||||
if (PMU->isBatInsertIrq()) {
|
if (PMU->isBatInsertIrq()) {
|
||||||
LOG_DEBUG("Battery inserted\n");
|
LOG_DEBUG("Battery inserted");
|
||||||
}
|
}
|
||||||
if (PMU->isBatRemoveIrq()) {
|
if (PMU->isBatRemoveIrq()) {
|
||||||
LOG_DEBUG("Battery removed\n");
|
LOG_DEBUG("Battery removed");
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
#ifndef T_WATCH_S3 // FIXME - why is this triggering on the T-Watch S3?
|
#ifndef T_WATCH_S3 // FIXME - why is this triggering on the T-Watch S3?
|
||||||
if (PMU->isPekeyLongPressIrq()) {
|
if (PMU->isPekeyLongPressIrq()) {
|
||||||
LOG_DEBUG("PEK long button press\n");
|
LOG_DEBUG("PEK long button press");
|
||||||
screen->setOn(false);
|
screen->setOn(false);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -779,22 +815,22 @@ bool Power::axpChipInit()
|
|||||||
if (!PMU) {
|
if (!PMU) {
|
||||||
PMU = new XPowersAXP2101(*w);
|
PMU = new XPowersAXP2101(*w);
|
||||||
if (!PMU->init()) {
|
if (!PMU->init()) {
|
||||||
LOG_WARN("Failed to find AXP2101 power management\n");
|
LOG_WARN("No AXP2101 power management");
|
||||||
delete PMU;
|
delete PMU;
|
||||||
PMU = NULL;
|
PMU = NULL;
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("AXP2101 PMU init succeeded, using AXP2101 PMU\n");
|
LOG_INFO("AXP2101 PMU init succeeded");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PMU) {
|
if (!PMU) {
|
||||||
PMU = new XPowersAXP192(*w);
|
PMU = new XPowersAXP192(*w);
|
||||||
if (!PMU->init()) {
|
if (!PMU->init()) {
|
||||||
LOG_WARN("Failed to find AXP192 power management\n");
|
LOG_WARN("No AXP192 power management");
|
||||||
delete PMU;
|
delete PMU;
|
||||||
PMU = NULL;
|
PMU = NULL;
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("AXP192 PMU init succeeded, using AXP192 PMU\n");
|
LOG_INFO("AXP192 PMU init succeeded");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -950,56 +986,54 @@ bool Power::axpChipInit()
|
|||||||
PMU->enableVbusVoltageMeasure();
|
PMU->enableVbusVoltageMeasure();
|
||||||
PMU->enableBattVoltageMeasure();
|
PMU->enableBattVoltageMeasure();
|
||||||
|
|
||||||
LOG_DEBUG("=======================================================================\n");
|
|
||||||
if (PMU->isChannelAvailable(XPOWERS_DCDC1)) {
|
if (PMU->isChannelAvailable(XPOWERS_DCDC1)) {
|
||||||
LOG_DEBUG("DC1 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC1) ? "+" : "-",
|
LOG_DEBUG("DC1 : %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_DCDC1) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_DCDC1));
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC1));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_DCDC2)) {
|
if (PMU->isChannelAvailable(XPOWERS_DCDC2)) {
|
||||||
LOG_DEBUG("DC2 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC2) ? "+" : "-",
|
LOG_DEBUG("DC2 : %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_DCDC2) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_DCDC2));
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC2));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_DCDC3)) {
|
if (PMU->isChannelAvailable(XPOWERS_DCDC3)) {
|
||||||
LOG_DEBUG("DC3 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC3) ? "+" : "-",
|
LOG_DEBUG("DC3 : %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_DCDC3) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_DCDC3));
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC3));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_DCDC4)) {
|
if (PMU->isChannelAvailable(XPOWERS_DCDC4)) {
|
||||||
LOG_DEBUG("DC4 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC4) ? "+" : "-",
|
LOG_DEBUG("DC4 : %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_DCDC4) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_DCDC4));
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC4));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_LDO2)) {
|
if (PMU->isChannelAvailable(XPOWERS_LDO2)) {
|
||||||
LOG_DEBUG("LDO2 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_LDO2) ? "+" : "-",
|
LOG_DEBUG("LDO2 : %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_LDO2) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_LDO2));
|
PMU->getPowerChannelVoltage(XPOWERS_LDO2));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_LDO3)) {
|
if (PMU->isChannelAvailable(XPOWERS_LDO3)) {
|
||||||
LOG_DEBUG("LDO3 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_LDO3) ? "+" : "-",
|
LOG_DEBUG("LDO3 : %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_LDO3) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_LDO3));
|
PMU->getPowerChannelVoltage(XPOWERS_LDO3));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_ALDO1)) {
|
if (PMU->isChannelAvailable(XPOWERS_ALDO1)) {
|
||||||
LOG_DEBUG("ALDO1: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO1) ? "+" : "-",
|
LOG_DEBUG("ALDO1: %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_ALDO1) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_ALDO1));
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO1));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_ALDO2)) {
|
if (PMU->isChannelAvailable(XPOWERS_ALDO2)) {
|
||||||
LOG_DEBUG("ALDO2: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO2) ? "+" : "-",
|
LOG_DEBUG("ALDO2: %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_ALDO2) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_ALDO2));
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO2));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_ALDO3)) {
|
if (PMU->isChannelAvailable(XPOWERS_ALDO3)) {
|
||||||
LOG_DEBUG("ALDO3: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO3) ? "+" : "-",
|
LOG_DEBUG("ALDO3: %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_ALDO3) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_ALDO3));
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO3));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_ALDO4)) {
|
if (PMU->isChannelAvailable(XPOWERS_ALDO4)) {
|
||||||
LOG_DEBUG("ALDO4: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO4) ? "+" : "-",
|
LOG_DEBUG("ALDO4: %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_ALDO4) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_ALDO4));
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO4));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_BLDO1)) {
|
if (PMU->isChannelAvailable(XPOWERS_BLDO1)) {
|
||||||
LOG_DEBUG("BLDO1: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_BLDO1) ? "+" : "-",
|
LOG_DEBUG("BLDO1: %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_BLDO1) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_BLDO1));
|
PMU->getPowerChannelVoltage(XPOWERS_BLDO1));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_BLDO2)) {
|
if (PMU->isChannelAvailable(XPOWERS_BLDO2)) {
|
||||||
LOG_DEBUG("BLDO2: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_BLDO2) ? "+" : "-",
|
LOG_DEBUG("BLDO2: %s Voltage:%u mV ", PMU->isPowerChannelEnable(XPOWERS_BLDO2) ? "+" : "-",
|
||||||
PMU->getPowerChannelVoltage(XPOWERS_BLDO2));
|
PMU->getPowerChannelVoltage(XPOWERS_BLDO2));
|
||||||
}
|
}
|
||||||
LOG_DEBUG("=======================================================================\n");
|
|
||||||
|
|
||||||
// We can safely ignore this approach for most (or all) boards because MCU turned off
|
// We can safely ignore this approach for most (or all) boards because MCU turned off
|
||||||
// earlier than battery discharged to 2.6V.
|
// earlier than battery discharged to 2.6V.
|
||||||
@@ -1042,4 +1076,82 @@ bool Power::axpChipInit()
|
|||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper class for an I2C MAX17048 Lipo battery sensor.
|
||||||
|
*/
|
||||||
|
class LipoBatteryLevel : public HasBatteryLevel
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
MAX17048Singleton *max17048 = nullptr;
|
||||||
|
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Init the I2C MAX17048 Lipo battery level sensor
|
||||||
|
*/
|
||||||
|
bool runOnce()
|
||||||
|
{
|
||||||
|
if (max17048 == nullptr) {
|
||||||
|
max17048 = MAX17048Singleton::GetInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
// try to start if the sensor has been detected
|
||||||
|
if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_MAX17048].first != 0) {
|
||||||
|
return max17048->runOnce(nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_MAX17048].second);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Battery state of charge, from 0 to 100 or -1 for unknown
|
||||||
|
*/
|
||||||
|
virtual int getBatteryPercent() override { return max17048->getBusBatteryPercent(); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The raw voltage of the battery in millivolts, or NAN if unknown
|
||||||
|
*/
|
||||||
|
virtual uint16_t getBattVoltage() override { return max17048->getBusVoltageMv(); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return true if there is a battery installed in this unit
|
||||||
|
*/
|
||||||
|
virtual bool isBatteryConnect() override { return max17048->isBatteryConnected(); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return true if there is an external power source detected
|
||||||
|
*/
|
||||||
|
virtual bool isVbusIn() override { return max17048->isExternallyPowered(); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return true if the battery is currently charging
|
||||||
|
*/
|
||||||
|
virtual bool isCharging() override { return max17048->isBatteryCharging(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
LipoBatteryLevel lipoLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init the Lipo battery level sensor
|
||||||
|
*/
|
||||||
|
bool Power::lipoInit()
|
||||||
|
{
|
||||||
|
bool result = lipoLevel.runOnce();
|
||||||
|
LOG_DEBUG("Power::lipoInit lipo sensor is %s", result ? "ready" : "not ready yet");
|
||||||
|
if (!result)
|
||||||
|
return false;
|
||||||
|
batteryLevel = &lipoLevel;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
/**
|
||||||
|
* The Lipo battery level sensor is unavailable - default to AnalogBatteryLevel
|
||||||
|
*/
|
||||||
|
bool Power::lipoInit()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -53,16 +53,21 @@ static bool isPowered()
|
|||||||
|
|
||||||
static void sdsEnter()
|
static void sdsEnter()
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Enter state: SDS\n");
|
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()
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Enter state: SHUTDOWN\n");
|
LOG_DEBUG("State: SHUTDOWN");
|
||||||
power->shutdown();
|
power->shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,16 +77,16 @@ static uint32_t secsSlept;
|
|||||||
|
|
||||||
static void lsEnter()
|
static void lsEnter()
|
||||||
{
|
{
|
||||||
LOG_INFO("lsEnter begin, ls_secs=%u\n", config.power.ls_secs);
|
LOG_INFO("lsEnter begin, ls_secs=%u", config.power.ls_secs);
|
||||||
screen->setOn(false);
|
screen->setOn(false);
|
||||||
secsSlept = 0; // How long have we been sleeping this time
|
secsSlept = 0; // How long have we been sleeping this time
|
||||||
|
|
||||||
// LOG_INFO("lsEnter end\n");
|
// LOG_INFO("lsEnter end");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lsIdle()
|
static void lsIdle()
|
||||||
{
|
{
|
||||||
// LOG_INFO("lsIdle begin ls_secs=%u\n", getPref_ls_secs());
|
// LOG_INFO("lsIdle begin ls_secs=%u", getPref_ls_secs());
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
|
|
||||||
@@ -105,7 +110,7 @@ static void lsIdle()
|
|||||||
wakeCause2 = doLightSleep(100); // leave led on for 1ms
|
wakeCause2 = doLightSleep(100); // leave led on for 1ms
|
||||||
|
|
||||||
secsSlept += sleepTime;
|
secsSlept += sleepTime;
|
||||||
// LOG_INFO("sleeping, flash led!\n");
|
// LOG_INFO("Sleep, flash led!");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESP_SLEEP_WAKEUP_UART:
|
case ESP_SLEEP_WAKEUP_UART:
|
||||||
@@ -137,7 +142,7 @@ static void lsIdle()
|
|||||||
} else {
|
} else {
|
||||||
// Time to stop sleeping!
|
// Time to stop sleeping!
|
||||||
ledBlink.set(false);
|
ledBlink.set(false);
|
||||||
LOG_INFO("Reached ls_secs, servicing loop()\n");
|
LOG_INFO("Reached ls_secs, service loop()");
|
||||||
powerFSM.trigger(EVENT_WAKE_TIMER);
|
powerFSM.trigger(EVENT_WAKE_TIMER);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -145,12 +150,12 @@ static void lsIdle()
|
|||||||
|
|
||||||
static void lsExit()
|
static void lsExit()
|
||||||
{
|
{
|
||||||
LOG_INFO("Exit state: LS\n");
|
LOG_INFO("Exit state: LS");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nbEnter()
|
static void nbEnter()
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Enter state: NB\n");
|
LOG_DEBUG("State: NB");
|
||||||
screen->setOn(false);
|
screen->setOn(false);
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
// Only ESP32 should turn off bluetooth
|
// Only ESP32 should turn off bluetooth
|
||||||
@@ -168,7 +173,7 @@ static void darkEnter()
|
|||||||
|
|
||||||
static void serialEnter()
|
static void serialEnter()
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Enter state: SERIAL\n");
|
LOG_DEBUG("State: SERIAL");
|
||||||
setBluetoothEnable(false);
|
setBluetoothEnable(false);
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
screen->print("Serial connected\n");
|
screen->print("Serial connected\n");
|
||||||
@@ -183,10 +188,10 @@ static void serialExit()
|
|||||||
|
|
||||||
static void powerEnter()
|
static void powerEnter()
|
||||||
{
|
{
|
||||||
// LOG_DEBUG("Enter state: POWER\n");
|
// LOG_DEBUG("State: POWER");
|
||||||
if (!isPowered()) {
|
if (!isPowered()) {
|
||||||
// If we got here, we are in the wrong state - we should be in powered, let that state ahndle things
|
// If we got here, we are in the wrong state - we should be in powered, let that state handle things
|
||||||
LOG_INFO("Loss of power in Powered\n");
|
LOG_INFO("Loss of power in Powered");
|
||||||
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
||||||
} else {
|
} else {
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
@@ -205,7 +210,7 @@ static void powerIdle()
|
|||||||
{
|
{
|
||||||
if (!isPowered()) {
|
if (!isPowered()) {
|
||||||
// If we got here, we are in the wrong state
|
// If we got here, we are in the wrong state
|
||||||
LOG_INFO("Loss of power in Powered\n");
|
LOG_INFO("Loss of power in Powered");
|
||||||
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,7 +227,7 @@ static void powerExit()
|
|||||||
|
|
||||||
static void onEnter()
|
static void onEnter()
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Enter state: ON\n");
|
LOG_DEBUG("State: ON");
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
setBluetoothEnable(true);
|
setBluetoothEnable(true);
|
||||||
}
|
}
|
||||||
@@ -230,7 +235,7 @@ static void onEnter()
|
|||||||
static void onIdle()
|
static void onIdle()
|
||||||
{
|
{
|
||||||
if (isPowered()) {
|
if (isPowered()) {
|
||||||
// If we got here, we are in the wrong state - we should be in powered, let that state ahndle things
|
// If we got here, we are in the wrong state - we should be in powered, let that state handle things
|
||||||
powerFSM.trigger(EVENT_POWER_CONNECTED);
|
powerFSM.trigger(EVENT_POWER_CONNECTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,11 +247,12 @@ static void screenPress()
|
|||||||
|
|
||||||
static void bootEnter()
|
static void bootEnter()
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Enter state: BOOT\n");
|
LOG_DEBUG("State: BOOT");
|
||||||
}
|
}
|
||||||
|
|
||||||
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");
|
||||||
@@ -264,7 +270,7 @@ void PowerFSM_setup()
|
|||||||
config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR;
|
config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR;
|
||||||
bool hasPower = isPowered();
|
bool hasPower = isPowered();
|
||||||
|
|
||||||
LOG_INFO("PowerFSM init, USB power=%d\n", hasPower ? 1 : 0);
|
LOG_INFO("PowerFSM init, USB power=%d", hasPower ? 1 : 0);
|
||||||
powerFSM.add_timed_transition(&stateBOOT, hasPower ? &statePOWER : &stateON, 3 * 1000, NULL, "boot timeout");
|
powerFSM.add_timed_transition(&stateBOOT, hasPower ? &statePOWER : &stateON, 3 * 1000, NULL, "boot timeout");
|
||||||
|
|
||||||
// wake timer expired or a packet arrived
|
// wake timer expired or a packet arrived
|
||||||
@@ -291,12 +297,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,7 +377,7 @@ 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 initiatiated through the
|
// Don't add power saving transitions if we are a power saving tracker or sensor. Sleep will be initiated through the
|
||||||
// modules
|
// modules
|
||||||
if ((isRouter || config.power.is_power_saving) && !isTrackerOrSensor) {
|
if ((isRouter || config.power.is_power_saving) && !isTrackerOrSensor) {
|
||||||
powerFSM.add_timed_transition(&stateNB, &stateLS,
|
powerFSM.add_timed_transition(&stateNB, &stateLS,
|
||||||
|
|||||||