mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-18 00:32:38 +00:00
Compare commits
1431 Commits
v1.3.32.7e
...
v2.0.14.2b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2baaad8298 | ||
|
|
2e8832babb | ||
|
|
ed155476ac | ||
|
|
61028293b8 | ||
|
|
d14bd652eb | ||
|
|
cb3d5a5748 | ||
|
|
d51aa60864 | ||
|
|
9b18d5d85f | ||
|
|
25096c5c63 | ||
|
|
f1fd41a378 | ||
|
|
ca91447c0e | ||
|
|
4a0f3f31cb | ||
|
|
f07963e802 | ||
|
|
cb8532f2df | ||
|
|
0b1e1687ae | ||
|
|
006cddd5cb | ||
|
|
4d7e3329d9 | ||
|
|
9e8342eb8f | ||
|
|
afb4d141dc | ||
|
|
19d864b5ce | ||
|
|
e8186f7dba | ||
|
|
81854a173a | ||
|
|
083dcef9d6 | ||
|
|
5f0662d47d | ||
|
|
76022b65c6 | ||
|
|
2df81810ec | ||
|
|
efa1445df4 | ||
|
|
53d096b58e | ||
|
|
4da1fb8e27 | ||
|
|
8e0dcb09e8 | ||
|
|
014946ad0e | ||
|
|
3aebb1ffb3 | ||
|
|
3b80421403 | ||
|
|
255d433ebf | ||
|
|
2c1b7840c5 | ||
|
|
e9acf413fb | ||
|
|
7c60896072 | ||
|
|
1941d196bb | ||
|
|
3120744716 | ||
|
|
2ecf273cf3 | ||
|
|
50cee4a6c8 | ||
|
|
ac6d4e33d4 | ||
|
|
4c9f0b2646 | ||
|
|
fab663d1b7 | ||
|
|
fc5e80a5cc | ||
|
|
266c61065d | ||
|
|
e2e7658789 | ||
|
|
a421edce49 | ||
|
|
3f3a4ce44c | ||
|
|
8aab63dace | ||
|
|
aac9b5db30 | ||
|
|
6f30a84afc | ||
|
|
c53c87499b | ||
|
|
cdf379616c | ||
|
|
6fdb93cd16 | ||
|
|
ab3446faed | ||
|
|
9ebe24e680 | ||
|
|
811ac15a81 | ||
|
|
51b2c431d9 | ||
|
|
6cf18b7d07 | ||
|
|
52e8dc7317 | ||
|
|
d8e644191b | ||
|
|
fdc47728af | ||
|
|
54b4b67e5c | ||
|
|
bcf24b8187 | ||
|
|
c628c70db2 | ||
|
|
7f9e638140 | ||
|
|
5a2ad03294 | ||
|
|
a584cac827 | ||
|
|
8f5338dc85 | ||
|
|
8c434c7084 | ||
|
|
88c84dd806 | ||
|
|
f9f083da51 | ||
|
|
481880872c | ||
|
|
0eaf0747f4 | ||
|
|
9a7121d8c9 | ||
|
|
cbd6a0065b | ||
|
|
50f72b0ea0 | ||
|
|
74ec5e8a5c | ||
|
|
bec0cda175 | ||
|
|
ca298d8a7d | ||
|
|
3eaa054c68 | ||
|
|
48ea836a5c | ||
|
|
fda1e29c4d | ||
|
|
836559cda1 | ||
|
|
c04980084a | ||
|
|
111ec56028 | ||
|
|
384eac9a87 | ||
|
|
6a5e0edb60 | ||
|
|
9d47f7a531 | ||
|
|
660a73d58c | ||
|
|
412fbea978 | ||
|
|
293625924d | ||
|
|
4cfedc4b57 | ||
|
|
cd57df3f4f | ||
|
|
6c41960919 | ||
|
|
48609b5bdd | ||
|
|
dad8e2bf6a | ||
|
|
9cda2e9058 | ||
|
|
72dad37138 | ||
|
|
ee25a488ef | ||
|
|
9046dacec8 | ||
|
|
b218ea9ec7 | ||
|
|
6f70d39bae | ||
|
|
80f259cc6c | ||
|
|
36b3bf2211 | ||
|
|
92525587e1 | ||
|
|
5189e328b6 | ||
|
|
4d4af7de59 | ||
|
|
1b932c6bbe | ||
|
|
4065fb1709 | ||
|
|
cf39628222 | ||
|
|
d7fa8fea8d | ||
|
|
db3d66544d | ||
|
|
0a2539650e | ||
|
|
d35b619063 | ||
|
|
0e51a42ce2 | ||
|
|
d5f7d741c3 | ||
|
|
cc0cccbd1b | ||
|
|
6c388e0da8 | ||
|
|
9f3c09cf40 | ||
|
|
34b2d51113 | ||
|
|
1dbd0f8dd1 | ||
|
|
0f4306158c | ||
|
|
d5a3acb83a | ||
|
|
efbdb273c3 | ||
|
|
011013ab1a | ||
|
|
49279e56d0 | ||
|
|
1cfda77356 | ||
|
|
f4779bd93f | ||
|
|
e95db927ac | ||
|
|
a4d3fa55db | ||
|
|
59ee0fb012 | ||
|
|
5831124f1d | ||
|
|
2b9f01f0e4 | ||
|
|
aca1241a7f | ||
|
|
da0440ba17 | ||
|
|
85dd606423 | ||
|
|
7e27729dae | ||
|
|
d49f19a67c | ||
|
|
5520d68b34 | ||
|
|
c33569f833 | ||
|
|
8db3f317ab | ||
|
|
a3636ae8a1 | ||
|
|
7936c7c8ae | ||
|
|
2f3f19fda7 | ||
|
|
c89ca50cc4 | ||
|
|
867e55b9e7 | ||
|
|
28b1616630 | ||
|
|
42122f3d0f | ||
|
|
f905763161 | ||
|
|
bd2b766a36 | ||
|
|
bd51cbd721 | ||
|
|
5e66dd0dad | ||
|
|
80d1a993dd | ||
|
|
e3fd17772d | ||
|
|
440b965e71 | ||
|
|
cf0fb13a12 | ||
|
|
c0166773e8 | ||
|
|
fc775012ea | ||
|
|
d7a71e46aa | ||
|
|
721f87af7e | ||
|
|
a354cebd88 | ||
|
|
97680ca730 | ||
|
|
17a2589b35 | ||
|
|
4f71ab07c9 | ||
|
|
1f6a8eae86 | ||
|
|
ab9d0ba543 | ||
|
|
e13fb9919e | ||
|
|
a3b93a4dcf | ||
|
|
6b0f18e1e4 | ||
|
|
312ef790fc | ||
|
|
713f7d5996 | ||
|
|
3985008e06 | ||
|
|
8f2155f8f9 | ||
|
|
1fc5d70221 | ||
|
|
e7d425ef6e | ||
|
|
c63536d948 | ||
|
|
9c1cfe9358 | ||
|
|
971565aed3 | ||
|
|
3a6e3464e6 | ||
|
|
0181e186ac | ||
|
|
86748bf88e | ||
|
|
5fd00b2538 | ||
|
|
5cec370cf5 | ||
|
|
fce52e16e3 | ||
|
|
0e7797f3bb | ||
|
|
81ee6dd799 | ||
|
|
49172e416e | ||
|
|
57f185c26b | ||
|
|
3a8ffe7ac2 | ||
|
|
d8b85f9a09 | ||
|
|
4d7402839e | ||
|
|
8465467aa8 | ||
|
|
2a0b8093ea | ||
|
|
96fa5dafb8 | ||
|
|
be2d3f7769 | ||
|
|
b283e526bf | ||
|
|
03c5dfc7a8 | ||
|
|
52cfd62031 | ||
|
|
c98dc4cae0 | ||
|
|
f21212dd3e | ||
|
|
0e0ccad489 | ||
|
|
9f1c77da76 | ||
|
|
7c1c49b8ab | ||
|
|
f4099261df | ||
|
|
450e7362f6 | ||
|
|
0b9c8e62ea | ||
|
|
09efbb75b1 | ||
|
|
e5d9f1f946 | ||
|
|
2400dd43b3 | ||
|
|
988d5af69b | ||
|
|
78b6916b1b | ||
|
|
9740f0a505 | ||
|
|
b64a74c0c5 | ||
|
|
d9f0dc7ea4 | ||
|
|
30ae4c2a38 | ||
|
|
d077be1496 | ||
|
|
4f26a2a74a | ||
|
|
41f9636ba3 | ||
|
|
b544163c3f | ||
|
|
6d989a29dd | ||
|
|
8914d1a184 | ||
|
|
1cfc7b800b | ||
|
|
cab5fcf5ae | ||
|
|
cad5c9b70c | ||
|
|
5867038abf | ||
|
|
42b24d4510 | ||
|
|
d750109d00 | ||
|
|
7f0a8d329f | ||
|
|
64895cc7eb | ||
|
|
52903f83e3 | ||
|
|
e0002ef2d5 | ||
|
|
021fc8235c | ||
|
|
0305c7394f | ||
|
|
bca70d10d0 | ||
|
|
1077846e8d | ||
|
|
63c8ca9ca5 | ||
|
|
523b132100 | ||
|
|
2d62cbe345 | ||
|
|
b55fe549e3 | ||
|
|
9a04aaa811 | ||
|
|
092a753a6f | ||
|
|
8a9af37d82 | ||
|
|
74e6eb34bd | ||
|
|
11f1508d85 | ||
|
|
19436b7d54 | ||
|
|
69ff724f0f | ||
|
|
3d3aba584e | ||
|
|
ef1fb877ba | ||
|
|
f1cdfd163d | ||
|
|
8364c2b147 | ||
|
|
8193215294 | ||
|
|
e73ae7cdac | ||
|
|
65aad62702 | ||
|
|
3eefd46ca1 | ||
|
|
115cb05d3b | ||
|
|
44d5c69ba8 | ||
|
|
5ccd66864b | ||
|
|
0b5cae5393 | ||
|
|
be91b08b3e | ||
|
|
c7c5671cca | ||
|
|
979d12d607 | ||
|
|
110c80d045 | ||
|
|
38a1315599 | ||
|
|
8ebe0edc5a | ||
|
|
a8f93d5f47 | ||
|
|
96c272d3d1 | ||
|
|
45e6e86ff9 | ||
|
|
f73b8661de | ||
|
|
3c5710e65b | ||
|
|
4e4a74379e | ||
|
|
41a1dfec79 | ||
|
|
1a949b7ca6 | ||
|
|
840079c25b | ||
|
|
887405cc08 | ||
|
|
d633212f70 | ||
|
|
02def448bc | ||
|
|
7baf30dcb8 | ||
|
|
e09b12ca58 | ||
|
|
1736dada7d | ||
|
|
7f3a624ee3 | ||
|
|
475c87b0e4 | ||
|
|
541f4aa998 | ||
|
|
ab6c4e61a6 | ||
|
|
6ea0963f4b | ||
|
|
259d442d8f | ||
|
|
b134f0bb46 | ||
|
|
63cf01223c | ||
|
|
2505bdbc21 | ||
|
|
d9d8c7eb74 | ||
|
|
3b19040590 | ||
|
|
14be4ee9f0 | ||
|
|
94cb100e3f | ||
|
|
f632933b93 | ||
|
|
e25d05689b | ||
|
|
5c859da4e4 | ||
|
|
6c5602e88d | ||
|
|
b4735f4224 | ||
|
|
3b9b33a5ee | ||
|
|
430908f5d6 | ||
|
|
6f6ca64cfd | ||
|
|
d0243d2cd0 | ||
|
|
796e58161d | ||
|
|
e56f17c658 | ||
|
|
b808ffa9ab | ||
|
|
506bae4a8b | ||
|
|
f6ee6265e6 | ||
|
|
7539d92857 | ||
|
|
21fff392b4 | ||
|
|
580ec590fa | ||
|
|
5c9996dfa1 | ||
|
|
34f9324766 | ||
|
|
3f988c8b69 | ||
|
|
2ac2b6d1b6 | ||
|
|
b8657158be | ||
|
|
70f5f8301b | ||
|
|
adb8d773d4 | ||
|
|
a289406863 | ||
|
|
1a3f2a8ab5 | ||
|
|
23d6b815f5 | ||
|
|
e1feb5eb30 | ||
|
|
cb8247559d | ||
|
|
28b954017f | ||
|
|
16d826d6c7 | ||
|
|
2f7c18303d | ||
|
|
b9df41c55f | ||
|
|
4801260440 | ||
|
|
606262e55d | ||
|
|
0064d18e64 | ||
|
|
6f5a6d5cb4 | ||
|
|
e0194528dd | ||
|
|
30240ac14b | ||
|
|
090e1660fe | ||
|
|
92c9b34d4f | ||
|
|
fb41b0f5c8 | ||
|
|
3f50371ff3 | ||
|
|
812b321154 | ||
|
|
815f9bfc5f | ||
|
|
86ff23d13c | ||
|
|
201b786f77 | ||
|
|
8074955841 | ||
|
|
0992093f4d | ||
|
|
6978e57991 | ||
|
|
755c0b7008 | ||
|
|
7396d0f241 | ||
|
|
220859d0aa | ||
|
|
941786669b | ||
|
|
4eb620d47b | ||
|
|
9794995d7a | ||
|
|
055146602a | ||
|
|
86d7860d86 | ||
|
|
0f2d0d1f07 | ||
|
|
ab6a5a5e07 | ||
|
|
44a33ed463 | ||
|
|
fab08b6451 | ||
|
|
d9cd3dd3e1 | ||
|
|
c75ea87f6b | ||
|
|
706ddf6e95 | ||
|
|
aec091e7aa | ||
|
|
cea8393a7f | ||
|
|
8f94463eac | ||
|
|
a0f5e44967 | ||
|
|
feb7181767 | ||
|
|
a0c1e9cdc6 | ||
|
|
7d1b6f63b5 | ||
|
|
ab6b6514cb | ||
|
|
0e6285edf2 | ||
|
|
8b58eaac20 | ||
|
|
8cbf292373 | ||
|
|
80d0b63c3a | ||
|
|
f5120a29ec | ||
|
|
efc3f4c0ee | ||
|
|
bd2bfd6822 | ||
|
|
e40625d2ad | ||
|
|
eae347ddac | ||
|
|
ae2ca1d89c | ||
|
|
34c73da886 | ||
|
|
88c3ab2636 | ||
|
|
6a5dd26907 | ||
|
|
4de557b4db | ||
|
|
d9eb9758e2 | ||
|
|
d566457f0c | ||
|
|
79ff0659c0 | ||
|
|
af9d4328eb | ||
|
|
8c66940b78 | ||
|
|
c577e09183 | ||
|
|
4a6f269b4b | ||
|
|
bbaeeb7ce9 | ||
|
|
54686905dc | ||
|
|
3cde75f97b | ||
|
|
6c84b3f01c | ||
|
|
68f6cfde0c | ||
|
|
1c8181dc75 | ||
|
|
270746e303 | ||
|
|
72f1416b30 | ||
|
|
a788f16e91 | ||
|
|
f2229e6977 | ||
|
|
05f81922e6 | ||
|
|
06be74ae7c | ||
|
|
72504a5e8b | ||
|
|
e8c034e988 | ||
|
|
aa19718ba4 | ||
|
|
088ab106dd | ||
|
|
110c3f619a | ||
|
|
d1cc503ca8 | ||
|
|
eae7f8a786 | ||
|
|
bb24b86018 | ||
|
|
d3b3a4c148 | ||
|
|
46f1cee2a8 | ||
|
|
0386af721d | ||
|
|
de6b752db8 | ||
|
|
92fd5511ec | ||
|
|
8507125e98 | ||
|
|
59ec7f31ab | ||
|
|
627b21f3f2 | ||
|
|
64cc6e0b91 | ||
|
|
779d2352bd | ||
|
|
0162db12b8 | ||
|
|
91ff7b9032 | ||
|
|
643f99f577 | ||
|
|
152288b4cc | ||
|
|
45b518baf2 | ||
|
|
24cc479f95 | ||
|
|
5fbc630061 | ||
|
|
0c65c73f90 | ||
|
|
95eca75336 | ||
|
|
0f0dbc3274 | ||
|
|
edb674759f | ||
|
|
e3d8c5c7a6 | ||
|
|
f3d6f26a28 | ||
|
|
1a0d51495d | ||
|
|
32d9a397aa | ||
|
|
60e6dc1134 | ||
|
|
06d34daeab | ||
|
|
a00187b97f | ||
|
|
ba1f68d758 | ||
|
|
d4c0977a70 | ||
|
|
1a19d71e95 | ||
|
|
21c10934fc | ||
|
|
13cca91097 | ||
|
|
b335b1c66b | ||
|
|
a42a9bf4fe | ||
|
|
cc2653bfb5 | ||
|
|
fc5bf5a68f | ||
|
|
0f7e6b8964 | ||
|
|
63d7338311 | ||
|
|
37f716d27b | ||
|
|
03bfdec1e1 | ||
|
|
0f2a835359 | ||
|
|
2a84d39e40 | ||
|
|
b14289e976 | ||
|
|
1fef6f0656 | ||
|
|
183ec2124f | ||
|
|
aeb9bfa063 | ||
|
|
b84c7ae49b | ||
|
|
61598c5942 | ||
|
|
a3a24e0216 | ||
|
|
31ec2da0e9 | ||
|
|
53da7cb036 | ||
|
|
911083c49d | ||
|
|
27a10b395f | ||
|
|
b1f3e117d1 | ||
|
|
7570cdbd22 | ||
|
|
28ff2efdef | ||
|
|
bb1a9192eb | ||
|
|
1787e2c775 | ||
|
|
470e711383 | ||
|
|
eb4f682ad1 | ||
|
|
4b63730efb | ||
|
|
c857474116 | ||
|
|
8ff5dacc3c | ||
|
|
fb89828990 | ||
|
|
c7529f9a3e | ||
|
|
dbefa71bc8 | ||
|
|
7907404028 | ||
|
|
72e17b558c | ||
|
|
628028475c | ||
|
|
05e992ad67 | ||
|
|
bba6bf387e | ||
|
|
4d32f7c5ad | ||
|
|
0dff05e881 | ||
|
|
f3c5a01daf | ||
|
|
7ca104cef6 | ||
|
|
fe95247d56 | ||
|
|
f1179d31ba | ||
|
|
c7681cb24d | ||
|
|
abe60b96f1 | ||
|
|
206520f179 | ||
|
|
97fd5cf2ab | ||
|
|
d13a095516 | ||
|
|
4dc7d92cf1 | ||
|
|
e7dbbeb606 | ||
|
|
3e892fc391 | ||
|
|
330ac3be68 | ||
|
|
3b1e34efa1 | ||
|
|
dfec37dfd0 | ||
|
|
b82ab34f85 | ||
|
|
18a2cfeda4 | ||
|
|
082aa07e7f | ||
|
|
a703ab4418 | ||
|
|
185ceac9df | ||
|
|
7c9cada50e | ||
|
|
a5ba3dd445 | ||
|
|
63838a1632 | ||
|
|
30d7f188e2 | ||
|
|
47a47f1e69 | ||
|
|
daac79f314 | ||
|
|
1864216e78 | ||
|
|
71c0cf9b9a | ||
|
|
ef87ddb798 | ||
|
|
711c748b44 | ||
|
|
6eff09a260 | ||
|
|
c5fe878a6f | ||
|
|
39948c76de | ||
|
|
10f14d27b7 | ||
|
|
5e9d722b7d | ||
|
|
b324c04097 | ||
|
|
84a9d95b1f | ||
|
|
cdd499f147 | ||
|
|
c45a85547e | ||
|
|
8815746006 | ||
|
|
32a1e8ef0d | ||
|
|
0dff4538f3 | ||
|
|
6507683909 | ||
|
|
c71e32970c | ||
|
|
fcf21da843 | ||
|
|
ab464fe038 | ||
|
|
fd546af2a5 | ||
|
|
acfbe202b6 | ||
|
|
29fb283daf | ||
|
|
51ef9b7fbe | ||
|
|
025d2264a2 | ||
|
|
b2284b2097 | ||
|
|
5f8267c956 | ||
|
|
cf783a5bae | ||
|
|
32e5ced814 | ||
|
|
605fadabcf | ||
|
|
e91ace7329 | ||
|
|
c87cd136d4 | ||
|
|
0d7d59609a | ||
|
|
75ed0e5906 | ||
|
|
8e3b500307 | ||
|
|
d6f77bf07e | ||
|
|
65e8209d51 | ||
|
|
aae5247caa | ||
|
|
2fedb6b774 | ||
|
|
02d18d4831 | ||
|
|
b70c2d088d | ||
|
|
b3c396683e | ||
|
|
f08874dd37 | ||
|
|
648054da9b | ||
|
|
70bf7c490c | ||
|
|
adbed5de95 | ||
|
|
fe989f0bff | ||
|
|
679e346bcb | ||
|
|
832439b336 | ||
|
|
71c2af04ec | ||
|
|
0f4261d02f | ||
|
|
23466d8eee | ||
|
|
8edbba2180 | ||
|
|
5417671332 | ||
|
|
35d7e11678 | ||
|
|
7a63ba827b | ||
|
|
71c163a8ee | ||
|
|
5d8e661807 | ||
|
|
24244e8474 | ||
|
|
fb4f9bdc40 | ||
|
|
668c46e0cf | ||
|
|
abf8fdb661 | ||
|
|
a28a04b7a0 | ||
|
|
cd9671650b | ||
|
|
00bc762bf1 | ||
|
|
9a065bce03 | ||
|
|
3b2b0bdc97 | ||
|
|
53cd6bdf15 | ||
|
|
edc97c1c07 | ||
|
|
6a24ef2263 | ||
|
|
50ba523fb4 | ||
|
|
a33325f90f | ||
|
|
a173b7159a | ||
|
|
91295d3772 | ||
|
|
9c1c04a8db | ||
|
|
51d0d0d779 | ||
|
|
9cdf627ae3 | ||
|
|
4b9c482384 | ||
|
|
b1ba807ec9 | ||
|
|
c844f153e1 | ||
|
|
4a2b02347f | ||
|
|
e8a05d1874 | ||
|
|
08c4e3fbd6 | ||
|
|
1c5292ac86 | ||
|
|
aa553ea5d8 | ||
|
|
a00bd59e27 | ||
|
|
f02c6c49ee | ||
|
|
e54e37a600 | ||
|
|
b95103cab0 | ||
|
|
9b43e49116 | ||
|
|
457538c8f6 | ||
|
|
da48f0704b | ||
|
|
cf8d953bba | ||
|
|
5f2b859e38 | ||
|
|
3187b5abda | ||
|
|
ce16b50d5f | ||
|
|
4295720770 | ||
|
|
4392df0676 | ||
|
|
4ec3b025f0 | ||
|
|
f4704181e9 | ||
|
|
0e04bea39e | ||
|
|
b54044fd00 | ||
|
|
08c69c09c8 | ||
|
|
681ea420c1 | ||
|
|
48ea54748f | ||
|
|
4b7627595a | ||
|
|
6299e5483b | ||
|
|
6118a966a6 | ||
|
|
1fac9ee1f2 | ||
|
|
1e06b2d51e | ||
|
|
f3a6ed9d61 | ||
|
|
f71cbb6f6e | ||
|
|
23ea22c741 | ||
|
|
8be65bb0ab | ||
|
|
57e2e75d24 | ||
|
|
29cd7568f5 | ||
|
|
581076a5a1 | ||
|
|
27401bb9b8 | ||
|
|
10837ce549 | ||
|
|
1dcd411d00 | ||
|
|
0533fd9227 | ||
|
|
5ce7ffc888 | ||
|
|
9e914de995 | ||
|
|
0cc653263e | ||
|
|
d2d2f278cf | ||
|
|
eb34a95ab7 | ||
|
|
eb1f6c0de6 | ||
|
|
8de79e8fb6 | ||
|
|
fe00f0c369 | ||
|
|
f9ee8583b0 | ||
|
|
a4d5f8c717 | ||
|
|
35c50f074b | ||
|
|
dcfa226509 | ||
|
|
a9fde30a58 | ||
|
|
7ceb52103e | ||
|
|
8da5d37888 | ||
|
|
95cc328b5c | ||
|
|
990c0119a7 | ||
|
|
144afee29e | ||
|
|
9665c08b59 | ||
|
|
20ee6a509d | ||
|
|
70d44b8838 | ||
|
|
b260c8b058 | ||
|
|
5991b59ba3 | ||
|
|
bc1fed0fb4 | ||
|
|
b23c364fc0 | ||
|
|
28b428c5a0 | ||
|
|
5bfc58ed64 | ||
|
|
e9a34fca7b | ||
|
|
6ce9734ddd | ||
|
|
d42797ffeb | ||
|
|
b5ebfa9cc3 | ||
|
|
79eff42c3c | ||
|
|
7022807fa3 | ||
|
|
50a301899e | ||
|
|
351db5f6ef | ||
|
|
09fe616ac5 | ||
|
|
2d7ff39ecc | ||
|
|
6e856efd0e | ||
|
|
c3c899bc85 | ||
|
|
916f3cac41 | ||
|
|
9b5f358823 | ||
|
|
22119c272d | ||
|
|
8d4c526d16 | ||
|
|
83aebb7a00 | ||
|
|
33cd5ce6c1 | ||
|
|
f22c2e768e | ||
|
|
3d7dea0606 | ||
|
|
263a421c4a | ||
|
|
401b92bdbb | ||
|
|
6a696af8f6 | ||
|
|
037d6c253b | ||
|
|
b6de79b21a | ||
|
|
52cf530356 | ||
|
|
861ded37db | ||
|
|
7a67388a97 | ||
|
|
4f60fad3f6 | ||
|
|
67efd8172a | ||
|
|
60fdf9fcb2 | ||
|
|
a606e9b7b5 | ||
|
|
65197a8e48 | ||
|
|
43f769ebac | ||
|
|
dff6eeb90e | ||
|
|
61ebdb3367 | ||
|
|
cd95d0865f | ||
|
|
b68a026627 | ||
|
|
68ccebafbf | ||
|
|
3737252d39 | ||
|
|
888a8d05c4 | ||
|
|
f25f902c20 | ||
|
|
a6ea5496b4 | ||
|
|
222424a80c | ||
|
|
74f31d7d68 | ||
|
|
5c59c8d701 | ||
|
|
30a87e3145 | ||
|
|
87f7a60f71 | ||
|
|
f7d8885257 | ||
|
|
77410dc3c3 | ||
|
|
d1acf02ee8 | ||
|
|
de0954f307 | ||
|
|
7da1e5c3e8 | ||
|
|
3c11e87197 | ||
|
|
b004706eff | ||
|
|
2247e71a52 | ||
|
|
8146e84200 | ||
|
|
1213ec2d57 | ||
|
|
30b6cca366 | ||
|
|
4dd140a887 | ||
|
|
87c555bde3 | ||
|
|
c4951b1236 | ||
|
|
0249eb1307 | ||
|
|
f0279e7f92 | ||
|
|
1a50181ace | ||
|
|
d77bc239c1 | ||
|
|
cb283f4c57 | ||
|
|
803858ab0a | ||
|
|
728fc8cbad | ||
|
|
ad05b91f89 | ||
|
|
671e6cde44 | ||
|
|
7a3ad0afba | ||
|
|
d9f1704e36 | ||
|
|
32223a818c | ||
|
|
31e13d4de3 | ||
|
|
815bd6321b | ||
|
|
9f9bd40343 | ||
|
|
2331226bb6 | ||
|
|
80ff118f0f | ||
|
|
d6eeda7136 | ||
|
|
fb92e498f0 | ||
|
|
bf8d8886fd | ||
|
|
a695726f2a | ||
|
|
6dc4172110 | ||
|
|
25a9ee8eb6 | ||
|
|
e122232761 | ||
|
|
b13eaee6b3 | ||
|
|
f0f5107a5d | ||
|
|
0832cc50a8 | ||
|
|
962a3d0c55 | ||
|
|
6934e0bce7 | ||
|
|
3492d64177 | ||
|
|
057109dcac | ||
|
|
12fa08007d | ||
|
|
3562d34555 | ||
|
|
3ca6f645d4 | ||
|
|
6694d31d07 | ||
|
|
d15edf1955 | ||
|
|
e1ce037550 | ||
|
|
f9c376a524 | ||
|
|
26a907444c | ||
|
|
5c214bf4d8 | ||
|
|
5151a5641e | ||
|
|
9513209b70 | ||
|
|
f1416ac9f7 | ||
|
|
631db56a44 | ||
|
|
7b378d36cc | ||
|
|
8ab269e1b3 | ||
|
|
7652253b8d | ||
|
|
9805319940 | ||
|
|
e1e607cba3 | ||
|
|
d74bcd3583 | ||
|
|
9c0483975c | ||
|
|
2fb85dc129 | ||
|
|
d641adc0fc | ||
|
|
a7a020f431 | ||
|
|
a08ac5a47e | ||
|
|
30e5706eaa | ||
|
|
16444c190d | ||
|
|
3d9633a56c | ||
|
|
c0e630522c | ||
|
|
9422d31f55 | ||
|
|
087c7c19af | ||
|
|
3476b35fca | ||
|
|
950d5defda | ||
|
|
c6f060a24f | ||
|
|
1716c4d6f9 | ||
|
|
cda7a60734 | ||
|
|
ed26ab801c | ||
|
|
8874a6e488 | ||
|
|
657ae44b6f | ||
|
|
01381057c5 | ||
|
|
3dc6ed5672 | ||
|
|
764b48e04a | ||
|
|
4c931967c7 | ||
|
|
a547a791ba | ||
|
|
176072801b | ||
|
|
b941c51cf7 | ||
|
|
8a9fd6846e | ||
|
|
a49355133c | ||
|
|
09cdc20440 | ||
|
|
1c0dfe47c8 | ||
|
|
66623693eb | ||
|
|
7c692444e5 | ||
|
|
4ccb4393c5 | ||
|
|
b2e540b114 | ||
|
|
a5d1165c54 | ||
|
|
aa321e06dd | ||
|
|
8b84ac8a6c | ||
|
|
6c07fbfc12 | ||
|
|
04a478a5ad | ||
|
|
acfa186d44 | ||
|
|
3db504c470 | ||
|
|
3e5955be44 | ||
|
|
f1afbf2c0f | ||
|
|
20c559382d | ||
|
|
a3f1c02347 | ||
|
|
f5945d429e | ||
|
|
a3eced53bb | ||
|
|
20686cc66a | ||
|
|
5608fa32f7 | ||
|
|
a0c5defda6 | ||
|
|
25a3a09d5f | ||
|
|
593301146e | ||
|
|
5715ddc361 | ||
|
|
09ddde177c | ||
|
|
ef18b173cd | ||
|
|
ac4e88e0d2 | ||
|
|
3e82cd7dd4 | ||
|
|
b1f2025558 | ||
|
|
57ca5fea81 | ||
|
|
0ce018cf97 | ||
|
|
15a8710e69 | ||
|
|
cae75dcb6d | ||
|
|
d5e2b70b71 | ||
|
|
05b9fd04c6 | ||
|
|
4650989774 | ||
|
|
bcc77efb88 | ||
|
|
39c1637030 | ||
|
|
6d3028f213 | ||
|
|
b2969b2faf | ||
|
|
d07350e4a4 | ||
|
|
12df55c3d4 | ||
|
|
85b541bfd9 | ||
|
|
a9c6d6a80c | ||
|
|
32ad8aaa4e | ||
|
|
3d8e6aead2 | ||
|
|
2747600a3a | ||
|
|
b7ef63230b | ||
|
|
b4d6c8f37b | ||
|
|
6a907348b4 | ||
|
|
18ab8749ff | ||
|
|
a1ed5cdffc | ||
|
|
760d463bf5 | ||
|
|
5ed2a4e8bb | ||
|
|
60e95ef3bd | ||
|
|
5b648be2a5 | ||
|
|
0149171e1a | ||
|
|
b24caa1e06 | ||
|
|
8fa71afb72 | ||
|
|
309a3d5396 | ||
|
|
afafb3ba32 | ||
|
|
311835a231 | ||
|
|
1f9db0a8fe | ||
|
|
d6c9327aef | ||
|
|
0091863888 | ||
|
|
051ce5e09f | ||
|
|
6146b773cf | ||
|
|
8a4341fec4 | ||
|
|
154b7d256c | ||
|
|
548b0d0b53 | ||
|
|
e59361425f | ||
|
|
713e0f4260 | ||
|
|
8a1bf8cd86 | ||
|
|
f474953b51 | ||
|
|
d5ded53f05 | ||
|
|
82bcd391cd | ||
|
|
058689709f | ||
|
|
23c9fa0b56 | ||
|
|
eb29f10634 | ||
|
|
d5a9e3114a | ||
|
|
7417729482 | ||
|
|
d5c407c098 | ||
|
|
a1256818d9 | ||
|
|
689cec14aa | ||
|
|
04225826f6 | ||
|
|
86787e60f3 | ||
|
|
0c3ec9254d | ||
|
|
c0770402ce | ||
|
|
d7c98062ce | ||
|
|
497c0b7a47 | ||
|
|
d588dde007 | ||
|
|
3de0a3adfc | ||
|
|
b7ebe03ca8 | ||
|
|
a7fb88e293 | ||
|
|
6e1b1e3ed7 | ||
|
|
a66538fe55 | ||
|
|
b2913be086 | ||
|
|
602e65d898 | ||
|
|
338c9c1e0c | ||
|
|
9fac57b713 | ||
|
|
761804b17a | ||
|
|
c47401d729 | ||
|
|
aab52f1e8d | ||
|
|
4d2e44d64b | ||
|
|
41267a42f7 | ||
|
|
568434d0fa | ||
|
|
2c1bbf1ac6 | ||
|
|
1e97dcbb4c | ||
|
|
103c82bc2c | ||
|
|
f3fee5f4fb | ||
|
|
564feadc0d | ||
|
|
f05e0f3a81 | ||
|
|
cb26bc3871 | ||
|
|
f6251eef27 | ||
|
|
a9d6ef5990 | ||
|
|
60da55d6dd | ||
|
|
05147c016c | ||
|
|
f7655f3abe | ||
|
|
62b3509009 | ||
|
|
d817889255 | ||
|
|
d4ddcdd91e | ||
|
|
0bda4c2f76 | ||
|
|
da2279c295 | ||
|
|
be8da851a6 | ||
|
|
d4459a48b9 | ||
|
|
197bd2c3e1 | ||
|
|
d4ea9568ac | ||
|
|
97968213ff | ||
|
|
995885962d | ||
|
|
ddc1928bbb | ||
|
|
056a93f0c9 | ||
|
|
3d9845ff6d | ||
|
|
b615463981 | ||
|
|
d3540e82ff | ||
|
|
15ec8ba6a3 | ||
|
|
db12eab083 | ||
|
|
7d8c77a4b2 | ||
|
|
7c8c479b96 | ||
|
|
e29ae1cc91 | ||
|
|
089dd5b4d7 | ||
|
|
06285b599c | ||
|
|
1b6395b4e4 | ||
|
|
2236f74a55 | ||
|
|
43c9ab1faa | ||
|
|
b56f9b3b16 | ||
|
|
303396dfc3 | ||
|
|
075a53ced0 | ||
|
|
18ccb38824 | ||
|
|
c97831963b | ||
|
|
7c3dc076d2 | ||
|
|
b859347ecd | ||
|
|
ea87193c8f | ||
|
|
c1381b9ebd | ||
|
|
227cd93e67 | ||
|
|
f68f8e5547 | ||
|
|
943e6f02d4 | ||
|
|
01298a7b01 | ||
|
|
46aee8274f | ||
|
|
f76a2eeb9e | ||
|
|
3b7c0be842 | ||
|
|
49378a9145 | ||
|
|
139f61d03e | ||
|
|
f10d04591d | ||
|
|
e65d9e8ccd | ||
|
|
1fc3c0af70 | ||
|
|
e4751e34ae | ||
|
|
e922169e72 | ||
|
|
2b851ef6ae | ||
|
|
5f4b93aba2 | ||
|
|
b66d1a5dab | ||
|
|
867525eff8 | ||
|
|
7dcc981a2c | ||
|
|
38fed8a61e | ||
|
|
31c2c8a7a3 | ||
|
|
a081d28e36 | ||
|
|
93bb4f84f9 | ||
|
|
72e04edd7f | ||
|
|
b0d05522c0 | ||
|
|
f6119639bb | ||
|
|
fc57a9daa4 | ||
|
|
d8f44d7b1b | ||
|
|
efe2e90a03 | ||
|
|
45f9dee89a | ||
|
|
cc73d2c2f2 | ||
|
|
b1f789dddd | ||
|
|
d3e9dbf6a9 | ||
|
|
44529620ad | ||
|
|
7a9673dc37 | ||
|
|
27bcf67c0c | ||
|
|
7fde56b8ac | ||
|
|
6b614a2d6a | ||
|
|
1e1509fbf5 | ||
|
|
a3e67f8e4b | ||
|
|
028b25cfe8 | ||
|
|
2555e082d6 | ||
|
|
f8fa721c72 | ||
|
|
a7e0127793 | ||
|
|
603f60d86a | ||
|
|
6febf6b17c | ||
|
|
53aaf766dd | ||
|
|
4fa8d02b08 | ||
|
|
efa423c8ad | ||
|
|
43fb0d80f1 | ||
|
|
b25ace14e5 | ||
|
|
8734751bc4 | ||
|
|
5559a1edb0 | ||
|
|
bf503354f3 | ||
|
|
7b10441a28 | ||
|
|
994e396c00 | ||
|
|
6e22ee9061 | ||
|
|
b5fb0f60b0 | ||
|
|
a7fe69ed6b | ||
|
|
7f05298172 | ||
|
|
92a2505056 | ||
|
|
aae9d2fcf6 | ||
|
|
b59e928589 | ||
|
|
1db08b3b0e | ||
|
|
2cf3c105a1 | ||
|
|
505e4e8176 | ||
|
|
49a9973548 | ||
|
|
18af9d734d | ||
|
|
3e22aafea8 | ||
|
|
434db4347b | ||
|
|
b2c3b405b1 | ||
|
|
4bc8f6a6b9 | ||
|
|
4534d17d79 | ||
|
|
f88dde2f60 | ||
|
|
f8982ddaf8 | ||
|
|
784cd8c6f1 | ||
|
|
c3ab8f12cf | ||
|
|
b5adb7babc | ||
|
|
62c809a596 | ||
|
|
d2fe4426c1 | ||
|
|
984f0ca12c | ||
|
|
9d3eba9ea4 | ||
|
|
323f81eaba | ||
|
|
13e635b74e | ||
|
|
8d0e25fd82 | ||
|
|
20eaddee58 | ||
|
|
30b1bd85d9 | ||
|
|
09cce094d1 | ||
|
|
33a208e3c4 | ||
|
|
dd4c4fba80 | ||
|
|
a17c40ad09 | ||
|
|
9d73e606ac | ||
|
|
da12360105 | ||
|
|
ee1ae627a3 | ||
|
|
137a8dcfdf | ||
|
|
b2d753ed86 | ||
|
|
6e40102f26 | ||
|
|
511fe23b8a | ||
|
|
e433895873 | ||
|
|
5572195af9 | ||
|
|
cb956cd35b | ||
|
|
b551c7738e | ||
|
|
3d45c4dbd8 | ||
|
|
8681489cb7 | ||
|
|
ed328766b2 | ||
|
|
fb852ee6eb | ||
|
|
a6ee708b90 | ||
|
|
c9398e7b8a | ||
|
|
b591e35442 | ||
|
|
e50e15dc04 | ||
|
|
d4e65d8607 | ||
|
|
63ced7da7c | ||
|
|
03868d05db | ||
|
|
186374525a | ||
|
|
f116585c2a | ||
|
|
f4945729bc | ||
|
|
a3c76232c8 | ||
|
|
5bc41118e2 | ||
|
|
9445a96b3a | ||
|
|
a5761069ca | ||
|
|
2d4bfe183c | ||
|
|
bf4115a80f | ||
|
|
b2e84dfd29 | ||
|
|
004f6fa4d6 | ||
|
|
cefd4cd647 | ||
|
|
fd2ae61e3e | ||
|
|
7cda61ca01 | ||
|
|
98e1d52eaa | ||
|
|
1d09beb8a7 | ||
|
|
d44cce2928 | ||
|
|
51b3d4d06e | ||
|
|
a17ddaa951 | ||
|
|
9bd925226c | ||
|
|
e34ada3ff1 | ||
|
|
1ec1ff0773 | ||
|
|
7f935717db | ||
|
|
5b1d3a0c51 | ||
|
|
484f340023 | ||
|
|
ab0cf025c5 | ||
|
|
b384d9ea88 | ||
|
|
bb2094c4de | ||
|
|
6708121ba6 | ||
|
|
46a9bb3f7d | ||
|
|
62498d0935 | ||
|
|
c70184fbed | ||
|
|
4d2cb45f9f | ||
|
|
e5605cc6fe | ||
|
|
f7331a2e41 | ||
|
|
838271a14f | ||
|
|
b6b23907ed | ||
|
|
b240b9a088 | ||
|
|
b3a484f1e5 | ||
|
|
f3042ddf37 | ||
|
|
54816231e9 | ||
|
|
1c168d7d62 | ||
|
|
063c4904ff | ||
|
|
fefcbb147b | ||
|
|
53d48e8f61 | ||
|
|
ce5bce5cdc | ||
|
|
3597685b23 | ||
|
|
dc097c7230 | ||
|
|
b148781e4b | ||
|
|
5d8826e8ef | ||
|
|
39a51c7fbb | ||
|
|
129edde338 | ||
|
|
93cc278eee | ||
|
|
c34198264a | ||
|
|
054b12325d | ||
|
|
0f7a126828 | ||
|
|
7ff72fb981 | ||
|
|
0fe99595a9 | ||
|
|
b2ff628cec | ||
|
|
86a3bd6db8 | ||
|
|
73a5357d0e | ||
|
|
2faf507c0d | ||
|
|
cf124d97b8 | ||
|
|
482c0766af | ||
|
|
7e5a26fde5 | ||
|
|
e85af2f732 | ||
|
|
4df81008bc | ||
|
|
803dc69ccd | ||
|
|
42308cca5b | ||
|
|
ea991a4eee | ||
|
|
04db2d4410 | ||
|
|
076c1ed2ee | ||
|
|
75aa4ea325 | ||
|
|
e54be07dc0 | ||
|
|
d439d00e25 | ||
|
|
c4bea793af | ||
|
|
b53dcb932e | ||
|
|
371428d6ab | ||
|
|
1970d0c00f | ||
|
|
1dd7aa935f | ||
|
|
6b40f9d95c | ||
|
|
b3717d0396 | ||
|
|
82ba95833b | ||
|
|
28384df702 | ||
|
|
aee06f4738 | ||
|
|
ab282765d4 | ||
|
|
5d464badc8 | ||
|
|
68282682de | ||
|
|
2696b04138 | ||
|
|
31dc37150b | ||
|
|
e66d9d0add | ||
|
|
067bde321b | ||
|
|
84ec364ac2 | ||
|
|
32990856e3 | ||
|
|
a1bd5c9ea0 | ||
|
|
51f0e7879a | ||
|
|
0bdb90d133 | ||
|
|
e98c11ff89 | ||
|
|
8f84d7089c | ||
|
|
b0712c4186 | ||
|
|
8f92383ce4 | ||
|
|
c571fc9e24 | ||
|
|
05126bc6dc | ||
|
|
de56a370c6 | ||
|
|
daf189bf4b | ||
|
|
d95ec7e6b9 | ||
|
|
ac235bcabb | ||
|
|
ab4b3a50ee | ||
|
|
7f0fb2a2b6 | ||
|
|
ade1edfdfc | ||
|
|
4723faa95f | ||
|
|
93f83b0fcb | ||
|
|
8f84f7c0a5 | ||
|
|
48e4101f1c | ||
|
|
e6bb79f4c1 | ||
|
|
0bef3464f5 | ||
|
|
3c038a8c50 | ||
|
|
b8eb751316 | ||
|
|
5332db1eca | ||
|
|
9deda962aa | ||
|
|
c53434539b | ||
|
|
7f179deaf3 | ||
|
|
da29fa139f | ||
|
|
1d8a562fd9 | ||
|
|
0dbf97afab | ||
|
|
e5720fba3e | ||
|
|
498ac00b92 | ||
|
|
226a2dfe04 | ||
|
|
7e9a233296 | ||
|
|
ae311c838e | ||
|
|
de769db3bc | ||
|
|
5fa96c7fd1 | ||
|
|
2ee0c9a67a | ||
|
|
347af0210e | ||
|
|
d8455d687c | ||
|
|
34fef4c4e7 | ||
|
|
18bb373219 | ||
|
|
2f74f9ca15 | ||
|
|
5775c390f3 | ||
|
|
80826b8712 | ||
|
|
664d18cf58 | ||
|
|
bc2cddcb11 | ||
|
|
4949bda606 | ||
|
|
b4f75ad042 | ||
|
|
af4d11e17b | ||
|
|
e8f4a8b739 | ||
|
|
fae6693f8f | ||
|
|
0646ecdec4 | ||
|
|
544c89460f | ||
|
|
15089f5b01 | ||
|
|
8ef510035d | ||
|
|
864b1f754c | ||
|
|
883a2ebac0 | ||
|
|
bbe5b2e42c | ||
|
|
1b316b111f | ||
|
|
d0720620e8 | ||
|
|
cf4947d898 | ||
|
|
b5a8efa16b | ||
|
|
b38ae783b9 | ||
|
|
cbd8346c93 | ||
|
|
c0bfb979fd | ||
|
|
7c5a36ce38 | ||
|
|
fc729b0cbb | ||
|
|
0b81a25fda | ||
|
|
011db443ba | ||
|
|
b73e240f4d | ||
|
|
6de77ee310 | ||
|
|
0a8293a2d6 | ||
|
|
d0ad5dd4cf | ||
|
|
ab342ce904 | ||
|
|
140250ef03 | ||
|
|
ed90275370 | ||
|
|
e8b28faaf1 | ||
|
|
afcc7b6a56 | ||
|
|
e27a507a28 | ||
|
|
207f701f0a | ||
|
|
dd8cb1c7fb | ||
|
|
ccf93b8c23 | ||
|
|
4c6f3ead60 | ||
|
|
2d81d359b8 | ||
|
|
1f96d5d957 | ||
|
|
033f45d4da | ||
|
|
ae2c514ee7 | ||
|
|
80ddb81fac | ||
|
|
4bc29200be | ||
|
|
55c55fb705 | ||
|
|
0e2ab75bb0 | ||
|
|
128d20b290 | ||
|
|
ad9cc40b97 | ||
|
|
e0d3ac01b0 | ||
|
|
0f87adad7b | ||
|
|
9481461145 | ||
|
|
accd23eddc | ||
|
|
7c202b6069 | ||
|
|
e93b98ff98 | ||
|
|
b1ac2cf821 | ||
|
|
bfd1fecc2a | ||
|
|
c622a9b4be | ||
|
|
ade66cd8f4 | ||
|
|
397030b5a6 | ||
|
|
adc50f40b1 | ||
|
|
32d92d9b75 | ||
|
|
18f37981bb | ||
|
|
a8711bc54a | ||
|
|
eac2613743 | ||
|
|
4a0c18c4cd | ||
|
|
e376a3a28e | ||
|
|
a6bdff53c9 | ||
|
|
b5c5483ced | ||
|
|
601422e92b | ||
|
|
dbbe5e59ae | ||
|
|
b96dd6d36d | ||
|
|
e6b6e175b8 | ||
|
|
2ff549d458 | ||
|
|
a1230500fd | ||
|
|
17db87e042 | ||
|
|
42d2986cb8 | ||
|
|
cc054a13e2 | ||
|
|
60b4dbfdcd | ||
|
|
c446a0f222 | ||
|
|
f98e96cf1b | ||
|
|
3102777a71 | ||
|
|
ed95f382cf | ||
|
|
7f18c0fb77 | ||
|
|
52e4f93760 | ||
|
|
0167304300 | ||
|
|
7aaca3d486 | ||
|
|
bf3306fbc8 | ||
|
|
e375a8460b | ||
|
|
ff88900982 | ||
|
|
7f293bfda3 | ||
|
|
99de0a76a5 | ||
|
|
47ffb9c70d | ||
|
|
1231f926ea | ||
|
|
e05e888fca | ||
|
|
03580f5be8 | ||
|
|
90dabfea30 | ||
|
|
c8d7b1aba0 | ||
|
|
6065ef3a54 | ||
|
|
86c7eefc91 | ||
|
|
f7b12f0695 | ||
|
|
0c46ad91ef | ||
|
|
96cab75ccd | ||
|
|
a7138b7213 | ||
|
|
11590e33d3 | ||
|
|
a3a92d2d13 | ||
|
|
2088036521 | ||
|
|
7d0e16d1b6 | ||
|
|
35c77ef99c | ||
|
|
9244d03cf9 | ||
|
|
a50a461675 | ||
|
|
f78911666e | ||
|
|
f1e6585726 | ||
|
|
b8f862ac46 | ||
|
|
94a572aee6 | ||
|
|
e87ecc210a | ||
|
|
a9e7a33473 | ||
|
|
5621719eef | ||
|
|
cb3010b58c | ||
|
|
a27a07956f | ||
|
|
285ba9639e | ||
|
|
f54f60c31c | ||
|
|
84e438f72f | ||
|
|
f767fd5075 | ||
|
|
8fb8212434 | ||
|
|
8d5ffb7262 | ||
|
|
70e1a208d5 | ||
|
|
9d3cac7cdb | ||
|
|
84f1edab18 | ||
|
|
221843e176 | ||
|
|
0063ae6512 | ||
|
|
1922034c44 | ||
|
|
7f586f7099 | ||
|
|
0efa1b25c5 | ||
|
|
1b25ea714d | ||
|
|
fd27a40edb | ||
|
|
1013aff9b6 | ||
|
|
d7e5eb4d22 | ||
|
|
9a03b2e49d | ||
|
|
e7831f13c5 | ||
|
|
ddc3727155 | ||
|
|
ef9bfc9104 | ||
|
|
3bb645d4fe | ||
|
|
8f99258fc4 | ||
|
|
b54073a8a1 | ||
|
|
c85e9f53c7 | ||
|
|
4cfc229e77 | ||
|
|
bbd7c5063d | ||
|
|
05df849a6d | ||
|
|
ccbc01a753 | ||
|
|
d6d936b5d2 | ||
|
|
b028af0d82 | ||
|
|
86d3759f55 | ||
|
|
aadaf332cf | ||
|
|
4dea95d03f | ||
|
|
1253abd138 | ||
|
|
80e3cee006 | ||
|
|
ca9113ad05 | ||
|
|
63c8f15d38 | ||
|
|
73a1ea59f4 | ||
|
|
97712a9dc4 | ||
|
|
20e43fcf34 | ||
|
|
f66c8572b4 | ||
|
|
64f852e3f7 | ||
|
|
ea90e4d2de | ||
|
|
dd720f2fe6 | ||
|
|
808fef7e91 | ||
|
|
70e6dc3c67 | ||
|
|
279149e40f | ||
|
|
4588995fba | ||
|
|
11ae248c5e | ||
|
|
a0a5147c42 | ||
|
|
b8aac2c5b6 | ||
|
|
de22f20876 | ||
|
|
9b5211dc65 | ||
|
|
0b4fb72d58 | ||
|
|
7e03019cc4 | ||
|
|
780f4383f4 | ||
|
|
8148f06773 | ||
|
|
d5780af362 | ||
|
|
82ed7a2084 | ||
|
|
dd5fd3744d | ||
|
|
afb5fca6e1 | ||
|
|
95d75fdfee | ||
|
|
029a6b16ba | ||
|
|
9be3099ca6 | ||
|
|
b6126e6e63 | ||
|
|
d6dfdc314e | ||
|
|
78666e9b36 | ||
|
|
3abba0ce39 | ||
|
|
2c8e030b3d | ||
|
|
eed7408f00 | ||
|
|
cabd1eb8c0 | ||
|
|
f46c11a047 | ||
|
|
cdd5e16e25 | ||
|
|
a6c9a819f8 | ||
|
|
2e72397898 | ||
|
|
f554226226 | ||
|
|
2d1897a36f | ||
|
|
fe1ed3f284 | ||
|
|
3251cd510a | ||
|
|
7d0411cd15 | ||
|
|
1d1ccd6b19 | ||
|
|
3b8566747c | ||
|
|
3cc584d855 | ||
|
|
90d3cc2ff8 | ||
|
|
d125b0ec3c | ||
|
|
5e842dd735 | ||
|
|
bbc0baa31d | ||
|
|
31788feab1 | ||
|
|
2c37be58ac | ||
|
|
836782b3c1 | ||
|
|
cfc44cd608 | ||
|
|
519f31ed60 | ||
|
|
e04d6b3f56 | ||
|
|
25c851a929 | ||
|
|
0c8fb6e27f | ||
|
|
8490bdd14e | ||
|
|
22a5cf04d3 | ||
|
|
ddc5a59ece | ||
|
|
6382f67b89 | ||
|
|
401b5d92aa | ||
|
|
572f9f9295 | ||
|
|
96ce40040c | ||
|
|
d0a1aad7d1 | ||
|
|
ab0095cb05 | ||
|
|
591ae7a803 | ||
|
|
de47cc55a0 |
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
|
*.{cmd,[cC][mM][dD]} text eol=crlf
|
||||||
|
*.{bat,[bB][aA][tT]} text eol=crlf
|
||||||
|
*.{sh,[sS][hH]} text eol=lf
|
||||||
27
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
27
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: Feature Request
|
||||||
|
description: Request a new feature
|
||||||
|
title: "[Feature Request]: "
|
||||||
|
labels: ["enhancement"]
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Thanks for your request this will not gurantee that we will implement it, but it will be reviewed.
|
||||||
|
- type: dropdown
|
||||||
|
id: soc
|
||||||
|
attributes:
|
||||||
|
label: Platform
|
||||||
|
description: What device platform will support your feature?
|
||||||
|
multiple: true
|
||||||
|
options:
|
||||||
|
- NRF52
|
||||||
|
- ESP32
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: body
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: Please provide details about your enhancement.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
41
.github/actions/setup-base/action.yml
vendored
Normal file
41
.github/actions/setup-base/action.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
name: "Setup Build Base Composite Action"
|
||||||
|
description: "Base build actions for Meshtastic Platform IO steps"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: "recursive"
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Install cppcheck
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y cppcheck
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
|
||||||
|
- name: Cache python libs
|
||||||
|
uses: actions/cache@v3
|
||||||
|
id: cache-pip # needed in if test
|
||||||
|
with:
|
||||||
|
path: ~/.cache/pip
|
||||||
|
key: ${{ runner.os }}-pip
|
||||||
|
|
||||||
|
- name: Upgrade python tools
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -U platformio adafruit-nrfutil
|
||||||
|
pip install -U meshtastic --pre
|
||||||
|
|
||||||
|
- name: Upgrade platformio
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
pio upgrade
|
||||||
61
.github/workflows/build_esp32.yml
vendored
Normal file
61
.github/workflows/build_esp32.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
name: Build ESP32
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-esp32:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- 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
|
||||||
|
|
||||||
|
- 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.bin"
|
||||||
|
target: "release/bleota.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@v3
|
||||||
|
with:
|
||||||
|
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
||||||
|
path: |
|
||||||
|
release/*.bin
|
||||||
|
release/*.elf
|
||||||
33
.github/workflows/build_nrf52.yml
vendored
Normal file
33
.github/workflows/build_nrf52.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Build NRF52
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-nrf52:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Build base
|
||||||
|
id: base
|
||||||
|
uses: ./.github/actions/setup-base
|
||||||
|
|
||||||
|
- name: Build NRF52
|
||||||
|
run: bin/build-nrf52.sh ${{ inputs.board }}
|
||||||
|
|
||||||
|
- 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@v3
|
||||||
|
with:
|
||||||
|
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
||||||
|
path: |
|
||||||
|
release/*.uf2
|
||||||
|
release/*.elf
|
||||||
|
release/*.zip
|
||||||
32
.github/workflows/build_rpi2040.yml
vendored
Normal file
32
.github/workflows/build_rpi2040.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: Build RPI2040
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-rpi2040:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Build base
|
||||||
|
id: base
|
||||||
|
uses: ./.github/actions/setup-base
|
||||||
|
|
||||||
|
- name: Build Raspberry Pi 2040
|
||||||
|
run: ./bin/build-rpi2040.sh ${{ inputs.board }}
|
||||||
|
|
||||||
|
- 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@v3
|
||||||
|
with:
|
||||||
|
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
||||||
|
path: |
|
||||||
|
release/*.uf2
|
||||||
|
release/*.elf
|
||||||
368
.github/workflows/main_matrix.yml
vendored
368
.github/workflows/main_matrix.yml
vendored
@@ -2,18 +2,17 @@ name: CI
|
|||||||
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:
|
||||||
branches: [master]
|
branches: [master, develop]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "**.md"
|
- "**.md"
|
||||||
- "**.yml"
|
|
||||||
- "version.properties"
|
- "version.properties"
|
||||||
|
|
||||||
# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
|
# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
branches: [master]
|
branches: [master, develop]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "**.md"
|
- "**.md"
|
||||||
- "**.yml"
|
#- "**.yml"
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@@ -24,57 +23,26 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- board: rak11200
|
- board: rak11200
|
||||||
- board: tlora-v2
|
|
||||||
- board: tlora-v1
|
|
||||||
- board: tlora_v1_3
|
|
||||||
- board: tlora-v2-1-1.6
|
- board: tlora-v2-1-1.6
|
||||||
- board: tbeam
|
- board: tbeam
|
||||||
- board: heltec-v1
|
|
||||||
- board: heltec-v2.0
|
|
||||||
- board: heltec-v2.1
|
- board: heltec-v2.1
|
||||||
- board: tbeam0.7
|
|
||||||
- board: meshtastic-diy-v1
|
- board: meshtastic-diy-v1
|
||||||
- board: rak4631
|
- board: rak4631
|
||||||
- board: rak4631_eink
|
|
||||||
- board: t-echo
|
- board: t-echo
|
||||||
- board: nano-g1
|
|
||||||
- board: station-g1
|
- board: station-g1
|
||||||
- board: m5stack-core
|
|
||||||
- board: m5stack-coreink
|
- board: m5stack-coreink
|
||||||
|
- board: tbeam-s3-core
|
||||||
|
- board: tlora-t3s3-v1
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
- name: Build base
|
||||||
with:
|
id: base
|
||||||
submodules: "recursive"
|
uses: ./.github/actions/setup-base
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Install cppcheck
|
- name: Trunk Check
|
||||||
run: |
|
uses: trunk-io/trunk-action@v1
|
||||||
sudo apt-get install -y cppcheck
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- name: Cache python libs
|
|
||||||
uses: actions/cache@v1
|
|
||||||
id: cache-pip # needed in if test
|
|
||||||
with:
|
|
||||||
path: ~/.cache/pip
|
|
||||||
key: ${{ runner.os }}-pip
|
|
||||||
|
|
||||||
- name: Upgrade python tools and install platformio
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U platformio
|
|
||||||
|
|
||||||
- name: Upgrade platformio
|
|
||||||
run: |
|
|
||||||
pio upgrade
|
|
||||||
|
|
||||||
- name: Check ${{ matrix.board }}
|
- name: Check ${{ matrix.board }}
|
||||||
run: bin/check-all.sh ${{ matrix.board }}
|
run: bin/check-all.sh ${{ matrix.board }}
|
||||||
@@ -89,76 +57,25 @@ jobs:
|
|||||||
- board: tlora-v1
|
- board: tlora-v1
|
||||||
- board: tlora_v1_3
|
- board: tlora_v1_3
|
||||||
- board: tlora-v2-1-1.6
|
- board: tlora-v2-1-1.6
|
||||||
|
- board: tlora-v2-1-1.8
|
||||||
- board: tbeam
|
- board: tbeam
|
||||||
- board: heltec-v1
|
- board: heltec-v1
|
||||||
- board: heltec-v2.0
|
- board: heltec-v2.0
|
||||||
- board: heltec-v2.1
|
- board: heltec-v2.1
|
||||||
|
- board: heltec-v3
|
||||||
|
- board: heltec-wsl-v3
|
||||||
- board: tbeam0.7
|
- board: tbeam0.7
|
||||||
- board: meshtastic-diy-v1
|
- board: meshtastic-diy-v1
|
||||||
|
- board: meshtastic-dr-dev
|
||||||
- board: nano-g1
|
- board: nano-g1
|
||||||
- board: station-g1
|
- board: station-g1
|
||||||
- board: m5stack-core
|
- board: m5stack-core
|
||||||
- board: m5stack-coreink
|
- board: m5stack-coreink
|
||||||
|
- board: tbeam-s3-core
|
||||||
runs-on: ubuntu-latest
|
- board: tlora-t3s3-v1
|
||||||
steps:
|
uses: ./.github/workflows/build_esp32.yml
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
board: ${{ matrix.board }}
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- name: Cache python libs
|
|
||||||
uses: actions/cache@v1
|
|
||||||
id: cache-pip # needed in if test
|
|
||||||
with:
|
|
||||||
path: ~/.cache/pip
|
|
||||||
key: ${{ runner.os }}-pip
|
|
||||||
|
|
||||||
- name: Upgrade python tools
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U platformio adafruit-nrfutil littlefs-python
|
|
||||||
pip install -U --pre meshtastic
|
|
||||||
|
|
||||||
- name: Upgrade platformio
|
|
||||||
run: |
|
|
||||||
pio upgrade
|
|
||||||
|
|
||||||
- name: Pull web ui
|
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
|
||||||
with:
|
|
||||||
repo: "meshtastic/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: Build ESP32
|
|
||||||
run: bin/build-esp32.sh ${{ matrix.board }}
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: firmware-${{ matrix.board }}-${{ steps.version.outputs.version }}.zip
|
|
||||||
path: |
|
|
||||||
release/*.bin
|
|
||||||
release/*.elf
|
|
||||||
retention-days: 90
|
|
||||||
|
|
||||||
build-nrf52:
|
build-nrf52:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -170,112 +87,81 @@ jobs:
|
|||||||
- board: rak4631_eink
|
- board: rak4631_eink
|
||||||
- board: t-echo
|
- board: t-echo
|
||||||
- board: pca10059_diy_eink
|
- board: pca10059_diy_eink
|
||||||
|
- board: feather_diy
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/build_nrf52.yml
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
board: ${{ matrix.board }}
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Setup Python
|
build-rpi2040:
|
||||||
uses: actions/setup-python@v2
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
max-parallel: 2
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- board: pico
|
||||||
|
uses: ./.github/workflows/build_rpi2040.yml
|
||||||
with:
|
with:
|
||||||
python-version: 3.x
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
- name: Cache python libs
|
|
||||||
uses: actions/cache@v1
|
|
||||||
id: cache-pip # needed in if test
|
|
||||||
with:
|
|
||||||
path: ~/.cache/pip
|
|
||||||
key: ${{ runner.os }}-pip
|
|
||||||
|
|
||||||
- name: Upgrade python tools
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U platformio adafruit-nrfutil
|
|
||||||
pip install -U --pre meshtastic
|
|
||||||
|
|
||||||
- name: Upgrade platformio
|
|
||||||
run: |
|
|
||||||
pio upgrade
|
|
||||||
|
|
||||||
- name: Build NRF52
|
|
||||||
run: bin/build-nrf52.sh ${{ matrix.board }}
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: firmware-${{ matrix.board }}-${{ steps.version.outputs.version }}.zip
|
|
||||||
path: |
|
|
||||||
release/*.uf2
|
|
||||||
release/*.elf
|
|
||||||
retention-days: 90
|
|
||||||
|
|
||||||
build-native:
|
build-native:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
- name: Build base
|
||||||
with:
|
id: base
|
||||||
submodules: "recursive"
|
uses: ./.github/actions/setup-base
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- name: Cache python libs
|
|
||||||
uses: actions/cache@v1
|
|
||||||
id: cache-pip # needed in if test
|
|
||||||
with:
|
|
||||||
path: ~/.cache/pip
|
|
||||||
key: ${{ runner.os }}-pip
|
|
||||||
|
|
||||||
- name: Upgrade python tools
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U platformio adafruit-nrfutil
|
|
||||||
pip install -U --pre meshtastic
|
|
||||||
|
|
||||||
- name: Upgrade platformio
|
|
||||||
run: |
|
|
||||||
pio upgrade
|
|
||||||
|
|
||||||
# We now run integration test before other build steps (to quickly see runtime failures)
|
# We now run integration test before other build steps (to quickly see runtime failures)
|
||||||
- name: Build for native
|
#- name: Build for native
|
||||||
run: platformio run -e native
|
# run: platformio run -e native
|
||||||
- name: Integration test
|
#- name: Integration test
|
||||||
run: |
|
# run: |
|
||||||
.pio/build/native/program &
|
#.pio/build/native/program
|
||||||
sleep 20 # 5 seconds was not enough
|
#& sleep 20 # 5 seconds was not enough
|
||||||
echo "Simulator started, launching python test..."
|
#echo "Simulator started, launching python test..."
|
||||||
python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
|
#python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
|
||||||
|
|
||||||
- name: Build Native
|
- name: Build Native
|
||||||
run: bin/build-native.sh
|
run: bin/build-native.sh
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
|
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
- name: Store binaries as an artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: firmware-native-${{ steps.version.outputs.version }}.zip
|
name: firmware-native-${{ steps.version.outputs.version }}.zip
|
||||||
path: |
|
path: |
|
||||||
release/meshtasticd_linux_amd64
|
|
||||||
release/device-*.sh
|
release/device-*.sh
|
||||||
release/device-*.bat
|
release/device-*.bat
|
||||||
retention-days: 90
|
|
||||||
|
- name: Docker login
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: meshtastic
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
|
- name: Docker setup
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Docker build and push tagged versions
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: meshtastic/device-simulator:${{ steps.version.outputs.version }}
|
||||||
|
|
||||||
|
- name: Docker build and push
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: meshtastic/device-simulator:latest
|
||||||
|
|
||||||
after-checks:
|
after-checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -289,7 +175,7 @@ jobs:
|
|||||||
|
|
||||||
gather-artifacts:
|
gather-artifacts:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build-esp32, build-nrf52, build-native]
|
needs: [build-esp32, build-nrf52, build-native, build-rpi2040]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -297,30 +183,30 @@ jobs:
|
|||||||
ref: ${{github.event.pull_request.head.ref}}
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: ./
|
path: ./
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
|
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Move files up
|
- name: Move files up
|
||||||
run: mv -b -t ./ ./*tbeam-*/littlefs*.bin ./*tbeam-*/system-info.bin ./**/firmware*.bin ./**/*.uf2 ./**/*.elf ./**/meshtasticd_linux_amd64 ./*native*/*device-*.sh ./*native*/*device-*.bat
|
run: mv -b -t ./ ./*tbeam-2*/littlefs*.bin ./*tbeam-2*/bleota.bin ./**/firmware*.bin ./*t-echo*/Meshtastic_nRF52_factory_erase.uf2 ./**/firmware-*.uf2 ./**/firmware-*-ota.zip ./**/*.elf ./*native*/*device-*.sh ./*native*/*device-*.bat
|
||||||
|
|
||||||
- name: Repackage in single firmware zip
|
- name: Repackage in single firmware zip
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: firmware-${{ steps.version.outputs.version }}
|
name: firmware-${{ steps.version.outputs.version }}
|
||||||
path: |
|
path: |
|
||||||
./*.bin
|
./*.bin
|
||||||
./*.uf2
|
./*.uf2
|
||||||
./meshtasticd_linux_amd64
|
./firmware-*-ota.zip
|
||||||
./device-*.sh
|
./device-*.sh
|
||||||
./device-*.bat
|
./device-*.bat
|
||||||
retention-days: 90
|
retention-days: 90
|
||||||
|
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: firmware-${{ steps.version.outputs.version }}
|
name: firmware-${{ steps.version.outputs.version }}
|
||||||
path: ./output
|
path: ./output
|
||||||
@@ -329,15 +215,20 @@ jobs:
|
|||||||
- name: Show artifacts
|
- name: Show artifacts
|
||||||
run: ls -lR
|
run: ls -lR
|
||||||
|
|
||||||
|
- name: Device scripts permissions
|
||||||
|
run: |
|
||||||
|
chmod +x ./output/device-install.sh
|
||||||
|
chmod +x ./output/device-update.sh
|
||||||
|
|
||||||
- name: Zip firmware
|
- name: Zip firmware
|
||||||
run: zip -j -r ./firmware-${{ steps.version.outputs.version }}.zip ./output
|
run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
- name: Repackage in single elfs zip
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: debug-elfs-${{ steps.version.outputs.version }}.zip
|
name: debug-elfs-${{ steps.version.outputs.version }}.zip
|
||||||
path: ./*.elf
|
path: ./*.elf
|
||||||
retention-days: 90
|
retention-days: 30
|
||||||
|
|
||||||
- name: Create request artifacts
|
- name: Create request artifacts
|
||||||
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
|
||||||
@@ -350,3 +241,88 @@ jobs:
|
|||||||
artifacts-branch: device
|
artifacts-branch: device
|
||||||
artifacts-dir: pr
|
artifacts-dir: pr
|
||||||
artifacts: ./firmware-${{ steps.version.outputs.version }}.zip
|
artifacts: ./firmware-${{ steps.version.outputs.version }}.zip
|
||||||
|
|
||||||
|
release-artifacts:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
needs: [gather-artifacts, after-checks]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
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@v3
|
||||||
|
with:
|
||||||
|
name: firmware-${{ steps.version.outputs.version }}
|
||||||
|
path: ./output
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: debug-elfs-${{ steps.version.outputs.version }}.zip
|
||||||
|
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
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
id: create_release
|
||||||
|
with:
|
||||||
|
draft: true
|
||||||
|
prerelease: true
|
||||||
|
release_name: Meshtastic Firmware ${{ steps.version.outputs.version }}
|
||||||
|
tag_name: v${{ steps.version.outputs.version }}
|
||||||
|
body: |
|
||||||
|
Autogenerated by github action, developer should edit as required before publishing...
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Add bins to release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./firmware-${{ steps.version.outputs.version }}.zip
|
||||||
|
asset_name: firmware-${{ 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: ${{ 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: Bump version.properties
|
||||||
|
run: >-
|
||||||
|
bin/bump_version.py
|
||||||
|
|
||||||
|
- name: Create version.properties pull request
|
||||||
|
uses: peter-evans/create-pull-request@v3
|
||||||
|
with:
|
||||||
|
add-paths: |
|
||||||
|
version.properties
|
||||||
|
|||||||
19
.github/workflows/nightly.yml
vendored
Normal file
19
.github/workflows/nightly.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Nightly
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: 0 8 * * 1-5
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
trunk_check:
|
||||||
|
name: Trunk Check Upload
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Trunk Check
|
||||||
|
uses: trunk-io/trunk-action@v1
|
||||||
|
with:
|
||||||
|
trunk-token: ${{ secrets.TRUNK_TOKEN }}
|
||||||
92
.github/workflows/release.yml
vendored
92
.github/workflows/release.yml
vendored
@@ -1,92 +0,0 @@
|
|||||||
name: Make Release
|
|
||||||
on:
|
|
||||||
# Can optionally take parameters from the github UI, more info here https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/#:~:text=You%20can%20now%20create%20workflows,the%20workflow%20is%20run%20on.
|
|
||||||
workflow_dispatch:
|
|
||||||
# inputs:
|
|
||||||
|
|
||||||
# Only want to run if version.properties is bumped in master
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- "version.properties"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: "recursive"
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
# Will be available in steps.version.outputs.version
|
|
||||||
- name: Get release version string
|
|
||||||
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
|
|
||||||
id: version
|
|
||||||
# Note: we don't use caches on release builds because we don't want to accidentally not have a virgin build machine
|
|
||||||
|
|
||||||
- name: Upgrade python tools
|
|
||||||
# We actually want to run this every time
|
|
||||||
# if: steps.cache-pip.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U platformio meshtastic adafruit-nrfutil littlefs-python
|
|
||||||
|
|
||||||
- name: Upgrade platformio
|
|
||||||
run: |
|
|
||||||
pio upgrade
|
|
||||||
|
|
||||||
- name: Pull web ui
|
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
|
||||||
with:
|
|
||||||
repo: "meshtastic/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: Build everything
|
|
||||||
run: bin/build-all.sh
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
id: create_release
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
prerelease: true
|
|
||||||
release_name: ${{ steps.version.outputs.version }} alpha
|
|
||||||
tag_name: v${{ steps.version.outputs.version }}
|
|
||||||
body: |
|
|
||||||
Autogenerated by github action, developer should edit as required before publishing...
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Add bins to release
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: release/archive/firmware-${{ steps.version.outputs.version }}.zip
|
|
||||||
asset_name: firmware-${{ 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: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: release/archive/elfs-${{ steps.version.outputs.version }}.zip
|
|
||||||
asset_name: debug-elfs-${{ steps.version.outputs.version }}.zip
|
|
||||||
asset_content_type: application/zip
|
|
||||||
40
.github/workflows/sec_sast_flawfinder.yml
vendored
Normal file
40
.github/workflows/sec_sast_flawfinder.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
name: Flawfinder Scan
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master, develop]
|
||||||
|
paths-ignore:
|
||||||
|
- "**.md"
|
||||||
|
- "version.properties"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
flawfinder:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Flawfinder
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# step 1
|
||||||
|
- name: clone application source code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# step 2
|
||||||
|
- name: flawfinder_scan
|
||||||
|
uses: david-a-wheeler/flawfinder@2.0.19
|
||||||
|
with:
|
||||||
|
arguments: "--sarif ./"
|
||||||
|
output: "flawfinder_report.sarif"
|
||||||
|
|
||||||
|
# step 3
|
||||||
|
- name: save report as pipeline artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: flawfinder_report.sarif
|
||||||
|
path: flawfinder_report.sarif
|
||||||
|
|
||||||
|
# step 4
|
||||||
|
- name: publish code scanning alerts
|
||||||
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
|
with:
|
||||||
|
sarif_file: flawfinder_report.sarif
|
||||||
|
category: flawfinder
|
||||||
42
.github/workflows/sec_sast_semgrep_cron.yml
vendored
Normal file
42
.github/workflows/sec_sast_semgrep_cron.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
name: Semgrep Full Scan
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
schedule:
|
||||||
|
- cron: "0 1 * * 6"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
semgrep-full:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: returntocorp/semgrep
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# step 1
|
||||||
|
- name: clone application source code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# step 2
|
||||||
|
- name: full scan
|
||||||
|
run: |
|
||||||
|
semgrep \
|
||||||
|
--sarif --output report.sarif \
|
||||||
|
--metrics=off \
|
||||||
|
--config="p/default"
|
||||||
|
|
||||||
|
# step 3
|
||||||
|
- name: save report as pipeline artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: report.sarif
|
||||||
|
path: report.sarif
|
||||||
|
|
||||||
|
# step 4
|
||||||
|
- name: publish code scanning alerts
|
||||||
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
|
with:
|
||||||
|
sarif_file: report.sarif
|
||||||
|
category: semgrep
|
||||||
25
.github/workflows/sec_sast_semgrep_pull.yml
vendored
Normal file
25
.github/workflows/sec_sast_semgrep_pull.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
name: Semgrep Differential Scan
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
semgrep-diff:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: returntocorp/semgrep
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# step 1
|
||||||
|
- name: clone application source code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# step 2
|
||||||
|
- name: differential scan
|
||||||
|
run: |
|
||||||
|
semgrep scan \
|
||||||
|
--error \
|
||||||
|
--metrics=off \
|
||||||
|
--baseline-commit ${{ github.event.pull_request.base.sha }} \
|
||||||
|
--config="p/default"
|
||||||
6
.github/workflows/update_protobufs.yml
vendored
6
.github/workflows/update_protobufs.yml
vendored
@@ -17,9 +17,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Download nanopb
|
- name: Download nanopb
|
||||||
run: |
|
run: |
|
||||||
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.6-linux-x86.tar.gz
|
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.7-linux-x86.tar.gz
|
||||||
tar xvzf nanopb-0.4.6-linux-x86.tar.gz
|
tar xvzf nanopb-0.4.7-linux-x86.tar.gz
|
||||||
mv nanopb-0.4.6-linux-x86 nanopb-0.4.6
|
mv nanopb-0.4.7-linux-x86 nanopb-0.4.7
|
||||||
|
|
||||||
- name: Re-generate protocol buffers
|
- name: Re-generate protocol buffers
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -29,3 +29,4 @@ __pycache__
|
|||||||
|
|
||||||
venv/
|
venv/
|
||||||
release/
|
release/
|
||||||
|
.vscode/extensions.json
|
||||||
|
|||||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
|||||||
[submodule "protobufs"]
|
[submodule "protobufs"]
|
||||||
path = protobufs
|
path = protobufs
|
||||||
url = https://github.com/meshtastic/Meshtastic-protobufs.git
|
url = https://github.com/meshtastic/protobufs.git
|
||||||
|
|||||||
2
.semgrepignore
Normal file
2
.semgrepignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.github/workflows/main_matrix.yml
|
||||||
|
src/mesh/compression/unishox2.c
|
||||||
7
.trunk/.gitignore
vendored
Normal file
7
.trunk/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
*out
|
||||||
|
*logs
|
||||||
|
*actions
|
||||||
|
*notifications
|
||||||
|
plugins
|
||||||
|
user_trunk.yaml
|
||||||
|
user.yaml
|
||||||
4
.trunk/configs/.hadolint.yaml
Normal file
4
.trunk/configs/.hadolint.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Following source doesn't work in most setups
|
||||||
|
ignored:
|
||||||
|
- SC1090
|
||||||
|
- SC1091
|
||||||
10
.trunk/configs/.markdownlint.yaml
Normal file
10
.trunk/configs/.markdownlint.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Autoformatter friendly markdownlint config (all formatting rules disabled)
|
||||||
|
default: true
|
||||||
|
blank_lines: false
|
||||||
|
bullet: false
|
||||||
|
html: false
|
||||||
|
indentation: false
|
||||||
|
line_length: false
|
||||||
|
spaces: false
|
||||||
|
url: false
|
||||||
|
whitespace: false
|
||||||
7
.trunk/configs/.shellcheckrc
Normal file
7
.trunk/configs/.shellcheckrc
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
enable=all
|
||||||
|
source-path=SCRIPTDIR
|
||||||
|
disable=SC2154
|
||||||
|
|
||||||
|
# If you're having issues with shellcheck following source, disable the errors via:
|
||||||
|
# disable=SC1090
|
||||||
|
# disable=SC1091
|
||||||
14
.trunk/configs/svgo.config.js
Normal file
14
.trunk/configs/svgo.config.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: [
|
||||||
|
{
|
||||||
|
name: "preset-default",
|
||||||
|
params: {
|
||||||
|
overrides: {
|
||||||
|
removeViewBox: false, // https://github.com/svg/svgo/issues/1128
|
||||||
|
sortAttrs: true,
|
||||||
|
removeOffCanvasPaths: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
33
.trunk/trunk.yaml
Normal file
33
.trunk/trunk.yaml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
version: 0.1
|
||||||
|
cli:
|
||||||
|
version: 1.3.1
|
||||||
|
plugins:
|
||||||
|
sources:
|
||||||
|
- id: trunk
|
||||||
|
ref: v0.0.8
|
||||||
|
uri: https://github.com/trunk-io/plugins
|
||||||
|
lint:
|
||||||
|
enabled:
|
||||||
|
- git-diff-check
|
||||||
|
- gitleaks@8.15.2
|
||||||
|
- clang-format@14.0.0
|
||||||
|
- prettier@2.8.3
|
||||||
|
disabled:
|
||||||
|
- shellcheck@0.9.0
|
||||||
|
- shfmt@3.5.0
|
||||||
|
- oxipng@8.0.0
|
||||||
|
- actionlint@1.6.22
|
||||||
|
- markdownlint@0.33.0
|
||||||
|
- hadolint@2.12.0
|
||||||
|
- svgo@3.0.2
|
||||||
|
runtimes:
|
||||||
|
enabled:
|
||||||
|
- go@1.18.3
|
||||||
|
- node@18.12.1
|
||||||
|
actions:
|
||||||
|
disabled:
|
||||||
|
- trunk-announce
|
||||||
|
- trunk-check-pre-push
|
||||||
|
- trunk-fmt-pre-commit
|
||||||
|
enabled:
|
||||||
|
- trunk-upgrade-available
|
||||||
6
.vscode/extensions.json
vendored
6
.vscode/extensions.json
vendored
@@ -2,10 +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": [
|
||||||
|
"ms-vscode.cpptools",
|
||||||
"platformio.platformio-ide",
|
"platformio.platformio-ide",
|
||||||
"xaver.clang-format"
|
"trunk.io"
|
||||||
],
|
],
|
||||||
"unwantedRecommendations": [
|
|
||||||
"ms-vscode.cpptools-extension-pack"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
78
.vscode/settings.json
vendored
78
.vscode/settings.json
vendored
@@ -1,78 +1,4 @@
|
|||||||
{
|
{
|
||||||
"files.associations": {
|
"editor.formatOnSave": true,
|
||||||
"type_traits": "cpp",
|
"editor.defaultFormatter": "trunk.io"
|
||||||
"array": "cpp",
|
|
||||||
"*.tcc": "cpp",
|
|
||||||
"cctype": "cpp",
|
|
||||||
"clocale": "cpp",
|
|
||||||
"cmath": "cpp",
|
|
||||||
"cstdarg": "cpp",
|
|
||||||
"cstddef": "cpp",
|
|
||||||
"cstdint": "cpp",
|
|
||||||
"cstdio": "cpp",
|
|
||||||
"cstdlib": "cpp",
|
|
||||||
"cstring": "cpp",
|
|
||||||
"ctime": "cpp",
|
|
||||||
"cwchar": "cpp",
|
|
||||||
"cwctype": "cpp",
|
|
||||||
"deque": "cpp",
|
|
||||||
"unordered_map": "cpp",
|
|
||||||
"unordered_set": "cpp",
|
|
||||||
"vector": "cpp",
|
|
||||||
"exception": "cpp",
|
|
||||||
"algorithm": "cpp",
|
|
||||||
"functional": "cpp",
|
|
||||||
"system_error": "cpp",
|
|
||||||
"tuple": "cpp",
|
|
||||||
"fstream": "cpp",
|
|
||||||
"initializer_list": "cpp",
|
|
||||||
"iomanip": "cpp",
|
|
||||||
"iosfwd": "cpp",
|
|
||||||
"istream": "cpp",
|
|
||||||
"limits": "cpp",
|
|
||||||
"memory": "cpp",
|
|
||||||
"new": "cpp",
|
|
||||||
"ostream": "cpp",
|
|
||||||
"numeric": "cpp",
|
|
||||||
"sstream": "cpp",
|
|
||||||
"stdexcept": "cpp",
|
|
||||||
"streambuf": "cpp",
|
|
||||||
"cinttypes": "cpp",
|
|
||||||
"utility": "cpp",
|
|
||||||
"typeinfo": "cpp",
|
|
||||||
"string": "cpp",
|
|
||||||
"*.xbm": "cpp",
|
|
||||||
"list": "cpp",
|
|
||||||
"atomic": "cpp",
|
|
||||||
"memory_resource": "cpp",
|
|
||||||
"optional": "cpp",
|
|
||||||
"string_view": "cpp",
|
|
||||||
"cassert": "cpp",
|
|
||||||
"iterator": "cpp",
|
|
||||||
"shared_mutex": "cpp",
|
|
||||||
"iostream": "cpp",
|
|
||||||
"esp_nimble_hci.h": "c",
|
|
||||||
"map": "cpp"
|
|
||||||
},
|
|
||||||
"cSpell.words": [
|
|
||||||
"Blox",
|
|
||||||
"EINK",
|
|
||||||
"HFSR",
|
|
||||||
"Meshtastic",
|
|
||||||
"NEMAGPS",
|
|
||||||
"NMEAGPS",
|
|
||||||
"RDEF",
|
|
||||||
"Ublox",
|
|
||||||
"bkpt",
|
|
||||||
"cfsr",
|
|
||||||
"descs",
|
|
||||||
"ocrypto",
|
|
||||||
"protobufs",
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"C_Cpp.dimInactiveRegions": true,
|
|
||||||
"cmake.configureOnOpen": true,
|
|
||||||
"protoc": {
|
|
||||||
"compile_on_save": false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
4
.vscode/tasks.json
vendored
4
.vscode/tasks.json
vendored
@@ -4,9 +4,7 @@
|
|||||||
{
|
{
|
||||||
"type": "PlatformIO",
|
"type": "PlatformIO",
|
||||||
"task": "Build",
|
"task": "Build",
|
||||||
"problemMatcher": [
|
"problemMatcher": ["$platformio"],
|
||||||
"$platformio"
|
|
||||||
],
|
|
||||||
"group": {
|
"group": {
|
||||||
"kind": "build",
|
"kind": "build",
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
|
|||||||
41
Dockerfile
Normal file
41
Dockerfile
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
FROM debian:bullseye-slim AS builder
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV TZ=Etc/UTC
|
||||||
|
|
||||||
|
# http://bugs.python.org/issue19846
|
||||||
|
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
|
||||||
|
ENV LANG C.UTF-8
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
|
# Install build deps
|
||||||
|
USER root
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get -y install wget python3 g++ zip python3-venv git vim ca-certificates
|
||||||
|
|
||||||
|
# create a non-priveleged user & group
|
||||||
|
RUN groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh
|
||||||
|
|
||||||
|
USER mesh
|
||||||
|
RUN wget https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -qO /tmp/get-platformio.py && \
|
||||||
|
chmod +x /tmp/get-platformio.py && \
|
||||||
|
python3 /tmp/get-platformio.py && \
|
||||||
|
git clone https://github.com/meshtastic/firmware --recurse-submodules /tmp/firmware && \
|
||||||
|
cd /tmp/firmware && \
|
||||||
|
chmod +x /tmp/firmware/bin/build-native.sh && \
|
||||||
|
source ~/.platformio/penv/bin/activate && \
|
||||||
|
./bin/build-native.sh
|
||||||
|
|
||||||
|
FROM frolvlad/alpine-glibc
|
||||||
|
|
||||||
|
RUN apk --update add --no-cache g++ shadow && \
|
||||||
|
groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh
|
||||||
|
|
||||||
|
COPY --from=builder /tmp/firmware/release/meshtasticd_linux_amd64 /home/mesh/
|
||||||
|
|
||||||
|
USER mesh
|
||||||
|
WORKDIR /home/mesh
|
||||||
|
CMD sh -cx "./meshtasticd_linux_amd64 --hwid '$RANDOM'"
|
||||||
|
|
||||||
|
HEALTHCHECK NONE
|
||||||
11
README.md
11
README.md
@@ -1,8 +1,8 @@
|
|||||||
# Meshtastic Firmware
|
# Meshtastic Firmware
|
||||||
|
|
||||||

|

|
||||||
[](https://github.com/meshtastic/repo/actions/workflows/main_matrix.yml)
|
[](https://github.com/meshtastic/firmware/actions/workflows/ci.yml)
|
||||||
[](https://cla-assistant.io/meshtastic/Meshtastic-device)
|
[](https://cla-assistant.io/meshtastic/firmware)
|
||||||
[](https://opencollective.com/meshtastic/)
|
[](https://opencollective.com/meshtastic/)
|
||||||
[](https://vercel.com?utm_source=meshtastic&utm_campaign=oss)
|
[](https://vercel.com?utm_source=meshtastic&utm_campaign=oss)
|
||||||
|
|
||||||
@@ -10,10 +10,9 @@
|
|||||||
|
|
||||||
This repository contains the device firmware for the Meshtastic project.
|
This repository contains the device firmware for the Meshtastic project.
|
||||||
|
|
||||||
|
**[Building Instructions](https://meshtastic.org/docs/development/firmware/build)**
|
||||||
**[Building Instructions](https://meshtastic.org/docs/developers/Firmware/build)**
|
|
||||||
**[Flashing Instructions](https://meshtastic.org/docs/getting-started/flashing-firmware/)**
|
**[Flashing Instructions](https://meshtastic.org/docs/getting-started/flashing-firmware/)**
|
||||||
|
|
||||||
## Stats
|
## Stats
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
54
arch/esp32/esp32.ini
Normal file
54
arch/esp32/esp32.ini
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
; Common settings for ESP targes, mixin with extends = esp32_base
|
||||||
|
[esp32_base]
|
||||||
|
extends = arduino_base
|
||||||
|
platform = platformio/espressif32@^5.2.0
|
||||||
|
build_src_filter =
|
||||||
|
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040> -<mesh/eth/>
|
||||||
|
upload_speed = 921600
|
||||||
|
debug_init_break = tbreak setup
|
||||||
|
monitor_filters = esp32_exception_decoder
|
||||||
|
board_build.filesystem = littlefs
|
||||||
|
|
||||||
|
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
|
||||||
|
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
|
||||||
|
# This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h
|
||||||
|
build_flags =
|
||||||
|
${arduino_base.build_flags}
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Isrc/platform/esp32
|
||||||
|
-std=c++11
|
||||||
|
-DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG
|
||||||
|
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
||||||
|
-DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
|
||||||
|
-DAXP_DEBUG_PORT=Serial
|
||||||
|
-DCONFIG_BT_NIMBLE_ENABLED
|
||||||
|
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
||||||
|
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
||||||
|
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
||||||
|
-DDEBUG_HEAP
|
||||||
|
|
||||||
|
lib_deps =
|
||||||
|
${arduino_base.lib_deps}
|
||||||
|
${networking_base.lib_deps}
|
||||||
|
${environmental_base.lib_deps}
|
||||||
|
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||||
|
h2zero/NimBLE-Arduino@^1.4.0
|
||||||
|
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
||||||
|
caveman99/ESP32 Codec2@^1.0.1
|
||||||
|
|
||||||
|
lib_ignore =
|
||||||
|
segger_rtt
|
||||||
|
ESP32 BLE Arduino
|
||||||
|
|
||||||
|
; leave this commented out to avoid breaking Windows
|
||||||
|
;upload_port = /dev/ttyUSB0
|
||||||
|
;monitor_port = /dev/ttyUSB0
|
||||||
|
|
||||||
|
; Please don't delete these lines. JM uses them.
|
||||||
|
;upload_port = /dev/cu.SLAB_USBtoUART
|
||||||
|
;monitor_port = /dev/cu.SLAB_USBtoUART
|
||||||
|
|
||||||
|
; customize the partition table
|
||||||
|
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
||||||
|
board_build.partitions = partition-table.csv
|
||||||
47
arch/esp32/esp32s2.ini
Normal file
47
arch/esp32/esp32s2.ini
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
[esp32s2_base]
|
||||||
|
extends = arduino_base
|
||||||
|
platform = platformio/espressif32@^5.2.0
|
||||||
|
build_src_filter =
|
||||||
|
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040> -<mesh/eth/> -<nimble/>
|
||||||
|
upload_speed = 961200
|
||||||
|
monitor_speed = 115200
|
||||||
|
debug_init_break = tbreak setup
|
||||||
|
monitor_filters = esp32_exception_decoder
|
||||||
|
board_build.filesystem = littlefs
|
||||||
|
|
||||||
|
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
|
||||||
|
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
|
||||||
|
# This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h
|
||||||
|
build_flags =
|
||||||
|
${arduino_base.build_flags}
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Isrc/platform/esp32
|
||||||
|
-std=c++11
|
||||||
|
-DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG
|
||||||
|
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
||||||
|
-DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
|
||||||
|
-DAXP_DEBUG_PORT=Serial
|
||||||
|
-DCONFIG_BT_NIMBLE_ENABLED
|
||||||
|
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
||||||
|
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
||||||
|
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
||||||
|
-DHAS_BLUETOOTH=0
|
||||||
|
-DDEBUG_HEAP
|
||||||
|
|
||||||
|
lib_deps =
|
||||||
|
${arduino_base.lib_deps}
|
||||||
|
${networking_base.lib_deps}
|
||||||
|
${environmental_base.lib_deps}
|
||||||
|
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||||
|
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
||||||
|
caveman99/ESP32 Codec2@^1.0.1
|
||||||
|
|
||||||
|
lib_ignore =
|
||||||
|
segger_rtt
|
||||||
|
ESP32 BLE Arduino
|
||||||
|
|
||||||
|
; customize the partition table
|
||||||
|
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
||||||
|
board_build.partitions = partition-table.csv
|
||||||
|
|
||||||
47
arch/esp32/esp32s3.ini
Normal file
47
arch/esp32/esp32s3.ini
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
[esp32s3_base]
|
||||||
|
extends = arduino_base
|
||||||
|
platform = platformio/espressif32@^5.2.0
|
||||||
|
build_src_filter =
|
||||||
|
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040> -<mesh/eth/>
|
||||||
|
upload_speed = 961200
|
||||||
|
monitor_speed = 115200
|
||||||
|
debug_init_break = tbreak setup
|
||||||
|
monitor_filters = esp32_exception_decoder
|
||||||
|
board_build.filesystem = littlefs
|
||||||
|
|
||||||
|
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
|
||||||
|
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
|
||||||
|
# This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h
|
||||||
|
build_flags =
|
||||||
|
${arduino_base.build_flags}
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Isrc/platform/esp32
|
||||||
|
-std=c++11
|
||||||
|
-DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG
|
||||||
|
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
||||||
|
-DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
|
||||||
|
-DAXP_DEBUG_PORT=Serial
|
||||||
|
-DCONFIG_BT_NIMBLE_ENABLED
|
||||||
|
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
||||||
|
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
||||||
|
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
||||||
|
-DDEBUG_HEAP
|
||||||
|
|
||||||
|
lib_deps =
|
||||||
|
${arduino_base.lib_deps}
|
||||||
|
${networking_base.lib_deps}
|
||||||
|
${environmental_base.lib_deps}
|
||||||
|
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||||
|
h2zero/NimBLE-Arduino@^1.4.0
|
||||||
|
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
||||||
|
caveman99/ESP32 Codec2@^1.0.1
|
||||||
|
|
||||||
|
lib_ignore =
|
||||||
|
segger_rtt
|
||||||
|
ESP32 BLE Arduino
|
||||||
|
|
||||||
|
; customize the partition table
|
||||||
|
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
||||||
|
board_build.partitions = partition-table.csv
|
||||||
|
|
||||||
18
arch/nrf52/nrf52.ini
Normal file
18
arch/nrf52/nrf52.ini
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[nrf52_base]
|
||||||
|
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
|
||||||
|
platform = platformio/nordicnrf52@^9.4.0
|
||||||
|
|
||||||
|
extends = arduino_base
|
||||||
|
build_type = debug ; I'm debugging with ICE a lot now
|
||||||
|
build_flags =
|
||||||
|
${arduino_base.build_flags} -Wno-unused-variable
|
||||||
|
-Isrc/platform/nrf52
|
||||||
|
build_src_filter =
|
||||||
|
${arduino_base.build_src_filter} -<platform/esp32/> -<platform/stm32wl> -<nimble/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<mqtt/> -<platform/rp2040> -<mesh/eth/>
|
||||||
|
lib_ignore =
|
||||||
|
BluetoothOTA
|
||||||
|
|
||||||
|
; Note: By default no lora device is created for this build - it uses a simulated interface
|
||||||
|
[env:feather_nrf52832]
|
||||||
|
extends = nrf52_base
|
||||||
|
board = adafruit_feather_nrf52832
|
||||||
14
arch/nrf52/nrf52840.ini
Normal file
14
arch/nrf52/nrf52840.ini
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[nrf52840_base]
|
||||||
|
extends = nrf52_base
|
||||||
|
build_flags = ${nrf52_base.build_flags}
|
||||||
|
lib_deps =
|
||||||
|
${arduino_base.lib_deps}
|
||||||
|
${environmental_base.lib_deps}
|
||||||
|
https://github.com/Kongduino/Adafruit_nRFCrypto.git#e31a8825ea3300b163a0a3c1ddd5de34e10e1371
|
||||||
|
|
||||||
|
; Note: By default no lora device is created for this build - it uses a simulated interface
|
||||||
|
[env:nrf52840dk]
|
||||||
|
extends = nrf52840_base
|
||||||
|
board = nrf52840_dk
|
||||||
|
|
||||||
|
|
||||||
21
arch/portduino/portduino.ini
Normal file
21
arch/portduino/portduino.ini
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
|
||||||
|
[portduino_base]
|
||||||
|
platform = https://github.com/meshtastic/platform-native.git#096b3c3e9c5c8e19d4c3b6cd803fffef2a9be4c5
|
||||||
|
framework = arduino
|
||||||
|
build_src_filter =
|
||||||
|
${env.build_src_filter}
|
||||||
|
-<platform/esp32/>
|
||||||
|
-<nimble/>
|
||||||
|
-<platform/nrf52/>
|
||||||
|
-<platform/stm32wl/>
|
||||||
|
-<platform/rp2040>
|
||||||
|
-<mesh/http/>
|
||||||
|
-<mesh/eth/>
|
||||||
|
-<modules/esp32>
|
||||||
|
-<modules/Telemetry>
|
||||||
|
+<../variants/portduino>
|
||||||
|
lib_deps =
|
||||||
|
${env.lib_deps}
|
||||||
|
${networking_base.lib_deps}
|
||||||
|
rweather/Crypto@^0.4.0
|
||||||
|
build_flags = ${arduino_base.build_flags} -Isrc/platform/portduino
|
||||||
21
arch/rp2040/rp2040.ini
Normal file
21
arch/rp2040/rp2040.ini
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
; Common settings for rp2040 Processor based targets
|
||||||
|
[rp2040_base]
|
||||||
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#20c7dbfcfe6677c5305fa28ecf5e3870321cb157
|
||||||
|
platform_packages =
|
||||||
|
earlephilhower/toolchain-rp2040-earlephilhower@^5.100300.221223
|
||||||
|
extends = arduino_base
|
||||||
|
board_build.core = earlephilhower
|
||||||
|
board_build.filesystem_size = 0.5m
|
||||||
|
build_flags =
|
||||||
|
${arduino_base.build_flags} -Wno-unused-variable
|
||||||
|
-Isrc/platform/rp2040
|
||||||
|
-D__PLAT_RP2040__
|
||||||
|
# -D _POSIX_THREADS
|
||||||
|
build_src_filter =
|
||||||
|
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<mqtt/> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/>
|
||||||
|
lib_ignore =
|
||||||
|
BluetoothOTA
|
||||||
|
lib_deps =
|
||||||
|
${arduino_base.lib_deps}
|
||||||
|
${environmental_base.lib_deps}
|
||||||
|
https://github.com/kokke/tiny-AES-c.git#f06ac37fc31dfdaca2e0d9bec83f90d5663c319b
|
||||||
18
arch/stm32/stm32wl5e.ini
Normal file
18
arch/stm32/stm32wl5e.ini
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[stm32wl5e_base]
|
||||||
|
platform = platformio/ststm32@^15.4.1
|
||||||
|
board = generic_wl5e
|
||||||
|
framework = arduino
|
||||||
|
build_type = debug
|
||||||
|
build_flags =
|
||||||
|
${arduino_base.build_flags}
|
||||||
|
-Isrc/platform/stm32wl -g
|
||||||
|
-DHAL_SUBGHZ_MODULE_ENABLED
|
||||||
|
# Arduino/PlatformIO framework-arduinoststm32 package does not presently have SUBGHZSPI support
|
||||||
|
# -DPIN_SPI_MOSI=PINSUBGHZSPIMOSI -DPIN_SPI_MISO=PINSUBGHZSPIMISO -DPIN_SPI_SCK=PINSUBGHZSPISCK
|
||||||
|
build_src_filter =
|
||||||
|
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<mqtt/> -<graphics> -<input> -<buzz> -<modules/Telemetry> -<platform/nrf52> -<platform/portduino> -<platform/rp2040>
|
||||||
|
lib_deps =
|
||||||
|
${env.lib_deps}
|
||||||
|
https://github.com/kokke/tiny-AES-c.git#f06ac37fc31dfdaca2e0d9bec83f90d5663c319b
|
||||||
|
lib_ignore =
|
||||||
|
mathertel/OneButton@^2.0.3
|
||||||
BIN
bin/Meshtastic_nRF52_factory_erase.uf2
Normal file
BIN
bin/Meshtastic_nRF52_factory_erase.uf2
Normal file
Binary file not shown.
109
bin/build-all.sh
109
bin/build-all.sh
@@ -1,109 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
VERSION=`bin/buildinfo.py long`
|
|
||||||
SHORT_VERSION=`bin/buildinfo.py short`
|
|
||||||
|
|
||||||
BOARDS_ESP32="rak11200 tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 nano-g1 station-g1 m5stack-core m5stack-coreink"
|
|
||||||
#BOARDS_ESP32=tbeam
|
|
||||||
|
|
||||||
# FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine
|
|
||||||
BOARDS_NRF52="rak4631 rak4631_eink t-echo pca10059_diy_eink"
|
|
||||||
#BOARDS_NRF52=""
|
|
||||||
|
|
||||||
OUTDIR=release/latest
|
|
||||||
|
|
||||||
# We keep all old builds (and their map files in the archive dir)
|
|
||||||
ARCHIVEDIR=release/archive
|
|
||||||
|
|
||||||
rm -f $OUTDIR/firmware*
|
|
||||||
|
|
||||||
mkdir -p $OUTDIR/bins $ARCHIVEDIR
|
|
||||||
rm -r $OUTDIR/bins/* || true
|
|
||||||
mkdir -p $OUTDIR/bins/universal $OUTDIR/elfs/universal
|
|
||||||
|
|
||||||
# build the named environment and copy the bins to the release directory
|
|
||||||
function do_build() {
|
|
||||||
BOARD=$1
|
|
||||||
isNrf=$3
|
|
||||||
|
|
||||||
echo "Building for $BOARD ($isNrf) with $PLATFORMIO_BUILD_FLAGS"
|
|
||||||
rm -f .pio/build/$BOARD/firmware.*
|
|
||||||
|
|
||||||
# The shell vars the build tool expects to find
|
|
||||||
export APP_VERSION=$VERSION
|
|
||||||
|
|
||||||
basename=universal/firmware-$BOARD-$VERSION
|
|
||||||
|
|
||||||
pio run --environment $BOARD # -v
|
|
||||||
SRCELF=.pio/build/$BOARD/firmware.elf
|
|
||||||
cp $SRCELF $OUTDIR/elfs/$basename.elf
|
|
||||||
|
|
||||||
if [ "$isNrf" = "false" ]
|
|
||||||
then
|
|
||||||
echo "Copying ESP32 bin file"
|
|
||||||
SRCBIN=.pio/build/$BOARD/firmware.bin
|
|
||||||
cp $SRCBIN $OUTDIR/bins/$basename.bin
|
|
||||||
else
|
|
||||||
echo "Generating NRF52 uf2 file"
|
|
||||||
SRCHEX=.pio/build/$BOARD/firmware.hex
|
|
||||||
bin/uf2conv.py $SRCHEX -c -o $OUTDIR/bins/$basename.uf2 -f 0xADA52840
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_boards() {
|
|
||||||
declare boards=$1
|
|
||||||
declare isNrf=$2
|
|
||||||
for board in $boards; do
|
|
||||||
# Build universal
|
|
||||||
echo "about to build $board $isNrf"
|
|
||||||
do_build $board "" "$isNrf"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make sure our submodules are current
|
|
||||||
git submodule update
|
|
||||||
|
|
||||||
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
|
||||||
platformio lib update
|
|
||||||
|
|
||||||
do_boards "$BOARDS_ESP32" "false"
|
|
||||||
do_boards "$BOARDS_NRF52" "true"
|
|
||||||
|
|
||||||
pio run --environment native
|
|
||||||
cp .pio/build/native/program $OUTDIR/bins/universal/meshtasticd_linux_amd64
|
|
||||||
|
|
||||||
echo "Building Filesystem for ESP32 targets"
|
|
||||||
pio run --environment tbeam -t buildfs
|
|
||||||
cp .pio/build/tbeam/spiffs.bin $OUTDIR/bins/universal/littlefs-$VERSION.bin
|
|
||||||
|
|
||||||
# keep the bins in archive also
|
|
||||||
cp $OUTDIR/bins/universal/littlefs* $OUTDIR/bins/universal/firmware* $OUTDIR/elfs/universal/firmware* $ARCHIVEDIR
|
|
||||||
|
|
||||||
echo Updating android bins $OUTDIR/forandroid
|
|
||||||
rm -rf $OUTDIR/forandroid
|
|
||||||
mkdir -p $OUTDIR/forandroid
|
|
||||||
cp -a $OUTDIR/bins/universal/*.bin $OUTDIR/forandroid/
|
|
||||||
|
|
||||||
cat >$OUTDIR/curfirmwareversion.xml <<XML
|
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!-- This file is kept in source control because it reflects the last stable
|
|
||||||
release. It is used by the android app for forcing software updates. Do not edit.
|
|
||||||
Generated by bin/buildall.sh -->
|
|
||||||
|
|
||||||
<resources>
|
|
||||||
<string name="cur_firmware_version" translatable="false">$VERSION</string>
|
|
||||||
<string name="short_firmware_version" translatable="false">$SHORT_VERSION</string>
|
|
||||||
</resources>
|
|
||||||
XML
|
|
||||||
|
|
||||||
echo Generating $ARCHIVEDIR/firmware-$VERSION.zip
|
|
||||||
rm -f $ARCHIVEDIR/firmware-$VERSION.zip
|
|
||||||
zip --junk-paths $ARCHIVEDIR/firmware-$VERSION.zip $ARCHIVEDIR/littlefs-$VERSION.bin $OUTDIR/bins/universal/firmware-*-$VERSION.* $OUTDIR/bins/universal/meshtasticd* images/system-info.bin bin/device-install.* bin/device-update.*
|
|
||||||
echo Generating $ARCHIVEDIR/elfs-$VERSION.zip
|
|
||||||
rm -f $ARCHIVEDIR/elfs-$VERSION.zip
|
|
||||||
zip --junk-paths $ARCHIVEDIR/elfs-$VERSION.zip $OUTDIR/elfs/universal/firmware-*-$VERSION.*
|
|
||||||
|
|
||||||
echo BUILT ALL
|
|
||||||
@@ -10,11 +10,8 @@ OUTDIR=release/
|
|||||||
rm -f $OUTDIR/firmware*
|
rm -f $OUTDIR/firmware*
|
||||||
rm -r $OUTDIR/* || true
|
rm -r $OUTDIR/* || true
|
||||||
|
|
||||||
# Make sure our submodules are current
|
|
||||||
git submodule update
|
|
||||||
|
|
||||||
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
||||||
platformio lib update
|
platformio pkg update
|
||||||
|
|
||||||
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
||||||
rm -f .pio/build/$1/firmware.*
|
rm -f .pio/build/$1/firmware.*
|
||||||
@@ -29,13 +26,15 @@ SRCELF=.pio/build/$1/firmware.elf
|
|||||||
cp $SRCELF $OUTDIR/$basename.elf
|
cp $SRCELF $OUTDIR/$basename.elf
|
||||||
|
|
||||||
echo "Copying ESP32 bin file"
|
echo "Copying ESP32 bin file"
|
||||||
SRCBIN=.pio/build/$1/firmware.bin
|
SRCBIN=.pio/build/$1/firmware.factory.bin
|
||||||
cp $SRCBIN $OUTDIR/$basename.bin
|
cp $SRCBIN $OUTDIR/$basename.bin
|
||||||
|
|
||||||
|
echo "Copying ESP32 update bin file"
|
||||||
|
SRCBIN=.pio/build/$1/firmware.bin
|
||||||
|
cp $SRCBIN $OUTDIR/$basename-update.bin
|
||||||
|
|
||||||
echo "Building Filesystem for ESP32 targets"
|
echo "Building Filesystem for ESP32 targets"
|
||||||
pio run --environment tbeam -t buildfs
|
pio run --environment tbeam -t buildfs
|
||||||
cp .pio/build/tbeam/spiffs.bin $OUTDIR/littlefs-$VERSION.bin
|
cp .pio/build/tbeam/littlefs.bin $OUTDIR/littlefs-$VERSION.bin
|
||||||
cp images/system-info.bin $OUTDIR/system-info.bin
|
|
||||||
|
|
||||||
cp bin/device-install.* $OUTDIR
|
cp bin/device-install.* $OUTDIR
|
||||||
cp bin/device-update.* $OUTDIR
|
cp bin/device-update.* $OUTDIR
|
||||||
|
|||||||
@@ -12,11 +12,8 @@ rm -f $OUTDIR/firmware*
|
|||||||
mkdir -p $OUTDIR/
|
mkdir -p $OUTDIR/
|
||||||
rm -r $OUTDIR/* || true
|
rm -r $OUTDIR/* || true
|
||||||
|
|
||||||
# Make sure our submodules are current
|
|
||||||
git submodule update
|
|
||||||
|
|
||||||
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
||||||
platformio lib update
|
platformio pkg update
|
||||||
|
|
||||||
pio run --environment native
|
pio run --environment native
|
||||||
cp .pio/build/native/program $OUTDIR/meshtasticd_linux_amd64
|
cp .pio/build/native/program $OUTDIR/meshtasticd_linux_amd64
|
||||||
|
|||||||
@@ -10,11 +10,8 @@ OUTDIR=release/
|
|||||||
rm -f $OUTDIR/firmware*
|
rm -f $OUTDIR/firmware*
|
||||||
rm -r $OUTDIR/* || true
|
rm -r $OUTDIR/* || true
|
||||||
|
|
||||||
# Make sure our submodules are current
|
|
||||||
git submodule update
|
|
||||||
|
|
||||||
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
||||||
platformio lib update
|
platformio pkg update
|
||||||
|
|
||||||
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
||||||
rm -f .pio/build/$1/firmware.*
|
rm -f .pio/build/$1/firmware.*
|
||||||
@@ -26,7 +23,9 @@ basename=firmware-$1-$VERSION
|
|||||||
|
|
||||||
pio run --environment $1 # -v
|
pio run --environment $1 # -v
|
||||||
SRCELF=.pio/build/$1/firmware.elf
|
SRCELF=.pio/build/$1/firmware.elf
|
||||||
|
DFUPKG=.pio/build/$1/firmware.zip
|
||||||
cp $SRCELF $OUTDIR/$basename.elf
|
cp $SRCELF $OUTDIR/$basename.elf
|
||||||
|
cp $DFUPKG $OUTDIR/$basename-ota.zip
|
||||||
|
|
||||||
echo "Generating NRF52 uf2 file"
|
echo "Generating NRF52 uf2 file"
|
||||||
SRCHEX=.pio/build/$1/firmware.hex
|
SRCHEX=.pio/build/$1/firmware.hex
|
||||||
@@ -34,3 +33,4 @@ bin/uf2conv.py $SRCHEX -c -o $OUTDIR/$basename.uf2 -f 0xADA52840
|
|||||||
|
|
||||||
cp bin/device-install.* $OUTDIR
|
cp bin/device-install.* $OUTDIR
|
||||||
cp bin/device-update.* $OUTDIR
|
cp bin/device-update.* $OUTDIR
|
||||||
|
cp bin/*.uf2 $OUTDIR
|
||||||
|
|||||||
33
bin/build-rpi2040.sh
Executable file
33
bin/build-rpi2040.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
VERSION=`bin/buildinfo.py long`
|
||||||
|
SHORT_VERSION=`bin/buildinfo.py short`
|
||||||
|
|
||||||
|
OUTDIR=release/
|
||||||
|
|
||||||
|
rm -f $OUTDIR/firmware*
|
||||||
|
rm -r $OUTDIR/* || true
|
||||||
|
|
||||||
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
||||||
|
platformio pkg update
|
||||||
|
|
||||||
|
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
||||||
|
rm -f .pio/build/$1/firmware.*
|
||||||
|
|
||||||
|
# The shell vars the build tool expects to find
|
||||||
|
export APP_VERSION=$VERSION
|
||||||
|
|
||||||
|
basename=firmware-$1-$VERSION
|
||||||
|
|
||||||
|
pio run --environment $1 # -v
|
||||||
|
SRCELF=.pio/build/$1/firmware.elf
|
||||||
|
cp $SRCELF $OUTDIR/$basename.elf
|
||||||
|
|
||||||
|
echo "Copying uf2 file"
|
||||||
|
SRCBIN=.pio/build/$1/firmware.uf2
|
||||||
|
cp $SRCBIN $OUTDIR/$basename.uf2
|
||||||
|
|
||||||
|
cp bin/device-install.* $OUTDIR
|
||||||
|
cp bin/device-update.* $OUTDIR
|
||||||
16
bin/bump_version.py
Executable file
16
bin/bump_version.py
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
"""Bump the version number"""
|
||||||
|
|
||||||
|
lines = None
|
||||||
|
|
||||||
|
with open('version.properties', 'r', encoding='utf-8') as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
|
||||||
|
with open('version.properties', 'w', encoding='utf-8') as f:
|
||||||
|
for line in lines:
|
||||||
|
if line.lstrip().startswith("build = "):
|
||||||
|
words = line.split(" = ")
|
||||||
|
ver = f'build = {int(words[1]) + 1}'
|
||||||
|
f.write(f'{ver}\n')
|
||||||
|
else:
|
||||||
|
f.write(line)
|
||||||
23
bin/check-dependencies.sh
Normal file
23
bin/check-dependencies.sh
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Note: This is a prototype for how we could add static code analysis to the CI.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [[ $# -gt 0 ]]; then
|
||||||
|
# can override which environment by passing arg
|
||||||
|
BOARDS="$@"
|
||||||
|
else
|
||||||
|
BOARDS="rak4631 rak4631_eink t-echo pca10059_diy_eink pico rak11200 tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 nano-g1 station-g1 m5stack-core m5stack-coreink tbeam-s3-core"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "BOARDS:${BOARDS}"
|
||||||
|
|
||||||
|
CHECK=""
|
||||||
|
for BOARD in $BOARDS; do
|
||||||
|
CHECK="${CHECK} -e ${BOARD}"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo $CHECK
|
||||||
|
|
||||||
|
pio pkg outdated -e $CHECK
|
||||||
11
bin/device-install.bat
Normal file → Executable file
11
bin/device-install.bat
Normal file → Executable file
@@ -26,14 +26,17 @@ IF "__%FILENAME%__" == "____" (
|
|||||||
echo "Missing FILENAME"
|
echo "Missing FILENAME"
|
||||||
goto HELP
|
goto HELP
|
||||||
)
|
)
|
||||||
IF EXIST %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
|
%PYTHON% -m esptool --baud 115200 erase_flash
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x1000 system-info.bin
|
%PYTHON% -m esptool --baud 115200 write_flash 0x00 %FILENAME%
|
||||||
|
%PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota.bin
|
||||||
for %%f in (littlefs-*.bin) do (
|
for %%f in (littlefs-*.bin) do (
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x00390000 %%f
|
%PYTHON% -m esptool --baud 115200 write_flash 0x300000 %%f
|
||||||
)
|
)
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x10000 %FILENAME%
|
) else (
|
||||||
|
echo "Invalid file: %FILENAME%"
|
||||||
|
goto HELP
|
||||||
) else (
|
) else (
|
||||||
echo "Invalid file: %FILENAME%"
|
echo "Invalid file: %FILENAME%"
|
||||||
goto HELP
|
goto HELP
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ Flash image file to device, but first erasing and writing system information"
|
|||||||
-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.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,15 +45,16 @@ shift "$((OPTIND-1))"
|
|||||||
shift
|
shift
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -f "${FILENAME}" ]; then
|
if [ -f "${FILENAME}" ] && [ ! -z "${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
|
"$PYTHON" -m esptool erase_flash
|
||||||
"$PYTHON" -m esptool write_flash 0x1000 system-info.bin
|
"$PYTHON" -m esptool write_flash 0x00 ${FILENAME}
|
||||||
"$PYTHON" -m esptool write_flash 0x00390000 littlefs-*.bin
|
"$PYTHON" -m esptool write_flash 0x260000 bleota.bin
|
||||||
"$PYTHON" -m esptool write_flash 0x10000 ${FILENAME}
|
"$PYTHON" -m esptool write_flash 0x300000 littlefs-*.bin
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Invalid file: ${FILENAME}"
|
|
||||||
show_help
|
show_help
|
||||||
|
echo "Invalid file: ${FILENAME}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
9
bin/device-update.bat
Normal file → Executable file
9
bin/device-update.bat
Normal file → Executable file
@@ -10,7 +10,7 @@ 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 *update.bin file to flash. Custom to your device type.
|
||||||
goto EOF
|
goto EOF
|
||||||
|
|
||||||
:GETOPTS
|
:GETOPTS
|
||||||
@@ -26,11 +26,12 @@ IF "__%FILENAME%__" == "____" (
|
|||||||
echo "Missing FILENAME"
|
echo "Missing FILENAME"
|
||||||
goto HELP
|
goto HELP
|
||||||
)
|
)
|
||||||
IF EXIST %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%
|
%PYTHON% -m esptool --baud 115200 write_flash 0x10000 %FILENAME%
|
||||||
echo Erasing the otadata partition, which will turn off flash flippy-flop and force the first image to be used
|
) else (
|
||||||
%PYTHON% -m esptool --baud 115200 erase_region 0xe000 0x2000
|
echo "Invalid file: %FILENAME%"
|
||||||
|
goto HELP
|
||||||
) else (
|
) else (
|
||||||
echo "Invalid file: %FILENAME%"
|
echo "Invalid file: %FILENAME%"
|
||||||
goto HELP
|
goto HELP
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ 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 (Dangerrous).
|
||||||
-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 *update.bin file to flash. Custom to your device type.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,14 +43,12 @@ shift "$((OPTIND-1))"
|
|||||||
shift
|
shift
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -f "${FILENAME}" ]; then
|
if [ -f "${FILENAME}" ] && [ -z "${FILENAME##*"update"*}" ]; then
|
||||||
echo "Trying to flash update ${FILENAME}."
|
printf "Trying to flash update ${FILENAME}"
|
||||||
$PYTHON -m esptool --baud 115200 write_flash 0x10000 ${FILENAME}
|
$PYTHON -m esptool --baud 115200 write_flash 0x10000 ${FILENAME}
|
||||||
echo "Erasing the otadata partition, which will turn off flash flippy-flop and force the first image to be used"
|
|
||||||
$PYTHON -m esptool --baud 115200 erase_region 0xe000 0x2000
|
|
||||||
else
|
else
|
||||||
echo "Invalid file: ${FILENAME}"
|
|
||||||
show_help
|
show_help
|
||||||
|
echo "Invalid file: ${FILENAME}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import getopt
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
from littlefs import LittleFS
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
print( "Building LittleFS image..." )
|
|
||||||
|
|
||||||
argList = sys.argv[1:]
|
|
||||||
arxx = { argList[i]: argList[i+1] for i in range(0, len(argList)-1, 2) }
|
|
||||||
|
|
||||||
dataPath = arxx["-c"]
|
|
||||||
blockSize = int(arxx["-b"])
|
|
||||||
blockCount = int(arxx["-s"]) / blockSize
|
|
||||||
|
|
||||||
cwd = os.getcwd()
|
|
||||||
|
|
||||||
os.chdir(dataPath)
|
|
||||||
|
|
||||||
fileList = []
|
|
||||||
dirList = []
|
|
||||||
|
|
||||||
for (dirpath, dirnames, filenames) in os.walk('.'):
|
|
||||||
for f in filenames:
|
|
||||||
if (f[:1] != '.'):
|
|
||||||
fileList.append( os.path.join(dirpath, f) )
|
|
||||||
for d in dirnames:
|
|
||||||
if (d[:1] != '.'):
|
|
||||||
dirList.append( os.path.join(dirpath, d) )
|
|
||||||
|
|
||||||
fs = LittleFS(block_size=blockSize, block_count=blockCount) # create a 448kB partition
|
|
||||||
|
|
||||||
for curDir in dirList:
|
|
||||||
print( "Creating dir " + curDir )
|
|
||||||
fs.mkdir( curDir )
|
|
||||||
|
|
||||||
for curFile in fileList:
|
|
||||||
print( "Adding file " + curFile )
|
|
||||||
with open( curFile, 'rb' ) as f:
|
|
||||||
data = f.read()
|
|
||||||
|
|
||||||
with fs.open( curFile, 'wb') as fh:
|
|
||||||
fh.write( data )
|
|
||||||
|
|
||||||
outName = argList[-1]
|
|
||||||
|
|
||||||
os.chdir(cwd)
|
|
||||||
|
|
||||||
with open(outName, 'wb') as fh:
|
|
||||||
fh.write(fs.context.buffer)
|
|
||||||
@@ -1,24 +1,70 @@
|
|||||||
|
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import configparser
|
import configparser
|
||||||
import traceback
|
import traceback
|
||||||
import sys
|
import sys
|
||||||
|
from os.path import join
|
||||||
from readprops import readProps
|
from readprops import readProps
|
||||||
|
|
||||||
Import("env")
|
Import("env")
|
||||||
env.Replace( MKSPIFFSTOOL=env.get("PROJECT_DIR") + '/bin/mklittlefs.py' )
|
platform = env.PioPlatform()
|
||||||
try:
|
|
||||||
import littlefs
|
def esp32_create_combined_bin(source, target, env):
|
||||||
except ImportError:
|
# this sub is borrowed from ESPEasy build toolchain. It's licensed under GPL V3
|
||||||
env.Execute("$PYTHONEXE -m pip install littlefs-python")
|
# https://github.com/letscontrolit/ESPEasy/blob/mega/tools/pio/post_esp32.py
|
||||||
|
print("Generating combined binary for serial flashing")
|
||||||
|
|
||||||
|
app_offset = 0x10000
|
||||||
|
|
||||||
|
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.factory.bin")
|
||||||
|
sections = env.subst(env.get("FLASH_EXTRA_IMAGES"))
|
||||||
|
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin")
|
||||||
|
chip = env.get("BOARD_MCU")
|
||||||
|
flash_size = env.BoardConfig().get("upload.flash_size")
|
||||||
|
flash_freq = env.BoardConfig().get("build.f_flash", '40m')
|
||||||
|
flash_freq = flash_freq.replace('000000L', 'm')
|
||||||
|
flash_mode = env.BoardConfig().get("build.flash_mode", "dio")
|
||||||
|
memory_type = env.BoardConfig().get("build.arduino.memory_type", "qio_qspi")
|
||||||
|
if flash_mode == "qio" or flash_mode == "qout":
|
||||||
|
flash_mode = "dio"
|
||||||
|
if memory_type == "opi_opi" or memory_type == "opi_qspi":
|
||||||
|
flash_mode = "dout"
|
||||||
|
cmd = [
|
||||||
|
"--chip",
|
||||||
|
chip,
|
||||||
|
"merge_bin",
|
||||||
|
"-o",
|
||||||
|
new_file_name,
|
||||||
|
"--flash_mode",
|
||||||
|
flash_mode,
|
||||||
|
"--flash_freq",
|
||||||
|
flash_freq,
|
||||||
|
"--flash_size",
|
||||||
|
flash_size,
|
||||||
|
]
|
||||||
|
|
||||||
|
print(" Offset | File")
|
||||||
|
for section in sections:
|
||||||
|
sect_adr, sect_file = section.split(" ", 1)
|
||||||
|
print(f" - {sect_adr} | {sect_file}")
|
||||||
|
cmd += [sect_adr, sect_file]
|
||||||
|
|
||||||
|
print(f" - {hex(app_offset)} | {firmware_name}")
|
||||||
|
cmd += [hex(app_offset), firmware_name]
|
||||||
|
|
||||||
|
print('Using esptool.py arguments: %s' % ' '.join(cmd))
|
||||||
|
|
||||||
|
esptool.main(cmd)
|
||||||
|
|
||||||
|
if (platform.name == "espressif32"):
|
||||||
|
sys.path.append(join(platform.get_package_dir("tool-esptoolpy")))
|
||||||
|
import esptool
|
||||||
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_combined_bin)
|
||||||
|
|
||||||
Import("projenv")
|
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'])
|
||||||
# print("path is" + ','.join(sys.path))
|
|
||||||
|
|
||||||
# General options that are passed to the C and C++ compilers
|
# General options that are passed to the C and C++ compilers
|
||||||
projenv.Append(CCFLAGS=[
|
projenv.Append(CCFLAGS=[
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ VERSION=`bin/buildinfo.py long`
|
|||||||
# Must have a V prefix to trigger github
|
# Must have a V prefix to trigger github
|
||||||
git tag "v${VERSION}"
|
git tag "v${VERSION}"
|
||||||
|
|
||||||
# Commented out per https://github.com/meshtastic/Meshtastic-device/issues/947
|
|
||||||
#git push root "v${VERSION}" # push the tag
|
|
||||||
|
|
||||||
git push origin "v${VERSION}" # push the tag
|
git push origin "v${VERSION}" # push the tag
|
||||||
|
|
||||||
echo "Tag ${VERSION} pushed to github, github actions should now be building the draft release. If it seems good, click to publish it"
|
echo "Tag ${VERSION} pushed to github, github actions should now be building the draft release. If it seems good, click to publish it"
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
cd protobufs && ..\nanopb-0.4.6\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs *.proto
|
cd protobufs && ..\nanopb-0.4.7\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs ..\protobufs\meshtastic\*.proto
|
||||||
|
|
||||||
|
@REM cd ../src/mesh/generated/meshtastic
|
||||||
|
@REM sed -i 's/#include "meshtastic/#include "./g' *
|
||||||
|
@REM sed -i 's/meshtastic_//g' *
|
||||||
|
|||||||
@@ -2,13 +2,18 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.6 to be located in the"
|
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.7 to be located in the"
|
||||||
echo "meshtastic-device 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.6"
|
echo "prebuilt binaries for your computer into nanopb-0.4.7"
|
||||||
|
|
||||||
# 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.6/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs *.proto
|
../nanopb-0.4.7/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated/ -I=../protobufs meshtastic/*.proto
|
||||||
|
|
||||||
|
# cd ../src/mesh/generated/meshtastic
|
||||||
|
# sed -i 's/#include "meshtastic/#include "./g' -- *
|
||||||
|
|
||||||
|
# sed -i 's/meshtastic_//g' -- *
|
||||||
|
|
||||||
#echo "Regenerating protobuf documentation - if you see an error message"
|
#echo "Regenerating protobuf documentation - if you see an error message"
|
||||||
#echo "you can ignore it unless doing a new protobuf release to github."
|
#echo "you can ignore it unless doing a new protobuf release to github."
|
||||||
|
|||||||
@@ -7,12 +7,7 @@
|
|||||||
"cpu": "cortex-m4",
|
"cpu": "cortex-m4",
|
||||||
"extra_flags": "-DARDUINO_NRF52840_TTGO_EINK -DNRF52840_XXAA",
|
"extra_flags": "-DARDUINO_NRF52840_TTGO_EINK -DNRF52840_XXAA",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [["0x239A", "0x4405"]],
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x4405"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"usb_product": "TTGO_eink",
|
"usb_product": "TTGO_eink",
|
||||||
"mcu": "nrf52840",
|
"mcu": "nrf52840",
|
||||||
"variant": "eink0.1",
|
"variant": "eink0.1",
|
||||||
@@ -30,19 +25,13 @@
|
|||||||
"settings_addr": "0xFF000"
|
"settings_addr": "0xFF000"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["bluetooth"],
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"jlink_device": "nRF52840_xxAA",
|
"jlink_device": "nRF52840_xxAA",
|
||||||
"onboard_tools": [
|
"onboard_tools": ["jlink"],
|
||||||
"jlink"
|
|
||||||
],
|
|
||||||
"svd_path": "nrf52840.svd"
|
"svd_path": "nrf52840.svd"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino"],
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "TTGO eink (Adafruit BSP)",
|
"name": "TTGO eink (Adafruit BSP)",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 248832,
|
"maximum_ram_size": 248832,
|
||||||
@@ -50,11 +39,7 @@
|
|||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"speed": 115200,
|
"speed": 115200,
|
||||||
"protocol": "jlink",
|
"protocol": "jlink",
|
||||||
"protocols": [
|
"protocols": ["jlink", "nrfjprog", "stlink"]
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"stlink"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"url": "FIXME",
|
"url": "FIXME",
|
||||||
"vendor": "TTGO"
|
"vendor": "TTGO"
|
||||||
|
|||||||
27
boards/generic_wl5e.json
Normal file
27
boards/generic_wl5e.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"core": "stm32",
|
||||||
|
"cpu": "cortex-m4",
|
||||||
|
"extra_flags": "-DSTM32WLxx -DSTM32WLE5xx -DARDUINO_GENERIC_WLE5CCUX",
|
||||||
|
"f_cpu": "48000000L",
|
||||||
|
"mcu": "stm32wle5ccu",
|
||||||
|
"variant": "STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U",
|
||||||
|
"product_line": "STM32WLE5xx"
|
||||||
|
},
|
||||||
|
"debug": {
|
||||||
|
"default_tools": ["stlink"],
|
||||||
|
"jlink_device": "STM32WLE5CC",
|
||||||
|
"openocd_target": "stm32wlx",
|
||||||
|
"svd_path": "STM32WLE5_CM4.svd"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "BB-STM32WL",
|
||||||
|
"upload": {
|
||||||
|
"maximum_ram_size": 65536,
|
||||||
|
"maximum_size": 262144,
|
||||||
|
"protocol": "cmsis-dap",
|
||||||
|
"protocols": ["cmsis-dap"]
|
||||||
|
},
|
||||||
|
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32wl-series.html",
|
||||||
|
"vendor": "ST"
|
||||||
|
}
|
||||||
@@ -19,16 +19,12 @@
|
|||||||
"sd_fwid": "0x00B7"
|
"sd_fwid": "0x00B7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["bluetooth"],
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"jlink_device": "nRF52832_xxAA",
|
"jlink_device": "nRF52832_xxAA",
|
||||||
"svd_path": "nrf52.svd"
|
"svd_path": "nrf52.svd"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino"],
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "lora ISP4520",
|
"name": "lora ISP4520",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 65536,
|
"maximum_ram_size": 65536,
|
||||||
@@ -36,12 +32,7 @@
|
|||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"speed": 115200,
|
"speed": 115200,
|
||||||
"protocol": "nrfutil",
|
"protocol": "nrfutil",
|
||||||
"protocols": [
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"]
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"nrfutil",
|
|
||||||
"stlink"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"url": "",
|
"url": "",
|
||||||
"vendor": "PsiSoft"
|
"vendor": "PsiSoft"
|
||||||
|
|||||||
@@ -8,22 +8,10 @@
|
|||||||
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
|
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
[
|
["0x239A", "0x8029"],
|
||||||
"0x239A",
|
["0x239A", "0x0029"],
|
||||||
"0x8029"
|
["0x239A", "0x002A"],
|
||||||
],
|
["0x239A", "0x802A"]
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x0029"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x002A"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x802A"
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
"usb_product": "PCA10059",
|
"usb_product": "PCA10059",
|
||||||
"mcu": "nrf52840",
|
"mcu": "nrf52840",
|
||||||
@@ -41,28 +29,19 @@
|
|||||||
"settings_addr": "0xFF000"
|
"settings_addr": "0xFF000"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["bluetooth"],
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"jlink_device": "nRF52840_xxAA",
|
"jlink_device": "nRF52840_xxAA",
|
||||||
"svd_path": "nrf52840.svd"
|
"svd_path": "nrf52840.svd"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino"],
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "nRF52840 Dongle",
|
"name": "nRF52840 Dongle",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 248832,
|
"maximum_ram_size": 248832,
|
||||||
"maximum_size": 815104,
|
"maximum_size": 815104,
|
||||||
"speed": 115200,
|
"speed": 115200,
|
||||||
"protocol": "nrfutil",
|
"protocol": "nrfutil",
|
||||||
"protocols": [
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"nrfutil",
|
|
||||||
"stlink"
|
|
||||||
],
|
|
||||||
"use_1200bps_touch": true,
|
"use_1200bps_touch": true,
|
||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"wait_for_upload_port": true
|
"wait_for_upload_port": true
|
||||||
|
|||||||
@@ -43,5 +43,4 @@
|
|||||||
},
|
},
|
||||||
"url": "https://meshtastic.org/",
|
"url": "https://meshtastic.org/",
|
||||||
"vendor": "Nordic Semi"
|
"vendor": "Nordic Semi"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,7 @@
|
|||||||
"cpu": "cortex-m4",
|
"cpu": "cortex-m4",
|
||||||
"extra_flags": "-DARDUINO_NRF52840_TTGO_EINK -DNRF52840_XXAA",
|
"extra_flags": "-DARDUINO_NRF52840_TTGO_EINK -DNRF52840_XXAA",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [["0x239A", "0x4405"]],
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x4405"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"usb_product": "TTGO_eink",
|
"usb_product": "TTGO_eink",
|
||||||
"mcu": "nrf52840",
|
"mcu": "nrf52840",
|
||||||
"variant": "t-echo",
|
"variant": "t-echo",
|
||||||
@@ -30,31 +25,20 @@
|
|||||||
"settings_addr": "0xFF000"
|
"settings_addr": "0xFF000"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["bluetooth"],
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"jlink_device": "nRF52840_xxAA",
|
"jlink_device": "nRF52840_xxAA",
|
||||||
"onboard_tools": [
|
"onboard_tools": ["jlink"],
|
||||||
"jlink"
|
|
||||||
],
|
|
||||||
"svd_path": "nrf52840.svd"
|
"svd_path": "nrf52840.svd"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino"],
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "TTGO eink (Adafruit BSP)",
|
"name": "TTGO eink (Adafruit BSP)",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 248832,
|
"maximum_ram_size": 248832,
|
||||||
"maximum_size": 815104,
|
"maximum_size": 815104,
|
||||||
"speed": 115200,
|
"speed": 115200,
|
||||||
"protocol": "nrfutil",
|
"protocol": "nrfutil",
|
||||||
"protocols": [
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"nrfutil",
|
|
||||||
"stlink"
|
|
||||||
],
|
|
||||||
"use_1200bps_touch": true,
|
"use_1200bps_touch": true,
|
||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"wait_for_upload_port": true
|
"wait_for_upload_port": true
|
||||||
|
|||||||
37
boards/tbeam-s3-core.json
Normal file
37
boards/tbeam-s3-core.json
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DLILYGO_TBEAM_S3_CORE",
|
||||||
|
"-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": "dio",
|
||||||
|
"hwids": [["0X303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "tbeam-s3-core"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi"],
|
||||||
|
"debug": {
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "LilyGo TBeam-S3-Core",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "8MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 8388608,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "http://www.lilygo.cn/",
|
||||||
|
"vendor": "LilyGo"
|
||||||
|
}
|
||||||
37
boards/tlora-t3s3-v1.json
Normal file
37
boards/tlora-t3s3-v1.json
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DLILYGO_T3S3_V1",
|
||||||
|
"-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": "dio",
|
||||||
|
"hwids": [["0X303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "tlora-t3s3-v1"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi"],
|
||||||
|
"debug": {
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "LilyGo TLora-T3S3-V1",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "4MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 4194304,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "http://www.lilygo.cn/",
|
||||||
|
"vendor": "LilyGo"
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"arduino":{
|
"arduino": {
|
||||||
"ldscript": "esp32_out.ld"
|
"ldscript": "esp32_out.ld"
|
||||||
},
|
},
|
||||||
"core": "esp32",
|
"core": "esp32",
|
||||||
@@ -11,26 +11,14 @@
|
|||||||
"mcu": "esp32",
|
"mcu": "esp32",
|
||||||
"variant": "WisCore_RAK11200_Board"
|
"variant": "WisCore_RAK11200_Board"
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["wifi", "bluetooth", "ethernet", "can"],
|
||||||
"wifi",
|
"frameworks": ["arduino", "espidf"],
|
||||||
"bluetooth",
|
|
||||||
"ethernet",
|
|
||||||
"can"
|
|
||||||
],
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "WisCore RAK11200 Board",
|
"name": "WisCore RAK11200 Board",
|
||||||
"upload": {
|
"upload": {
|
||||||
"flash_size": "4MB",
|
"flash_size": "4MB",
|
||||||
"maximum_ram_size": 327680,
|
"maximum_ram_size": 327680,
|
||||||
"maximum_size": 4194304,
|
"maximum_size": 4194304,
|
||||||
"protocols": [
|
"protocols": ["esptool", "espota", "ftdi"],
|
||||||
"esptool",
|
|
||||||
"espota",
|
|
||||||
"ftdi"
|
|
||||||
],
|
|
||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"speed": 460800
|
"speed": 460800
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,22 +8,10 @@
|
|||||||
"extra_flags": "-DNRF52832_XXAA -DNRF52",
|
"extra_flags": "-DNRF52832_XXAA -DNRF52",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
[
|
["0x239A", "0x8029"],
|
||||||
"0x239A",
|
["0x239A", "0x0029"],
|
||||||
"0x8029"
|
["0x239A", "0x002A"],
|
||||||
],
|
["0x239A", "0x802A"]
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x0029"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x002A"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x802A"
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
"usb_product": "Feather nRF52832 Express",
|
"usb_product": "Feather nRF52832 Express",
|
||||||
"mcu": "nrf52832",
|
"mcu": "nrf52832",
|
||||||
@@ -41,17 +29,12 @@
|
|||||||
"variant": "nrf52_adafruit_feather"
|
"variant": "nrf52_adafruit_feather"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["bluetooth"],
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"jlink_device": "nRF52832_xxAA",
|
"jlink_device": "nRF52832_xxAA",
|
||||||
"svd_path": "nrf52.svd"
|
"svd_path": "nrf52.svd"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino", "zephyr"],
|
||||||
"arduino",
|
|
||||||
"zephyr"
|
|
||||||
],
|
|
||||||
"name": "Adafruit Bluefruit nRF52832 Feather",
|
"name": "Adafruit Bluefruit nRF52832 Feather",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 65536,
|
"maximum_ram_size": 65536,
|
||||||
@@ -59,12 +42,7 @@
|
|||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"speed": 115200,
|
"speed": 115200,
|
||||||
"protocol": "nrfutil",
|
"protocol": "nrfutil",
|
||||||
"protocols": [
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"]
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"nrfutil",
|
|
||||||
"stlink"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"url": "https://www.adafruit.com/product/3406",
|
"url": "https://www.adafruit.com/product/3406",
|
||||||
"vendor": "Adafruit"
|
"vendor": "Adafruit"
|
||||||
|
|||||||
@@ -8,22 +8,10 @@
|
|||||||
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
|
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
[
|
["0x239A", "0x8029"],
|
||||||
"0x239A",
|
["0x239A", "0x0029"],
|
||||||
"0x8029"
|
["0x239A", "0x002A"],
|
||||||
],
|
["0x239A", "0x802A"]
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x0029"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x002A"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x802A"
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
"usb_product": "WisCore RAK4631 Board",
|
"usb_product": "WisCore RAK4631 Board",
|
||||||
"mcu": "nrf52840",
|
"mcu": "nrf52840",
|
||||||
@@ -41,28 +29,19 @@
|
|||||||
"settings_addr": "0xFF000"
|
"settings_addr": "0xFF000"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["bluetooth"],
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"jlink_device": "nRF52840_xxAA",
|
"jlink_device": "nRF52840_xxAA",
|
||||||
"svd_path": "nrf52840.svd"
|
"svd_path": "nrf52840.svd"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino"],
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "WisCore RAK4631 Board",
|
"name": "WisCore RAK4631 Board",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 248832,
|
"maximum_ram_size": 248832,
|
||||||
"maximum_size": 815104,
|
"maximum_size": 815104,
|
||||||
"speed": 115200,
|
"speed": 115200,
|
||||||
"protocol": "nrfutil",
|
"protocol": "nrfutil",
|
||||||
"protocols": [
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"nrfutil",
|
|
||||||
"stlink"
|
|
||||||
],
|
|
||||||
"use_1200bps_touch": true,
|
"use_1200bps_touch": true,
|
||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"wait_for_upload_port": true
|
"wait_for_upload_port": true
|
||||||
|
|||||||
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
version: "3.7"
|
||||||
|
|
||||||
|
services:
|
||||||
|
meshtastic-node:
|
||||||
|
build: .
|
||||||
|
deploy:
|
||||||
|
mode: replicated
|
||||||
|
replicas: 4
|
||||||
|
networks:
|
||||||
|
- mesh
|
||||||
|
|
||||||
|
networks:
|
||||||
|
mesh:
|
||||||
Binary file not shown.
@@ -1,8 +1,8 @@
|
|||||||
# FIXME! using the genpartitions based table doesn't work on TTGO so for now I stay with my old memory map
|
# FIXME! using the genpartitions based table doesn't work on TTGO so for now I stay with my old memory map
|
||||||
# This is a layout for 4MB of flash
|
# This is a layout for 4MB of flash
|
||||||
# Name, Type, SubType, Offset, Size, Flags
|
# Name, Type, SubType, Offset, Size, Flags
|
||||||
nvs, data, nvs, 0x9000, 0x5000,
|
nvs, data, nvs, 0x009000, 0x005000,
|
||||||
otadata, data, ota, 0xe000, 0x2000,
|
otadata, data, ota, 0x00e000, 0x002000,
|
||||||
app0, app, ota_0, 0x10000, 0x1c0000,
|
app, app, ota_0, 0x010000, 0x250000,
|
||||||
app1, app, ota_1, 0x1d0000,0x1c0000,
|
flashApp, app, ota_1, 0x260000, 0x0A0000,
|
||||||
spiffs, data, spiffs, 0x390000,0x070000,
|
spiffs, data, spiffs, 0x300000, 0x100000,
|
||||||
|
140
platformio.ini
140
platformio.ini
@@ -2,13 +2,14 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = tbeam
|
;default_envs = tbeam
|
||||||
|
;default_envs = pico
|
||||||
|
;default_envs = tbeam-s3-core
|
||||||
;default_envs = tbeam0.7
|
;default_envs = tbeam0.7
|
||||||
;default_envs = heltec-v1
|
;default_envs = heltec-v1
|
||||||
;default_envs = heltec-v2.0
|
;default_envs = heltec-v2.0
|
||||||
;default_envs = heltec-v2.1
|
;default_envs = heltec-v2.1
|
||||||
;default_envs = tlora-v1
|
;default_envs = tlora-v1
|
||||||
;default_envs = tlora-v1
|
|
||||||
;default_envs = tlora_v1_3
|
;default_envs = tlora_v1_3
|
||||||
;default_envs = tlora-v2
|
;default_envs = tlora-v2
|
||||||
;default_envs = tlora-v2-1-1.6
|
;default_envs = tlora-v2-1-1.6
|
||||||
@@ -20,9 +21,13 @@ default_envs = tbeam
|
|||||||
;default_envs = pca10059_diy_eink
|
;default_envs = pca10059_diy_eink
|
||||||
;default_envs = meshtastic-diy-v1
|
;default_envs = meshtastic-diy-v1
|
||||||
;default_envs = meshtastic-diy-v1.1
|
;default_envs = meshtastic-diy-v1.1
|
||||||
|
;default_envs = meshtastic-dr-dev
|
||||||
;default_envs = m5stack-coreink
|
;default_envs = m5stack-coreink
|
||||||
|
;default_envs = rak4631
|
||||||
|
|
||||||
extra_configs = variants/*/platformio.ini
|
extra_configs =
|
||||||
|
arch/*/*.ini
|
||||||
|
variants/*/platformio.ini
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
extra_scripts = bin/platformio-custom.py
|
extra_scripts = bin/platformio-custom.py
|
||||||
@@ -31,47 +36,63 @@ extra_scripts = bin/platformio-custom.py
|
|||||||
; 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.
|
||||||
build_flags = -Wno-missing-field-initializers
|
build_flags = -Wno-missing-field-initializers
|
||||||
-Wno-format
|
-Wno-format
|
||||||
-Isrc -Isrc/mesh -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map
|
-Isrc -Isrc/mesh -Isrc/mesh/generated -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map
|
||||||
-DUSE_THREAD_NAMES
|
-DUSE_THREAD_NAMES
|
||||||
-DTINYGPS_OPTION_NO_CUSTOM_FIELDS
|
-DTINYGPS_OPTION_NO_CUSTOM_FIELDS
|
||||||
-DPB_ENABLE_MALLOC=1
|
-DPB_ENABLE_MALLOC=1
|
||||||
|
-DRADIOLIB_EXCLUDE_CC1101
|
||||||
|
-DRADIOLIB_EXCLUDE_NRF24
|
||||||
|
-DRADIOLIB_EXCLUDE_RF69
|
||||||
|
-DRADIOLIB_EXCLUDE_SX1231
|
||||||
|
-DRADIOLIB_EXCLUDE_SI443X
|
||||||
|
-DRADIOLIB_EXCLUDE_RFM2X
|
||||||
|
-DRADIOLIB_EXCLUDE_AFSK
|
||||||
|
-DRADIOLIB_EXCLUDE_HELLSCHREIBER
|
||||||
|
-DRADIOLIB_EXCLUDE_MORSE
|
||||||
|
-DRADIOLIB_EXCLUDE_RTTY
|
||||||
|
-DRADIOLIB_EXCLUDE_SSTV
|
||||||
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
https://github.com/meshtastic/esp8266-oled-ssd1306.git#53580644255b48ebb7a737343c6b4e71c7e11cf2 ; ESP8266_SSD1306
|
https://github.com/meshtastic/esp8266-oled-ssd1306.git#da1ede4dfcd91074283b029080759fd744120909 ; ESP8266_SSD1306
|
||||||
mathertel/OneButton@^2.0.3 ; OneButton library for non-blocking button debounce
|
mathertel/OneButton@^2.0.3 ; OneButton library for non-blocking button debounce
|
||||||
1202 ; CRC32, explicitly needed because dependency is missing in the ble ota update lib
|
https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159
|
||||||
https://github.com/meshtastic/arduino-fsm.git
|
https://github.com/meshtastic/TinyGPSPlus.git#127ad674ef85f0201cb68a065879653ed94792c4
|
||||||
https://github.com/meshtastic/TinyGPSPlus.git
|
|
||||||
Wire ; explicitly needed here because the AXP202 library forgets to add it
|
|
||||||
SPI
|
|
||||||
https://github.com/meshtastic/ArduinoThread.git#72921ac222eed6f526ba1682023cee290d9aa1b3
|
https://github.com/meshtastic/ArduinoThread.git#72921ac222eed6f526ba1682023cee290d9aa1b3
|
||||||
nanopb/Nanopb@^0.4.6
|
nanopb/Nanopb@^0.4.6
|
||||||
|
erriez/ErriezCRC32@^1.0.1
|
||||||
|
; jgromes/RadioLib@^5.5.1
|
||||||
|
https://github.com/jgromes/RadioLib.git#7a25b27c3183ffe3627c5c221243c378d8951da7
|
||||||
|
|
||||||
; 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 =
|
||||||
|
-DAPP_VERSION=1.0.0
|
||||||
|
--suppressions-list=suppressions.txt
|
||||||
|
--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}
|
||||||
; Portduino is using meshtastic fork for now
|
mprograms/QMC5883LCompass@^1.1.1
|
||||||
https://github.com/jgromes/RadioLib.git
|
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||||
|
https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#52b5282639d08a8cbd4b748363089eed6102dc76
|
||||||
|
|
||||||
build_flags = ${env.build_flags} -Os
|
build_flags = ${env.build_flags} -Os -DRADIOLIB_SPI_PARANOID=0
|
||||||
# -DRADIOLIB_GODMODE
|
build_src_filter = ${env.build_src_filter} -<platform/portduino/>
|
||||||
build_src_filter = ${env.build_src_filter} -<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 =
|
||||||
PubSubClient
|
knolleary/PubSubClient@^2.8
|
||||||
meshtastic/json11@^1.0.2
|
arduino-libraries/NTPClient@^3.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)
|
||||||
@@ -79,89 +100,12 @@ lib_deps =
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
adafruit/Adafruit BusIO@^1.11.4
|
adafruit/Adafruit BusIO@^1.11.4
|
||||||
adafruit/Adafruit Unified Sensor@^1.1.4
|
adafruit/Adafruit Unified Sensor@^1.1.4
|
||||||
paulstoffregen/OneWire@^2.3.5
|
adafruit/Adafruit BMP280 Library@^2.6.6
|
||||||
robtillaart/DS18B20@^0.1.11
|
|
||||||
adafruit/Adafruit BMP280 Library@^2.6.3
|
|
||||||
adafruit/Adafruit BME280 Library@^2.2.2
|
adafruit/Adafruit BME280 Library@^2.2.2
|
||||||
adafruit/Adafruit BME680 Library@^2.0.1
|
adafruit/Adafruit BME680 Library@^2.0.1
|
||||||
adafruit/Adafruit MCP9808 Library@^2.0.0
|
adafruit/Adafruit MCP9808 Library@^2.0.0
|
||||||
adafruit/Adafruit INA260 Library@^1.5.0
|
adafruit/Adafruit INA260 Library@^1.5.0
|
||||||
adafruit/Adafruit INA219@^1.2.0
|
adafruit/Adafruit INA219@^1.2.0
|
||||||
; Common settings for ESP targes, mixin with extends = esp32_base
|
adafruit/Adafruit SHTC3 Library@^1.0.0
|
||||||
[esp32_base]
|
adafruit/Adafruit LPS2X@^2.0.4
|
||||||
extends = arduino_base
|
adafruit/Adafruit SHT31 Library@^2.2.0
|
||||||
platform = espressif32@3.5.0
|
|
||||||
build_src_filter =
|
|
||||||
${arduino_base.build_src_filter} -<nrf52/> -<stm32wl>
|
|
||||||
upload_speed = 115200
|
|
||||||
debug_init_break = tbreak setup
|
|
||||||
|
|
||||||
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
|
|
||||||
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
|
|
||||||
# This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h
|
|
||||||
# -DUSE_NEW_ESP32_BLUETOOTH will enable the new NimBLE C++ api
|
|
||||||
build_flags =
|
|
||||||
${arduino_base.build_flags} -Wall -Wextra -Isrc/esp32 -Isrc/esp32-mfix-esp32-psram-cache-issue -lnimble -std=c++11
|
|
||||||
-DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
|
|
||||||
-DAXP_DEBUG_PORT=Serial -DUSE_NEW_ESP32_BLUETOOTH -DCONFIG_BT_NIMBLE_ENABLED -DCONFIG_NIMBLE_CPP_LOG_LEVEL=1
|
|
||||||
lib_deps =
|
|
||||||
${arduino_base.lib_deps}
|
|
||||||
${networking_base.lib_deps}
|
|
||||||
${environmental_base.lib_deps}
|
|
||||||
https://github.com/meshtastic/esp32_https_server.git
|
|
||||||
h2zero/NimBLE-Arduino@1.4.0
|
|
||||||
arduino-libraries/NTPClient@^3.1.0
|
|
||||||
lorol/LittleFS_esp32@^1.0.6
|
|
||||||
https://github.com/meshtastic/AXP202X_Library.git#8404abb6d4b486748636bc6ad72d2a47baaf5460
|
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
segger_rtt
|
|
||||||
ESP32 BLE Arduino
|
|
||||||
platform_packages =
|
|
||||||
framework-arduinoespressif32@https://github.com/meshtastic/arduino-esp32.git#4cde0f5d412d2695184f32e8a47e9bea57b45276
|
|
||||||
|
|
||||||
; leave this commented out to avoid breaking Windows
|
|
||||||
;upload_port = /dev/ttyUSB0
|
|
||||||
;monitor_port = /dev/ttyUSB0
|
|
||||||
|
|
||||||
; Please don't delete these lines. JM uses them.
|
|
||||||
;upload_port = /dev/cu.SLAB_USBtoUART
|
|
||||||
;monitor_port = /dev/cu.SLAB_USBtoUART
|
|
||||||
|
|
||||||
; customize the partition table
|
|
||||||
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
|
||||||
board_build.partitions = partition-table.csv
|
|
||||||
|
|
||||||
[nrf52_base]
|
|
||||||
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
|
|
||||||
; platform = nordicnrf52 ;pending https://github.com/platformio/builder-framework-arduino-nrf5/pull/7
|
|
||||||
platform = https://github.com/meshtastic/platform-nordicnrf52.git#merge
|
|
||||||
|
|
||||||
extends = arduino_base
|
|
||||||
build_type = debug ; I'm debugging with ICE a lot now
|
|
||||||
; note: liboberon provides the AES256 implementation for NRF52 (though not using the hardware acceleration of the NRF52840 - FIXME)
|
|
||||||
build_flags =
|
|
||||||
${arduino_base.build_flags} -Wno-unused-variable
|
|
||||||
-Isrc/nrf52
|
|
||||||
build_src_filter =
|
|
||||||
${arduino_base.build_src_filter} -<esp32/> -<stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mqtt/>
|
|
||||||
lib_ignore =
|
|
||||||
BluetoothOTA
|
|
||||||
|
|
||||||
[nrf52840_base]
|
|
||||||
extends = nrf52_base
|
|
||||||
build_flags = ${nrf52_base.build_flags}
|
|
||||||
lib_deps =
|
|
||||||
${arduino_base.lib_deps}
|
|
||||||
${environmental_base.lib_deps}
|
|
||||||
https://github.com/Kongduino/Adafruit_nRFCrypto.git
|
|
||||||
|
|
||||||
; Note: By default no lora device is created for this build - it uses a simulated interface
|
|
||||||
[env:nrf52840dk]
|
|
||||||
extends = nrf52840_base
|
|
||||||
board = nrf52840_dk
|
|
||||||
|
|
||||||
; Note: By default no lora device is created for this build - it uses a simulated interface
|
|
||||||
[env:feather_nrf52832]
|
|
||||||
extends = nrf52_base
|
|
||||||
board = adafruit_feather_nrf52832
|
|
||||||
|
|||||||
Submodule protobufs updated: 6bddcd2647...8cb6ed3c91
@@ -1,5 +1,5 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "BluetoothCommon.h"
|
#include "BluetoothCommon.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
// NRF52 wants these constants as byte arrays
|
// NRF52 wants these constants as byte arrays
|
||||||
// Generated here https://yupana-engineering.com/online-uuid-to-c-array-converter - but in REVERSE BYTE ORDER
|
// Generated here https://yupana-engineering.com/online-uuid-to-c-array-converter - but in REVERSE BYTE ORDER
|
||||||
@@ -7,7 +7,7 @@ const uint8_t MESH_SERVICE_UUID_16[16u] = {0xfd, 0xea, 0x73, 0xe2, 0xca, 0x5d, 0
|
|||||||
0x1f, 0x46, 0xa8, 0x15, 0x18, 0xb2, 0xa1, 0x6b};
|
0x1f, 0x46, 0xa8, 0x15, 0x18, 0xb2, 0xa1, 0x6b};
|
||||||
const uint8_t TORADIO_UUID_16[16u] = {0xe7, 0x01, 0x44, 0x12, 0x66, 0x78, 0xdd, 0xa1,
|
const uint8_t TORADIO_UUID_16[16u] = {0xe7, 0x01, 0x44, 0x12, 0x66, 0x78, 0xdd, 0xa1,
|
||||||
0xad, 0x4d, 0x9e, 0x12, 0xd2, 0x76, 0x5c, 0xf7};
|
0xad, 0x4d, 0x9e, 0x12, 0xd2, 0x76, 0x5c, 0xf7};
|
||||||
const uint8_t FROMRADIO_UUID_16[16u] = {0xd5, 0x54, 0xe4, 0xc5, 0x25, 0xc5, 0x31, 0xa5,
|
const uint8_t FROMRADIO_UUID_16[16u] = {0x02, 0x00, 0x12, 0xac, 0x42, 0x02, 0x78, 0xb8,
|
||||||
0x55, 0x4a, 0x02, 0xee, 0xc2, 0xbc, 0xa2, 0x8b};
|
0xed, 0x11, 0x93, 0x49, 0x9e, 0xe6, 0x55, 0x2c};
|
||||||
const uint8_t FROMNUM_UUID_16[16u] = {0x53, 0x44, 0xe3, 0x47, 0x75, 0xaa, 0x70, 0xa6,
|
const uint8_t FROMNUM_UUID_16[16u] = {0x53, 0x44, 0xe3, 0x47, 0x75, 0xaa, 0x70, 0xa6,
|
||||||
0x66, 0x4f, 0x00, 0xa8, 0x8c, 0xa1, 0x9d, 0xed};
|
0x66, 0x4f, 0x00, 0xa8, 0x8c, 0xa1, 0x9d, 0xed};
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
#define MESH_SERVICE_UUID "6ba1b218-15a8-461f-9fa8-5dcae273eafd"
|
#define MESH_SERVICE_UUID "6ba1b218-15a8-461f-9fa8-5dcae273eafd"
|
||||||
|
|
||||||
#define TORADIO_UUID "f75c76d2-129e-4dad-a1dd-7866124401e7"
|
#define TORADIO_UUID "f75c76d2-129e-4dad-a1dd-7866124401e7"
|
||||||
#define FROMRADIO_UUID "8ba2bcc2-ee02-4a55-a531-c525c5e454d5"
|
#define FROMRADIO_UUID "2c55e69e-4993-11ed-b878-0242ac120002"
|
||||||
#define FROMNUM_UUID "ed9da18c-a800-4f66-a670-aa7547e34453"
|
#define FROMNUM_UUID "ed9da18c-a800-4f66-a670-aa7547e34453"
|
||||||
|
|
||||||
// NRF52 wants these constants as byte arrays
|
// NRF52 wants these constants as byte arrays
|
||||||
|
|||||||
@@ -7,10 +7,6 @@
|
|||||||
#include "power.h"
|
#include "power.h"
|
||||||
#include <OneButton.h>
|
#include <OneButton.h>
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
|
||||||
#include "nimble/BluetoothUtil.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace concurrency
|
namespace concurrency
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -55,6 +51,7 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
pinMode(BUTTON_PIN, INPUT_PULLUP_SENSE);
|
pinMode(BUTTON_PIN, INPUT_PULLUP_SENSE);
|
||||||
#endif
|
#endif
|
||||||
userButton.attachClick(userButtonPressed);
|
userButton.attachClick(userButtonPressed);
|
||||||
|
userButton.setClickTicks(300);
|
||||||
userButton.attachDuringLongPress(userButtonPressedLong);
|
userButton.attachDuringLongPress(userButtonPressedLong);
|
||||||
userButton.attachDoubleClick(userButtonDoublePressed);
|
userButton.attachDoubleClick(userButtonDoublePressed);
|
||||||
userButton.attachMultiClick(userButtonMultiPressed);
|
userButton.attachMultiClick(userButtonMultiPressed);
|
||||||
@@ -101,8 +98,8 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
userButtonTouch.tick();
|
userButtonTouch.tick();
|
||||||
canSleep &= userButtonTouch.isIdle();
|
canSleep &= userButtonTouch.isIdle();
|
||||||
#endif
|
#endif
|
||||||
// if (!canSleep) DEBUG_MSG("Supressing sleep!\n");
|
// if (!canSleep) LOG_DEBUG("Supressing sleep!\n");
|
||||||
// else DEBUG_MSG("sleep ok\n");
|
// else LOG_DEBUG("sleep ok\n");
|
||||||
|
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
@@ -111,29 +108,28 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
static void touchPressed()
|
static void touchPressed()
|
||||||
{
|
{
|
||||||
screen->forceDisplay();
|
screen->forceDisplay();
|
||||||
DEBUG_MSG("touch press!\n");
|
LOG_DEBUG("touch press!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void userButtonPressed()
|
static void userButtonPressed()
|
||||||
{
|
{
|
||||||
// DEBUG_MSG("press!\n");
|
// LOG_DEBUG("press!\n");
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
if ((BUTTON_PIN != moduleConfig.canned_message.inputbroker_pin_press) ||
|
if ((BUTTON_PIN != moduleConfig.canned_message.inputbroker_pin_press) || !moduleConfig.canned_message.enabled) {
|
||||||
!moduleConfig.canned_message.enabled) {
|
|
||||||
powerFSM.trigger(EVENT_PRESS);
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
static void userButtonPressedLong()
|
static void userButtonPressedLong()
|
||||||
{
|
{
|
||||||
// DEBUG_MSG("Long press!\n");
|
// LOG_DEBUG("Long press!\n");
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
screen->adjustBrightness();
|
screen->adjustBrightness();
|
||||||
#endif
|
#endif
|
||||||
// If user button is held down for 5 seconds, shutdown the device.
|
// If user button is held down for 5 seconds, shutdown the device.
|
||||||
if ((millis() - longPressTime > 5 * 1000) && (longPressTime > 0)) {
|
if ((millis() - longPressTime > 5 * 1000) && (longPressTime > 0)) {
|
||||||
#ifdef TBEAM_V10
|
#ifdef HAS_PMU
|
||||||
if (axp192_found == true) {
|
if (pmu_found == true) {
|
||||||
setLed(false);
|
setLed(false);
|
||||||
power->shutdown();
|
power->shutdown();
|
||||||
}
|
}
|
||||||
@@ -142,7 +138,7 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
// may wake the board immediatedly.
|
// may wake the board immediatedly.
|
||||||
if ((!shutdown_on_long_stop) && (millis() > 30 * 1000)) {
|
if ((!shutdown_on_long_stop) && (millis() > 30 * 1000)) {
|
||||||
screen->startShutdownScreen();
|
screen->startShutdownScreen();
|
||||||
DEBUG_MSG("Shutdown from long press");
|
LOG_INFO("Shutdown from long press");
|
||||||
playBeep();
|
playBeep();
|
||||||
#ifdef PIN_LED1
|
#ifdef PIN_LED1
|
||||||
ledOff(PIN_LED1);
|
ledOff(PIN_LED1);
|
||||||
@@ -157,33 +153,37 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
// DEBUG_MSG("Long press %u\n", (millis() - longPressTime));
|
// LOG_DEBUG("Long press %u\n", (millis() - longPressTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void userButtonDoublePressed()
|
static void userButtonDoublePressed()
|
||||||
{
|
{
|
||||||
#ifdef ARCH_ESP32
|
#if defined(USE_EINK) && defined(PIN_EINK_EN)
|
||||||
disablePin();
|
|
||||||
#elif defined(USE_EINK)
|
|
||||||
digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW);
|
digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW);
|
||||||
#endif
|
#endif
|
||||||
|
screen->print("Sent ad-hoc ping\n");
|
||||||
|
service.refreshMyNodeInfo();
|
||||||
|
service.sendNetworkPing(NODENUM_BROADCAST, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void userButtonMultiPressed()
|
static void userButtonMultiPressed()
|
||||||
{
|
{
|
||||||
#ifdef ARCH_ESP32
|
#if defined(GPS_POWER_TOGGLE)
|
||||||
clearNVS();
|
if (config.position.gps_enabled) {
|
||||||
#endif
|
LOG_DEBUG("Flag set to false for gps power\n");
|
||||||
#ifdef ARCH_NRF52
|
} else {
|
||||||
clearBonds();
|
LOG_DEBUG("Flag set to true to restore power\n");
|
||||||
|
}
|
||||||
|
config.position.gps_enabled = !(config.position.gps_enabled);
|
||||||
|
doGPSpowersave(config.position.gps_enabled);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void userButtonPressedLongStart()
|
static void userButtonPressedLongStart()
|
||||||
{
|
{
|
||||||
if (millis() > 30 * 1000) {
|
if (millis() > 30 * 1000) {
|
||||||
DEBUG_MSG("Long press start!\n");
|
LOG_DEBUG("Long press start!\n");
|
||||||
longPressTime = millis();
|
longPressTime = millis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -191,7 +191,7 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
static void userButtonPressedLongStop()
|
static void userButtonPressedLongStop()
|
||||||
{
|
{
|
||||||
if (millis() > 30 * 1000) {
|
if (millis() > 30 * 1000) {
|
||||||
DEBUG_MSG("Long press stop!\n");
|
LOG_DEBUG("Long press stop!\n");
|
||||||
longPressTime = 0;
|
longPressTime = 0;
|
||||||
if (shutdown_on_long_stop) {
|
if (shutdown_on_long_stop) {
|
||||||
playShutdownMelody();
|
playShutdownMelody();
|
||||||
|
|||||||
@@ -13,17 +13,33 @@
|
|||||||
#define SERIAL_BAUD 115200 // Serial debug baud rate
|
#define SERIAL_BAUD 115200 // Serial debug baud rate
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_DEBUG "DEBUG"
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_INFO "INFO "
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_WARN "WARN "
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_ERROR "ERROR"
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_TRACE "TRACE"
|
||||||
|
|
||||||
#include "SerialConsole.h"
|
#include "SerialConsole.h"
|
||||||
|
|
||||||
#define DEBUG_PORT (*console) // Serial debug port
|
#define DEBUG_PORT (*console) // Serial debug port
|
||||||
|
|
||||||
#ifdef USE_SEGGER
|
#ifdef USE_SEGGER
|
||||||
#define DEBUG_MSG(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
#define LOG_DEBUG(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
|
#define LOG_INFO(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
|
#define LOG_WARN(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
|
#define LOG_ERROR(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_PORT
|
#ifdef DEBUG_PORT
|
||||||
#define DEBUG_MSG(...) DEBUG_PORT.logDebug(__VA_ARGS__)
|
#define LOG_DEBUG(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_DEBUG, __VA_ARGS__)
|
||||||
|
#define LOG_INFO(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_INFO, __VA_ARGS__)
|
||||||
|
#define LOG_WARN(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_WARN, __VA_ARGS__)
|
||||||
|
#define LOG_ERROR(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_ERROR, __VA_ARGS__)
|
||||||
|
#define LOG_TRACE(...) DEBUG_PORT.log(MESHTASTIC_LOG_TRACE, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define DEBUG_MSG(...)
|
#define LOG_DEBUG(...)
|
||||||
|
#define LOG_INFO(...)
|
||||||
|
#define LOG_WARN(...)
|
||||||
|
#define LOG_ERROR(...)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
209
src/FSCommon.cpp
209
src/FSCommon.cpp
@@ -1,21 +1,31 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "FSCommon.h"
|
#include "FSCommon.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
|
#ifdef HAS_SDCARD
|
||||||
|
#include <SD.h>
|
||||||
|
#include <SPI.h>
|
||||||
|
|
||||||
bool copyFile(const char* from, const char* to)
|
#ifdef SDCARD_USE_SPI1
|
||||||
|
SPIClass SPI1(HSPI);
|
||||||
|
#define SDHandler SPI1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // HAS_SDCARD
|
||||||
|
|
||||||
|
bool copyFile(const char *from, const char *to)
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
unsigned char cbuffer[16];
|
unsigned char cbuffer[16];
|
||||||
|
|
||||||
File f1 = FSCom.open(from, FILE_O_READ);
|
File f1 = FSCom.open(from, FILE_O_READ);
|
||||||
if (!f1){
|
if (!f1) {
|
||||||
DEBUG_MSG("Failed to open file");
|
LOG_ERROR("Failed to open source file %s\n", 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) {
|
||||||
DEBUG_MSG("Failed to open file");
|
LOG_ERROR("Failed to open destination file %s\n", to);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,94 +40,173 @@ bool copyFile(const char* from, const char* to)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool renameFile(const char* pathFrom, const char* pathTo)
|
bool renameFile(const char *pathFrom, const char *pathTo)
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
if (copyFile(pathFrom, pathTo) && FSCom.remove(pathFrom) ) {
|
#ifdef ARCH_ESP32
|
||||||
|
// rename was fixed for ESP32 IDF LittleFS in April
|
||||||
|
return FSCom.rename(pathFrom, pathTo);
|
||||||
|
#else
|
||||||
|
if (copyFile(pathFrom, pathTo) && FSCom.remove(pathFrom)) {
|
||||||
return true;
|
return true;
|
||||||
} else{
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void listDir(const char * dirname, uint8_t levels)
|
void listDir(const char *dirname, uint8_t levels, boolean del = false)
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
File root = FSCom.open(dirname);
|
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
if(!root){
|
char buffer[255];
|
||||||
|
#endif
|
||||||
|
File root = FSCom.open(dirname, FILE_O_READ);
|
||||||
|
if (!root) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!root.isDirectory()){
|
if (!root.isDirectory()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
File file = root.openNextFile();
|
File file = root.openNextFile();
|
||||||
while(file){
|
while (file) {
|
||||||
if(file.isDirectory() && !String(file.name()).endsWith(".")) {
|
if (file.isDirectory() && !String(file.name()).endsWith(".")) {
|
||||||
if(levels){
|
if (levels) {
|
||||||
listDir(file.name(), levels -1);
|
#ifdef ARCH_ESP32
|
||||||
|
listDir(file.path(), levels - 1, del);
|
||||||
|
if (del) {
|
||||||
|
LOG_DEBUG("Removing %s\n", file.path());
|
||||||
|
strncpy(buffer, file.path(), sizeof(buffer));
|
||||||
|
file.close();
|
||||||
|
FSCom.rmdir(buffer);
|
||||||
|
} else {
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
|
listDir(file.name(), levels - 1, del);
|
||||||
|
if (del) {
|
||||||
|
LOG_DEBUG("Removing %s\n", file.name());
|
||||||
|
strncpy(buffer, file.name(), sizeof(buffer));
|
||||||
|
file.close();
|
||||||
|
FSCom.rmdir(buffer);
|
||||||
|
} else {
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
listDir(file.name(), levels - 1, del);
|
||||||
|
file.close();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG(" %s (%i Bytes)\n", file.name(), file.size());
|
#ifdef ARCH_ESP32
|
||||||
}
|
if (del) {
|
||||||
|
LOG_DEBUG("Deleting %s\n", file.path());
|
||||||
|
strncpy(buffer, file.path(), sizeof(buffer));
|
||||||
file.close();
|
file.close();
|
||||||
|
FSCom.remove(buffer);
|
||||||
|
} else {
|
||||||
|
LOG_DEBUG(" %s (%i Bytes)\n", file.path(), file.size());
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
|
if (del) {
|
||||||
|
LOG_DEBUG("Deleting %s\n", file.name());
|
||||||
|
strncpy(buffer, file.name(), sizeof(buffer));
|
||||||
|
file.close();
|
||||||
|
FSCom.remove(buffer);
|
||||||
|
} else {
|
||||||
|
LOG_DEBUG(" %s (%i Bytes)\n", file.name(), file.size());
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
LOG_DEBUG(" %s (%i Bytes)\n", file.name(), file.size());
|
||||||
|
file.close();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
file = root.openNextFile();
|
file = root.openNextFile();
|
||||||
}
|
}
|
||||||
file.close();
|
#ifdef ARCH_ESP32
|
||||||
|
if (del) {
|
||||||
|
LOG_DEBUG("Removing %s\n", root.path());
|
||||||
|
strncpy(buffer, root.path(), sizeof(buffer));
|
||||||
|
root.close();
|
||||||
|
FSCom.rmdir(buffer);
|
||||||
|
} else {
|
||||||
|
root.close();
|
||||||
|
}
|
||||||
|
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
|
if (del) {
|
||||||
|
LOG_DEBUG("Removing %s\n", root.name());
|
||||||
|
strncpy(buffer, root.name(), sizeof(buffer));
|
||||||
|
root.close();
|
||||||
|
FSCom.rmdir(buffer);
|
||||||
|
} else {
|
||||||
|
root.close();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
root.close();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void rmDir(const char * dirname)
|
void rmDir(const char *dirname)
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
File file = FSCom.open(dirname);
|
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
if(!file){
|
listDir(dirname, 10, true);
|
||||||
return;
|
#elif defined(ARCH_NRF52)
|
||||||
}
|
// nRF52 implementation of LittleFS has a recursive delete function
|
||||||
if(!file.isDirectory()){
|
FSCom.rmdir_r(dirname);
|
||||||
file.close();
|
#endif
|
||||||
FSCom.remove(file.name());
|
|
||||||
// DEBUG_MSG("Remove FILE %s\n", file.name());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
file.rewindDirectory();
|
|
||||||
while (true) {
|
|
||||||
File entry = file.openNextFile();
|
|
||||||
if (!entry) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
char dirpath[100]; // array to hold the result.
|
|
||||||
strcpy(dirpath, dirname); // copy string one into the result.
|
|
||||||
strcat(dirpath,"/"); // append string two to the result.
|
|
||||||
strcat(dirpath,entry.name()); // append string two to the result.
|
|
||||||
if(entry.isDirectory() && !String(entry.name()).endsWith(".")) {
|
|
||||||
entry.close();
|
|
||||||
// DEBUG_MSG("Descend DIR %s\n", dirpath);
|
|
||||||
rmDir(dirpath);
|
|
||||||
} else {
|
|
||||||
entry.close();
|
|
||||||
// DEBUG_MSG("Remove FILE %s\n", entry.name());
|
|
||||||
FSCom.remove(entry.name());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FSCom.rmdir(dirname);
|
|
||||||
// DEBUG_MSG("Remove DIR %s\n", dirname);
|
|
||||||
file.close();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void fsInit()
|
void fsInit()
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
if (!FSBegin())
|
if (!FSBegin()) {
|
||||||
{
|
LOG_ERROR("Filesystem mount Failed.\n");
|
||||||
DEBUG_MSG("ERROR filesystem mount Failed. Formatting...\n");
|
// assert(0); This auto-formats the partition, so no need to fail here.
|
||||||
assert(0); // FIXME - report failure to phone
|
|
||||||
}
|
}
|
||||||
|
#ifdef ARCH_ESP32
|
||||||
DEBUG_MSG("Filesystem files:\n");
|
LOG_DEBUG("Filesystem files (%d/%d Bytes):\n", FSCom.usedBytes(), FSCom.totalBytes());
|
||||||
|
#else
|
||||||
|
LOG_DEBUG("Filesystem files:\n");
|
||||||
|
#endif
|
||||||
listDir("/", 10);
|
listDir("/", 10);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setupSDCard()
|
||||||
|
{
|
||||||
|
#ifdef HAS_SDCARD
|
||||||
|
SDHandler.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
|
||||||
|
|
||||||
|
if (!SD.begin(SDCARD_CS, SDHandler)) {
|
||||||
|
LOG_DEBUG("No SD_MMC card detected\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uint8_t cardType = SD.cardType();
|
||||||
|
if (cardType == CARD_NONE) {
|
||||||
|
LOG_DEBUG("No SD_MMC card attached\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LOG_DEBUG("SD_MMC Card Type: ");
|
||||||
|
if (cardType == CARD_MMC) {
|
||||||
|
LOG_DEBUG("MMC\n");
|
||||||
|
} else if (cardType == CARD_SD) {
|
||||||
|
LOG_DEBUG("SDSC\n");
|
||||||
|
} else if (cardType == CARD_SDHC) {
|
||||||
|
LOG_DEBUG("SDHC\n");
|
||||||
|
} else {
|
||||||
|
LOG_DEBUG("UNKNOWN\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
|
||||||
|
LOG_DEBUG("SD Card Size: %lluMB\n", cardSize);
|
||||||
|
LOG_DEBUG("Total space: %llu MB\n", SD.totalBytes() / (1024 * 1024));
|
||||||
|
LOG_DEBUG("Used space: %llu MB\n", SD.usedBytes() / (1024 * 1024));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,11 +13,20 @@
|
|||||||
#define FILE_O_READ "r"
|
#define FILE_O_READ "r"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ARCH_RP2040)
|
||||||
|
// RP2040
|
||||||
|
#include "LittleFS.h"
|
||||||
|
#define FSCom LittleFS
|
||||||
|
#define FSBegin() FSCom.begin() // set autoformat
|
||||||
|
#define FILE_O_WRITE "w"
|
||||||
|
#define FILE_O_READ "r"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(ARCH_ESP32)
|
#if defined(ARCH_ESP32)
|
||||||
// ESP32 version
|
// ESP32 version
|
||||||
#include "LITTLEFS.h"
|
#include "LittleFS.h"
|
||||||
#define FSCom LITTLEFS
|
#define FSCom LittleFS
|
||||||
#define FSBegin() FSCom.begin(true)
|
#define FSBegin() FSCom.begin(true) // format on failure
|
||||||
#define FILE_O_WRITE "w"
|
#define FILE_O_WRITE "w"
|
||||||
#define FILE_O_READ "r"
|
#define FILE_O_READ "r"
|
||||||
#endif
|
#endif
|
||||||
@@ -26,11 +35,13 @@
|
|||||||
// NRF52 version
|
// NRF52 version
|
||||||
#include "InternalFileSystem.h"
|
#include "InternalFileSystem.h"
|
||||||
#define FSCom InternalFS
|
#define FSCom InternalFS
|
||||||
#define FSBegin() FSCom.begin()
|
#define FSBegin() FSCom.begin() // InternalFS formats on failure
|
||||||
using namespace Adafruit_LittleFS_Namespace;
|
using namespace Adafruit_LittleFS_Namespace;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void fsInit();
|
void fsInit();
|
||||||
bool renameFile(const char* pathFrom, const char* pathTo);
|
bool copyFile(const char *from, const char *to);
|
||||||
void listDir(const char * dirname, uint8_t levels);
|
bool renameFile(const char *pathFrom, const char *pathTo);
|
||||||
void rmDir(const char * dirname);
|
void listDir(const char *dirname, uint8_t levels, boolean del);
|
||||||
|
void rmDir(const char *dirname);
|
||||||
|
void setupSDCard();
|
||||||
@@ -20,32 +20,19 @@ class GPSStatus : public Status
|
|||||||
bool hasLock = false; // default to false, until we complete our first read
|
bool hasLock = false; // default to false, until we complete our first read
|
||||||
bool isConnected = false; // Do we have a GPS we are talking to
|
bool isConnected = false; // Do we have a GPS we are talking to
|
||||||
|
|
||||||
Position p = Position_init_default;
|
bool isPowerSaving = false; // Are we in power saving state
|
||||||
|
|
||||||
|
meshtastic_Position p = meshtastic_Position_init_default;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GPSStatus() { statusType = STATUS_TYPE_GPS; }
|
GPSStatus() { statusType = STATUS_TYPE_GPS; }
|
||||||
|
|
||||||
// proposed for deprecation
|
|
||||||
GPSStatus(bool hasLock, bool isConnected, int32_t latitude, int32_t longitude, int32_t altitude, uint32_t dop,
|
|
||||||
uint32_t heading, uint32_t numSatellites)
|
|
||||||
: Status()
|
|
||||||
{
|
|
||||||
this->hasLock = hasLock;
|
|
||||||
this->isConnected = isConnected;
|
|
||||||
|
|
||||||
this->p.latitude_i = latitude;
|
|
||||||
this->p.longitude_i = longitude;
|
|
||||||
this->p.altitude = altitude;
|
|
||||||
this->p.PDOP = dop;
|
|
||||||
this->p.ground_track = heading;
|
|
||||||
this->p.sats_in_view = numSatellites;
|
|
||||||
}
|
|
||||||
|
|
||||||
// preferred method
|
// preferred method
|
||||||
GPSStatus(bool hasLock, bool isConnected, const Position &pos) : Status()
|
GPSStatus(bool hasLock, bool isConnected, bool isPowerSaving, const meshtastic_Position &pos) : Status()
|
||||||
{
|
{
|
||||||
this->hasLock = hasLock;
|
this->hasLock = hasLock;
|
||||||
this->isConnected = isConnected;
|
this->isConnected = isConnected;
|
||||||
|
this->isPowerSaving = isPowerSaving;
|
||||||
|
|
||||||
// all-in-one struct copy
|
// all-in-one struct copy
|
||||||
this->p = pos;
|
this->p = pos;
|
||||||
@@ -60,13 +47,15 @@ class GPSStatus : public Status
|
|||||||
|
|
||||||
bool getIsConnected() const { return isConnected; }
|
bool getIsConnected() const { return isConnected; }
|
||||||
|
|
||||||
|
bool getIsPowerSaving() const { return isPowerSaving; }
|
||||||
|
|
||||||
int32_t getLatitude() const
|
int32_t getLatitude() const
|
||||||
{
|
{
|
||||||
if (config.position.fixed_position) {
|
if (config.position.fixed_position) {
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
#ifdef GPS_EXTRAVERBOSE
|
||||||
DEBUG_MSG("WARNING: Using fixed latitude\n");
|
LOG_WARN("Using fixed latitude\n");
|
||||||
#endif
|
#endif
|
||||||
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
meshtastic_NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
||||||
return node->position.latitude_i;
|
return node->position.latitude_i;
|
||||||
} else {
|
} else {
|
||||||
return p.latitude_i;
|
return p.latitude_i;
|
||||||
@@ -77,9 +66,9 @@ class GPSStatus : public Status
|
|||||||
{
|
{
|
||||||
if (config.position.fixed_position) {
|
if (config.position.fixed_position) {
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
#ifdef GPS_EXTRAVERBOSE
|
||||||
DEBUG_MSG("WARNING: Using fixed longitude\n");
|
LOG_WARN("Using fixed longitude\n");
|
||||||
#endif
|
#endif
|
||||||
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
meshtastic_NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
||||||
return node->position.longitude_i;
|
return node->position.longitude_i;
|
||||||
} else {
|
} else {
|
||||||
return p.longitude_i;
|
return p.longitude_i;
|
||||||
@@ -90,30 +79,40 @@ class GPSStatus : public Status
|
|||||||
{
|
{
|
||||||
if (config.position.fixed_position) {
|
if (config.position.fixed_position) {
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
#ifdef GPS_EXTRAVERBOSE
|
||||||
DEBUG_MSG("WARNING: Using fixed altitude\n");
|
LOG_WARN("Using fixed altitude\n");
|
||||||
#endif
|
#endif
|
||||||
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
meshtastic_NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
||||||
return node->position.altitude;
|
return node->position.altitude;
|
||||||
} else {
|
} else {
|
||||||
return p.altitude;
|
return p.altitude;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getDOP() const { return p.PDOP; }
|
uint32_t getDOP() const
|
||||||
|
{
|
||||||
|
return p.PDOP;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t getHeading() const { return p.ground_track; }
|
uint32_t getHeading() const
|
||||||
|
{
|
||||||
|
return p.ground_track;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t getNumSatellites() const { return p.sats_in_view; }
|
uint32_t getNumSatellites() const
|
||||||
|
{
|
||||||
|
return p.sats_in_view;
|
||||||
|
}
|
||||||
|
|
||||||
bool matches(const GPSStatus *newStatus) const
|
bool matches(const GPSStatus *newStatus) const
|
||||||
{
|
{
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
#ifdef GPS_EXTRAVERBOSE
|
||||||
DEBUG_MSG("GPSStatus.match() new pos@%x to old pos@%x\n", newStatus->p.pos_timestamp, p.pos_timestamp);
|
LOG_DEBUG("GPSStatus.match() new pos@%x to old pos@%x\n", newStatus->p.pos_timestamp, p.pos_timestamp);
|
||||||
#endif
|
#endif
|
||||||
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected ||
|
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected ||
|
||||||
newStatus->p.latitude_i != p.latitude_i || newStatus->p.longitude_i != p.longitude_i ||
|
newStatus->isPowerSaving != isPowerSaving || newStatus->p.latitude_i != p.latitude_i ||
|
||||||
newStatus->p.altitude != p.altitude || newStatus->p.altitude_hae != p.altitude_hae ||
|
newStatus->p.longitude_i != p.longitude_i || newStatus->p.altitude != p.altitude ||
|
||||||
newStatus->p.PDOP != p.PDOP || newStatus->p.ground_track != p.ground_track ||
|
newStatus->p.altitude_hae != p.altitude_hae || newStatus->p.PDOP != p.PDOP ||
|
||||||
|
newStatus->p.ground_track != p.ground_track || newStatus->p.ground_speed != p.ground_speed ||
|
||||||
newStatus->p.sats_in_view != p.sats_in_view);
|
newStatus->p.sats_in_view != p.sats_in_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,9 +121,9 @@ class GPSStatus : public Status
|
|||||||
// Only update the status if values have actually changed
|
// Only update the status if values have actually changed
|
||||||
bool isDirty = matches(newStatus);
|
bool isDirty = matches(newStatus);
|
||||||
|
|
||||||
if (isDirty && p.pos_timestamp && (newStatus->p.pos_timestamp == p.pos_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)
|
||||||
DEBUG_MSG("BUG!! positional timestamp unchanged from prev solution\n");
|
LOG_ERROR("BUG: Positional timestamp unchanged from prev solution\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
@@ -136,11 +135,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)
|
||||||
DEBUG_MSG("New GPS pos@%x:3 lat=%f, lon=%f, alt=%d, pdop=%.2f, track=%.2f, sats=%d\n", p.pos_timestamp,
|
LOG_DEBUG("New GPS pos@%x:3 lat=%f, lon=%f, alt=%d, pdop=%.2f, track=%.2f, speed=%.2f, sats=%d\n", 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.sats_in_view);
|
p.ground_speed * 1e-2, p.sats_in_view);
|
||||||
} else
|
} else
|
||||||
DEBUG_MSG("No GPS lock\n");
|
LOG_DEBUG("No GPS lock\n");
|
||||||
onNewStatus.notifyObservers(this);
|
onNewStatus.notifyObservers(this);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <Arduino.h>
|
|
||||||
#include "Status.h"
|
#include "Status.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include <Arduino.h>
|
||||||
|
|
||||||
namespace meshtastic {
|
namespace meshtastic
|
||||||
|
{
|
||||||
|
|
||||||
/// Describes the state of the NodeDB system.
|
/// Describes the state of the NodeDB system.
|
||||||
class NodeStatus : public Status
|
class NodeStatus : public Status
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CallbackObserver<NodeStatus, const NodeStatus *> statusObserver = CallbackObserver<NodeStatus, const NodeStatus *>(this, &NodeStatus::updateStatus);
|
CallbackObserver<NodeStatus, const NodeStatus *> statusObserver =
|
||||||
|
CallbackObserver<NodeStatus, const NodeStatus *>(this, &NodeStatus::updateStatus);
|
||||||
|
|
||||||
uint8_t numOnline = 0;
|
uint8_t numOnline = 0;
|
||||||
uint8_t numTotal = 0;
|
uint8_t numTotal = 0;
|
||||||
@@ -20,10 +22,8 @@ namespace meshtastic {
|
|||||||
public:
|
public:
|
||||||
bool forceUpdate = false;
|
bool forceUpdate = false;
|
||||||
|
|
||||||
NodeStatus() {
|
NodeStatus() { statusType = STATUS_TYPE_NODE; }
|
||||||
statusType = STATUS_TYPE_NODE;
|
NodeStatus(uint8_t numOnline, uint8_t numTotal, bool forceUpdate = false) : Status()
|
||||||
}
|
|
||||||
NodeStatus( uint8_t numOnline, uint8_t numTotal, bool forceUpdate = false ) : Status()
|
|
||||||
{
|
{
|
||||||
this->forceUpdate = forceUpdate;
|
this->forceUpdate = forceUpdate;
|
||||||
this->numOnline = numOnline;
|
this->numOnline = numOnline;
|
||||||
@@ -32,34 +32,20 @@ namespace meshtastic {
|
|||||||
NodeStatus(const NodeStatus &);
|
NodeStatus(const NodeStatus &);
|
||||||
NodeStatus &operator=(const NodeStatus &);
|
NodeStatus &operator=(const NodeStatus &);
|
||||||
|
|
||||||
void observe(Observable<const NodeStatus *> *source)
|
void observe(Observable<const NodeStatus *> *source) { statusObserver.observe(source); }
|
||||||
{
|
|
||||||
statusObserver.observe(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getNumOnline() const
|
uint8_t getNumOnline() const { return numOnline; }
|
||||||
{
|
|
||||||
return numOnline;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getNumTotal() const
|
uint8_t getNumTotal() const { return numTotal; }
|
||||||
{
|
|
||||||
return numTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getLastNumTotal() const
|
uint8_t getLastNumTotal() const { return lastNumTotal; }
|
||||||
{
|
|
||||||
return lastNumTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool matches(const NodeStatus *newStatus) const
|
bool matches(const NodeStatus *newStatus) const
|
||||||
{
|
{
|
||||||
return (
|
return (newStatus->getNumOnline() != numOnline || newStatus->getNumTotal() != numTotal);
|
||||||
newStatus->getNumOnline() != numOnline ||
|
|
||||||
newStatus->getNumTotal() != numTotal
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
int updateStatus(const NodeStatus *newStatus) {
|
int updateStatus(const NodeStatus *newStatus)
|
||||||
|
{
|
||||||
// Only update the status if values have actually changed
|
// Only update the status if values have actually changed
|
||||||
lastNumTotal = numTotal;
|
lastNumTotal = numTotal;
|
||||||
bool isDirty;
|
bool isDirty;
|
||||||
@@ -69,15 +55,14 @@ namespace meshtastic {
|
|||||||
numOnline = newStatus->getNumOnline();
|
numOnline = newStatus->getNumOnline();
|
||||||
numTotal = newStatus->getNumTotal();
|
numTotal = newStatus->getNumTotal();
|
||||||
}
|
}
|
||||||
if(isDirty || newStatus->forceUpdate) {
|
if (isDirty || newStatus->forceUpdate) {
|
||||||
DEBUG_MSG("Node status update: %d online, %d total\n", numOnline, numTotal);
|
LOG_DEBUG("Node status update: %d online, %d total\n", numOnline, numTotal);
|
||||||
onNewStatus.notifyObservers(this);
|
onNewStatus.notifyObservers(this);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
};
|
} // namespace meshtastic
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
extern meshtastic::NodeStatus *nodeStatus;
|
extern meshtastic::NodeStatus *nodeStatus;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "OSTimer.h"
|
#include "OSTimer.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schedule a callback to run. The callback must _not_ block, though it is called from regular thread level (not ISR)
|
* Schedule a callback to run. The callback must _not_ block, though it is called from regular thread level (not ISR)
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "Observer.h"
|
#include "Observer.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <assert.h>
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
template <class T> class Observable;
|
template <class T> class Observable;
|
||||||
|
|||||||
507
src/Power.cpp
507
src/Power.cpp
@@ -1,18 +1,17 @@
|
|||||||
#include "power.h"
|
#include "power.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
|
#include "buzz/buzz.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "buzz/buzz.h"
|
|
||||||
|
|
||||||
#ifdef TBEAM_V10
|
#ifdef HAS_PMU
|
||||||
// FIXME. nasty hack cleanup how we load axp192
|
#include "XPowersAXP192.tpp"
|
||||||
#undef AXP192_SLAVE_ADDRESS
|
#include "XPowersAXP2101.tpp"
|
||||||
#include "axp20x.h"
|
#include "XPowersLibInterface.hpp"
|
||||||
|
XPowersLibInterface *PMU = NULL;
|
||||||
AXP20X_Class axp;
|
|
||||||
#else
|
#else
|
||||||
// Copy of the base class defined in axp20x.h.
|
// Copy of the base class defined in axp20x.h.
|
||||||
// I'd rather not inlude axp20x.h as it brings Wire dependency.
|
// I'd rather not inlude axp20x.h as it brings Wire dependency.
|
||||||
@@ -22,20 +21,20 @@ class HasBatteryLevel
|
|||||||
/**
|
/**
|
||||||
* Battery state of charge, from 0 to 100 or -1 for unknown
|
* Battery state of charge, from 0 to 100 or -1 for unknown
|
||||||
*/
|
*/
|
||||||
virtual int getBattPercentage() { return -1; }
|
virtual int getBatteryPercent() { return -1; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The raw voltage of the battery or NAN if unknown
|
* The raw voltage of the battery or NAN if unknown
|
||||||
*/
|
*/
|
||||||
virtual float getBattVoltage() { return NAN; }
|
virtual uint16_t getBattVoltage() { return 0; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return true if there is a battery installed in this unit
|
* return true if there is a battery installed in this unit
|
||||||
*/
|
*/
|
||||||
virtual bool isBatteryConnect() { return false; }
|
virtual bool isBatteryConnect() { return false; }
|
||||||
|
|
||||||
virtual bool isVBUSPlug() { return false; }
|
virtual bool isVbusIn() { return false; }
|
||||||
virtual bool isChargeing() { return false; }
|
virtual bool isCharging() { return false; }
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -77,7 +76,7 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
*
|
*
|
||||||
* FIXME - use a lipo lookup table, the current % full is super wrong
|
* FIXME - use a lipo lookup table, the current % full is super wrong
|
||||||
*/
|
*/
|
||||||
virtual int getBattPercentage() override
|
virtual int getBatteryPercent() override
|
||||||
{
|
{
|
||||||
float v = getBattVoltage();
|
float v = getBattVoltage();
|
||||||
|
|
||||||
@@ -96,33 +95,33 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
/**
|
/**
|
||||||
* The raw voltage of the batteryin millivolts or NAN if unknown
|
* The raw voltage of the batteryin millivolts or NAN if unknown
|
||||||
*/
|
*/
|
||||||
virtual float getBattVoltage() override
|
virtual uint16_t getBattVoltage() override
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifndef ADC_MULTIPLIER
|
#ifndef ADC_MULTIPLIER
|
||||||
#define ADC_MULTIPLIER 2.0
|
#define ADC_MULTIPLIER 2.0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef BATTERY_SENSE_SAMPLES
|
||||||
|
#define BATTERY_SENSE_SAMPLES 30
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BATTERY_PIN
|
#ifdef BATTERY_PIN
|
||||||
// Override variant or default ADC_MULTIPLIER if we have the override pref
|
// Override variant or default ADC_MULTIPLIER if we have the override pref
|
||||||
float operativeAdcMultiplier = config.power.adc_multiplier_override > 0
|
float operativeAdcMultiplier =
|
||||||
? config.power.adc_multiplier_override
|
config.power.adc_multiplier_override > 0 ? config.power.adc_multiplier_override : ADC_MULTIPLIER;
|
||||||
: 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 (millis() - last_read_time_ms > min_read_interval) {
|
||||||
last_read_time_ms = millis();
|
last_read_time_ms = millis();
|
||||||
|
|
||||||
#ifdef BATTERY_SENSE_SAMPLES
|
// Set the number of samples, it has an effect of increasing sensitivity, especially in complex electromagnetic
|
||||||
//Set the number of samples, it has an effect of increasing sensitivity, especially in complex electromagnetic environment.
|
// environment.
|
||||||
uint32_t raw = 0;
|
uint32_t raw = 0;
|
||||||
for(uint32_t i=0; i<BATTERY_SENSE_SAMPLES;i++){
|
for (uint32_t i = 0; i < BATTERY_SENSE_SAMPLES; i++) {
|
||||||
raw += analogRead(BATTERY_PIN);
|
raw += analogRead(BATTERY_PIN);
|
||||||
}
|
}
|
||||||
raw = raw/BATTERY_SENSE_SAMPLES;
|
raw = raw / BATTERY_SENSE_SAMPLES;
|
||||||
#else
|
|
||||||
uint32_t raw = analogRead(BATTERY_PIN);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float scaled;
|
float scaled;
|
||||||
#ifndef VBAT_RAW_TO_SCALED
|
#ifndef VBAT_RAW_TO_SCALED
|
||||||
@@ -130,36 +129,58 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
#else
|
#else
|
||||||
scaled = VBAT_RAW_TO_SCALED(raw); // defined in variant.h
|
scaled = VBAT_RAW_TO_SCALED(raw); // defined in variant.h
|
||||||
#endif
|
#endif
|
||||||
// DEBUG_MSG("battery gpio %d raw val=%u scaled=%u\n", BATTERY_PIN, raw, (uint32_t)(scaled));
|
// LOG_DEBUG("battery gpio %d raw val=%u scaled=%u\n", BATTERY_PIN, raw, (uint32_t)(scaled));
|
||||||
last_read_value = scaled;
|
last_read_value = scaled;
|
||||||
return scaled;
|
return scaled;
|
||||||
} else {
|
} else {
|
||||||
return last_read_value;
|
return last_read_value;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
return NAN;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return true if there is a battery installed in this unit
|
* return true if there is a battery installed in this unit
|
||||||
*/
|
*/
|
||||||
virtual bool isBatteryConnect() override { return getBattPercentage() != -1; }
|
virtual bool isBatteryConnect() override
|
||||||
|
{
|
||||||
|
return getBatteryPercent() != -1;
|
||||||
|
}
|
||||||
|
|
||||||
/// 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
|
||||||
virtual bool isVBUSPlug() override { return getBattVoltage() > chargingVolt; }
|
virtual bool isVbusIn() override
|
||||||
|
{
|
||||||
|
return getBattVoltage() > chargingVolt;
|
||||||
|
}
|
||||||
|
|
||||||
/// Assume charging if we have a battery and external power is connected.
|
/// Assume charging if we have a battery and external power is connected.
|
||||||
/// we can't be smart enough to say 'full'?
|
/// we can't be smart enough to say 'full'?
|
||||||
virtual bool isChargeing() override { return isBatteryConnect() && isVBUSPlug(); }
|
virtual bool isCharging() override
|
||||||
|
{
|
||||||
|
return isBatteryConnect() && isVbusIn();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// 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
|
||||||
|
|
||||||
|
#ifndef BAT_FULLVOLT
|
||||||
|
#define BAT_FULLVOLT 4200
|
||||||
|
#endif
|
||||||
|
#ifndef BAT_EMPTYVOLT
|
||||||
|
#define BAT_EMPTYVOLT 3270
|
||||||
|
#endif
|
||||||
|
#ifndef BAT_CHARGINGVOLT
|
||||||
|
#define BAT_CHARGINGVOLT 4210
|
||||||
|
#endif
|
||||||
|
#ifndef BAT_NOBATVOLT
|
||||||
|
#define BAT_NOBATVOLT 2230
|
||||||
|
#endif
|
||||||
|
|
||||||
/// For heltecs with no battery connected, the measured voltage is 2204, so raising to 2230 from 2100
|
/// For heltecs with no battery connected, the measured voltage is 2204, so raising to 2230 from 2100
|
||||||
const float fullVolt = 4200, emptyVolt = 3270, chargingVolt = 4210, noBatVolt = 2230;
|
const float fullVolt = BAT_FULLVOLT, emptyVolt = BAT_EMPTYVOLT, chargingVolt = BAT_CHARGINGVOLT, noBatVolt = BAT_NOBATVOLT;
|
||||||
float last_read_value = 0.0;
|
float last_read_value = 0.0;
|
||||||
uint32_t last_read_time_ms = 0;
|
uint32_t last_read_time_ms = 0;
|
||||||
};
|
};
|
||||||
@@ -170,12 +191,15 @@ Power::Power() : OSThread("Power")
|
|||||||
{
|
{
|
||||||
statusHandler = {};
|
statusHandler = {};
|
||||||
low_voltage_counter = 0;
|
low_voltage_counter = 0;
|
||||||
|
#ifdef DEBUG_HEAP
|
||||||
|
lastheap = ESP.getFreeHeap();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Power::analogInit()
|
bool Power::analogInit()
|
||||||
{
|
{
|
||||||
#ifdef BATTERY_PIN
|
#ifdef BATTERY_PIN
|
||||||
DEBUG_MSG("Using analog input %d for battery level\n", BATTERY_PIN);
|
LOG_DEBUG("Using analog input %d for battery level\n", BATTERY_PIN);
|
||||||
|
|
||||||
// disable any internal pullups
|
// disable any internal pullups
|
||||||
pinMode(BATTERY_PIN, INPUT);
|
pinMode(BATTERY_PIN, INPUT);
|
||||||
@@ -208,7 +232,7 @@ bool Power::analogInit()
|
|||||||
|
|
||||||
bool Power::setup()
|
bool Power::setup()
|
||||||
{
|
{
|
||||||
bool found = axp192Init();
|
bool found = axpChipInit();
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
found = analogInit();
|
found = analogInit();
|
||||||
@@ -221,10 +245,17 @@ bool Power::setup()
|
|||||||
|
|
||||||
void Power::shutdown()
|
void Power::shutdown()
|
||||||
{
|
{
|
||||||
#ifdef TBEAM_V10
|
screen->setOn(false);
|
||||||
DEBUG_MSG("Shutting down\n");
|
#if defined(USE_EINK) && defined(PIN_EINK_EN)
|
||||||
axp.setChgLEDMode(AXP20X_LED_OFF);
|
digitalWrite(PIN_EINK_EN, LOW); // power off backlight first
|
||||||
axp.shutdown();
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAS_PMU
|
||||||
|
LOG_INFO("Shutting down\n");
|
||||||
|
if (PMU) {
|
||||||
|
PMU->setChargingLedMode(XPOWERS_CHG_LED_OFF);
|
||||||
|
PMU->shutdown();
|
||||||
|
}
|
||||||
#elif defined(ARCH_NRF52)
|
#elif defined(ARCH_NRF52)
|
||||||
playBeep();
|
playBeep();
|
||||||
ledOff(PIN_LED1);
|
ledOff(PIN_LED1);
|
||||||
@@ -245,8 +276,8 @@ void Power::readPowerStatus()
|
|||||||
if (hasBattery) {
|
if (hasBattery) {
|
||||||
batteryVoltageMv = batteryLevel->getBattVoltage();
|
batteryVoltageMv = batteryLevel->getBattVoltage();
|
||||||
// If the AXP192 returns a valid battery percentage, use it
|
// If the AXP192 returns a valid battery percentage, use it
|
||||||
if (batteryLevel->getBattPercentage() >= 0) {
|
if (batteryLevel->getBatteryPercent() >= 0) {
|
||||||
batteryChargePercent = batteryLevel->getBattPercentage();
|
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 maximum and minimum voltages defined in
|
// In that case, we compute an estimate of the charge percent based on maximum and minimum voltages defined in
|
||||||
@@ -259,11 +290,28 @@ void Power::readPowerStatus()
|
|||||||
|
|
||||||
// Notify any status instances that are observing us
|
// Notify any status instances that are observing us
|
||||||
const PowerStatus powerStatus2 =
|
const PowerStatus powerStatus2 =
|
||||||
PowerStatus(hasBattery ? OptTrue : OptFalse, batteryLevel->isVBUSPlug() ? OptTrue : OptFalse,
|
PowerStatus(hasBattery ? OptTrue : OptFalse, batteryLevel->isVbusIn() ? OptTrue : OptFalse,
|
||||||
batteryLevel->isChargeing() ? OptTrue : OptFalse, batteryVoltageMv, batteryChargePercent);
|
batteryLevel->isCharging() ? OptTrue : OptFalse, batteryVoltageMv, batteryChargePercent);
|
||||||
DEBUG_MSG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d\n", powerStatus2.getHasUSB(),
|
LOG_DEBUG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d\n", powerStatus2.getHasUSB(),
|
||||||
powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent());
|
powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent());
|
||||||
newStatus.notifyObservers(&powerStatus2);
|
newStatus.notifyObservers(&powerStatus2);
|
||||||
|
#ifdef DEBUG_HEAP
|
||||||
|
if (lastheap != ESP.getFreeHeap()) {
|
||||||
|
LOG_DEBUG("Threads running:");
|
||||||
|
int running = 0;
|
||||||
|
for (int i = 0; i < MAX_THREADS; i++) {
|
||||||
|
auto thread = concurrency::mainController.get(i);
|
||||||
|
if ((thread != nullptr) && (thread->enabled)) {
|
||||||
|
LOG_DEBUG(" %s", thread->ThreadName.c_str());
|
||||||
|
running++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LOG_DEBUG("\n");
|
||||||
|
LOG_DEBUG("Heap status: %d/%d bytes free (%d), running %d/%d threads\n", ESP.getFreeHeap(), ESP.getHeapSize(),
|
||||||
|
ESP.getFreeHeap() - lastheap, running, concurrency::mainController.size(false));
|
||||||
|
lastheap = ESP.getFreeHeap();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// If we have a battery at all and it is less than 10% full, force deep sleep if we have more than 3 low readings in a row
|
// If we have a battery at all and it is less than 10% full, force deep sleep if we have more than 3 low readings in a row
|
||||||
// Supect fluctuating voltage on the RAK4631 to force it to deep sleep even if battery is at 85% after only a few days
|
// Supect fluctuating voltage on the RAK4631 to force it to deep sleep even if battery is at 85% after only a few days
|
||||||
@@ -271,8 +319,12 @@ void Power::readPowerStatus()
|
|||||||
if (powerStatus2.getHasBattery() && !powerStatus2.getHasUSB()) {
|
if (powerStatus2.getHasBattery() && !powerStatus2.getHasUSB()) {
|
||||||
if (batteryLevel->getBattVoltage() < MIN_BAT_MILLIVOLTS) {
|
if (batteryLevel->getBattVoltage() < MIN_BAT_MILLIVOLTS) {
|
||||||
low_voltage_counter++;
|
low_voltage_counter++;
|
||||||
if (low_voltage_counter > 3)
|
LOG_DEBUG("Warning RAK4631 Low voltage counter: %d/10\n", low_voltage_counter);
|
||||||
powerFSM.trigger(EVENT_LOW_BATTERY);
|
if (low_voltage_counter > 10) {
|
||||||
|
// We can't trigger deep sleep on NRF52, it's freezing the board
|
||||||
|
// powerFSM.trigger(EVENT_LOW_BATTERY);
|
||||||
|
LOG_DEBUG("Low voltage detected, but not triggering deep sleep\n");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
low_voltage_counter = 0;
|
low_voltage_counter = 0;
|
||||||
}
|
}
|
||||||
@@ -293,41 +345,47 @@ int32_t Power::runOnce()
|
|||||||
{
|
{
|
||||||
readPowerStatus();
|
readPowerStatus();
|
||||||
|
|
||||||
#ifdef TBEAM_V10
|
#ifdef HAS_PMU
|
||||||
// WE no longer use the IRQ line to wake the CPU (due to false wakes from sleep), but we do poll
|
// WE no longer use the IRQ line to wake the CPU (due to false wakes from sleep), but we do poll
|
||||||
// the IRQ status by reading the registers over I2C
|
// the IRQ status by reading the registers over I2C
|
||||||
axp.readIRQ();
|
if (PMU) {
|
||||||
|
|
||||||
if (axp.isVbusRemoveIRQ()) {
|
PMU->getIrqStatus();
|
||||||
DEBUG_MSG("USB unplugged\n");
|
|
||||||
|
if (PMU->isVbusRemoveIrq()) {
|
||||||
|
LOG_INFO("USB unplugged\n");
|
||||||
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
||||||
}
|
}
|
||||||
if (axp.isVbusPlugInIRQ()) {
|
|
||||||
DEBUG_MSG("USB plugged In\n");
|
if (PMU->isVbusInsertIrq()) {
|
||||||
|
LOG_INFO("USB plugged In\n");
|
||||||
powerFSM.trigger(EVENT_POWER_CONNECTED);
|
powerFSM.trigger(EVENT_POWER_CONNECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Other things we could check if we cared...
|
Other things we could check if we cared...
|
||||||
|
|
||||||
if (axp.isChargingIRQ()) {
|
if (PMU->isBatChagerStartIrq()) {
|
||||||
DEBUG_MSG("Battery start charging\n");
|
LOG_DEBUG("Battery start charging\n");
|
||||||
}
|
}
|
||||||
if (axp.isChargingDoneIRQ()) {
|
if (PMU->isBatChagerDoneIrq()) {
|
||||||
DEBUG_MSG("Battery fully charged\n");
|
LOG_DEBUG("Battery fully charged\n");
|
||||||
}
|
}
|
||||||
if (axp.isBattPlugInIRQ()) {
|
if (PMU->isBatInsertIrq()) {
|
||||||
DEBUG_MSG("Battery inserted\n");
|
LOG_DEBUG("Battery inserted\n");
|
||||||
}
|
}
|
||||||
if (axp.isBattRemoveIRQ()) {
|
if (PMU->isBatRemoveIrq()) {
|
||||||
DEBUG_MSG("Battery removed\n");
|
LOG_DEBUG("Battery removed\n");
|
||||||
}
|
|
||||||
if (axp.isPEKShortPressIRQ()) {
|
|
||||||
DEBUG_MSG("PEK short button press\n");
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
axp.clearIRQ();
|
if (PMU->isPekeyLongPressIrq()) {
|
||||||
#endif
|
LOG_DEBUG("PEK long button press\n");
|
||||||
|
screen->setOn(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
PMU->clearIrqStatus();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
// Only read once every 20 seconds once the power status for the app has been initialized
|
// Only read once every 20 seconds once the power status for the app has been initialized
|
||||||
return (statusHandler && statusHandler->isInitialized()) ? (1000 * 20) : RUN_SAME;
|
return (statusHandler && statusHandler->isInitialized()) ? (1000 * 20) : RUN_SAME;
|
||||||
}
|
}
|
||||||
@@ -340,128 +398,251 @@ int32_t Power::runOnce()
|
|||||||
share the same i2c bus, instead use ssd1306 sleep mode DCDC2 -> unused DCDC3 0.7-3.5V @ 700mA max -> ESP32 (keep this on!) LDO1
|
share the same i2c bus, instead use ssd1306 sleep mode DCDC2 -> unused DCDC3 0.7-3.5V @ 700mA max -> ESP32 (keep this on!) LDO1
|
||||||
30mA -> charges GPS backup battery // charges the tiny J13 battery by the GPS to power the GPS ram (for a couple of days), can
|
30mA -> charges GPS backup battery // charges the tiny J13 battery by the GPS to power the GPS ram (for a couple of days), can
|
||||||
not be turned off LDO2 200mA -> LORA LDO3 200mA -> GPS
|
not be turned off LDO2 200mA -> LORA LDO3 200mA -> GPS
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
bool Power::axp192Init()
|
bool Power::axpChipInit()
|
||||||
{
|
{
|
||||||
#ifdef TBEAM_V10
|
|
||||||
if (axp192_found) {
|
|
||||||
if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) {
|
|
||||||
batteryLevel = &axp;
|
|
||||||
|
|
||||||
DEBUG_MSG("AXP192 Begin PASS\n");
|
#ifdef HAS_PMU
|
||||||
|
|
||||||
// axp.setChgLEDMode(LED_BLINK_4HZ);
|
TwoWire *w = NULL;
|
||||||
DEBUG_MSG("DCDC1: %s\n", axp.isDCDC1Enable() ? "ENABLE" : "DISABLE");
|
|
||||||
DEBUG_MSG("DCDC2: %s\n", axp.isDCDC2Enable() ? "ENABLE" : "DISABLE");
|
|
||||||
DEBUG_MSG("LDO2: %s\n", axp.isLDO2Enable() ? "ENABLE" : "DISABLE");
|
|
||||||
DEBUG_MSG("LDO3: %s\n", axp.isLDO3Enable() ? "ENABLE" : "DISABLE");
|
|
||||||
DEBUG_MSG("DCDC3: %s\n", axp.isDCDC3Enable() ? "ENABLE" : "DISABLE");
|
|
||||||
DEBUG_MSG("Exten: %s\n", axp.isExtenEnable() ? "ENABLE" : "DISABLE");
|
|
||||||
DEBUG_MSG("----------------------------------------\n");
|
|
||||||
|
|
||||||
axp.setPowerOutPut(AXP192_LDO2, AXP202_ON); // LORA radio
|
// Use macro to distinguish which wire is used by PMU
|
||||||
// axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); // GPS main power - now turned on in setGpsPower
|
#ifdef PMU_USE_WIRE1
|
||||||
axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON);
|
w = &Wire1;
|
||||||
axp.setPowerOutPut(AXP192_EXTEN, AXP202_ON);
|
#else
|
||||||
axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON);
|
w = &Wire;
|
||||||
axp.setDCDC1Voltage(3300); // for the OLED power
|
#endif
|
||||||
|
|
||||||
DEBUG_MSG("DCDC1: %s\n", axp.isDCDC1Enable() ? "ENABLE" : "DISABLE");
|
/**
|
||||||
DEBUG_MSG("DCDC2: %s\n", axp.isDCDC2Enable() ? "ENABLE" : "DISABLE");
|
* It is not necessary to specify the wire pin,
|
||||||
DEBUG_MSG("LDO2: %s\n", axp.isLDO2Enable() ? "ENABLE" : "DISABLE");
|
* just input the wire, because the wire has been initialized in main.cpp
|
||||||
DEBUG_MSG("LDO3: %s\n", axp.isLDO3Enable() ? "ENABLE" : "DISABLE");
|
*/
|
||||||
DEBUG_MSG("DCDC3: %s\n", axp.isDCDC3Enable() ? "ENABLE" : "DISABLE");
|
if (!PMU) {
|
||||||
DEBUG_MSG("Exten: %s\n", axp.isExtenEnable() ? "ENABLE" : "DISABLE");
|
PMU = new XPowersAXP2101(*w);
|
||||||
|
if (!PMU->init()) {
|
||||||
switch (config.power.charge_current) {
|
LOG_WARN("Failed to find AXP2101 power management\n");
|
||||||
case Config_PowerConfig_ChargeCurrent_MAUnset:
|
delete PMU;
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_450MA);
|
PMU = NULL;
|
||||||
break;
|
} else {
|
||||||
case Config_PowerConfig_ChargeCurrent_MA100:
|
LOG_INFO("AXP2101 PMU init succeeded, using AXP2101 PMU\n");
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_100MA);
|
}
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA190:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_190MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA280:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_280MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA360:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_360MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA450:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_450MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA550:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_550MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA630:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_630MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA700:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_700MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA780:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_780MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA880:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_880MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA960:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_960MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA1000:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_1000MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA1080:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_1080MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA1160:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_1160MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA1240:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_1240MA);
|
|
||||||
break;
|
|
||||||
case Config_PowerConfig_ChargeCurrent_MA1320:
|
|
||||||
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_1320MA);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
if (!PMU) {
|
||||||
|
PMU = new XPowersAXP192(*w);
|
||||||
|
if (!PMU->init()) {
|
||||||
|
LOG_WARN("Failed to find AXP192 power management\n");
|
||||||
|
delete PMU;
|
||||||
|
PMU = NULL;
|
||||||
|
} else {
|
||||||
|
LOG_INFO("AXP192 PMU init succeeded, using AXP192 PMU\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Not connected
|
if (!PMU) {
|
||||||
//val = 0xfc;
|
/*
|
||||||
//axp._writeByte(AXP202_VHTF_CHGSET, 1, &val); // Set temperature protection
|
* In XPowersLib, if the XPowersAXPxxx object is released, Wire.end() will be called at the same time.
|
||||||
|
* In order not to affect other devices, if the initialization of the PMU fails, Wire needs to be re-initialized once,
|
||||||
//not used
|
* if there are multiple devices sharing the bus.
|
||||||
//val = 0x46;
|
* * */
|
||||||
//axp._writeByte(AXP202_OFF_CTL, 1, &val); // enable bat detection
|
#ifndef PMU_USE_WIRE1
|
||||||
|
w->begin(I2C_SDA, I2C_SCL);
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
batteryLevel = PMU;
|
||||||
|
|
||||||
|
if (PMU->getChipModel() == XPOWERS_AXP192) {
|
||||||
|
|
||||||
|
// lora radio power channel
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_LDO2, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_LDO2);
|
||||||
|
|
||||||
|
// oled module power channel,
|
||||||
|
// disable it will cause abnormal communication between boot and AXP power supply,
|
||||||
|
// do not turn it off
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_DCDC1, 3300);
|
||||||
|
// enable oled power
|
||||||
|
PMU->enablePowerOutput(XPOWERS_DCDC1);
|
||||||
|
|
||||||
|
// gnss module power channel - now turned on in setGpsPower
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_LDO3, 3300);
|
||||||
|
// PMU->enablePowerOutput(XPOWERS_LDO3);
|
||||||
|
|
||||||
|
// protected oled power source
|
||||||
|
PMU->setProtectedChannel(XPOWERS_DCDC1);
|
||||||
|
// protected esp32 power source
|
||||||
|
PMU->setProtectedChannel(XPOWERS_DCDC3);
|
||||||
|
|
||||||
|
// disable not use channel
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DCDC2);
|
||||||
|
|
||||||
|
// disable all axp chip interrupt
|
||||||
|
PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ);
|
||||||
|
|
||||||
|
// Set constant current charging current
|
||||||
|
PMU->setChargerConstantCurr(XPOWERS_AXP192_CHG_CUR_450MA);
|
||||||
|
|
||||||
|
// Set up the charging voltage
|
||||||
|
PMU->setChargeTargetVoltage(XPOWERS_AXP192_CHG_VOL_4V2);
|
||||||
|
|
||||||
|
} else if (PMU->getChipModel() == XPOWERS_AXP2101) {
|
||||||
|
|
||||||
|
// t-beam s3 core
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gnss module power channel
|
||||||
|
* The default ALDO4 is off, you need to turn on the GNSS power first, otherwise it will be invalid during initialization
|
||||||
|
*/
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO4, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_ALDO4);
|
||||||
|
|
||||||
|
// lora radio power channel
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO3, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_ALDO3);
|
||||||
|
|
||||||
|
// m.2 interface
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_DCDC3, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_DCDC3);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ALDO2 cannot be turned off.
|
||||||
|
* It is a necessary condition for sensor communication.
|
||||||
|
* It must be turned on to properly access the sensor and screen
|
||||||
|
* It is also responsible for the power supply of PCF8563
|
||||||
|
*/
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO2, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_ALDO2);
|
||||||
|
|
||||||
|
// 6-axis , magnetometer ,bme280 , oled screen power channel
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO1, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_ALDO1);
|
||||||
|
|
||||||
|
// sdcard power channle
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_BLDO1, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_BLDO1);
|
||||||
|
|
||||||
|
// PMU->setPowerChannelVoltage(XPOWERS_DCDC4, 3300);
|
||||||
|
// PMU->enablePowerOutput(XPOWERS_DCDC4);
|
||||||
|
|
||||||
|
// not use channel
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DCDC2); // not elicited
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DCDC5); // not elicited
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DLDO1); // Invalid power channel, it does not exist
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DLDO2); // Invalid power channel, it does not exist
|
||||||
|
PMU->disablePowerOutput(XPOWERS_VBACKUP);
|
||||||
|
|
||||||
|
// disable all axp chip interrupt
|
||||||
|
PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ);
|
||||||
|
|
||||||
|
// Set the constant current charging current of AXP2101, temporarily use 500mA by default
|
||||||
|
PMU->setChargerConstantCurr(XPOWERS_AXP2101_CHG_CUR_500MA);
|
||||||
|
|
||||||
|
// Set up the charging voltage
|
||||||
|
PMU->setChargeTargetVoltage(XPOWERS_AXP2101_CHG_VOL_4V2);
|
||||||
|
}
|
||||||
|
|
||||||
|
PMU->clearIrqStatus();
|
||||||
|
|
||||||
|
// TBeam1.1 /T-Beam S3-Core has no external TS detection,
|
||||||
|
// it needs to be disabled, otherwise it will cause abnormal charging
|
||||||
|
PMU->disableTSPinMeasure();
|
||||||
|
|
||||||
|
// PMU->enableSystemVoltageMeasure();
|
||||||
|
PMU->enableVbusVoltageMeasure();
|
||||||
|
PMU->enableBattVoltageMeasure();
|
||||||
|
|
||||||
|
LOG_DEBUG("=======================================================================\n");
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_DCDC1)) {
|
||||||
|
LOG_DEBUG("DC1 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC1) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC1));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_DCDC2)) {
|
||||||
|
LOG_DEBUG("DC2 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC2) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC2));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_DCDC3)) {
|
||||||
|
LOG_DEBUG("DC3 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC3) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC3));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_DCDC4)) {
|
||||||
|
LOG_DEBUG("DC4 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC4) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC4));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_LDO2)) {
|
||||||
|
LOG_DEBUG("LDO2 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_LDO2) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_LDO2));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_LDO3)) {
|
||||||
|
LOG_DEBUG("LDO3 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_LDO3) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_LDO3));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_ALDO1)) {
|
||||||
|
LOG_DEBUG("ALDO1: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO1) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO1));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_ALDO2)) {
|
||||||
|
LOG_DEBUG("ALDO2: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO2) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO2));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_ALDO3)) {
|
||||||
|
LOG_DEBUG("ALDO3: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO3) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO3));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_ALDO4)) {
|
||||||
|
LOG_DEBUG("ALDO4: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO4) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO4));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_BLDO1)) {
|
||||||
|
LOG_DEBUG("BLDO1: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_BLDO1) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_BLDO1));
|
||||||
|
}
|
||||||
|
if (PMU->isChannelAvailable(XPOWERS_BLDO2)) {
|
||||||
|
LOG_DEBUG("BLDO2: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_BLDO2) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_BLDO2));
|
||||||
|
}
|
||||||
|
LOG_DEBUG("=======================================================================\n");
|
||||||
|
|
||||||
|
// We can safely ignore this approach for most (or all) boards because MCU turned off
|
||||||
|
// earlier than battery discharged to 2.6V.
|
||||||
|
//
|
||||||
|
// Unfortanly for now we can't use this killswitch for RAK4630-based boards because they have a bug with
|
||||||
|
// battery voltage measurement. Probably it sometimes drops to low values.
|
||||||
|
#ifndef RAK4630
|
||||||
|
// Set PMU shutdown voltage at 2.6V to maximize battery utilization
|
||||||
|
PMU->setSysPowerDownVoltage(2600);
|
||||||
#endif
|
#endif
|
||||||
axp.debugCharging();
|
|
||||||
|
|
||||||
#ifdef PMU_IRQ
|
#ifdef PMU_IRQ
|
||||||
|
uint64_t pmuIrqMask = 0;
|
||||||
|
|
||||||
|
if (PMU->getChipModel() == XPOWERS_AXP192) {
|
||||||
|
pmuIrqMask = XPOWERS_AXP192_VBUS_INSERT_IRQ | XPOWERS_AXP192_BAT_INSERT_IRQ | XPOWERS_AXP192_PKEY_SHORT_IRQ;
|
||||||
|
} else if (PMU->getChipModel() == XPOWERS_AXP2101) {
|
||||||
|
pmuIrqMask = XPOWERS_AXP2101_VBUS_INSERT_IRQ | XPOWERS_AXP2101_BAT_INSERT_IRQ | XPOWERS_AXP2101_PKEY_SHORT_IRQ;
|
||||||
|
}
|
||||||
|
|
||||||
pinMode(PMU_IRQ, INPUT);
|
pinMode(PMU_IRQ, INPUT);
|
||||||
attachInterrupt(
|
attachInterrupt(
|
||||||
PMU_IRQ, [] { pmu_irq = true; }, FALLING);
|
PMU_IRQ, [] { pmu_irq = true; }, FALLING);
|
||||||
|
|
||||||
axp.adc1Enable(AXP202_BATT_CUR_ADC1, 1);
|
// we do not look for AXPXXX_CHARGING_FINISHED_IRQ & AXPXXX_CHARGING_IRQ because it occurs repeatedly while there is
|
||||||
// we do not look for AXP202_CHARGING_FINISHED_IRQ & AXP202_CHARGING_IRQ because it occurs repeatedly while there is
|
|
||||||
// no battery also it could cause inadvertent waking from light sleep just because the battery filled
|
// no battery also it could cause inadvertent waking from light sleep just because the battery filled
|
||||||
// we don't look for AXP202_BATT_REMOVED_IRQ because it occurs repeatedly while no battery installed
|
// we don't look for AXPXXX_BATT_REMOVED_IRQ because it occurs repeatedly while no battery installed
|
||||||
// we don't look at AXP202_VBUS_REMOVED_IRQ because we don't have anything hooked to vbus
|
// we don't look at AXPXXX_VBUS_REMOVED_IRQ because we don't have anything hooked to vbus
|
||||||
axp.enableIRQ(AXP202_BATT_CONNECT_IRQ | AXP202_VBUS_CONNECT_IRQ | AXP202_PEK_SHORTPRESS_IRQ, 1);
|
PMU->enableIRQ(pmuIrqMask);
|
||||||
|
|
||||||
|
PMU->clearIrqStatus();
|
||||||
|
#endif /*PMU_IRQ*/
|
||||||
|
|
||||||
axp.clearIRQ();
|
|
||||||
#endif
|
|
||||||
readPowerStatus();
|
readPowerStatus();
|
||||||
} else {
|
|
||||||
DEBUG_MSG("AXP192 Begin FAIL\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
DEBUG_MSG("AXP192 not found\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return axp192_found;
|
pmu_found = true;
|
||||||
|
|
||||||
|
return pmu_found;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -11,12 +11,12 @@
|
|||||||
/// Should we behave as if we have AC power now?
|
/// Should we behave as if we have AC power now?
|
||||||
static bool isPowered()
|
static bool isPowered()
|
||||||
{
|
{
|
||||||
// Circumvent the battery sensing logic and assumes constant power if no battery pin or power mgmt IC
|
// Circumvent the battery sensing logic and assumes constant power if no battery pin or power mgmt IC
|
||||||
#if !defined(BATTERY_PIN) && !defined(AXP192_SLAVE_ADDRESS)
|
#if !defined(BATTERY_PIN) && !defined(HAS_AXP192) && !defined(HAS_AXP2101)
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool isRouter = (config.device.role == Config_DeviceConfig_Role_Router ? 1 : 0);
|
bool isRouter = (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ? 1 : 0);
|
||||||
|
|
||||||
// If we are not a router and we already have AC power go to POWER state after init, otherwise go to ON
|
// If we are not a router and we already have AC power go to POWER state after init, otherwise go to ON
|
||||||
// We assume routers might be powered all the time, but from a low current (solar) source
|
// We assume routers might be powered all the time, but from a low current (solar) source
|
||||||
@@ -32,16 +32,16 @@ static bool isPowered()
|
|||||||
|
|
||||||
static void sdsEnter()
|
static void sdsEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: SDS\n");
|
LOG_INFO("Enter state: SDS\n");
|
||||||
// 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(config.power.sds_secs ? config.power.sds_secs : default_sds_secs * 1000LL);
|
doDeepSleep(getConfiguredOrDefaultMs(config.power.sds_secs));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern Power *power;
|
extern Power *power;
|
||||||
|
|
||||||
static void shutdownEnter()
|
static void shutdownEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: SHUTDOWN\n");
|
LOG_INFO("Enter state: SHUTDOWN\n");
|
||||||
power->shutdown();
|
power->shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,22 +51,21 @@ static uint32_t secsSlept;
|
|||||||
|
|
||||||
static void lsEnter()
|
static void lsEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("lsEnter begin, ls_secs=%u\n",
|
LOG_INFO("lsEnter begin, ls_secs=%u\n", config.power.ls_secs);
|
||||||
config.power.ls_secs ? config.power.ls_secs : default_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
|
||||||
|
|
||||||
// DEBUG_MSG("lsEnter end\n");
|
// LOG_INFO("lsEnter end\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lsIdle()
|
static void lsIdle()
|
||||||
{
|
{
|
||||||
// DEBUG_MSG("lsIdle begin ls_secs=%u\n", getPref_ls_secs());
|
// LOG_INFO("lsIdle begin ls_secs=%u\n", getPref_ls_secs());
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
|
|
||||||
// Do we have more sleeping to do?
|
// Do we have more sleeping to do?
|
||||||
if (secsSlept < config.power.ls_secs ? config.power.ls_secs : default_ls_secs * 1000) {
|
if (secsSlept < config.power.ls_secs) {
|
||||||
// Briefly come out of sleep long enough to blink the led once every few seconds
|
// Briefly come out of sleep long enough to blink the led once every few seconds
|
||||||
uint32_t sleepTime = 30;
|
uint32_t sleepTime = 30;
|
||||||
|
|
||||||
@@ -83,7 +82,7 @@ static void lsIdle()
|
|||||||
wakeCause2 = doLightSleep(1); // leave led on for 1ms
|
wakeCause2 = doLightSleep(1); // leave led on for 1ms
|
||||||
|
|
||||||
secsSlept += sleepTime;
|
secsSlept += sleepTime;
|
||||||
// DEBUG_MSG("sleeping, flash led!\n");
|
// LOG_INFO("sleeping, flash led!\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESP_SLEEP_WAKEUP_UART:
|
case ESP_SLEEP_WAKEUP_UART:
|
||||||
@@ -94,7 +93,7 @@ static void lsIdle()
|
|||||||
default:
|
default:
|
||||||
// We woke for some other reason (button press, device interrupt)
|
// We woke for some other reason (button press, device interrupt)
|
||||||
// uint64_t status = esp_sleep_get_ext1_wakeup_status();
|
// uint64_t status = esp_sleep_get_ext1_wakeup_status();
|
||||||
DEBUG_MSG("wakeCause2 %d\n", wakeCause2);
|
LOG_INFO("wakeCause2 %d\n", wakeCause2);
|
||||||
|
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
bool pressed = !digitalRead(BUTTON_PIN);
|
bool pressed = !digitalRead(BUTTON_PIN);
|
||||||
@@ -118,7 +117,7 @@ static void lsIdle()
|
|||||||
} else {
|
} else {
|
||||||
// Time to stop sleeping!
|
// Time to stop sleeping!
|
||||||
setLed(false);
|
setLed(false);
|
||||||
DEBUG_MSG("reached ls_secs, servicing loop()\n");
|
LOG_INFO("Reached ls_secs, servicing loop()\n");
|
||||||
powerFSM.trigger(EVENT_WAKE_TIMER);
|
powerFSM.trigger(EVENT_WAKE_TIMER);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -126,7 +125,7 @@ static void lsIdle()
|
|||||||
|
|
||||||
static void lsExit()
|
static void lsExit()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Exit state: LS\n");
|
LOG_INFO("Exit state: LS\n");
|
||||||
// setGPSPower(true); // restore GPS power
|
// setGPSPower(true); // restore GPS power
|
||||||
if (gps)
|
if (gps)
|
||||||
gps->forceWake(true);
|
gps->forceWake(true);
|
||||||
@@ -134,7 +133,7 @@ static void lsExit()
|
|||||||
|
|
||||||
static void nbEnter()
|
static void nbEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: NB\n");
|
LOG_INFO("Enter state: NB\n");
|
||||||
screen->setOn(false);
|
screen->setOn(false);
|
||||||
setBluetoothEnable(false);
|
setBluetoothEnable(false);
|
||||||
|
|
||||||
@@ -149,7 +148,7 @@ static void darkEnter()
|
|||||||
|
|
||||||
static void serialEnter()
|
static void serialEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: SERIAL\n");
|
LOG_INFO("Enter state: SERIAL\n");
|
||||||
setBluetoothEnable(false);
|
setBluetoothEnable(false);
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
screen->print("Serial connected\n");
|
screen->print("Serial connected\n");
|
||||||
@@ -162,10 +161,10 @@ static void serialExit()
|
|||||||
|
|
||||||
static void powerEnter()
|
static void powerEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: POWER\n");
|
LOG_INFO("Enter state: POWER\n");
|
||||||
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 ahndle things
|
||||||
DEBUG_MSG("Loss of power in Powered\n");
|
LOG_INFO("Loss of power in Powered\n");
|
||||||
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
||||||
} else {
|
} else {
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
@@ -178,7 +177,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
|
||||||
DEBUG_MSG("Loss of power in Powered\n");
|
LOG_INFO("Loss of power in Powered\n");
|
||||||
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -192,7 +191,7 @@ static void powerExit()
|
|||||||
|
|
||||||
static void onEnter()
|
static void onEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: ON\n");
|
LOG_INFO("Enter state: ON\n");
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
setBluetoothEnable(true);
|
setBluetoothEnable(true);
|
||||||
|
|
||||||
@@ -200,7 +199,7 @@ static void onEnter()
|
|||||||
|
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
|
|
||||||
if (now - lastPingMs >
|
if ((now - lastPingMs) >
|
||||||
30 * 1000) { // if more than a minute since our last press, ask node we are looking at to update their state
|
30 * 1000) { // if more than a minute since our last press, ask node we are looking at to update their state
|
||||||
if (displayedNodeNum)
|
if (displayedNodeNum)
|
||||||
service.sendNetworkPing(displayedNodeNum, true); // Refresh the currently displayed node
|
service.sendNetworkPing(displayedNodeNum, true); // Refresh the currently displayed node
|
||||||
@@ -223,7 +222,7 @@ static void screenPress()
|
|||||||
|
|
||||||
static void bootEnter()
|
static void bootEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: BOOT\n");
|
LOG_INFO("Enter state: BOOT\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
State stateSHUTDOWN(shutdownEnter, NULL, NULL, "SHUTDOWN");
|
State stateSHUTDOWN(shutdownEnter, NULL, NULL, "SHUTDOWN");
|
||||||
@@ -239,10 +238,10 @@ Fsm powerFSM(&stateBOOT);
|
|||||||
|
|
||||||
void PowerFSM_setup()
|
void PowerFSM_setup()
|
||||||
{
|
{
|
||||||
bool isRouter = (config.device.role == Config_DeviceConfig_Role_Router ? 1 : 0);
|
bool isRouter = (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ? 1 : 0);
|
||||||
bool hasPower = isPowered();
|
bool hasPower = isPowered();
|
||||||
|
|
||||||
DEBUG_MSG("PowerFSM init, USB power=%d\n", hasPower);
|
LOG_INFO("PowerFSM init, USB power=%d\n", 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
|
||||||
@@ -328,50 +327,28 @@ void PowerFSM_setup()
|
|||||||
|
|
||||||
powerFSM.add_transition(&stateDARK, &stateDARK, EVENT_CONTACT_FROM_PHONE, NULL, "Contact from phone");
|
powerFSM.add_transition(&stateDARK, &stateDARK, EVENT_CONTACT_FROM_PHONE, NULL, "Contact from phone");
|
||||||
|
|
||||||
// each time we get a new update packet make sure we are staying in the ON state so the screen stays awake (also we don't
|
|
||||||
// shutdown bluetooth if is_router)
|
|
||||||
powerFSM.add_transition(&stateDARK, &stateON, EVENT_FIRMWARE_UPDATE, NULL, "Got firmware update");
|
|
||||||
powerFSM.add_transition(&stateON, &stateON, EVENT_FIRMWARE_UPDATE, NULL, "Got firmware update");
|
|
||||||
|
|
||||||
powerFSM.add_timed_transition(&stateON, &stateDARK,
|
powerFSM.add_timed_transition(&stateON, &stateDARK,
|
||||||
config.display.screen_on_secs ? config.display.screen_on_secs
|
getConfiguredOrDefaultMs(config.display.screen_on_secs, default_screen_on_secs), NULL,
|
||||||
: 60 * 1000 * 10,
|
"Screen-on timeout");
|
||||||
NULL, "Screen-on timeout");
|
|
||||||
|
|
||||||
// On most boards we use light-sleep to be our main state, but on NRF52 we just stay in DARK
|
|
||||||
State *lowPowerState = &stateLS;
|
|
||||||
|
|
||||||
uint32_t meshSds = 0;
|
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
|
State *lowPowerState = &stateLS;
|
||||||
// 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)
|
||||||
|
|
||||||
// See: https://github.com/meshtastic/Meshtastic-device/issues/1071
|
// See: https://github.com/meshtastic/firmware/issues/1071
|
||||||
if (isRouter || config.power.is_power_saving) {
|
if (isRouter || config.power.is_power_saving) {
|
||||||
powerFSM.add_timed_transition(&stateNB, &stateLS,
|
powerFSM.add_timed_transition(&stateNB, &stateLS,
|
||||||
config.power.min_wake_secs ? config.power.min_wake_secs
|
getConfiguredOrDefaultMs(config.power.min_wake_secs, default_min_wake_secs), NULL,
|
||||||
: default_min_wake_secs * 1000,
|
"Min wake timeout");
|
||||||
NULL, "Min wake timeout");
|
|
||||||
powerFSM.add_timed_transition(&stateDARK, &stateLS,
|
powerFSM.add_timed_transition(&stateDARK, &stateLS,
|
||||||
config.power.wait_bluetooth_secs
|
getConfiguredOrDefaultMs(config.power.wait_bluetooth_secs, default_wait_bluetooth_secs),
|
||||||
? config.power.wait_bluetooth_secs
|
|
||||||
: default_wait_bluetooth_secs * 1000,
|
|
||||||
NULL, "Bluetooth timeout");
|
NULL, "Bluetooth timeout");
|
||||||
meshSds = config.power.mesh_sds_timeout_secs ? config.power.mesh_sds_timeout_secs
|
|
||||||
: default_mesh_sds_timeout_secs;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
meshSds = UINT32_MAX;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
if (config.power.sds_secs != UINT32_MAX)
|
||||||
lowPowerState = &stateDARK;
|
powerFSM.add_timed_transition(lowPowerState, &stateSDS, getConfiguredOrDefaultMs(config.power.sds_secs), NULL,
|
||||||
meshSds = UINT32_MAX; // Workaround for now: Don't go into deep sleep on the RAK4631
|
"mesh timeout");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (meshSds != UINT32_MAX)
|
|
||||||
powerFSM.add_timed_transition(lowPowerState, &stateSDS, meshSds * 1000, NULL, "mesh timeout");
|
|
||||||
|
|
||||||
powerFSM.run_machine(); // run one interation of the state machine, so we run our on enter tasks for the initial DARK state
|
powerFSM.run_machine(); // run one interation of the state machine, so we run our on enter tasks for the initial DARK state
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#define EVENT_POWER_CONNECTED 13
|
#define EVENT_POWER_CONNECTED 13
|
||||||
#define EVENT_POWER_DISCONNECTED 14
|
#define EVENT_POWER_DISCONNECTED 14
|
||||||
#define EVENT_FIRMWARE_UPDATE 15 // We just received a new firmware update packet from the phone
|
#define EVENT_FIRMWARE_UPDATE 15 // We just received a new firmware update packet from the phone
|
||||||
#define EVENT_SHUTDOWN 16 //force a full shutdown now (not just sleep)
|
#define EVENT_SHUTDOWN 16 // force a full shutdown now (not just sleep)
|
||||||
#define EVENT_INPUT 17 // input broker wants something, we need to wake up and enable screen
|
#define EVENT_INPUT 17 // input broker wants something, we need to wake up and enable screen
|
||||||
|
|
||||||
extern Fsm powerFSM;
|
extern Fsm powerFSM;
|
||||||
|
|||||||
@@ -26,11 +26,10 @@ class PowerFSMThread : public OSThread
|
|||||||
|
|
||||||
if (powerStatus->getHasUSB()) {
|
if (powerStatus->getHasUSB()) {
|
||||||
timeLastPowered = millis();
|
timeLastPowered = millis();
|
||||||
} else if (config.power.on_battery_shutdown_after_secs > 0 &&
|
} else if (config.power.on_battery_shutdown_after_secs > 0 && config.power.on_battery_shutdown_after_secs != UINT32_MAX &&
|
||||||
millis() >
|
millis() > (timeLastPowered +
|
||||||
timeLastPowered +
|
getConfiguredOrDefaultMs(
|
||||||
(1000 *
|
config.power.on_battery_shutdown_after_secs))) { // shutdown after 30 minutes unpowered
|
||||||
config.power.on_battery_shutdown_after_secs)) { // shutdown after 30 minutes unpowered
|
|
||||||
powerFSM.trigger(EVENT_SHUTDOWN);
|
powerFSM.trigger(EVENT_SHUTDOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class PowerStatus : public Status
|
|||||||
isCharging = newStatus->isCharging;
|
isCharging = newStatus->isCharging;
|
||||||
}
|
}
|
||||||
if (isDirty) {
|
if (isDirty) {
|
||||||
// DEBUG_MSG("Battery %dmV %d%%\n", batteryVoltageMv, batteryChargePercent);
|
// LOG_DEBUG("Battery %dmV %d%%\n", batteryVoltageMv, batteryChargePercent);
|
||||||
onNewStatus.notifyObservers(this);
|
onNewStatus.notifyObservers(this);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "RedirectablePrint.h"
|
#include "RedirectablePrint.h"
|
||||||
|
#include "NodeDB.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "concurrency/OSThread.h"
|
#include "concurrency/OSThread.h"
|
||||||
// #include "wifi/WiFiServerAPI.h"
|
#include "configuration.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <cstring>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A printer that doesn't go anywhere
|
* A printer that doesn't go anywhere
|
||||||
@@ -26,11 +26,9 @@ size_t RedirectablePrint::write(uint8_t c)
|
|||||||
SEGGER_RTT_PutChar(SEGGER_STDOUT_CH, c);
|
SEGGER_RTT_PutChar(SEGGER_STDOUT_CH, c);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// FIXME - clean this up, the whole relationship of this class to SerialConsole to TCP/bluetooth debug log output is kinda messed up. But for now, just have this hack to
|
if (!config.has_lora || config.device.serial_enabled)
|
||||||
// optionally send chars to TCP also
|
|
||||||
//WiFiServerPort::debugOut(c);
|
|
||||||
|
|
||||||
dest->write(c);
|
dest->write(c);
|
||||||
|
|
||||||
return 1; // We always claim one was written, rather than trusting what the
|
return 1; // We always claim one was written, rather than trusting what the
|
||||||
// serial port said (which could be zero)
|
// serial port said (which could be zero)
|
||||||
}
|
}
|
||||||
@@ -38,26 +36,25 @@ size_t RedirectablePrint::write(uint8_t c)
|
|||||||
size_t RedirectablePrint::vprintf(const char *format, va_list arg)
|
size_t RedirectablePrint::vprintf(const char *format, va_list arg)
|
||||||
{
|
{
|
||||||
va_list copy;
|
va_list copy;
|
||||||
|
static char printBuf[160];
|
||||||
|
|
||||||
va_copy(copy, arg);
|
va_copy(copy, arg);
|
||||||
int len = vsnprintf(printBuf, printBufLen, format, copy);
|
size_t len = vsnprintf(printBuf, sizeof(printBuf), format, copy);
|
||||||
va_end(copy);
|
va_end(copy);
|
||||||
if (len < 0) {
|
|
||||||
va_end(arg);
|
// If the resulting string is longer than sizeof(printBuf)-1 characters, the remaining characters are still counted for the
|
||||||
return 0;
|
// return value
|
||||||
};
|
|
||||||
if (len >= (int)printBufLen) {
|
if (len > sizeof(printBuf) - 1) {
|
||||||
delete[] printBuf;
|
len = sizeof(printBuf) - 1;
|
||||||
printBufLen *= 2;
|
printBuf[sizeof(printBuf) - 2] = '\n';
|
||||||
printBuf = new char[printBufLen];
|
|
||||||
len = vsnprintf(printBuf, printBufLen, format, arg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
len = Print::write(printBuf, len);
|
len = Print::write(printBuf, len);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t RedirectablePrint::logDebug(const char *format, ...)
|
size_t RedirectablePrint::log(const char *logLevel, const char *format, ...)
|
||||||
{
|
{
|
||||||
size_t r = 0;
|
size_t r = 0;
|
||||||
|
|
||||||
@@ -85,9 +82,9 @@ size_t RedirectablePrint::logDebug(const char *format, ...)
|
|||||||
int min = (hms % SEC_PER_HOUR) / SEC_PER_MIN;
|
int min = (hms % SEC_PER_HOUR) / SEC_PER_MIN;
|
||||||
int sec = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN
|
int sec = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN
|
||||||
|
|
||||||
r += printf("%02d:%02d:%02d %u ", hour, min, sec, millis() / 1000);
|
r += printf("%s | %02d:%02d:%02d %u ", logLevel, hour, min, sec, millis() / 1000);
|
||||||
} else
|
} else
|
||||||
r += printf("??:??:?? %u ", millis() / 1000);
|
r += printf("%s | ??:??:?? %u ", logLevel, millis() / 1000);
|
||||||
|
|
||||||
auto thread = concurrency::OSThread::currentThread;
|
auto thread = concurrency::OSThread::currentThread;
|
||||||
if (thread) {
|
if (thread) {
|
||||||
@@ -98,7 +95,6 @@ size_t RedirectablePrint::logDebug(const char *format, ...)
|
|||||||
print("] ");
|
print("] ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r += vprintf(format, arg);
|
r += vprintf(format, arg);
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
|
|
||||||
@@ -108,3 +104,35 @@ size_t RedirectablePrint::logDebug(const char *format, ...)
|
|||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RedirectablePrint::hexDump(const char *logLevel, unsigned char *buf, uint16_t len)
|
||||||
|
{
|
||||||
|
const char alphabet[17] = "0123456789abcdef";
|
||||||
|
log(logLevel, " +------------------------------------------------+ +----------------+\n");
|
||||||
|
log(logLevel, " |.0 .1 .2 .3 .4 .5 .6 .7 .8 .9 .a .b .c .d .e .f | | ASCII |\n");
|
||||||
|
for (uint16_t i = 0; i < len; i += 16) {
|
||||||
|
if (i % 128 == 0)
|
||||||
|
log(logLevel, " +------------------------------------------------+ +----------------+\n");
|
||||||
|
char s[] = "| | | |\n";
|
||||||
|
uint8_t ix = 1, iy = 52;
|
||||||
|
for (uint8_t j = 0; j < 16; j++) {
|
||||||
|
if (i + j < len) {
|
||||||
|
uint8_t c = buf[i + j];
|
||||||
|
s[ix++] = alphabet[(c >> 4) & 0x0F];
|
||||||
|
s[ix++] = alphabet[c & 0x0F];
|
||||||
|
ix++;
|
||||||
|
if (c > 31 && c < 128)
|
||||||
|
s[iy++] = c;
|
||||||
|
else
|
||||||
|
s[iy++] = '.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uint8_t index = i / 16;
|
||||||
|
if (i < 256)
|
||||||
|
log(logLevel, " ");
|
||||||
|
log(logLevel, "%02x", index);
|
||||||
|
log(logLevel, ".");
|
||||||
|
log(logLevel, s);
|
||||||
|
}
|
||||||
|
log(logLevel, " +------------------------------------------------+ +----------------+\n");
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,10 +12,6 @@ class RedirectablePrint : public Print
|
|||||||
{
|
{
|
||||||
Print *dest;
|
Print *dest;
|
||||||
|
|
||||||
/// We dynamically grow this scratch buffer if necessary
|
|
||||||
char *printBuf = new char[64];
|
|
||||||
size_t printBufLen = 64;
|
|
||||||
|
|
||||||
/// Used to allow multiple logDebug messages to appear on a single log line
|
/// Used to allow multiple logDebug messages to appear on a single log line
|
||||||
bool isContinuationMessage = false;
|
bool isContinuationMessage = false;
|
||||||
|
|
||||||
@@ -37,14 +33,13 @@ class RedirectablePrint : public Print
|
|||||||
* If the provide format string ends with a newline we assume it is the final print of a single
|
* If the provide format string ends with a newline we assume it is the final print of a single
|
||||||
* log message. Otherwise we assume more prints will come before the log message ends. This
|
* log message. Otherwise we assume more prints will come before the log message ends. This
|
||||||
* allows you to call logDebug a few times to build up a single log message line if you wish.
|
* allows you to call logDebug a few times to build up a single log message line if you wish.
|
||||||
*
|
|
||||||
* FIXME, eventually add log levels (INFO, WARN, ERROR) and subsystems. Move into
|
|
||||||
* a different class.
|
|
||||||
*/
|
*/
|
||||||
size_t logDebug(const char * format, ...) __attribute__ ((format (printf, 2, 3)));
|
size_t log(const char *logLevel, const char *format, ...) __attribute__((format(printf, 3, 4)));
|
||||||
|
|
||||||
/** like printf but va_list based */
|
/** like printf but va_list based */
|
||||||
size_t vprintf(const char *format, va_list arg);
|
size_t vprintf(const char *format, va_list arg);
|
||||||
|
|
||||||
|
void hexDump(const char *logLevel, unsigned char *buf, uint16_t len);
|
||||||
};
|
};
|
||||||
|
|
||||||
class NoopPrint : public Print
|
class NoopPrint : public Print
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "SPILock.h"
|
#include "SPILock.h"
|
||||||
|
#include "configuration.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ void consolePrintf(const char *format, ...)
|
|||||||
va_start(arg, format);
|
va_start(arg, format);
|
||||||
console->vprintf(format, arg);
|
console->vprintf(format, arg);
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
|
console->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
|
SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port), concurrency::OSThread("SerialConsole")
|
||||||
{
|
{
|
||||||
assert(!console);
|
assert(!console);
|
||||||
console = this;
|
console = this;
|
||||||
@@ -30,7 +31,7 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
|
|||||||
// setDestination(&noopPrint); for testing, try turning off 'all' debug output and see what leaks
|
// setDestination(&noopPrint); for testing, try turning off 'all' debug output and see what leaks
|
||||||
|
|
||||||
Port.begin(SERIAL_BAUD);
|
Port.begin(SERIAL_BAUD);
|
||||||
#ifdef ARCH_NRF52
|
#if defined(ARCH_NRF52) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||||
time_t timeout = millis();
|
time_t timeout = millis();
|
||||||
while (!Port) {
|
while (!Port) {
|
||||||
if ((millis() - timeout) < 5000) {
|
if ((millis() - timeout) < 5000) {
|
||||||
@@ -43,6 +44,15 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
|
|||||||
emitRebooted();
|
emitRebooted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t SerialConsole::runOnce()
|
||||||
|
{
|
||||||
|
return runOncePart();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SerialConsole::flush()
|
||||||
|
{
|
||||||
|
Port.flush();
|
||||||
|
}
|
||||||
|
|
||||||
// For the serial port we can't really detect if any client is on the other side, so instead just look for recent messages
|
// For the serial port we can't really detect if any client is on the other side, so instead just look for recent messages
|
||||||
bool SerialConsole::checkIsConnected()
|
bool SerialConsole::checkIsConnected()
|
||||||
@@ -57,10 +67,15 @@ bool SerialConsole::checkIsConnected()
|
|||||||
*/
|
*/
|
||||||
bool SerialConsole::handleToRadio(const uint8_t *buf, size_t len)
|
bool SerialConsole::handleToRadio(const uint8_t *buf, size_t len)
|
||||||
{
|
{
|
||||||
|
// only talk to the API once the configuration has been loaded and we're sure the serial port is not disabled.
|
||||||
|
if (config.has_lora && config.device.serial_enabled) {
|
||||||
// Turn off debug serial printing once the API is activated, because other threads could print and corrupt packets
|
// Turn off debug serial printing once the API is activated, because other threads could print and corrupt packets
|
||||||
if (!config.device.debug_log_enabled)
|
if (!config.device.debug_log_enabled)
|
||||||
setDestination(&noopPrint);
|
setDestination(&noopPrint);
|
||||||
canWrite = true;
|
canWrite = true;
|
||||||
|
|
||||||
return StreamAPI::handleToRadio(buf, len);
|
return StreamAPI::handleToRadio(buf, len);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
* Provides both debug printing and, if the client starts sending protobufs to us, switches to send/receive protobufs
|
* Provides both debug printing and, if the client starts sending protobufs to us, switches to send/receive protobufs
|
||||||
* (and starts dropping debug printing - FIXME, eventually those prints should be encapsulated in protobufs).
|
* (and starts dropping debug printing - FIXME, eventually those prints should be encapsulated in protobufs).
|
||||||
*/
|
*/
|
||||||
class SerialConsole : public StreamAPI, public RedirectablePrint
|
class SerialConsole : public StreamAPI, public RedirectablePrint, private concurrency::OSThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SerialConsole();
|
SerialConsole();
|
||||||
@@ -24,8 +24,11 @@ class SerialConsole : public StreamAPI, public RedirectablePrint
|
|||||||
return RedirectablePrint::write(c);
|
return RedirectablePrint::write(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
virtual int32_t runOnce() override;
|
||||||
|
|
||||||
|
void flush();
|
||||||
|
|
||||||
|
protected:
|
||||||
/// Check the current underlying physical link to see if the client is currently connected
|
/// Check the current underlying physical link to see if the client is currently connected
|
||||||
virtual bool checkIsConnected() override;
|
virtual bool checkIsConnected() override;
|
||||||
};
|
};
|
||||||
|
|||||||
42
src/Status.h
42
src/Status.h
@@ -8,16 +8,16 @@
|
|||||||
#define STATUS_TYPE_GPS 2
|
#define STATUS_TYPE_GPS 2
|
||||||
#define STATUS_TYPE_NODE 3
|
#define STATUS_TYPE_NODE 3
|
||||||
|
|
||||||
|
|
||||||
namespace meshtastic
|
namespace meshtastic
|
||||||
{
|
{
|
||||||
|
|
||||||
// A base class for observable status
|
// A base class for observable status
|
||||||
class Status
|
class Status
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
// Allows us to observe an Observable
|
// Allows us to observe an Observable
|
||||||
CallbackObserver<Status, const Status *> statusObserver = CallbackObserver<Status, const Status *>(this, &Status::updateStatus);
|
CallbackObserver<Status, const Status *> statusObserver =
|
||||||
|
CallbackObserver<Status, const Status *>(this, &Status::updateStatus);
|
||||||
bool initialized = false;
|
bool initialized = false;
|
||||||
// Workaround for no typeid support
|
// Workaround for no typeid support
|
||||||
int statusType = 0;
|
int statusType = 0;
|
||||||
@@ -29,9 +29,9 @@ namespace meshtastic
|
|||||||
// Enable polymorphism ?
|
// Enable polymorphism ?
|
||||||
virtual ~Status() = default;
|
virtual ~Status() = default;
|
||||||
|
|
||||||
Status() {
|
Status()
|
||||||
if (!statusType)
|
|
||||||
{
|
{
|
||||||
|
if (!statusType) {
|
||||||
statusType = STATUS_TYPE_BASE;
|
statusType = STATUS_TYPE_BASE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,32 +41,16 @@ namespace meshtastic
|
|||||||
Status &operator=(const Status &) = delete;
|
Status &operator=(const Status &) = delete;
|
||||||
|
|
||||||
// Start observing a source of data
|
// Start observing a source of data
|
||||||
void observe(Observable<const Status *> *source)
|
void observe(Observable<const Status *> *source) { statusObserver.observe(source); }
|
||||||
{
|
|
||||||
statusObserver.observe(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determines whether or not existing data matches the data in another Status instance
|
// Determines whether or not existing data matches the data in another Status instance
|
||||||
bool matches(const Status *otherStatus) const
|
bool matches(const Status *otherStatus) const { return true; }
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isInitialized() const
|
bool isInitialized() const { return initialized; }
|
||||||
{
|
|
||||||
return initialized;
|
|
||||||
}
|
|
||||||
|
|
||||||
int getStatusType() const
|
int getStatusType() const { return statusType; }
|
||||||
{
|
|
||||||
return statusType;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the Observable we're observing generates a new notification
|
// Called when the Observable we're observing generates a new notification
|
||||||
int updateStatus(const Status *newStatus)
|
int updateStatus(const Status *newStatus) { return 0; }
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
}; // namespace meshtastic
|
||||||
|
|||||||
@@ -10,18 +10,18 @@ void AirTime::logAirtime(reportTypes reportType, uint32_t airtime_ms)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (reportType == TX_LOG) {
|
if (reportType == TX_LOG) {
|
||||||
DEBUG_MSG("AirTime - Packet transmitted : %ums\n", airtime_ms);
|
LOG_DEBUG("AirTime - Packet transmitted : %ums\n", airtime_ms);
|
||||||
this->airtimes.periodTX[0] = this->airtimes.periodTX[0] + airtime_ms;
|
this->airtimes.periodTX[0] = this->airtimes.periodTX[0] + airtime_ms;
|
||||||
myNodeInfo.air_period_tx[0] = myNodeInfo.air_period_tx[0] + airtime_ms;
|
myNodeInfo.air_period_tx[0] = myNodeInfo.air_period_tx[0] + airtime_ms;
|
||||||
|
|
||||||
this->utilizationTX[this->getPeriodUtilHour()] = this->utilizationTX[this->getPeriodUtilHour()] + airtime_ms;
|
this->utilizationTX[this->getPeriodUtilHour()] = this->utilizationTX[this->getPeriodUtilHour()] + airtime_ms;
|
||||||
|
|
||||||
} else if (reportType == RX_LOG) {
|
} else if (reportType == RX_LOG) {
|
||||||
DEBUG_MSG("AirTime - Packet received : %ums\n", airtime_ms);
|
LOG_DEBUG("AirTime - Packet received : %ums\n", airtime_ms);
|
||||||
this->airtimes.periodRX[0] = this->airtimes.periodRX[0] + airtime_ms;
|
this->airtimes.periodRX[0] = this->airtimes.periodRX[0] + airtime_ms;
|
||||||
myNodeInfo.air_period_rx[0] = myNodeInfo.air_period_rx[0] + airtime_ms;
|
myNodeInfo.air_period_rx[0] = myNodeInfo.air_period_rx[0] + airtime_ms;
|
||||||
} else if (reportType == RX_ALL_LOG) {
|
} else if (reportType == RX_ALL_LOG) {
|
||||||
DEBUG_MSG("AirTime - Packet received (noise?) : %ums\n", airtime_ms);
|
LOG_DEBUG("AirTime - Packet received (noise?) : %ums\n", airtime_ms);
|
||||||
this->airtimes.periodRX_ALL[0] = this->airtimes.periodRX_ALL[0] + airtime_ms;
|
this->airtimes.periodRX_ALL[0] = this->airtimes.periodRX_ALL[0] + airtime_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,11 +34,13 @@ uint8_t AirTime::currentPeriodIndex()
|
|||||||
return ((getSecondsSinceBoot() / SECONDS_PER_PERIOD) % PERIODS_TO_LOG);
|
return ((getSecondsSinceBoot() / SECONDS_PER_PERIOD) % PERIODS_TO_LOG);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t AirTime::getPeriodUtilMinute() {
|
uint8_t AirTime::getPeriodUtilMinute()
|
||||||
|
{
|
||||||
return (getSecondsSinceBoot() / 10) % CHANNEL_UTILIZATION_PERIODS;
|
return (getSecondsSinceBoot() / 10) % CHANNEL_UTILIZATION_PERIODS;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t AirTime::getPeriodUtilHour() {
|
uint8_t AirTime::getPeriodUtilHour()
|
||||||
|
{
|
||||||
return (getSecondsSinceBoot() / 60) % MINUTES_IN_HOUR;
|
return (getSecondsSinceBoot() / 60) % MINUTES_IN_HOUR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +48,7 @@ void AirTime::airtimeRotatePeriod()
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (this->airtimes.lastPeriodIndex != this->currentPeriodIndex()) {
|
if (this->airtimes.lastPeriodIndex != this->currentPeriodIndex()) {
|
||||||
DEBUG_MSG("Rotating airtimes to a new period = %u\n", this->currentPeriodIndex());
|
LOG_DEBUG("Rotating airtimes to a new period = %u\n", this->currentPeriodIndex());
|
||||||
|
|
||||||
for (int i = PERIODS_TO_LOG - 2; i >= 0; --i) {
|
for (int i = PERIODS_TO_LOG - 2; i >= 0; --i) {
|
||||||
this->airtimes.periodTX[i + 1] = this->airtimes.periodTX[i];
|
this->airtimes.periodTX[i + 1] = this->airtimes.periodTX[i];
|
||||||
@@ -101,7 +103,7 @@ float AirTime::channelUtilizationPercent()
|
|||||||
uint32_t sum = 0;
|
uint32_t sum = 0;
|
||||||
for (uint32_t i = 0; i < CHANNEL_UTILIZATION_PERIODS; i++) {
|
for (uint32_t i = 0; i < CHANNEL_UTILIZATION_PERIODS; i++) {
|
||||||
sum += this->channelUtilization[i];
|
sum += this->channelUtilization[i];
|
||||||
// DEBUG_MSG("ChanUtilArray %u %u\n", i, this->channelUtilization[i]);
|
// LOG_DEBUG("ChanUtilArray %u %u\n", i, this->channelUtilization[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (float(sum) / float(CHANNEL_UTILIZATION_PERIODS * 10 * 1000)) * 100;
|
return (float(sum) / float(CHANNEL_UTILIZATION_PERIODS * 10 * 1000)) * 100;
|
||||||
@@ -117,9 +119,46 @@ float AirTime::utilizationTXPercent()
|
|||||||
return (float(sum) / float(MS_IN_HOUR)) * 100;
|
return (float(sum) / float(MS_IN_HOUR)) * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
AirTime::AirTime() : concurrency::OSThread("AirTime"),airtimes({}) {
|
bool AirTime::isTxAllowedChannelUtil(bool polite)
|
||||||
|
{
|
||||||
|
uint8_t percentage = (polite ? polite_channel_util_percent : max_channel_util_percent);
|
||||||
|
if (channelUtilizationPercent() < percentage) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
LOG_WARN("Channel utilization is >%d percent. Skipping this opportunity to send.\n", percentage);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AirTime::isTxAllowedAirUtil()
|
||||||
|
{
|
||||||
|
if (!config.lora.override_duty_cycle && myRegion->dutyCycle < 100) {
|
||||||
|
if (utilizationTXPercent() < myRegion->dutyCycle * polite_duty_cycle_percent / 100) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
LOG_WARN("Tx air utilization is >%f percent. Skipping this opportunity to send.\n",
|
||||||
|
myRegion->dutyCycle * polite_duty_cycle_percent / 100);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the amount of minutes we have to be silent before we can send again
|
||||||
|
uint8_t AirTime::getSilentMinutes(float txPercent, float dutyCycle)
|
||||||
|
{
|
||||||
|
float newTxPercent = txPercent;
|
||||||
|
for (int8_t i = MINUTES_IN_HOUR - 1; i >= 0; --i) {
|
||||||
|
newTxPercent -= ((float)this->utilizationTX[i] / (MS_IN_MINUTE * MINUTES_IN_HOUR / 100));
|
||||||
|
if (newTxPercent < dutyCycle)
|
||||||
|
return MINUTES_IN_HOUR - 1 - i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MINUTES_IN_HOUR;
|
||||||
|
}
|
||||||
|
|
||||||
|
AirTime::AirTime() : concurrency::OSThread("AirTime"), airtimes({}) {}
|
||||||
|
|
||||||
int32_t AirTime::runOnce()
|
int32_t AirTime::runOnce()
|
||||||
{
|
{
|
||||||
secSinceBoot++;
|
secSinceBoot++;
|
||||||
@@ -174,14 +213,14 @@ int32_t AirTime::runOnce()
|
|||||||
// Update channel_utilization every second.
|
// Update channel_utilization every second.
|
||||||
myNodeInfo.air_util_tx = airTime->utilizationTXPercent();
|
myNodeInfo.air_util_tx = airTime->utilizationTXPercent();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
DEBUG_MSG("utilPeriodTX %d TX Airtime %3.2f%\n", utilPeriodTX, airTime->utilizationTXPercent());
|
LOG_DEBUG("utilPeriodTX %d TX Airtime %3.2f%\n", utilPeriodTX, airTime->utilizationTXPercent());
|
||||||
for (uint32_t i = 0; i < MINUTES_IN_HOUR; i++) {
|
for (uint32_t i = 0; i < MINUTES_IN_HOUR; i++) {
|
||||||
DEBUG_MSG(
|
LOG_DEBUG(
|
||||||
"%d,", this->utilizationTX[i]
|
"%d,", this->utilizationTX[i]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
DEBUG_MSG("\n");
|
LOG_DEBUG("\n");
|
||||||
*/
|
*/
|
||||||
return (1000 * 1);
|
return (1000 * 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "MeshRadio.h"
|
||||||
#include "concurrency/OSThread.h"
|
#include "concurrency/OSThread.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
@@ -29,9 +30,9 @@
|
|||||||
#define PERIODS_TO_LOG 8
|
#define PERIODS_TO_LOG 8
|
||||||
#define MINUTES_IN_HOUR 60
|
#define MINUTES_IN_HOUR 60
|
||||||
#define SECONDS_IN_MINUTE 60
|
#define SECONDS_IN_MINUTE 60
|
||||||
|
#define MS_IN_MINUTE (SECONDS_IN_MINUTE * 1000)
|
||||||
#define MS_IN_HOUR (MINUTES_IN_HOUR * SECONDS_IN_MINUTE * 1000)
|
#define MS_IN_HOUR (MINUTES_IN_HOUR * SECONDS_IN_MINUTE * 1000)
|
||||||
|
|
||||||
|
|
||||||
enum reportTypes { TX_LOG, RX_LOG, RX_ALL_LOG };
|
enum reportTypes { TX_LOG, RX_LOG, RX_ALL_LOG };
|
||||||
|
|
||||||
void logAirtime(reportTypes reportType, uint32_t airtime_ms);
|
void logAirtime(reportTypes reportType, uint32_t airtime_ms);
|
||||||
@@ -57,12 +58,18 @@ class AirTime : private concurrency::OSThread
|
|||||||
uint32_t getSecondsPerPeriod();
|
uint32_t getSecondsPerPeriod();
|
||||||
uint32_t getSecondsSinceBoot();
|
uint32_t getSecondsSinceBoot();
|
||||||
uint32_t *airtimeReport(reportTypes reportType);
|
uint32_t *airtimeReport(reportTypes reportType);
|
||||||
|
uint8_t getSilentMinutes(float txPercent, float dutyCycle);
|
||||||
|
bool isTxAllowedChannelUtil(bool polite = false);
|
||||||
|
bool isTxAllowedAirUtil();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool firstTime = true;
|
bool firstTime = true;
|
||||||
uint8_t lastUtilPeriod = 0;
|
uint8_t lastUtilPeriod = 0;
|
||||||
uint8_t lastUtilPeriodTX = 0;
|
uint8_t lastUtilPeriodTX = 0;
|
||||||
uint32_t secSinceBoot = 0;
|
uint32_t secSinceBoot = 0;
|
||||||
|
uint8_t max_channel_util_percent = 40;
|
||||||
|
uint8_t polite_channel_util_percent = 25;
|
||||||
|
uint8_t polite_duty_cycle_percent = 50; // half of Duty Cycle allowance is ok for metadata
|
||||||
|
|
||||||
struct airtimeStruct {
|
struct airtimeStruct {
|
||||||
uint32_t periodTX[PERIODS_TO_LOG]; // AirTime transmitted
|
uint32_t periodTX[PERIODS_TO_LOG]; // AirTime transmitted
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
#include "buzz.h"
|
#include "buzz.h"
|
||||||
|
#include "NodeDB.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#ifndef PIN_BUZZER
|
#if !defined(ARCH_ESP32) && !defined(ARCH_RP2040) && !defined(ARCH_PORTDUINO)
|
||||||
|
|
||||||
// Noop methods for boards w/o buzzer
|
|
||||||
void playBeep(){};
|
|
||||||
void playStartMelody(){};
|
|
||||||
void playShutdownMelody(){};
|
|
||||||
|
|
||||||
#else
|
|
||||||
#ifdef M5STACK
|
|
||||||
#include "Speaker.h"
|
|
||||||
TONE Tone;
|
|
||||||
#else
|
|
||||||
#include "Tone.h"
|
#include "Tone.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(ARCH_PORTDUINO)
|
||||||
extern "C" void delay(uint32_t dwMs);
|
extern "C" void delay(uint32_t dwMs);
|
||||||
|
#endif
|
||||||
|
|
||||||
struct ToneDuration {
|
struct ToneDuration {
|
||||||
int frequency_khz;
|
int frequency_khz;
|
||||||
@@ -36,45 +28,41 @@ struct ToneDuration {
|
|||||||
#define NOTE_A3 220
|
#define NOTE_A3 220
|
||||||
#define NOTE_AS3 233
|
#define NOTE_AS3 233
|
||||||
#define NOTE_B3 247
|
#define NOTE_B3 247
|
||||||
|
#define NOTE_CS4 277
|
||||||
|
|
||||||
const int DURATION_1_8 = 125; // 1/8 note
|
const int DURATION_1_8 = 125; // 1/8 note
|
||||||
const int DURATION_1_4 = 250; // 1/4 note
|
const int DURATION_1_4 = 250; // 1/4 note
|
||||||
|
|
||||||
void playTones(const ToneDuration *tone_durations, int size) {
|
void playTones(const ToneDuration *tone_durations, int size)
|
||||||
|
{
|
||||||
|
#ifdef PIN_BUZZER
|
||||||
|
if (!config.device.buzzer_gpio)
|
||||||
|
config.device.buzzer_gpio = PIN_BUZZER;
|
||||||
|
#endif
|
||||||
|
if (config.device.buzzer_gpio) {
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
const auto &tone_duration = tone_durations[i];
|
const auto &tone_duration = tone_durations[i];
|
||||||
#ifdef M5STACK
|
tone(config.device.buzzer_gpio, tone_duration.frequency_khz, tone_duration.duration_ms);
|
||||||
Tone.tone(tone_duration.frequency_khz);
|
|
||||||
delay(tone_duration.duration_ms);
|
|
||||||
Tone.mute();
|
|
||||||
#else
|
|
||||||
tone(PIN_BUZZER, tone_duration.frequency_khz, tone_duration.duration_ms);
|
|
||||||
#endif
|
|
||||||
// to distinguish the notes, set a minimum time between them.
|
// to distinguish the notes, set a minimum time between them.
|
||||||
delay(1.3 * tone_duration.duration_ms);
|
delay(1.3 * tone_duration.duration_ms);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef M5STACK
|
void playBeep()
|
||||||
void playBeep() {
|
{
|
||||||
ToneDuration melody[] = {{NOTE_B3, DURATION_1_4}};
|
ToneDuration melody[] = {{NOTE_B3, DURATION_1_4}};
|
||||||
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
|
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
void playBeep() { tone(PIN_BUZZER, NOTE_B3, DURATION_1_4); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void playStartMelody() {
|
void playStartMelody()
|
||||||
ToneDuration melody[] = {{NOTE_B3, DURATION_1_4},
|
{
|
||||||
{NOTE_B3, DURATION_1_8},
|
ToneDuration melody[] = {{NOTE_FS3, DURATION_1_8}, {NOTE_AS3, DURATION_1_8}, {NOTE_CS4, DURATION_1_4}};
|
||||||
{NOTE_B3, DURATION_1_8}};
|
|
||||||
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
|
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
|
||||||
}
|
}
|
||||||
|
|
||||||
void playShutdownMelody() {
|
void playShutdownMelody()
|
||||||
ToneDuration melody[] = {{NOTE_B3, DURATION_1_4},
|
{
|
||||||
{NOTE_G3, DURATION_1_8},
|
ToneDuration melody[] = {{NOTE_CS4, DURATION_1_8}, {NOTE_AS3, DURATION_1_8}, {NOTE_FS3, DURATION_1_4}};
|
||||||
{NOTE_D3, DURATION_1_8}};
|
|
||||||
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
|
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -14,4 +14,5 @@ enum class Cmd {
|
|||||||
STOP_BOOT_SCREEN,
|
STOP_BOOT_SCREEN,
|
||||||
PRINT,
|
PRINT,
|
||||||
START_SHUTDOWN_SCREEN,
|
START_SHUTDOWN_SCREEN,
|
||||||
|
START_REBOOT_SCREEN,
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "concurrency/BinarySemaphoreFreeRTOS.h"
|
#include "concurrency/BinarySemaphoreFreeRTOS.h"
|
||||||
|
#include "configuration.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#ifdef HAS_FREE_RTOS
|
#ifdef HAS_FREE_RTOS
|
||||||
|
|||||||
@@ -1,18 +1,14 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "concurrency/BinarySemaphorePosix.h"
|
#include "concurrency/BinarySemaphorePosix.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
#ifndef HAS_FREE_RTOS
|
#ifndef HAS_FREE_RTOS
|
||||||
|
|
||||||
namespace concurrency
|
namespace concurrency
|
||||||
{
|
{
|
||||||
|
|
||||||
BinarySemaphorePosix::BinarySemaphorePosix()
|
BinarySemaphorePosix::BinarySemaphorePosix() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
BinarySemaphorePosix::~BinarySemaphorePosix()
|
BinarySemaphorePosix::~BinarySemaphorePosix() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns false if we timed out
|
* Returns false if we timed out
|
||||||
@@ -23,13 +19,9 @@ bool BinarySemaphorePosix::take(uint32_t msec)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinarySemaphorePosix::give()
|
void BinarySemaphorePosix::give() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
IRAM_ATTR void BinarySemaphorePosix::giveFromISR(BaseType_t *pxHigherPriorityTaskWoken)
|
IRAM_ATTR void BinarySemaphorePosix::giveFromISR(BaseType_t *pxHigherPriorityTaskWoken) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace concurrency
|
} // namespace concurrency
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "concurrency/InterruptableDelay.h"
|
#include "concurrency/InterruptableDelay.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
namespace concurrency
|
namespace concurrency
|
||||||
{
|
{
|
||||||
@@ -13,12 +13,12 @@ InterruptableDelay::~InterruptableDelay() {}
|
|||||||
*/
|
*/
|
||||||
bool InterruptableDelay::delay(uint32_t msec)
|
bool InterruptableDelay::delay(uint32_t msec)
|
||||||
{
|
{
|
||||||
// DEBUG_MSG("delay %u ", msec);
|
// LOG_DEBUG("delay %u ", msec);
|
||||||
|
|
||||||
// sem take will return false if we timed out (i.e. were not interrupted)
|
// sem take will return false if we timed out (i.e. were not interrupted)
|
||||||
bool r = semaphore.take(msec);
|
bool r = semaphore.take(msec);
|
||||||
|
|
||||||
// DEBUG_MSG("interrupt=%d\n", r);
|
// LOG_DEBUG("interrupt=%d\n", r);
|
||||||
return !r;
|
return !r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "../freertosinc.h"
|
#include "../freertosinc.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAS_FREE_RTOS
|
#ifdef HAS_FREE_RTOS
|
||||||
#include "concurrency/BinarySemaphoreFreeRTOS.h"
|
#include "concurrency/BinarySemaphoreFreeRTOS.h"
|
||||||
#define BinarySemaphore BinarySemaphoreFreeRTOS
|
#define BinarySemaphore BinarySemaphoreFreeRTOS
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "Lock.h"
|
#include "Lock.h"
|
||||||
|
#include "configuration.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
namespace concurrency
|
namespace concurrency
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user