mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-14 14:52:32 +00:00
Compare commits
1356 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ef2cc8623 | ||
|
|
b41a32c6b6 | ||
|
|
1ebd7b0c3e | ||
|
|
5457541244 | ||
|
|
ef325289eb | ||
|
|
40c63c0615 | ||
|
|
a9de8b9bb3 | ||
|
|
66a7f896c8 | ||
|
|
45a36f5571 | ||
|
|
62493efc40 | ||
|
|
2848b76cc9 | ||
|
|
ef8bea478d | ||
|
|
a8e4bbbe65 | ||
|
|
9a414d9c77 | ||
|
|
3d21794039 | ||
|
|
beac614e65 | ||
|
|
87f2673fc4 | ||
|
|
999b292717 | ||
|
|
8330c3270e | ||
|
|
0c8e0efed2 | ||
|
|
c44d8a0433 | ||
|
|
49b4ed2a89 | ||
|
|
4b9ea4f808 | ||
|
|
c3beca3e23 | ||
|
|
95cb6b06e4 | ||
|
|
c46a884558 | ||
|
|
2044427e97 | ||
|
|
514ebdf013 | ||
|
|
10f64590a9 | ||
|
|
4a70ba1f7a | ||
|
|
dd6a402ea0 | ||
|
|
bed7d8a619 | ||
|
|
1b6e8e36d3 | ||
|
|
7a4b8cde11 | ||
|
|
113859e791 | ||
|
|
a6b82ccfd9 | ||
|
|
e8b8ec69f1 | ||
|
|
023f1c24fb | ||
|
|
f00d07baa3 | ||
|
|
62c228b986 | ||
|
|
1a3cc40c7e | ||
|
|
bdcd5c3981 | ||
|
|
fc82e872d6 | ||
|
|
b47c54b5b6 | ||
|
|
c0c83ad389 | ||
|
|
23aecbdc38 | ||
|
|
eca7242a1f | ||
|
|
ef899425b8 | ||
|
|
269f90c510 | ||
|
|
7a5832ab8a | ||
|
|
044cc26340 | ||
|
|
4ccd03623f | ||
|
|
7854a22fbf | ||
|
|
943d5cb08d | ||
|
|
7480eb1826 | ||
|
|
c32c97c389 | ||
|
|
ef146fc0b5 | ||
|
|
f6861a8fe2 | ||
|
|
736642455f | ||
|
|
3c1c11e439 | ||
|
|
b072eec4ac | ||
|
|
ff9b49ddaa | ||
|
|
b8863c8a07 | ||
|
|
71cdbb1a73 | ||
|
|
200aa27cc0 | ||
|
|
f7752e4f9d | ||
|
|
7f0e8a8d6b | ||
|
|
1f6877606f | ||
|
|
1907873831 | ||
|
|
bacc6caf04 | ||
|
|
56d4250197 | ||
|
|
d66cede7fc | ||
|
|
f7ffd196e3 | ||
|
|
3a638090a2 | ||
|
|
4342ae74fb | ||
|
|
5a7962896d | ||
|
|
cfb9a600e4 | ||
|
|
7f3217d69e | ||
|
|
d94be0f534 | ||
|
|
17a3e6e975 | ||
|
|
423cbc2c6d | ||
|
|
124a82888d | ||
|
|
fec7a6bf17 | ||
|
|
bc50b39a3b | ||
|
|
158e3edbe7 | ||
|
|
116fe6d109 | ||
|
|
6a4ef7e1d1 | ||
|
|
a0fd83428f | ||
|
|
e5d4fbb164 | ||
|
|
154dd3990c | ||
|
|
78fe41710b | ||
|
|
1f38404e60 | ||
|
|
848760e5bf | ||
|
|
5ebac0cd54 | ||
|
|
9b4079317b | ||
|
|
0f64332f93 | ||
|
|
fd62edbcab | ||
|
|
46abb9ae3f | ||
|
|
b5361ef89f | ||
|
|
bf808f57fe | ||
|
|
648589ed16 | ||
|
|
28ec0e310d | ||
|
|
956d9e96f2 | ||
|
|
266ba03bb7 | ||
|
|
04c54840f4 | ||
|
|
db33200468 | ||
|
|
d7fbcf89bf | ||
|
|
a8b1bc735a | ||
|
|
ba8c640d6e | ||
|
|
d88d2780f4 | ||
|
|
b0bbf95b03 | ||
|
|
7ca150bf07 | ||
|
|
9c7aa02db8 | ||
|
|
6f444ed4b5 | ||
|
|
28119bf1bf | ||
|
|
7fdb5b594d | ||
|
|
6013fceb10 | ||
|
|
2996c7c8e2 | ||
|
|
d1c3078698 | ||
|
|
3e5f81bf2a | ||
|
|
772d045166 | ||
|
|
1a064a4666 | ||
|
|
e81c89dcae | ||
|
|
1f36139e99 | ||
|
|
6f77244af3 | ||
|
|
05351ce3e4 | ||
|
|
a79aff4778 | ||
|
|
86d6f88787 | ||
|
|
5fbeaee0b0 | ||
|
|
fed4dfd410 | ||
|
|
0d3b8bdb22 | ||
|
|
3c4f56f3bf | ||
|
|
d3c00584a2 | ||
|
|
ce7fa65595 | ||
|
|
9c0a0ad220 | ||
|
|
22d0ef36b8 | ||
|
|
829c5f493c | ||
|
|
2d8eb8e205 | ||
|
|
52a3927585 | ||
|
|
b39f6c96bd | ||
|
|
a96c2e0eac | ||
|
|
10b24c0269 | ||
|
|
4140883684 | ||
|
|
3352fae64c | ||
|
|
55cb0c52ee | ||
|
|
626d82614c | ||
|
|
d890068acb | ||
|
|
468ad39a94 | ||
|
|
5cbe06c2b0 | ||
|
|
3412ecfe7b | ||
|
|
adb16a334c | ||
|
|
377f0bda5d | ||
|
|
51ab853658 | ||
|
|
464a42258f | ||
|
|
9e9c50e6d8 | ||
|
|
945f726b65 | ||
|
|
7c44daf8f4 | ||
|
|
c57a9a8613 | ||
|
|
3c0429deee | ||
|
|
5d8f541e70 | ||
|
|
bd126b866c | ||
|
|
036a1991b8 | ||
|
|
6e3b22c624 | ||
|
|
82fbedbf41 | ||
|
|
0929b86d62 | ||
|
|
65fc1cf4a6 | ||
|
|
6f753799fd | ||
|
|
4d72afebe6 | ||
|
|
b1643e6036 | ||
|
|
362d8cb831 | ||
|
|
b203c95dd1 | ||
|
|
8d4672964c | ||
|
|
6e5e5822aa | ||
|
|
5fb0bf2575 | ||
|
|
9af2045dc1 | ||
|
|
9624cc3798 | ||
|
|
3541228c1f | ||
|
|
cc95361fdc | ||
|
|
9b1d1ad0a5 | ||
|
|
7e467f1466 | ||
|
|
d3e28e3e2c | ||
|
|
1a1a0fbfbe | ||
|
|
91305c2c84 | ||
|
|
48dd6d388d | ||
|
|
64710a6a04 | ||
|
|
c83ff03d66 | ||
|
|
73b47a78aa | ||
|
|
493b25f23e | ||
|
|
004f1f625b | ||
|
|
fc20f658e6 | ||
|
|
8e988cc926 | ||
|
|
8c240b59f6 | ||
|
|
f847e30a3c | ||
|
|
7050ae4ba1 | ||
|
|
3e64d8439d | ||
|
|
435c955acd | ||
|
|
c656a95a84 | ||
|
|
27ad8472c1 | ||
|
|
3fcd4a61aa | ||
|
|
c6d93d1a28 | ||
|
|
b0c82dcb5b | ||
|
|
7d4058f49d | ||
|
|
31fc8fafec | ||
|
|
313cee9a3f | ||
|
|
066d9d48a4 | ||
|
|
16de4a0d2e | ||
|
|
621fcb598e | ||
|
|
b2a6a4000b | ||
|
|
f5c939fb10 | ||
|
|
e508306395 | ||
|
|
cc6b500029 | ||
|
|
887b1b5dcd | ||
|
|
62e333b235 | ||
|
|
d859700497 | ||
|
|
f129b458ad | ||
|
|
bf68ad7cf5 | ||
|
|
6d9bdbb628 | ||
|
|
6782c2d3d1 | ||
|
|
b6f71ca1db | ||
|
|
92df77f228 | ||
|
|
caeea41867 | ||
|
|
bc17dd1a0f | ||
|
|
2a3175470b | ||
|
|
8ca6bbfb78 | ||
|
|
9777762052 | ||
|
|
da01f0ab7f | ||
|
|
1cd81208c0 | ||
|
|
2394075d94 | ||
|
|
de7b9877f9 | ||
|
|
ee27c15c2c | ||
|
|
076f8bd77b | ||
|
|
288363b3a6 | ||
|
|
48256d6e9e | ||
|
|
c007302564 | ||
|
|
0a9f7147f3 | ||
|
|
46ba36511a | ||
|
|
170f0693c6 | ||
|
|
d900509fbc | ||
|
|
8018c27dcd | ||
|
|
8df5ac9d3f | ||
|
|
c3196f47ef | ||
|
|
81a49d4e3c | ||
|
|
4f32c36db8 | ||
|
|
5db0bb3368 | ||
|
|
f3d38d84c9 | ||
|
|
f8bb6bbcb4 | ||
|
|
e0d5b9dce1 | ||
|
|
94e4b30125 | ||
|
|
2a067e7f6b | ||
|
|
97ab07e05c | ||
|
|
b8d39845cf | ||
|
|
cbea36a151 | ||
|
|
49dea6d6bd | ||
|
|
7d4c6c7086 | ||
|
|
fefd3d78f3 | ||
|
|
f41a77c46d | ||
|
|
6a475d8288 | ||
|
|
c629b94333 | ||
|
|
5423f4e06c | ||
|
|
88f8bbe21e | ||
|
|
eda4862f0d | ||
|
|
7ca752cd32 | ||
|
|
c5ffebc498 | ||
|
|
baa12aa5b3 | ||
|
|
ccf3522ada | ||
|
|
d14cf5aa94 | ||
|
|
810429b54f | ||
|
|
915427c964 | ||
|
|
347484baaf | ||
|
|
bb6913a56a | ||
|
|
6cdaf8c600 | ||
|
|
c370eb4a88 | ||
|
|
8dc4492ba3 | ||
|
|
901cc536ef | ||
|
|
41c2732e4f | ||
|
|
2d12a363db | ||
|
|
28455f0056 | ||
|
|
5125126aec | ||
|
|
f1ca1ee3c0 | ||
|
|
dffb6c2f06 | ||
|
|
7f214ffbb0 | ||
|
|
e049eac38a | ||
|
|
338445d175 | ||
|
|
8eb492d356 | ||
|
|
a5341d766e | ||
|
|
c78142b235 | ||
|
|
9ebaa2b962 | ||
|
|
79498580b1 | ||
|
|
41901aed97 | ||
|
|
2729a513ab | ||
|
|
af046e7dbd | ||
|
|
0caf534b65 | ||
|
|
f650222e94 | ||
|
|
5c40378805 | ||
|
|
780b7e3628 | ||
|
|
83ae3c7714 | ||
|
|
25ebb9adb8 | ||
|
|
7f6a0e7ddc | ||
|
|
f62e6793c5 | ||
|
|
babd57ecde | ||
|
|
de196810a2 | ||
|
|
82fe55471d | ||
|
|
83726086a9 | ||
|
|
60d90c4533 | ||
|
|
9145945efa | ||
|
|
7b09fbe049 | ||
|
|
a90bab5455 | ||
|
|
3d9cc8a056 | ||
|
|
ff885ef215 | ||
|
|
eb4286b560 | ||
|
|
9c90de0f6f | ||
|
|
d7a1cef046 | ||
|
|
6a359e2124 | ||
|
|
ca75dcd64d | ||
|
|
aba05ba5ce | ||
|
|
99882a675b | ||
|
|
9c9347df23 | ||
|
|
b66856c53f | ||
|
|
285069703c | ||
|
|
d91ab5480f | ||
|
|
e3b74ece74 | ||
|
|
66557241f3 | ||
|
|
3c09c3e520 | ||
|
|
781077e799 | ||
|
|
22946b5e51 | ||
|
|
c0307cbcb0 | ||
|
|
6b568ab2fb | ||
|
|
67bad9a689 | ||
|
|
559a790286 | ||
|
|
08e5bd728b | ||
|
|
0cfeeba2e2 | ||
|
|
5007624ba5 | ||
|
|
bba4677915 | ||
|
|
ac969cdb26 | ||
|
|
1c3eff0ee5 | ||
|
|
cba9546a4d | ||
|
|
ceae60cf13 | ||
|
|
3de1607cea | ||
|
|
029b2f3139 | ||
|
|
ab6c97bfef | ||
|
|
a61b15e861 | ||
|
|
8c7aa07c70 | ||
|
|
6a402b13fa | ||
|
|
c30b570e16 | ||
|
|
9b25818a50 | ||
|
|
5311e44660 | ||
|
|
55dafcbecb | ||
|
|
178958c165 | ||
|
|
d7cf7e2eb4 | ||
|
|
fce8c16d52 | ||
|
|
b690868bb1 | ||
|
|
dec88a368b | ||
|
|
17394d8c1c | ||
|
|
a7da7cd32e | ||
|
|
f37dc9c776 | ||
|
|
d6658dbb2e | ||
|
|
05531b2684 | ||
|
|
8b1fb39ce1 | ||
|
|
da46d4ca0e | ||
|
|
047141eb34 | ||
|
|
cb1053850d | ||
|
|
7652331e8c | ||
|
|
12bf3795ea | ||
|
|
7f45184d90 | ||
|
|
829763af2c | ||
|
|
75806ee666 | ||
|
|
91ec29db03 | ||
|
|
d191b12801 | ||
|
|
e0d6456618 | ||
|
|
70eda2ee06 | ||
|
|
7c4eb3eddd | ||
|
|
661a75d796 | ||
|
|
b617010a46 | ||
|
|
5a70c45a3e | ||
|
|
cb2b36811a | ||
|
|
92edcb97ed | ||
|
|
7f1ec15cab | ||
|
|
1aa7451866 | ||
|
|
d5c46dc114 | ||
|
|
5bab16636d | ||
|
|
204f2c1a68 | ||
|
|
a5b7501a4e | ||
|
|
b0e2c81666 | ||
|
|
00ca351169 | ||
|
|
0415a3c369 | ||
|
|
4eb27b637d | ||
|
|
107b56a346 | ||
|
|
abdc4dfae8 | ||
|
|
014eea2f56 | ||
|
|
9b4ca95660 | ||
|
|
78ff9a8116 | ||
|
|
66b147fb31 | ||
|
|
c5df1bc885 | ||
|
|
00cf3a768e | ||
|
|
b6a3deb341 | ||
|
|
531f488fe8 | ||
|
|
d674aaaa29 | ||
|
|
7f6dc104f0 | ||
|
|
102085808f | ||
|
|
2645730329 | ||
|
|
6aa28f55dd | ||
|
|
1e86365167 | ||
|
|
62c20f8ab9 | ||
|
|
7706f65921 | ||
|
|
68490336b8 | ||
|
|
20ac8d71fd | ||
|
|
ec082b7c9a | ||
|
|
ece75d1d7f | ||
|
|
9e10ce487c | ||
|
|
d248c6be4b | ||
|
|
39b0a89821 | ||
|
|
d9f43d3e2f | ||
|
|
94f03bee01 | ||
|
|
08c77caaa9 | ||
|
|
cfedc97cd0 | ||
|
|
cfad226b2b | ||
|
|
859642d2e4 | ||
|
|
8316419a01 | ||
|
|
96f5069742 | ||
|
|
e433249bb1 | ||
|
|
2a6df797ca | ||
|
|
28aa48c8d2 | ||
|
|
582f77e4ec | ||
|
|
5700cf96d5 | ||
|
|
769a98f1f4 | ||
|
|
4ee35a0612 | ||
|
|
64f6741f82 | ||
|
|
6ad5abcab2 | ||
|
|
5480f10184 | ||
|
|
41dfbdd331 | ||
|
|
903268c52a | ||
|
|
b60c630922 | ||
|
|
95588b420c | ||
|
|
b141ec2e35 | ||
|
|
3d0c611896 | ||
|
|
6cb92143ec | ||
|
|
f919eb6a64 | ||
|
|
4147786b12 | ||
|
|
3400bcde85 | ||
|
|
e5fac4b78d | ||
|
|
4d20865c67 | ||
|
|
8b4cf91f1f | ||
|
|
6a6a10fb9b | ||
|
|
44749470a4 | ||
|
|
8fe714d8b1 | ||
|
|
22137ff1bd | ||
|
|
da3b6d1958 | ||
|
|
c7213fb710 | ||
|
|
637960edde | ||
|
|
be7e4fea6a | ||
|
|
d9209ffaea | ||
|
|
9fb94796c8 | ||
|
|
f060f7faad | ||
|
|
55673fcd66 | ||
|
|
2ff94cb11d | ||
|
|
e46bebc06f | ||
|
|
80e8b4adcc | ||
|
|
e9be03b76c | ||
|
|
98dfecdb79 | ||
|
|
8ba8278fb5 | ||
|
|
51267379ab | ||
|
|
e2cf2ba4f2 | ||
|
|
4550cce639 | ||
|
|
f2f17c81d4 | ||
|
|
7c0d13f00a | ||
|
|
f78f3232e2 | ||
|
|
a687aa8e75 | ||
|
|
ed6b89b3b1 | ||
|
|
9d3ca0d0f9 | ||
|
|
05a0405709 | ||
|
|
efd8b70089 | ||
|
|
e12c057c31 | ||
|
|
0b5b18653a | ||
|
|
dc54e7331f | ||
|
|
6fbf6b2986 | ||
|
|
feb9992d7d | ||
|
|
fb4ac82d45 | ||
|
|
acbe8c159b | ||
|
|
63474dd952 | ||
|
|
cc35ed7782 | ||
|
|
d9fd227862 | ||
|
|
1415f2bed7 | ||
|
|
5b07d454b1 | ||
|
|
0c04ba4776 | ||
|
|
b00a936f41 | ||
|
|
5b11c1ca86 | ||
|
|
7802d00031 | ||
|
|
40a15248e8 | ||
|
|
9ba9e82706 | ||
|
|
ea6c33f3d2 | ||
|
|
82e5e1858a | ||
|
|
80b14c0a6f | ||
|
|
6954d0d5f4 | ||
|
|
7e53731fe6 | ||
|
|
c7290e6ccc | ||
|
|
284317cb25 | ||
|
|
311d1a56b4 | ||
|
|
ed589727d6 | ||
|
|
62c9bad183 | ||
|
|
616da8228e | ||
|
|
3a62453b8b | ||
|
|
c3f7829255 | ||
|
|
37d9fb2dad | ||
|
|
4388e72dec | ||
|
|
9803141fe7 | ||
|
|
1f0e9cc1c3 | ||
|
|
92b30ebec6 | ||
|
|
ccadb6a43d | ||
|
|
6f7f540c79 | ||
|
|
d5b8038457 | ||
|
|
0a6059ba13 | ||
|
|
aba5b01fa0 | ||
|
|
09f4943869 | ||
|
|
29c8543f87 | ||
|
|
7bd4940ed8 | ||
|
|
d5116935b5 | ||
|
|
0d320fe29b | ||
|
|
4159461a62 | ||
|
|
f4bd39e3fa | ||
|
|
fbc36a2cfd | ||
|
|
e93ba73adb | ||
|
|
03301f093d | ||
|
|
55a5fa6fb5 | ||
|
|
4d04d10135 | ||
|
|
cda423acab | ||
|
|
0f92678c3b | ||
|
|
8d122f36e3 | ||
|
|
439cdfbb32 | ||
|
|
0a6ab31e10 | ||
|
|
0b6486256d | ||
|
|
da12b93f82 | ||
|
|
6dec6af5dc | ||
|
|
11444621ae | ||
|
|
98f1b3296c | ||
|
|
26c43e7091 | ||
|
|
9b9447858a | ||
|
|
3151cfb064 | ||
|
|
c327fee986 | ||
|
|
a4f53270e8 | ||
|
|
a7456a1126 | ||
|
|
8381512ce4 | ||
|
|
57d968cdcd | ||
|
|
20a669029b | ||
|
|
f2e6c6de58 | ||
|
|
8fa44c3590 | ||
|
|
f5b7c33d4e | ||
|
|
be8e663d39 | ||
|
|
0d4a9748e3 | ||
|
|
bd477f0fb2 | ||
|
|
5317895a5e | ||
|
|
542b8b26ce | ||
|
|
aaca854620 | ||
|
|
64da384fc1 | ||
|
|
a595fc4642 | ||
|
|
ac135be8cd | ||
|
|
ac2d3e2ae0 | ||
|
|
33946af39f | ||
|
|
5ea59a1c4d | ||
|
|
8bafd87b76 | ||
|
|
6b40e9a5e0 | ||
|
|
a2f6fd9298 | ||
|
|
bc604fc9ba | ||
|
|
9baaa13897 | ||
|
|
65e53be8b0 | ||
|
|
7f5283e95d | ||
|
|
ae4ab48ddc | ||
|
|
afccf1da02 | ||
|
|
fc07c7c01f | ||
|
|
aeb906414f | ||
|
|
a6c6b45576 | ||
|
|
13806cce93 | ||
|
|
e7eee0995a | ||
|
|
5687bd09c6 | ||
|
|
f3db895832 | ||
|
|
dd2ffe5d14 | ||
|
|
ec10e784e1 | ||
|
|
649faa1d93 | ||
|
|
669f96b367 | ||
|
|
996821d18e | ||
|
|
2e172b019e | ||
|
|
3df05cd5c1 | ||
|
|
8bb85cdc69 | ||
|
|
9f6e23754c | ||
|
|
5a7cfdffb3 | ||
|
|
caafddfdfa | ||
|
|
ee0e31be97 | ||
|
|
f1da6469a3 | ||
|
|
68e57dd3a7 | ||
|
|
2504311671 | ||
|
|
aa29315624 | ||
|
|
e3bcb87cf0 | ||
|
|
2530dc44c7 | ||
|
|
70a8fe30b7 | ||
|
|
30e538e5ed | ||
|
|
58dbc3c702 | ||
|
|
210c904604 | ||
|
|
27fdab7c8d | ||
|
|
ba3e1abb5e | ||
|
|
ce194e2162 | ||
|
|
595166db8e | ||
|
|
38d9e34a66 | ||
|
|
c1e0977db3 | ||
|
|
b4f32e7645 | ||
|
|
6bb0c95c95 | ||
|
|
4e958c9230 | ||
|
|
64cf1890f2 | ||
|
|
6a857b00db | ||
|
|
6d60a061bc | ||
|
|
6a09ddef18 | ||
|
|
d48e803b7b | ||
|
|
9061b3d8c3 | ||
|
|
2839539c6c | ||
|
|
f77a1798f3 | ||
|
|
664b558a36 | ||
|
|
c1865f127c | ||
|
|
3a69539192 | ||
|
|
cfcaf28ace | ||
|
|
d9e93f3944 | ||
|
|
60470211e5 | ||
|
|
c5851a4a0c | ||
|
|
0c0b2446b7 | ||
|
|
ce9352fd23 | ||
|
|
375ae5fe77 | ||
|
|
665d35196d | ||
|
|
9757f9ae53 | ||
|
|
e45d0c4dcf | ||
|
|
5c9f22bc18 | ||
|
|
d8287e9cdb | ||
|
|
c66e064f42 | ||
|
|
364fc84aaa | ||
|
|
fe4f86bc84 | ||
|
|
982b2e33ff | ||
|
|
8190098bb8 | ||
|
|
c99411311b | ||
|
|
da8a048dce | ||
|
|
b4de495154 | ||
|
|
aaa6af3f38 | ||
|
|
b11b322581 | ||
|
|
60b38215ce | ||
|
|
53e68515dd | ||
|
|
7676ae9184 | ||
|
|
b385feefa5 | ||
|
|
fc50b4abc0 | ||
|
|
0104a2eb3a | ||
|
|
23fdc9d1a9 | ||
|
|
ea4a678308 | ||
|
|
6566c4f15e | ||
|
|
6f39f1740f | ||
|
|
7b61bdbfd2 | ||
|
|
8e65db19b0 | ||
|
|
698fcdad36 | ||
|
|
c25d6e974f | ||
|
|
35aae48932 | ||
|
|
f8afa2703f | ||
|
|
cd903dceb9 | ||
|
|
5843c6f25e | ||
|
|
3005373760 | ||
|
|
7678540a93 | ||
|
|
463666aec5 | ||
|
|
5847f94ece | ||
|
|
09855b76ef | ||
|
|
f4d476d160 | ||
|
|
d88d4be63e | ||
|
|
154114e900 | ||
|
|
03f019dea2 | ||
|
|
a47524b762 | ||
|
|
fd2f5a5ba4 | ||
|
|
e66b2234f6 | ||
|
|
f35b15b09c | ||
|
|
99dac51b9d | ||
|
|
656faf4ce9 | ||
|
|
d9ab6986ad | ||
|
|
514d45c219 | ||
|
|
94b7fc76c1 | ||
|
|
e9923ac257 | ||
|
|
60ad1793e4 | ||
|
|
96a15bec3b | ||
|
|
91b4cadb1b | ||
|
|
fba676fc07 | ||
|
|
9ad14ad98b | ||
|
|
477c62082d | ||
|
|
82169d4115 | ||
|
|
362d5452d5 | ||
|
|
92e5a15399 | ||
|
|
114e0c4ada | ||
|
|
075ff26499 | ||
|
|
d65f2ede81 | ||
|
|
4a9248a451 | ||
|
|
1c6092c430 | ||
|
|
0e9ed1e82f | ||
|
|
02ce0558b9 | ||
|
|
63110f0134 | ||
|
|
d8db4449be | ||
|
|
fda98bbf58 | ||
|
|
aadba1f694 | ||
|
|
2c8d152885 | ||
|
|
37c598833c | ||
|
|
e80de4eba0 | ||
|
|
e382a181f7 | ||
|
|
85f69cb908 | ||
|
|
112a94e572 | ||
|
|
13307c502f | ||
|
|
8a1754efe8 | ||
|
|
8caa075bc6 | ||
|
|
d5deb49d20 | ||
|
|
575a15e135 | ||
|
|
dc7469c64b | ||
|
|
f54b18f733 | ||
|
|
db66e4dc00 | ||
|
|
47e614c7d6 | ||
|
|
03cb3c2145 | ||
|
|
a8d4b5479d | ||
|
|
de37e1bbab | ||
|
|
f0b8f10665 | ||
|
|
88b91de197 | ||
|
|
f22bb34c07 | ||
|
|
2d1cb7a43a | ||
|
|
dc169675e2 | ||
|
|
99f8253637 | ||
|
|
f3244caac1 | ||
|
|
6edaadf5d8 | ||
|
|
1f668046a0 | ||
|
|
cb2aa3b29f | ||
|
|
8ccd59a7d8 | ||
|
|
ddfdae64bf | ||
|
|
21a90a42e5 | ||
|
|
712d6e5c1e | ||
|
|
f02a2c0853 | ||
|
|
00d55c9daa | ||
|
|
a05e45f84b | ||
|
|
e650033f2c | ||
|
|
846fc14b4a | ||
|
|
a8a5e036f5 | ||
|
|
009f05b61d | ||
|
|
d8a6f82459 | ||
|
|
185fe8520a | ||
|
|
ce9bac34d6 | ||
|
|
e80673ed15 | ||
|
|
bdbaf9c655 | ||
|
|
7473a6c27a | ||
|
|
71a4cfefd5 | ||
|
|
4919129bbc | ||
|
|
a02175cec0 | ||
|
|
63affdd2e7 | ||
|
|
351687e5cd | ||
|
|
739f497bbd | ||
|
|
2d2ed591e9 | ||
|
|
871a85d688 | ||
|
|
a5f05019db | ||
|
|
e124d2094f | ||
|
|
5d874cd43b | ||
|
|
9f6cdadd3e | ||
|
|
6a3853ef35 | ||
|
|
9ea65c6793 | ||
|
|
8d14e97dfa | ||
|
|
1c63a70673 | ||
|
|
8022f3b920 | ||
|
|
420b7d48d9 | ||
|
|
5915669f6f | ||
|
|
52b01db306 | ||
|
|
a0d6ecb331 | ||
|
|
0271b02d50 | ||
|
|
9f61c78c0e | ||
|
|
4db176867b | ||
|
|
4b5cfaf9ba | ||
|
|
c014c1bafe | ||
|
|
96594516af | ||
|
|
bed20bf1fa | ||
|
|
4e5a445d8b | ||
|
|
99437d931e | ||
|
|
5166717298 | ||
|
|
49b5738f4f | ||
|
|
c753ea7cd1 | ||
|
|
5b1488ddf0 | ||
|
|
a34cfb0ee0 | ||
|
|
d8ff605d32 | ||
|
|
8031c47602 | ||
|
|
e522e47544 | ||
|
|
ed0f79b683 | ||
|
|
de1337d351 | ||
|
|
1b34a0c6d8 | ||
|
|
313380381b | ||
|
|
f56ff2ca20 | ||
|
|
da2ef0ac61 | ||
|
|
6a3033fa85 | ||
|
|
f3a1c5e679 | ||
|
|
a96c8fd4db | ||
|
|
da3ed9926b | ||
|
|
fd386d9d7f | ||
|
|
5d1614989e | ||
|
|
bae73a9526 | ||
|
|
f4b1678535 | ||
|
|
943517a1e4 | ||
|
|
03999e9d56 | ||
|
|
d5f177b1ee | ||
|
|
fdaed7e323 | ||
|
|
d39e775c95 | ||
|
|
829e0b6e26 | ||
|
|
1656c8d0cb | ||
|
|
2770cc7de3 | ||
|
|
48de631e04 | ||
|
|
66b11bcbd7 | ||
|
|
cda7487cbe | ||
|
|
e8f6504ec4 | ||
|
|
8f1b26bdda | ||
|
|
5bd3e4bcd0 | ||
|
|
fb3b62f8f0 | ||
|
|
e89fe2f7d9 | ||
|
|
16812c3ee4 | ||
|
|
c9cb293bf2 | ||
|
|
8e2e154cdd | ||
|
|
b7505ab575 | ||
|
|
cc47e29fac | ||
|
|
608f8349d9 | ||
|
|
3ecd93dcf6 | ||
|
|
dd0209b192 | ||
|
|
ae92567383 | ||
|
|
9f2646ba03 | ||
|
|
925e46da8c | ||
|
|
a6475ce848 | ||
|
|
9149912a2d | ||
|
|
2dadb4d7a2 | ||
|
|
1897d4703c | ||
|
|
a25cead7d7 | ||
|
|
3d919b21f6 | ||
|
|
d2de04d5b2 | ||
|
|
a753c942b9 | ||
|
|
9dd88281af | ||
|
|
e75561016b | ||
|
|
e2cbccb133 | ||
|
|
0271df0657 | ||
|
|
e05e324a7c | ||
|
|
71041e8674 | ||
|
|
c65b518432 | ||
|
|
6ba960ce47 | ||
|
|
8bf4919576 | ||
|
|
cca4867987 | ||
|
|
7aa47cf93b | ||
|
|
3089de79ee | ||
|
|
a23f327461 | ||
|
|
6b020149f3 | ||
|
|
34fae52e98 | ||
|
|
976bdad067 | ||
|
|
26d3ef529e | ||
|
|
53c3d9baa2 | ||
|
|
2a6858fa34 | ||
|
|
5440cbec6a | ||
|
|
19f5a5ef79 | ||
|
|
ef831a0b4d | ||
|
|
efc239533c | ||
|
|
ef1463a6a9 | ||
|
|
95e952b896 | ||
|
|
db72faca5e | ||
|
|
6961853ed7 | ||
|
|
5ec5248fe4 | ||
|
|
14fdd33972 | ||
|
|
140e29840a | ||
|
|
d1d318fad5 | ||
|
|
dfb6c0bb20 | ||
|
|
7339abbab5 | ||
|
|
27db0e27e8 | ||
|
|
a0b43b9a95 | ||
|
|
b6a202d68e | ||
|
|
125035d546 | ||
|
|
9f05ad2927 | ||
|
|
86ae69d360 | ||
|
|
c12fb69ca2 | ||
|
|
8b911aba7f | ||
|
|
2fa595523f | ||
|
|
190a3c2d6b | ||
|
|
1bf9d052fc | ||
|
|
e7b99b0d78 | ||
|
|
96313ee1c4 | ||
|
|
3e356e5866 | ||
|
|
1cc24de787 | ||
|
|
e6875d559c | ||
|
|
b73dd5b23b | ||
|
|
28d21ecdcc | ||
|
|
42298abfad | ||
|
|
c4a1fe0f36 | ||
|
|
0396f8f968 | ||
|
|
f1b840dede | ||
|
|
4da5d79e88 | ||
|
|
fc0c9bcfe3 | ||
|
|
32d0368f59 | ||
|
|
8bfe9fa8fc | ||
|
|
f10ad07f97 | ||
|
|
95df7dd8dc | ||
|
|
dcd1f7478a | ||
|
|
c2be6c4068 | ||
|
|
101eef5495 | ||
|
|
933d5424da | ||
|
|
ecf528f9b6 | ||
|
|
9b309fe0a0 | ||
|
|
29fd8dc7a5 | ||
|
|
624b95782d | ||
|
|
4fa25042c8 | ||
|
|
9f9cb030ad | ||
|
|
1d9290afc0 | ||
|
|
ad2f639195 | ||
|
|
07b4eea037 | ||
|
|
79c61cf0e0 | ||
|
|
80268ea56a | ||
|
|
bb9f595b8b | ||
|
|
2ad314f150 | ||
|
|
916e62398d | ||
|
|
4735b3ff5b | ||
|
|
cfd6483ea5 | ||
|
|
4f7a25f562 | ||
|
|
4176d79ee9 | ||
|
|
fad496378c | ||
|
|
e084699704 | ||
|
|
50213d8323 | ||
|
|
763276a2c8 | ||
|
|
71fcdba017 | ||
|
|
08227e79d0 | ||
|
|
5a4fab2506 | ||
|
|
31eb2f5337 | ||
|
|
82c1752d85 | ||
|
|
49a13bbfd3 | ||
|
|
0096f54ae9 | ||
|
|
5af122b39d | ||
|
|
4e106f4098 | ||
|
|
1f1d683f4f | ||
|
|
a8f64c3cc8 | ||
|
|
968a2d7fbc | ||
|
|
1fab9c5aac | ||
|
|
22bca31ce3 | ||
|
|
48c045a253 | ||
|
|
e9ca7792eb | ||
|
|
b1a55b4576 | ||
|
|
dd7452ad96 | ||
|
|
d7d8188093 | ||
|
|
62a893c760 | ||
|
|
a2ba9d3c44 | ||
|
|
22720e9f63 | ||
|
|
11b79a942d | ||
|
|
3c3e722181 | ||
|
|
fce31560c6 | ||
|
|
074ac33b8a | ||
|
|
2982e197e0 | ||
|
|
f69ddf168b | ||
|
|
8d985cfd37 | ||
|
|
4693302d82 | ||
|
|
814c126e67 | ||
|
|
a7d153abcb | ||
|
|
1b265eb48d | ||
|
|
94e80d3b44 | ||
|
|
f1ec95f49b | ||
|
|
7ee2643e9a | ||
|
|
2ab34357d5 | ||
|
|
b53392ab73 | ||
|
|
803d2dfefb | ||
|
|
6a54bbcf2a | ||
|
|
02dfe7564f | ||
|
|
b704911603 | ||
|
|
0193c281ef | ||
|
|
59086fd477 | ||
|
|
88a704c4d3 | ||
|
|
9f49f90acd | ||
|
|
93f69d5a94 | ||
|
|
cceecf5f8e | ||
|
|
e5d2d24e2c | ||
|
|
eb40013ddc | ||
|
|
dda946d933 | ||
|
|
178e800969 | ||
|
|
dec4870649 | ||
|
|
97f5a7c5fe | ||
|
|
7ff42b89a6 | ||
|
|
44de3bd179 | ||
|
|
15cb599cd1 | ||
|
|
038b7c9c91 | ||
|
|
724e39bc92 | ||
|
|
def86131f0 | ||
|
|
8f1c1a9049 | ||
|
|
3f3a1a11df | ||
|
|
64f6c0f5c0 | ||
|
|
7cd60d859e | ||
|
|
db11d9280c | ||
|
|
ca03110932 | ||
|
|
b8b503cb0a | ||
|
|
bb885a5110 | ||
|
|
bebaa838c4 | ||
|
|
7fa9d09d9f | ||
|
|
7bc299573f | ||
|
|
e0a1855429 | ||
|
|
5e75beff3f | ||
|
|
4f7e85c1a4 | ||
|
|
5ad30caf67 | ||
|
|
8f26ae240a | ||
|
|
d445cbe083 | ||
|
|
12599849db | ||
|
|
3c9c01189d | ||
|
|
4f3a9d8646 | ||
|
|
0c7c3f17e5 | ||
|
|
5b0451f25c | ||
|
|
8f3b33c84c | ||
|
|
2fdb75efdf | ||
|
|
fbd12e1929 | ||
|
|
ffe95f62ab | ||
|
|
3e4ccef992 | ||
|
|
309e7be00c | ||
|
|
f0f6c4950b | ||
|
|
16998ebd8d | ||
|
|
b77c068881 | ||
|
|
e94227cddd | ||
|
|
fe3cbeed3a | ||
|
|
2061706c11 | ||
|
|
a0b6d57591 | ||
|
|
3673f95fe5 | ||
|
|
c67b53b969 | ||
|
|
562b227c73 | ||
|
|
169d85d0fa | ||
|
|
bd77d47215 | ||
|
|
e40524baf0 | ||
|
|
31f735ae1f | ||
|
|
9232dfcccf | ||
|
|
fab616a15e | ||
|
|
2419ebb04e | ||
|
|
88c576798b | ||
|
|
db766f18ed | ||
|
|
f9a805e3d4 | ||
|
|
e5f9a752d8 | ||
|
|
20b41836e2 | ||
|
|
c55df4d1cc | ||
|
|
908b1020c0 | ||
|
|
78470ed3f5 | ||
|
|
4ce7df295e | ||
|
|
598abb0d23 | ||
|
|
184eac6281 | ||
|
|
176532f55f | ||
|
|
8eb3045451 | ||
|
|
2fe145aed9 | ||
|
|
ab61e64056 | ||
|
|
5b17417e0c | ||
|
|
04a83fd6b7 | ||
|
|
7730bd762a | ||
|
|
62286fff52 | ||
|
|
25cca0628d | ||
|
|
65406eaa08 | ||
|
|
ea24394110 | ||
|
|
6afeb3e456 | ||
|
|
f108c576a7 | ||
|
|
6eb74415ab | ||
|
|
0d14b69a24 | ||
|
|
d4eb47e837 | ||
|
|
86716c4397 | ||
|
|
7bbcf101c1 | ||
|
|
8e495e417c | ||
|
|
a6e0d6d751 | ||
|
|
cff255a397 | ||
|
|
3336e821ad | ||
|
|
d75d603218 | ||
|
|
bf5be49186 | ||
|
|
39ff26aa45 | ||
|
|
02b5efed96 | ||
|
|
0a07c5692c | ||
|
|
2464784f00 | ||
|
|
a8f5ff1fbd | ||
|
|
0a6af936ed | ||
|
|
0b62083e35 | ||
|
|
5ca149fac9 | ||
|
|
80c69c28cd | ||
|
|
5904d66111 | ||
|
|
fd17193d5e | ||
|
|
5c379c4a98 | ||
|
|
9c5d626e7d | ||
|
|
4757b6807e | ||
|
|
ac7f3cd603 | ||
|
|
04ad8bb533 | ||
|
|
5924690ce3 | ||
|
|
3ac3baf1c1 | ||
|
|
aa88e2bb1f | ||
|
|
640cb3bf7f | ||
|
|
6ad451eb5f | ||
|
|
93a06906cb | ||
|
|
3754950a0e | ||
|
|
06a17885eb | ||
|
|
33624b7753 | ||
|
|
2d6b9320a5 | ||
|
|
6b35454570 | ||
|
|
753a57230d | ||
|
|
9c3e63e6b5 | ||
|
|
4d4d7b38cc | ||
|
|
23f148f8ce | ||
|
|
d150549754 | ||
|
|
441c4c7b3c | ||
|
|
c22df18e28 | ||
|
|
e32b41938a | ||
|
|
ef395a1596 | ||
|
|
af35f3006c | ||
|
|
13ac686c96 | ||
|
|
05a0266fc4 | ||
|
|
3acbf31198 | ||
|
|
2e82bf3ca1 | ||
|
|
63e1a3f47e | ||
|
|
07a8972aea | ||
|
|
d1cb45aa5d | ||
|
|
1b3610d0fa | ||
|
|
2fcdc2c09f | ||
|
|
da74803ffb | ||
|
|
890511615f | ||
|
|
17de6f9532 | ||
|
|
2a15195c32 | ||
|
|
1b050a6c3d | ||
|
|
1da62e5ba1 | ||
|
|
feb6f2e59e | ||
|
|
7dabad1b70 | ||
|
|
a73f466473 | ||
|
|
1fd92cf8eb | ||
|
|
dd671ceca6 | ||
|
|
8a76931b37 | ||
|
|
b071eecce1 | ||
|
|
81734f75c8 | ||
|
|
11d57e721a | ||
|
|
9b0e329bb9 | ||
|
|
450fb7bc35 | ||
|
|
c1f8c8cca4 | ||
|
|
ea250d9cd3 | ||
|
|
be468a2183 | ||
|
|
a47d6c4d68 | ||
|
|
5386a5b224 | ||
|
|
a350b3795b | ||
|
|
cf2aa37635 | ||
|
|
d1387be015 | ||
|
|
f8857ad45b | ||
|
|
d831beab3d | ||
|
|
5c4ae6c042 | ||
|
|
a0c97825e8 | ||
|
|
cc3bac7ea0 | ||
|
|
ce21859ada | ||
|
|
54cd082bfe | ||
|
|
4c35d1f207 | ||
|
|
4d54df4c9b | ||
|
|
aa9aca2b88 | ||
|
|
a579bbcb50 | ||
|
|
12e67d3b30 | ||
|
|
50d724780a | ||
|
|
45babab8c4 | ||
|
|
3443e60718 | ||
|
|
65128a04c9 | ||
|
|
7210c1ae5e | ||
|
|
9075501917 | ||
|
|
a3b70e7538 | ||
|
|
b4b8abe6ec | ||
|
|
d647be73df | ||
|
|
42d7966858 | ||
|
|
f4d368e1f4 | ||
|
|
3a756b0e08 | ||
|
|
34ead2d68e | ||
|
|
3f1161b68b | ||
|
|
f108e24bc1 | ||
|
|
1f83f7d9df | ||
|
|
756c7ca7b3 | ||
|
|
79f7bf77c9 | ||
|
|
dee3e530de | ||
|
|
3e44c2c3e1 | ||
|
|
3886665041 | ||
|
|
c9b269c3c0 | ||
|
|
eb51c92d08 | ||
|
|
992b525588 | ||
|
|
25288d8ed6 | ||
|
|
32ac5ac9ae | ||
|
|
ef5cdefca6 | ||
|
|
f6f9dfa463 | ||
|
|
2161ce21df | ||
|
|
534691f0c2 | ||
|
|
6bc8e1b10a | ||
|
|
c8b95f7691 | ||
|
|
daf8594b99 | ||
|
|
5b54fd6359 | ||
|
|
53765298e1 | ||
|
|
0d94458c4e | ||
|
|
5e55695862 | ||
|
|
c9e2e6c386 | ||
|
|
dbbb62f63e | ||
|
|
79ce7d929c | ||
|
|
33437b5246 | ||
|
|
f4bacb9d87 | ||
|
|
0ac218b06d | ||
|
|
2ce1b4bb2c | ||
|
|
f002bee4f4 | ||
|
|
9c69326ed9 | ||
|
|
7a617d5378 | ||
|
|
90edae1ce0 | ||
|
|
2134b4db9b | ||
|
|
7b1ffb5c09 | ||
|
|
535f07d927 | ||
|
|
bfad136137 | ||
|
|
36bee8fa53 | ||
|
|
99cb0b3855 | ||
|
|
41c95eaff7 | ||
|
|
ca8a25f585 | ||
|
|
51a8700391 | ||
|
|
f099a31a29 | ||
|
|
52dbc4e15d | ||
|
|
8cabb3ea3d | ||
|
|
7a4a1af332 | ||
|
|
90ecdf229e | ||
|
|
24ac907780 | ||
|
|
5037fb830e | ||
|
|
79f1346359 | ||
|
|
35dada683a | ||
|
|
30a431788d | ||
|
|
d0b8adab75 | ||
|
|
74f7b7b622 | ||
|
|
9ec8562ce7 | ||
|
|
0cbcb7a9bd | ||
|
|
2874b22d6c | ||
|
|
3c9be48445 | ||
|
|
b5201f928b | ||
|
|
2591859df5 | ||
|
|
c411db111b | ||
|
|
0d62a2be85 | ||
|
|
9c971d3686 | ||
|
|
3c1357b732 | ||
|
|
acd5e5d29d | ||
|
|
64109b25f2 | ||
|
|
e93bc76ac9 | ||
|
|
1107c6d23d | ||
|
|
9b2155402d | ||
|
|
35cf8a4859 | ||
|
|
76f21dfd6e | ||
|
|
b101dc2c88 | ||
|
|
9bbd658b9d | ||
|
|
4999da0824 | ||
|
|
a783341df1 | ||
|
|
04258755e7 | ||
|
|
ea711ece1f | ||
|
|
e93187b630 | ||
|
|
eca3cda8b9 | ||
|
|
2874adfd69 | ||
|
|
91227b25df | ||
|
|
4dfac03402 | ||
|
|
9bc895eb57 | ||
|
|
474026d7fe | ||
|
|
9995d2a7ab | ||
|
|
3028ac3f24 | ||
|
|
8605950eef | ||
|
|
0f856dea7b | ||
|
|
2a2bc5b1d6 | ||
|
|
f87cb00940 | ||
|
|
a4ebf83b69 | ||
|
|
5dbacbddba | ||
|
|
011864a2d3 | ||
|
|
8646d8aeba | ||
|
|
87782cdf8f | ||
|
|
10289ed11a | ||
|
|
5def6a66e6 | ||
|
|
2d3bb4bb75 | ||
|
|
ffe8bf2be6 | ||
|
|
ab73033e51 | ||
|
|
c66e24aa4d | ||
|
|
651b13b3e5 | ||
|
|
951f5d11d5 | ||
|
|
2ce95ed2ce | ||
|
|
d1b7b6c5c5 | ||
|
|
425c570757 | ||
|
|
46dab2d496 | ||
|
|
f5271f5c79 | ||
|
|
375804c9e4 | ||
|
|
fe5703c684 | ||
|
|
f1c90a232f | ||
|
|
a91fba763a | ||
|
|
28588f6730 | ||
|
|
d074218049 | ||
|
|
1f07d6735b | ||
|
|
bb0b2e72c8 | ||
|
|
30c717ac2f | ||
|
|
e01680cd4b | ||
|
|
4bb308c80c | ||
|
|
12a68026e7 | ||
|
|
06449e39c1 | ||
|
|
cc6a8c8430 | ||
|
|
9aedec2c5c | ||
|
|
2221ddfca2 | ||
|
|
7dc6264fa7 | ||
|
|
f091a9505a | ||
|
|
57d5a54099 | ||
|
|
045a2031a3 | ||
|
|
0b8d7768fd | ||
|
|
c41f572cf5 | ||
|
|
bf26994d4e | ||
|
|
30ff67d46a | ||
|
|
65e6d029e0 | ||
|
|
31e9d34d1e | ||
|
|
0a796c4937 | ||
|
|
877e312833 | ||
|
|
cace2f4290 | ||
|
|
7b348f30ac | ||
|
|
8893be57df | ||
|
|
6b696bfdc5 | ||
|
|
a3df099f60 | ||
|
|
0ce1bbb758 | ||
|
|
bb808c6c52 | ||
|
|
15ea13c286 | ||
|
|
b0e0ee6934 | ||
|
|
f4791137fd | ||
|
|
51b53f406e | ||
|
|
bd0f35ad83 | ||
|
|
af5e3a0e02 | ||
|
|
0110e1d2e0 | ||
|
|
82afd234a1 | ||
|
|
419dd44ff6 | ||
|
|
621beadb5c | ||
|
|
8dfd7a4a71 | ||
|
|
a45d7be922 | ||
|
|
f9ce6a53e1 | ||
|
|
5f88174dbf | ||
|
|
bf640bec3c | ||
|
|
76100e23eb | ||
|
|
a678dd3ee8 | ||
|
|
356902d552 | ||
|
|
4906b12489 | ||
|
|
316347226b | ||
|
|
635e189007 | ||
|
|
6eba792537 | ||
|
|
4e06d9409a | ||
|
|
372a3e000e | ||
|
|
5e2044dd63 | ||
|
|
a1a1ceb94d | ||
|
|
ca37e50362 | ||
|
|
fe2ca65a11 | ||
|
|
c7894f3bc5 | ||
|
|
509f9b6e2b | ||
|
|
045529d91f | ||
|
|
4fa6b64c3d | ||
|
|
fa4c63edc8 | ||
|
|
aebcbf767f | ||
|
|
598023f5db | ||
|
|
3df81682b3 | ||
|
|
20461807f3 | ||
|
|
a6b98bec1f | ||
|
|
d4efb2c44c | ||
|
|
5f3e8b5309 | ||
|
|
132e54ecc5 | ||
|
|
7a745c9e65 | ||
|
|
beccc34ef1 | ||
|
|
7e2d765516 | ||
|
|
e00d2db741 | ||
|
|
96ca063f63 | ||
|
|
045ac16e7f | ||
|
|
e40bf8e2d3 | ||
|
|
ab1ace63a5 | ||
|
|
57c483d136 | ||
|
|
655814c816 | ||
|
|
84a86ec35d | ||
|
|
8972814270 | ||
|
|
a4c6ad6e8f | ||
|
|
5233c6d629 | ||
|
|
31cc277553 | ||
|
|
8c80861b69 | ||
|
|
0ab5b69c11 | ||
|
|
e9279c6daa | ||
|
|
b060c518a2 | ||
|
|
6ade723caa |
6
.clang-format
Normal file
6
.clang-format
Normal file
@@ -0,0 +1,6 @@
|
||||
Language: Cpp
|
||||
IndentWidth: 4
|
||||
ColumnLimit: 130
|
||||
PointerAlignment: Right
|
||||
BreakBeforeBraces: Linux
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
38
.github/ISSUE_TEMPLATE/bug-report-or-feature-proposal.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/bug-report-or-feature-proposal.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report or feature proposal
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Please - if you just have a question (i.e. not a bug report or a feature proposal), post in our [forum](https://meshtastic.discourse.group/) instead.
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Device info:**
|
||||
- Device model: [e.g. TBEAM]
|
||||
- Software Version [e.g. 0.7.8]
|
||||
|
||||
**Smartphone information (if relevant):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- App Version [e.g. 0.7.2]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
13
.github/pull_request_template.md
vendored
Normal file
13
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
## Thank you for sending in a pull request, here's some tips to get started!
|
||||
|
||||
(Please delete all these tips and replace with your text)
|
||||
|
||||
- Before starting on some new big chunk of code, it it is optional but highly recommended to open an issue first
|
||||
to say "hey, I think this idea X should be implemented and I'm starting work on it. My general plan is Y, any feedback
|
||||
is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc...
|
||||
- Please do not check in files that don't have real changes
|
||||
- Please do not reformat lines that you didn't have to change the code on
|
||||
- We recommend using the [Visual Studio Code](https://platformio.org/install/ide?install=vscode) editor,
|
||||
because automatically follows our indentation rules and it's auto reformatting will not cause spurious changes to lines.
|
||||
- If your PR fixes a bug, mention "fixes #bugnum" somewhere in your pull request description.
|
||||
- If your other co-developers have comments on your PR please tweak as needed.
|
||||
26
.github/workflows/main.yml
vendored
Normal file
26
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Continuous Integration
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
main:
|
||||
name: Main
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Checkout submodules
|
||||
uses: textbook/git-checkout-submodule-action@master
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@master
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Install Platform IO
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
- name: Install extra python tools
|
||||
run: |
|
||||
pip install -U adafruit-nrfutil
|
||||
- name: Build
|
||||
run: platformio run -e tbeam -e heltec -e lora-relay-v1 -e linux
|
||||
14
.gitignore
vendored
14
.gitignore
vendored
@@ -6,6 +6,16 @@ main/credentials.h
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
*.code-workspace
|
||||
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.autotools
|
||||
.built
|
||||
.context
|
||||
.cproject
|
||||
.idea/*
|
||||
.vagrant
|
||||
|
||||
flash.uf2
|
||||
|
||||
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
[submodule "proto"]
|
||||
path = proto
|
||||
url = https://github.com/meshtastic/Meshtastic-protobufs.git
|
||||
[submodule "sdk-nrfxlib"]
|
||||
path = sdk-nrfxlib
|
||||
url = https://github.com/nrfconnect/sdk-nrfxlib.git
|
||||
32
.vscode/launch.json
vendored
32
.vscode/launch.json
vendored
@@ -1,32 +0,0 @@
|
||||
// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY
|
||||
|
||||
// PIO Unified Debugger
|
||||
//
|
||||
// Documentation: https://docs.platformio.org/page/plus/debugging.html
|
||||
// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html
|
||||
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "platformio-debug",
|
||||
"request": "launch",
|
||||
"name": "PIO Debug",
|
||||
"executable": "/home/kevinh/development/meshtastic/meshtastic-esp32/.pio/build/esp32/firmware.elf",
|
||||
"toolchainBinDir": "/home/kevinh/.platformio/packages/toolchain-xtensa32/bin",
|
||||
"preLaunchTask": {
|
||||
"type": "PlatformIO",
|
||||
"task": "Pre-Debug"
|
||||
},
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
},
|
||||
{
|
||||
"type": "platformio-debug",
|
||||
"request": "launch",
|
||||
"name": "PIO Debug (skip Pre-Debug)",
|
||||
"executable": "/home/kevinh/development/meshtastic/meshtastic-esp32/.pio/build/esp32/firmware.elf",
|
||||
"toolchainBinDir": "/home/kevinh/.platformio/packages/toolchain-xtensa32/bin",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
}
|
||||
]
|
||||
}
|
||||
28
.vscode/settings.json
vendored
28
.vscode/settings.json
vendored
@@ -41,9 +41,31 @@
|
||||
"utility": "cpp",
|
||||
"typeinfo": "cpp",
|
||||
"string": "cpp",
|
||||
"*.xbm": "cpp"
|
||||
"*.xbm": "cpp",
|
||||
"list": "cpp",
|
||||
"atomic": "cpp",
|
||||
"memory_resource": "cpp",
|
||||
"optional": "cpp",
|
||||
"string_view": "cpp",
|
||||
"cassert": "cpp",
|
||||
"iterator": "cpp",
|
||||
"shared_mutex": "cpp"
|
||||
},
|
||||
"cSpell.words": [
|
||||
"Meshtastic"
|
||||
]
|
||||
"Blox",
|
||||
"EINK",
|
||||
"HFSR",
|
||||
"Meshtastic",
|
||||
"NEMAGPS",
|
||||
"NMEAGPS",
|
||||
"RDEF",
|
||||
"Ublox",
|
||||
"bkpt",
|
||||
"cfsr",
|
||||
"descs",
|
||||
"ocrypto",
|
||||
"protobufs",
|
||||
"wifi"
|
||||
],
|
||||
"C_Cpp.dimInactiveRegions": true
|
||||
}
|
||||
17
.vscode/tasks.json
vendored
Normal file
17
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "PlatformIO",
|
||||
"task": "Build",
|
||||
"problemMatcher": [
|
||||
"$platformio"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"label": "PlatformIO: Build"
|
||||
}
|
||||
]
|
||||
}
|
||||
220
README.md
220
README.md
@@ -1,47 +1,207 @@
|
||||
# Meshtastic-esp32
|
||||
This is the device side code for the [meshtastic.org](https://www.meshtastic.org) project.
|
||||
# Meshtastic-device
|
||||
|
||||
Meshtastic is a project that lets you use
|
||||
inexpensive GPS mesh radios as an extensible, super long battery life mesh GPS communicator. These radios are great for hiking, skiing, paragliding -
|
||||
essentially any hobby where you don't have reliable internet access. Each member of your private mesh can always see the location and distance of all other
|
||||
This is the device side code for the [meshtastic.org](https://www.meshtastic.org) project.
|
||||
|
||||

|
||||
|
||||
Meshtastic™ is a project that lets you use
|
||||
inexpensive GPS mesh radios as an extensible, super long battery life mesh GPS communicator. These radios are great for hiking, skiing, paragliding -
|
||||
essentially any hobby where you don't have reliable internet access. Each member of your private mesh can always see the location and distance of all other
|
||||
members and any text messages sent to your group chat.
|
||||
|
||||
The radios automatically create a mesh to forward packets as needed, so everyone in the group can receive messages from even the furthest member. The radios
|
||||
The radios automatically create a mesh to forward packets as needed, so everyone in the group can receive messages from even the furthest member. The radios
|
||||
will optionally work with your phone, but no phone is required.
|
||||
|
||||
Typical time between recharging the radios should be about eight days.
|
||||
|
||||
This project is currently pre-alpha, but if you have questions please join our chat [](https://gitter.im/Meshtastic/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge).
|
||||
This project is is currently in beta-testing - if you have questions please [join our discussion forum](https://meshtastic.discourse.group/).
|
||||
|
||||
This software is 100% open source and developed by a group of hobbyist experimenters. No warranty is provided, if you'd like to improve it - we'd love your help. Please post in the chat.
|
||||
|
||||
## Meshtastic Android app
|
||||
The source code for the (optional) Meshtastic Android app is [here](https://github.com/geeksville/Meshtastic-Android).
|
||||
Soon our first alpha release of will be released here:
|
||||
[](https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source%3Dgithub%26utm_medium%3Desp32-readme%26utm_campaign%3Dmeshtastic-esp32%2520readme%26anid%3Dadmob&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1)
|
||||
This software is 100% open source and developed by a group of hobbyist experimenters. No warranty is provided, if you'd like to improve it - we'd love your help. Please post in the chat.
|
||||
|
||||
## Supported hardware
|
||||
We currently support two brands of radios. The [TTGO T-Beam](https://www.aliexpress.com/item/4000119152086.html) and the [Heltec LoRa 32](https://heltec.org/project/wifi-lora-32/). Most users should buy the T-Beam and a 18650 battery (total cost less than $35). Make
|
||||
sure to buy the frequency range which is legal for your country. For the USA, you should buy the 915MHz version. Getting a version that include a screen
|
||||
is optional, but highly recommended.
|
||||
|
||||
We don't yet distribute prebuilt binaries. But soon (by Feb 22) we will have a file that you can fairly easily install on your radio via USB. Once our software is installed, all future software updates happen over bluetooth from your phone.
|
||||
We currently support three models of radios.
|
||||
|
||||
For a nice 3D printable case see this [design](https://www.thingiverse.com/thing:3773717) by [bsiege](https://www.thingiverse.com/bsiege).
|
||||
- TTGO T-Beam (usually the recommended choice)
|
||||
- [T-Beam V1.1 w/ NEO-6M - special Meshtastic version](https://www.aliexpress.com/item/4001178678568.html) (Includes built-in OLED display and they have **preinstalled** the meshtastic software)
|
||||
- [T-Beam V1.1 w/ NEO-M8N](https://www.aliexpress.com/item/33047631119.html) (slightly better GPS)
|
||||
- [T-Beam V1.1 w/ NEO-M8N /w SX1262](https://www.aliexpress.com/item/4001287221970.html) (slightly better GPS + LoRa)
|
||||
- board labels "TTGO T22_V1.1 20191212"
|
||||
- [T-Beam V0.7 w/ NEO-6M](https://www.aliexpress.com/item/4000574335430.html) (will work but **you must use the tbeam0.7 firmware ** - but the T-Beam V1.0 or later are better!)
|
||||
- board labels "TTGO T22_V07 20180711"
|
||||
- 3D printable cases
|
||||
- [T-Beam V0](https://www.thingiverse.com/thing:3773717)
|
||||
- [T-Beam V1 (SMA-antenna)](https://www.thingiverse.com/thing:3830711)
|
||||
- [T-Beam V1 (IPEX-antenna)](https://www.thingiverse.com/thing:4587297)
|
||||
- Laser-cut cases
|
||||
- [T-Beam V1](https://www.thingiverse.com/thing:4552771)
|
||||
|
||||
- [TTGO LORA32](https://www.aliexpress.com/item/4000211331316.html) - No GPS
|
||||
- version 2.1
|
||||
- board labels "TTGO T3_V1.6 20180606"
|
||||
- 3D printable case
|
||||
- [TTGO LORA32 v1](https://www.thingiverse.com/thing:3385109)
|
||||
|
||||
- [Heltec LoRa 32](https://heltec.org/project/wifi-lora-32/) - No GPS
|
||||
- [3D Printable case](https://www.thingiverse.com/thing:3125854)
|
||||
|
||||
**Make sure to get the frequency for your country**
|
||||
|
||||
- US/JP/AU/NZ/CA - 915MHz
|
||||
- CN - 470MHz
|
||||
- EU - 868MHz, 433MHz
|
||||
- full list of LoRa frequencies per region is available [here](https://www.thethingsnetwork.org/docs/lorawan/frequencies-by-country.html)
|
||||
|
||||
Getting a version that includes a screen is optional, but highly recommended.
|
||||
|
||||
## Firmware Installation
|
||||
|
||||
Prebuilt binaries for the supported radios are available in our [releases](https://github.com/meshtastic/Meshtastic-esp32/releases). Your initial installation has to happen over USB from your Mac, Windows or Linux PC. Once our software is installed, all future software updates happen over bluetooth from your phone.
|
||||
|
||||
Be **very careful** to install the correct load for your board. In particular the popular 'T-BEAM' radio from TTGO is not called 'TTGO-Lora' (that is a different board). So don't install the 'TTGO-Lora' build on a TBEAM, it won't work correctly.
|
||||
|
||||
Please post comments on our [group chat](https://meshtastic.discourse.group/) if you have problems or successes.
|
||||
|
||||
### Installing from a GUI - Windows and Mac
|
||||
|
||||
1. Download and unzip the latest Meshtastic firmware [release](https://github.com/meshtastic/Meshtastic-esp32/releases).
|
||||
2. Download [ESPHome Flasher](https://github.com/esphome/esphome-flasher/releases) (either x86-32bit Windows or x64-64 bit Windows).
|
||||
3. Connect your radio to your USB port and open ESPHome Flasher.
|
||||
4. If your board is not showing under Serial Port then you likely need to install the drivers for the CP210X serial chip. In Windows you can check by searching “Device Manager” and ensuring the device is shown under “Ports”.
|
||||
5. If there is an error, download the drivers [here](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers), then unzip and run the Installer application.
|
||||
6. In ESPHome Flasher, refresh the serial ports and select your board.
|
||||
7. Browse to the previously downloaded firmware and select the correct firmware based on the board type, country and frequency.
|
||||
8. Select Flash ESP.
|
||||
9. Once complete, “Done! Flashing is complete!” will be shown.
|
||||
10. Debug messages sent from the Meshtastic device can be viewed with a terminal program such as [PuTTY](https://www.putty.org/) (Windows only). Within PuTTY, click “Serial”, enter the “Serial line” com port (can be found at step 4), enter “Speed” as 921600, then click “Open”.
|
||||
|
||||
### Installing from a commandline
|
||||
|
||||
These instructions currently require a few commmand lines, but it should be pretty straightforward.
|
||||
|
||||
1. Install "pip". Pip is the python package manager we use to get the esptool installer app. Instructions [here](https://www.makeuseof.com/tag/install-pip-for-python/). If you are using OS-X, see these [special instructions](docs/software/install-OSX.md).
|
||||
2. Run "pip install --upgrade esptool" to get esptool installed on your machine.
|
||||
3. Connect your radio to your USB port.
|
||||
4. Confirm that your device is talking to your PC by running "esptool.py chip_id". The Heltec build also works on the TTGO LORA32 radio. You should see something like:
|
||||
|
||||
```
|
||||
mydir$ esptool.py chip_id
|
||||
esptool.py v2.6
|
||||
Found 2 serial ports
|
||||
Serial port /dev/ttyUSB0
|
||||
Connecting....
|
||||
Detecting chip type... ESP32
|
||||
Chip is ESP32D0WDQ6 (revision 1)
|
||||
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
|
||||
MAC: 24:6f:28:b5:36:71
|
||||
Uploading stub...
|
||||
Running stub...
|
||||
Stub running...
|
||||
Warning: ESP32 has no Chip ID. Reading MAC instead.
|
||||
MAC: 24:6f:28:b5:36:71
|
||||
Hard resetting via RTS pin...
|
||||
```
|
||||
|
||||
5. cd into the directory where the release zip file was expanded.
|
||||
6. Install the correct firmware for your board with `device-install.sh -f firmware-_board_-_country_.bin`.
|
||||
- Example: `./device-install.sh -f firmware-HELTEC-US-0.0.3.bin`.
|
||||
7. To update run `device-update.sh -f firmware-_board_-_country_.bin`
|
||||
- Example: `./device-update.sh -f firmware-HELTEC-US-0.0.3.bin`.
|
||||
|
||||
Note: If you have previously installed meshtastic, you don't need to run this full script instead just run `esptool.py --baud 921600 write_flash 0x10000 firmware-_board_-_country_-_version_.bin`. This will be faster, also all of your current preferences will be preserved.
|
||||
|
||||
You should see something like this:
|
||||
|
||||
```
|
||||
kevinh@kevin-server:~/development/meshtastic/meshtastic-esp32/release/latest$ ./device-install.sh firmware-TBEAM-US-0.1.8.bin
|
||||
Trying to flash firmware-TBEAM-US-0.1.8.bin, but first erasing and writing system information
|
||||
esptool.py v2.6
|
||||
Found 2 serial ports
|
||||
Serial port /dev/ttyUSB0
|
||||
Connecting........____
|
||||
Detecting chip type... ESP32
|
||||
Chip is ESP32D0WDQ6 (revision 1)
|
||||
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
|
||||
MAC: 24:6f:28:b2:01:6c
|
||||
Uploading stub...
|
||||
Running stub...
|
||||
Stub running...
|
||||
Changing baud rate to 921600
|
||||
Changed.
|
||||
Erasing flash (this may take a while)...
|
||||
Chip erase completed successfully in 6.1s
|
||||
Hard resetting via RTS pin...
|
||||
esptool.py v2.6
|
||||
Found 2 serial ports
|
||||
Serial port /dev/ttyUSB0
|
||||
Connecting.......
|
||||
Detecting chip type... ESP32
|
||||
Chip is ESP32D0WDQ6 (revision 1)
|
||||
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
|
||||
MAC: 24:6f:28:b2:01:6c
|
||||
Uploading stub...
|
||||
Running stub...
|
||||
Stub running...
|
||||
Changing baud rate to 921600
|
||||
Changed.
|
||||
Configuring flash size...
|
||||
Auto-detected Flash size: 4MB
|
||||
Flash params set to 0x0220
|
||||
Compressed 61440 bytes to 11950...
|
||||
Wrote 61440 bytes (11950 compressed) at 0x00001000 in 0.2 seconds (effective 3092.4 kbit/s)...
|
||||
Hash of data verified.
|
||||
|
||||
Leaving...
|
||||
Hard resetting via RTS pin...
|
||||
esptool.py v2.6
|
||||
Found 2 serial ports
|
||||
Serial port /dev/ttyUSB0
|
||||
Connecting.....
|
||||
Detecting chip type... ESP32
|
||||
Chip is ESP32D0WDQ6 (revision 1)
|
||||
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
|
||||
MAC: 24:6f:28:b2:01:6c
|
||||
Uploading stub...
|
||||
Running stub...
|
||||
Stub running...
|
||||
Changing baud rate to 921600
|
||||
Changed.
|
||||
Configuring flash size...
|
||||
Auto-detected Flash size: 4MB
|
||||
Compressed 1223568 bytes to 678412...
|
||||
Wrote 1223568 bytes (678412 compressed) at 0x00010000 in 10.7 seconds (effective 912.0 kbit/s)...
|
||||
Hash of data verified.
|
||||
|
||||
Leaving...
|
||||
Hard resetting via RTS pin...
|
||||
```
|
||||
|
||||
7. The board will boot and show the Meshtastic logo.
|
||||
8. Please post a comment on our chat so we know if these instructions worked for you ;-). If you find bugs/have-questions post there also - we will be rapidly iterating over the next few weeks.
|
||||
|
||||
# Meshtastic Android app
|
||||
|
||||
The companion (optional) Meshtastic Android app is [here](https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source%3Dgithub-dev-readme). You can also download it on Google Play.
|
||||
|
||||
# Python API
|
||||
|
||||
We offer a [python API](https://github.com/meshtastic/Meshtastic-python) that makes it easy to use these devices to provide mesh networking for your custom projects.
|
||||
|
||||
# Development
|
||||
The following sections are probably only interesting if you want to join us in developing the software.
|
||||
|
||||
## Power measurements
|
||||
Since one of the main goals of this project is long battery life, it is important to consider that in our software/protocol design. Based on initial measurements it seems that the current code should run about three days between charging, and with a bit more software work (see the [TODO list](TODO.md)) a battery life of eight days should be quite doable. Our current power measurements/model is in [this spreadsheet](https://docs.google.com/spreadsheets/d/1ft1bS3iXqFKU8SApU8ZLTq9r7QQEGESYnVgdtvdT67k/edit?usp=sharing).
|
||||
We'd love to have you join us on this merry little project. Please see our [development documents](./docs/software/sw-design.md) and [join us in our discussion forum](https://meshtastic.discourse.group/).
|
||||
|
||||
## Build instructions
|
||||
This project uses the simple PlatformIO build system. You can use the IDE, but for brevity
|
||||
in these instructions I describe use of their command line tool.
|
||||
# Credits
|
||||
|
||||
1. Purchase a suitable radio (see above)
|
||||
2. Install [PlatformIO](https://platformio.org/platformio-ide)
|
||||
3. Download this git repo and cd into it
|
||||
4. Plug the radio into your USB port
|
||||
4. Type "pio run -t upload" (This command will fetch dependencies, build the project and install it on the board via USB)
|
||||
5. Platform IO also installs a very nice VisualStudio Code based IDE, see their [tutorial](https://docs.platformio.org/en/latest/tutorials/espressif32/arduino_debugging_unit_testing.html) if you'd like to use it
|
||||
This project is run by volunteers. Past contributors include:
|
||||
|
||||
- @astro-arphid: Added support for 433MHz radios in europe.
|
||||
- @claesg: Various documentation fixes and 3D print enclosures
|
||||
- @girtsf: Lots of improvements
|
||||
- @spattinson: Fixed interrupt handling for the AXP192 part
|
||||
|
||||
# IMPORTANT DISCLAIMERS AND FAQ
|
||||
|
||||
For a listing of currently missing features and a FAQ click [here](docs/faq.md).
|
||||
|
||||
Copyright 2019 Geeksville Industries, LLC. GPL V3 Licensed.
|
||||
|
||||
183
TODO.md
183
TODO.md
@@ -1,183 +0,0 @@
|
||||
# High priority
|
||||
Items to complete before the first alpha release.
|
||||
|
||||
* rx signal measurements -3 marginal, -9 bad, 10 great
|
||||
* only send 10% of phone gps positions on the network
|
||||
* post sample video to signal forum
|
||||
* support non US frequencies
|
||||
* make an install script to let novices install software on their boards
|
||||
* retest BLE software update for both board types
|
||||
* default to enter deep sleep if no LORA received for two hours (indicates user has probably left the meshS)
|
||||
* first alpha release, article writeup for hackaday
|
||||
* send note about Adafruit Clue
|
||||
* send note to the guy who designed the cases
|
||||
* send pr https://github.com/ThingPulse/esp8266-oled-ssd1306 to tell them about this project
|
||||
* update the prebuilt bins for different regulatory regions
|
||||
|
||||
# Medium priority
|
||||
Items to complete before the first beta release.
|
||||
|
||||
* assign every "channel" a random shared 8 bit sync word (per 4.2.13.6 of datasheet) - use that word to filter packets before even checking CRC. This will ensure our CPU will only wake for packets on our "channel"
|
||||
* Note: we do not do address filtering at the chip level, because we might need to route for the mesh
|
||||
* Use the Periodic class for both position and user periodic broadcasts
|
||||
* make debug info screen show real data (including battery level & charging)
|
||||
* don't forward redundant pings or ping responses to the phone, it just wastes phone battery
|
||||
* don't treat north as up, instead adjust shown bearings for our guess at the users heading (i.e. subtract one from the other)
|
||||
* answer to pings (because some other user is looking at our nodeinfo) with our latest location
|
||||
* show radio and gps signal strength as an image
|
||||
* only BLE advertise for a short time after the screen is on and button pressed - to save power and prevent people for sniffing for our BT app.
|
||||
* use https://platformio.org/lib/show/1260/OneButton if necessary
|
||||
* make an about to sleep screen
|
||||
* don't send location packets if we haven't moved
|
||||
* scrub default radio config settings for bandwidth/range/speed
|
||||
* add basic crypto - http://rweather.github.io/arduinolibs/crypto.html with speck https://www.airspayce.com/mikem/arduino/RadioHead/rf95_encrypted_client_8pde-example.html
|
||||
* override peekAtMessage so we can see any messages that pass through our node (even if not broadcast)? would that be useful?
|
||||
* sendToMesh can currently block for a long time, instead have it just queue a packet for a radio freertos thread
|
||||
* How do avalanche beacons work? Could this do that as well? possibly by using beacon mode feature of the RF95?
|
||||
* use std::map<NodeInfo*, std::string> in node db
|
||||
|
||||
# Low power consumption tasks
|
||||
General ideas to hit the power draws our spreadsheet predicts. Do the easy ones before beta, the last 15% can be done after 1.0.
|
||||
|
||||
* (possibly bad idea - better to have lora radio always listen - check spreadsheet) have every node wake at the same tick and do their position syncs then go back to deep sleep
|
||||
* lower BT announce interval to save battery
|
||||
* change to use RXcontinuous mode and config to drop packets with bad CRC (see section 6.4 of datasheet) - I think this is already the case
|
||||
* have mesh service run in a thread that stays blocked until a packet arrives from the RF95
|
||||
* platformio sdkconfig CONFIG_PM and turn on modem sleep mode
|
||||
* keep cpu 100% in deepsleep until irq from radio wakes it. Then stay awake for 30 secs to attempt delivery to phone.
|
||||
* use https://lastminuteengineers.com/esp32-sleep-modes-power-consumption/ association sleep pattern to save power - but see https://github.com/espressif/esp-idf/issues/2070 and https://esp32.com/viewtopic.php?f=13&t=12182 it seems with BLE on the 'easy' draw people are getting is 80mA
|
||||
* stop using loop() instead use a job queue and let cpu sleep
|
||||
* measure power consumption and calculate battery life assuming no deep sleep
|
||||
* do lowest sleep level possible where BT still works during normal sleeping, make sure cpu stays in that mode unless lora rx packet happens, bt rx packet happens or button press happens
|
||||
* optionally do lora messaging only during special scheduled intervals (unless nodes are told to go to low latency mode), then deep sleep except during those intervals - before implementing calculate what battery life would be with this feature
|
||||
* see section 7.3 of https://cdn.sparkfun.com/assets/learn_tutorials/8/0/4/RFM95_96_97_98W.pdf and have hope radio wake only when a valid packet is received. Possibly even wake the ESP32 from deep sleep via GPIO.
|
||||
* never enter deep sleep while connected to USB power (but still go to other low power modes)
|
||||
* when main cpu is idle (in loop), turn cpu clock rate down and/or activate special sleep modes. We want almost everything shutdown until it gets an interrupt.
|
||||
|
||||
# Mesh broadcast algoritm
|
||||
|
||||
FIXME - instead look for standard solutions. this approach seems really suboptimal, because too many nodes will try to rebroast.
|
||||
|
||||
## approach 1
|
||||
* send all broadcasts with a TTL
|
||||
* periodically(?) do a survey to find the max TTL that is needed to fully cover the current network.
|
||||
* to do a study first send a broadcast (maybe our current initial user announcement?) with TTL set to one (so therefore no one will rebroadcast our request)
|
||||
* survey replies are sent unicast back to us (and intervening nodes will need to keep the route table that they have built up based on past packets)
|
||||
* count the number of replies to this TTL 1 attempt. That is the number of nodes we can reach without any rebroadcasts
|
||||
* repeat the study with a TTL of 2 and then 3. stop once the # of replies stops going up.
|
||||
* it is important for any node to do listen before talk to prevent stomping on other rebroadcasters...
|
||||
* For these little networks I bet a max TTL would never be higher than 3?
|
||||
|
||||
## approach 2
|
||||
* send a TTL1 broadcast, the replies let us build a list of the nodes (stored as a bitvector?) that we can see (and their rssis)
|
||||
* we then broadcast out that bitvector (also TTL1) asking "can any of ya'll (even indirectly) see anyone else?"
|
||||
* if a node can see someone I missed (and they are the best person to see that node), they reply (unidirectionally) with the missing nodes and their rssis (other nodes might sniff (and update their db) based on this reply but they don't have to)
|
||||
* given that the max number of nodes in this mesh will be like 20 (for normal cases), I bet globally updating this db of "nodenums and who has the best rssi for packets from that node" would be useful
|
||||
* once the global DB is shared, when a node wants to broadcast, it just sends out its broadcast . the first level receivers then make a decision "am I the best to rebroadcast to someone who likely missed this packet?" if so, rebroadcast
|
||||
|
||||
# Pre-beta priority
|
||||
During the beta timeframe the following improvements 'would be nice' (and yeah - I guess some of these items count as features, but it is a hobby project ;-) )
|
||||
|
||||
* fix the frequency error reading in the RF95 RX code (can't do floating point math in an ISR ;-)
|
||||
* See CustomRF95::send and fix the problem of dropping partially received packets if we want to start sending
|
||||
* swap out speck for hw-accelerated full AES https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/esp32/hwcrypto/aes.h
|
||||
* use variable length arduino Strings in protobufs (instead of current fixed buffers)
|
||||
* don't even power on bluetooth until we have some data to send to the android phone. Most of the time we should be sleeping in a lowpower "listening for lora" only mode. Once we have some packets for the phone, then power on bluetooth
|
||||
until the phone pulls those packets. Ever so often power on bluetooth just so we can see if the phone wants to send some packets. Possibly might need ULP processor to help with this wake process.
|
||||
* do hibernation mode to get power draw down to 2.5uA https://lastminuteengineers.com/esp32-sleep-modes-power-consumption/
|
||||
* make sure main cpu is not woken for packets with bad crc or not addressed to this node - do that in the radio hw
|
||||
* enable fast init inside the gps chip
|
||||
* triple check fcc compliance
|
||||
* pick channel center frequency based on name? "dolphin" would hash to 900Mhz, "cat" to 905MHz etc? Or is that too opaque?
|
||||
* scan to find channels with low background noise?
|
||||
* share channel settings over Signal (or qr code) by embedding an an URL which is handled by the MeshUtil app.
|
||||
|
||||
# Low priority
|
||||
Items after the first final candidate release.
|
||||
|
||||
* make a no bluetooth configured yet screen - include this screen in the loop if the user hasn't yet paired
|
||||
* the AXP debug output says it is trying to charge at 700mA, but the max I've seen is 180mA, so AXP registers probably need to be set to tell them the circuit can only provide 300mAish max. So that the low charge rate kicks in faster and we don't wear out batteries.
|
||||
* increase the max charging rate a bit for 18650s, currently it limits to 180mA (at 4V). Work backwards from the 500mA USB limit (at 5V) and let the AXP charge at that rate.
|
||||
* if radio params change fundamentally, discard the nodedb
|
||||
* discard very old nodedb records (> 1wk)
|
||||
* using the genpartitions based table doesn't work on TTGO so for now I stay with my old memory map
|
||||
* We let anyone BLE scan for us (FIXME, perhaps only allow that until we are paired with a phone and configured)
|
||||
* use two different buildenv flags for ttgo vs lora32. https://docs.platformio.org/en/latest/ide/vscode.html#key-bindings
|
||||
* sim gps data for testing nodes that don't have hardware
|
||||
* have android provide position data for nodes that don't have gps
|
||||
* do debug serial logging to android over bluetooth
|
||||
* break out my bluetooth OTA software as a seperate library so others can use it
|
||||
* Heltec LoRa32 has 8MB flash, use a bigger partition table if needed - TTGO is 4MB but has PSRAM
|
||||
* add a watchdog timer
|
||||
* fix GPS.zeroOffset calculation it is wrong
|
||||
* handle millis() rollover in GPS.getTime - otherwise we will break after 50 days
|
||||
* reneable the bluetooth battery level service on the T-BEAM, because we can read battery level there
|
||||
* report esp32 device code bugs back to the mothership via android
|
||||
|
||||
# Done
|
||||
|
||||
* change the partition table to take advantage of the 4MB flash on the wroom: http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
||||
* wrap in nice MeshRadio class
|
||||
* add mesh send & rx
|
||||
* make message send from android go to service, then to mesh radio
|
||||
* make message receive from radio go through to android
|
||||
* test loopback tx/rx path code without using radio
|
||||
* notify phone when rx packets arrive, currently the phone polls at startup only
|
||||
* figure out if we can use PA_BOOST - yes, it seems to be on both boards
|
||||
* implement new ble characteristics
|
||||
* have MeshService keep a node DB by sniffing user messages
|
||||
* have a state machine return the correct FromRadio packet to the phone, it isn't always going to be a MeshPacket. Do a notify on fromnum to force the radio to read our state machine generated packets
|
||||
* send my_node_num when phone sends WantsNodes
|
||||
* have meshservice periodically send location data on mesh (if device has a GPS)
|
||||
* implement getCurrentTime() - set based off gps but then updated locally
|
||||
* make default owner record have valid usernames
|
||||
* message loop between node 0x28 and 0x7c
|
||||
* check in my radiolib fixes
|
||||
* figure out what is busted with rx
|
||||
* send our owner info at boot, reply if we see anyone send theirs
|
||||
* add manager layers
|
||||
* confirm second device receives that gps message and updates device db
|
||||
* send correct hw vendor in the bluetooth info - needed so the android app can update different radio models
|
||||
* correctly map nodeids to nodenums, currently we just do a proof of concept by always doing a broadcast
|
||||
* add interrupt detach/sleep mode config to lora radio so we can enable deepsleep without panicing
|
||||
* make jtag work on second board
|
||||
* implement regen owner and radio prefs
|
||||
* use a better font
|
||||
* make nice screens (boot, about to sleep, debug info (gps signal, #people), latest text, person info - one frame per person on network)
|
||||
* turn framerate from ui->state.frameState to 1 fps (or less) unless in transition
|
||||
* switch to my gui layout manager
|
||||
* make basic gui. different screens: debug, one page for each user in the user db, last received text message
|
||||
* make button press cycle between screens
|
||||
* save our node db on entry to sleep
|
||||
* fix the logo
|
||||
* sent/received packets (especially if a node was just reset) have variant of zero sometimes - I think there is a bug (race-condtion?) in the radio send/rx path.
|
||||
* DONE dynamic nodenum assignment tasks
|
||||
* make jtag debugger id stable: https://askubuntu.com/questions/49910/how-to-distinguish-between-identical-usb-to-serial-adapters
|
||||
* reported altitude is crap
|
||||
* good tips on which bands might be more free https://github.com/TheThingsNetwork/ttn/issues/119
|
||||
* finish power measurements (GPS on during sleep vs LCD on during sleep vs LORA on during sleep) and est battery life
|
||||
* make screen sleep behavior work
|
||||
* make screen advance only when a new node update arrives, a new text arrives or the user presses a button, turn off screen after a while
|
||||
* after reboot, channel number is getting reset to zero! fix!
|
||||
* send user and location events much less often
|
||||
* send location (or if not available user) when the user wakes the device from display sleep (both for testing and to improve user experience)
|
||||
* make real implementation of getNumOnlineNodes
|
||||
* very occasionally send our position and user packet based on the schedule in the radio info (if for nothing else so that other nodes update last_seen)
|
||||
* show real text info on the text screen
|
||||
* apply radio settings from android land
|
||||
* cope with nodes that have 0xff or 0x00 as the last byte of their mac
|
||||
* allow setting full radio params from android
|
||||
* add receive timestamps to messages, inserted by esp32 when message is received but then shown on the phone
|
||||
* update build to generate both board types
|
||||
* have node info screen show real info (including distance and heading)
|
||||
* blink the power led less often
|
||||
* have radiohead ISR send messages to RX queue directly, to allow that thread to block until we have something to send
|
||||
* move lora rx/tx to own thread and block on IO
|
||||
* keep our pseudo time moving forward even if we enter deep sleep (use esp32 rtc)
|
||||
* for non GPS equipped devices, set time from phone
|
||||
* GUI on oled hangs for a few seconds occasionally, but comes back
|
||||
* update local GPS position (but do not broadcast) at whatever rate the GPS is giving it
|
||||
* don't send our times to other nodes
|
||||
* don't trust times from other nodes
|
||||
* draw compass rose based off local walking track
|
||||
* add requestResponse optional bool - use for location broadcasts when sending tests
|
||||
@@ -1,15 +1,85 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
VERSION=0.0.3
|
||||
source bin/version.sh
|
||||
|
||||
COUNTRY=US
|
||||
COUNTRIES="US EU433 EU865 CN JP ANZ KR"
|
||||
#COUNTRIES=US
|
||||
#COUNTRIES=CN
|
||||
|
||||
rm .pio/build/esp32/firmware.bin
|
||||
export PLATFORMIO_BUILD_FLAGS="-DT_BEAM_V10 -DAPP_VERSION=$VERSION"
|
||||
pio run # -v
|
||||
cp .pio/build/esp32/firmware.bin release/firmware-TBEAM-$COUNTRY.bin
|
||||
BOARDS_ESP32="tlora-v2 tlora-v1 tlora-v2-1-1.6 tbeam heltec tbeam0.7"
|
||||
|
||||
rm .pio/build/esp32/firmware.bin
|
||||
export PLATFORMIO_BUILD_FLAGS="-DHELTEC_LORA32 -DAPP_VERSION=$VERSION"
|
||||
pio run # -v
|
||||
cp .pio/build/esp32/firmware.bin release/firmware-HELTEC-$COUNTRY.bin
|
||||
# FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine
|
||||
BOARDS_NRF52="lora-relay-v1"
|
||||
BOARDS="$BOARDS_ESP32 $BOARDS_NRF52"
|
||||
#BOARDS=tbeam
|
||||
|
||||
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 $OUTDIR/elfs
|
||||
rm -f $OUTDIR/bins/*
|
||||
|
||||
# build the named environment and copy the bins to the release directory
|
||||
function do_build {
|
||||
echo "Building for $BOARD with $PLATFORMIO_BUILD_FLAGS"
|
||||
rm -f .pio/build/$BOARD/firmware.*
|
||||
|
||||
# The shell vars the build tool expects to find
|
||||
export HW_VERSION="1.0-$COUNTRY"
|
||||
export APP_VERSION=$VERSION
|
||||
export COUNTRY
|
||||
|
||||
pio run --jobs 4 --environment $BOARD # -v
|
||||
SRCELF=.pio/build/$BOARD/firmware.elf
|
||||
cp $SRCELF $OUTDIR/elfs/firmware-$BOARD-$COUNTRY-$VERSION.elf
|
||||
}
|
||||
|
||||
# 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
|
||||
|
||||
for COUNTRY in $COUNTRIES; do
|
||||
for BOARD in $BOARDS; do
|
||||
do_build $BOARD
|
||||
done
|
||||
|
||||
echo "Copying ESP32 bin files"
|
||||
for BOARD in $BOARDS_ESP32; do
|
||||
SRCBIN=.pio/build/$BOARD/firmware.bin
|
||||
cp $SRCBIN $OUTDIR/bins/firmware-$BOARD-$COUNTRY-$VERSION.bin
|
||||
done
|
||||
|
||||
echo "Generating NRF52 uf2 files"
|
||||
for BOARD in $BOARDS_NRF52; do
|
||||
SRCHEX=.pio/build/$BOARD/firmware.hex
|
||||
bin/uf2conv.py $SRCHEX -c -o $OUTDIR/bins/firmware-$BOARD-$COUNTRY-$VERSION.uf2 -f 0xADA52840
|
||||
done
|
||||
done
|
||||
|
||||
# keep the bins in archive also
|
||||
cp $OUTDIR/bins/firmware* $OUTDIR/elfs/firmware* $ARCHIVEDIR
|
||||
|
||||
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">$VERSION</string>
|
||||
</resources>
|
||||
XML
|
||||
|
||||
rm -f $ARCHIVEDIR/firmware-$VERSION.zip
|
||||
zip --junk-paths $ARCHIVEDIR/firmware-$VERSION.zip $OUTDIR/bins/firmware-*-$VERSION.* images/system-info.bin bin/device-install.sh bin/device-update.sh
|
||||
|
||||
echo BUILT ALL
|
||||
|
||||
45
bin/device-install.sh
Executable file
45
bin/device-install.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Usage info
|
||||
show_help() {
|
||||
cat << EOF
|
||||
Usage: ${0##*/} [-h] [-p ESPTOOL_PORT] [-f FILENAME]
|
||||
Flash image file to device, but first erasing and writing system information"
|
||||
|
||||
-h Display this help and exit
|
||||
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous).
|
||||
-f FILENAME The .bin file to flash. Custom to your device type and region.
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
while getopts ":h:p:f:" opt; do
|
||||
case "${opt}" in
|
||||
h)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
p) export ESPTOOL_PORT=${OPTARG}
|
||||
;;
|
||||
f) FILENAME=${OPTARG}
|
||||
;;
|
||||
*)
|
||||
echo "Invalid flag."
|
||||
show_help >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift "$((OPTIND-1))"
|
||||
|
||||
if [ -f "${FILENAME}" ]; then
|
||||
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
||||
esptool.py --baud 921600 erase_flash
|
||||
esptool.py --baud 921600 write_flash 0x1000 system-info.bin
|
||||
esptool.py --baud 921600 write_flash 0x10000 ${FILENAME}
|
||||
else
|
||||
echo "Invalid file: ${FILENAME}"
|
||||
show_help
|
||||
fi
|
||||
|
||||
exit 0
|
||||
43
bin/device-update.sh
Executable file
43
bin/device-update.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Usage info
|
||||
show_help() {
|
||||
cat << EOF
|
||||
Usage: ${0##*/} [-h] [-p ESPTOOL_PORT] -f FILENAME
|
||||
Flash image file to device, leave existing system intact."
|
||||
|
||||
-h Display this help and exit
|
||||
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous).
|
||||
-f FILENAME The .bin file to flash. Custom to your device type and region.
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
while getopts ":h:p:f:" opt; do
|
||||
case "${opt}" in
|
||||
h)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
p) export ESPTOOL_PORT=${OPTARG}
|
||||
;;
|
||||
f) FILENAME=${OPTARG}
|
||||
;;
|
||||
*)
|
||||
echo "Invalid flag."
|
||||
show_help >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift "$((OPTIND-1))"
|
||||
|
||||
if [ -f "${FILENAME}" ]; then
|
||||
echo "Trying to flash update ${FILENAME}."
|
||||
esptool.py --baud 921600 write_flash 0x10000 ${FILENAME}
|
||||
else
|
||||
echo "Invalid file: ${FILENAME}"
|
||||
show_help
|
||||
fi
|
||||
|
||||
exit 0
|
||||
3
bin/dump-ram-users.sh
Executable file
3
bin/dump-ram-users.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
arm-none-eabi-readelf -s -e .pio/build/nrf52dk/firmware.elf | head -80
|
||||
|
||||
nm -CSr --size-sort .pio/build/nrf52dk/firmware.elf | grep '^200'
|
||||
329
bin/exception_decoder.py
Executable file
329
bin/exception_decoder.py
Executable file
@@ -0,0 +1,329 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""ESP Exception Decoder
|
||||
|
||||
github: https://github.com/janLo/EspArduinoExceptionDecoder
|
||||
license: GPL v3
|
||||
author: Jan Losinski
|
||||
|
||||
Meshtastic notes:
|
||||
* original version is at: https://github.com/janLo/EspArduinoExceptionDecoder
|
||||
* version that's checked into meshtastic repo is based on: https://github.com/me21/EspArduinoExceptionDecoder
|
||||
which adds in ESP32 Backtrace decoding.
|
||||
* this also updates the defaults to use ESP32, instead of ESP8266 and defaults to the built firmware.bin
|
||||
|
||||
To use, copy the "Backtrace: 0x...." line to a file, e.g., backtrace.txt, then run:
|
||||
$ bin/exception_decoder.py backtrace.txt
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import re
|
||||
import subprocess
|
||||
from collections import namedtuple
|
||||
|
||||
import sys
|
||||
|
||||
import os
|
||||
|
||||
EXCEPTIONS = [
|
||||
"Illegal instruction",
|
||||
"SYSCALL instruction",
|
||||
"InstructionFetchError: Processor internal physical address or data error during instruction fetch",
|
||||
"LoadStoreError: Processor internal physical address or data error during load or store",
|
||||
"Level1Interrupt: Level-1 interrupt as indicated by set level-1 bits in the INTERRUPT register",
|
||||
"Alloca: MOVSP instruction, if caller's registers are not in the register file",
|
||||
"IntegerDivideByZero: QUOS, QUOU, REMS, or REMU divisor operand is zero",
|
||||
"reserved",
|
||||
"Privileged: Attempt to execute a privileged operation when CRING ? 0",
|
||||
"LoadStoreAlignmentCause: Load or store to an unaligned address",
|
||||
"reserved",
|
||||
"reserved",
|
||||
"InstrPIFDataError: PIF data error during instruction fetch",
|
||||
"LoadStorePIFDataError: Synchronous PIF data error during LoadStore access",
|
||||
"InstrPIFAddrError: PIF address error during instruction fetch",
|
||||
"LoadStorePIFAddrError: Synchronous PIF address error during LoadStore access",
|
||||
"InstTLBMiss: Error during Instruction TLB refill",
|
||||
"InstTLBMultiHit: Multiple instruction TLB entries matched",
|
||||
"InstFetchPrivilege: An instruction fetch referenced a virtual address at a ring level less than CRING",
|
||||
"reserved",
|
||||
"InstFetchProhibited: An instruction fetch referenced a page mapped with an attribute that does not permit instruction fetch",
|
||||
"reserved",
|
||||
"reserved",
|
||||
"reserved",
|
||||
"LoadStoreTLBMiss: Error during TLB refill for a load or store",
|
||||
"LoadStoreTLBMultiHit: Multiple TLB entries matched for a load or store",
|
||||
"LoadStorePrivilege: A load or store referenced a virtual address at a ring level less than CRING",
|
||||
"reserved",
|
||||
"LoadProhibited: A load referenced a page mapped with an attribute that does not permit loads",
|
||||
"StoreProhibited: A store referenced a page mapped with an attribute that does not permit stores"
|
||||
]
|
||||
|
||||
PLATFORMS = {
|
||||
"ESP8266": "lx106",
|
||||
"ESP32": "esp32"
|
||||
}
|
||||
|
||||
BACKTRACE_REGEX = re.compile(r"(?:\s+(0x40[0-2](?:\d|[a-f]|[A-F]){5}):0x(?:\d|[a-f]|[A-F]){8})\b")
|
||||
EXCEPTION_REGEX = re.compile("^Exception \\((?P<exc>[0-9]*)\\):$")
|
||||
COUNTER_REGEX = re.compile('^epc1=(?P<epc1>0x[0-9a-f]+) epc2=(?P<epc2>0x[0-9a-f]+) epc3=(?P<epc3>0x[0-9a-f]+) '
|
||||
'excvaddr=(?P<excvaddr>0x[0-9a-f]+) depc=(?P<depc>0x[0-9a-f]+)$')
|
||||
CTX_REGEX = re.compile("^ctx: (?P<ctx>.+)$")
|
||||
POINTER_REGEX = re.compile('^sp: (?P<sp>[0-9a-f]+) end: (?P<end>[0-9a-f]+) offset: (?P<offset>[0-9a-f]+)$')
|
||||
STACK_BEGIN = '>>>stack>>>'
|
||||
STACK_END = '<<<stack<<<'
|
||||
STACK_REGEX = re.compile(
|
||||
'^(?P<off>[0-9a-f]+):\W+(?P<c1>[0-9a-f]+) (?P<c2>[0-9a-f]+) (?P<c3>[0-9a-f]+) (?P<c4>[0-9a-f]+)(\W.*)?$')
|
||||
|
||||
StackLine = namedtuple("StackLine", ["offset", "content"])
|
||||
|
||||
|
||||
class ExceptionDataParser(object):
|
||||
def __init__(self):
|
||||
self.exception = None
|
||||
|
||||
self.epc1 = None
|
||||
self.epc2 = None
|
||||
self.epc3 = None
|
||||
self.excvaddr = None
|
||||
self.depc = None
|
||||
|
||||
self.ctx = None
|
||||
|
||||
self.sp = None
|
||||
self.end = None
|
||||
self.offset = None
|
||||
|
||||
self.stack = []
|
||||
|
||||
def _parse_backtrace(self, line):
|
||||
if line.startswith('Backtrace:'):
|
||||
self.stack = [StackLine(offset=0, content=(addr,)) for addr in BACKTRACE_REGEX.findall(line)]
|
||||
return None
|
||||
return self._parse_backtrace
|
||||
|
||||
def _parse_exception(self, line):
|
||||
match = EXCEPTION_REGEX.match(line)
|
||||
if match is not None:
|
||||
self.exception = int(match.group('exc'))
|
||||
return self._parse_counters
|
||||
return self._parse_exception
|
||||
|
||||
def _parse_counters(self, line):
|
||||
match = COUNTER_REGEX.match(line)
|
||||
if match is not None:
|
||||
self.epc1 = match.group("epc1")
|
||||
self.epc2 = match.group("epc2")
|
||||
self.epc3 = match.group("epc3")
|
||||
self.excvaddr = match.group("excvaddr")
|
||||
self.depc = match.group("depc")
|
||||
return self._parse_ctx
|
||||
return self._parse_counters
|
||||
|
||||
def _parse_ctx(self, line):
|
||||
match = CTX_REGEX.match(line)
|
||||
if match is not None:
|
||||
self.ctx = match.group("ctx")
|
||||
return self._parse_pointers
|
||||
return self._parse_ctx
|
||||
|
||||
def _parse_pointers(self, line):
|
||||
match = POINTER_REGEX.match(line)
|
||||
if match is not None:
|
||||
self.sp = match.group("sp")
|
||||
self.end = match.group("end")
|
||||
self.offset = match.group("offset")
|
||||
return self._parse_stack_begin
|
||||
return self._parse_pointers
|
||||
|
||||
def _parse_stack_begin(self, line):
|
||||
if line == STACK_BEGIN:
|
||||
return self._parse_stack_line
|
||||
return self._parse_stack_begin
|
||||
|
||||
def _parse_stack_line(self, line):
|
||||
if line != STACK_END:
|
||||
match = STACK_REGEX.match(line)
|
||||
if match is not None:
|
||||
self.stack.append(StackLine(offset=match.group("off"),
|
||||
content=(match.group("c1"), match.group("c2"), match.group("c3"),
|
||||
match.group("c4"))))
|
||||
return self._parse_stack_line
|
||||
return None
|
||||
|
||||
def parse_file(self, file, platform, stack_only=False):
|
||||
if platform == 'ESP32':
|
||||
func = self._parse_backtrace
|
||||
else:
|
||||
func = self._parse_exception
|
||||
if stack_only:
|
||||
func = self._parse_stack_begin
|
||||
|
||||
for line in file:
|
||||
func = func(line.strip())
|
||||
if func is None:
|
||||
break
|
||||
|
||||
if func is not None:
|
||||
print("ERROR: Parser not complete!")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
class AddressResolver(object):
|
||||
def __init__(self, tool_path, elf_path):
|
||||
self._tool = tool_path
|
||||
self._elf = elf_path
|
||||
self._address_map = {}
|
||||
|
||||
def _lookup(self, addresses):
|
||||
cmd = [self._tool, "-aipfC", "-e", self._elf] + [addr for addr in addresses if addr is not None]
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
output = subprocess.check_output(cmd)
|
||||
else:
|
||||
output = subprocess.check_output(cmd, encoding="utf-8")
|
||||
|
||||
line_regex = re.compile("^(?P<addr>[0-9a-fx]+): (?P<result>.+)$")
|
||||
|
||||
last = None
|
||||
for line in output.splitlines():
|
||||
line = line.strip()
|
||||
match = line_regex.match(line)
|
||||
|
||||
if match is None:
|
||||
if last is not None and line.startswith('(inlined by)'):
|
||||
line = line [12:].strip()
|
||||
self._address_map[last] += ("\n \-> inlined by: " + line)
|
||||
continue
|
||||
|
||||
if match.group("result") == '?? ??:0':
|
||||
continue
|
||||
|
||||
self._address_map[match.group("addr")] = match.group("result")
|
||||
last = match.group("addr")
|
||||
|
||||
def fill(self, parser):
|
||||
addresses = [parser.epc1, parser.epc2, parser.epc3, parser.excvaddr, parser.sp, parser.end, parser.offset]
|
||||
for line in parser.stack:
|
||||
addresses.extend(line.content)
|
||||
|
||||
self._lookup(addresses)
|
||||
|
||||
def _sanitize_addr(self, addr):
|
||||
if addr.startswith("0x"):
|
||||
addr = addr[2:]
|
||||
|
||||
fill = "0" * (8 - len(addr))
|
||||
return "0x" + fill + addr
|
||||
|
||||
def resolve_addr(self, addr):
|
||||
out = self._sanitize_addr(addr)
|
||||
|
||||
if out in self._address_map:
|
||||
out += ": " + self._address_map[out]
|
||||
|
||||
return out
|
||||
|
||||
def resolve_stack_addr(self, addr, full=True):
|
||||
addr = self._sanitize_addr(addr)
|
||||
if addr in self._address_map:
|
||||
return addr + ": " + self._address_map[addr]
|
||||
|
||||
if full:
|
||||
return "[DATA (0x" + addr + ")]"
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def print_addr(name, value, resolver):
|
||||
print("{}:{} {}".format(name, " " * (8 - len(name)), resolver.resolve_addr(value)))
|
||||
|
||||
|
||||
def print_stack_full(lines, resolver):
|
||||
print("stack:")
|
||||
for line in lines:
|
||||
print(line.offset + ":")
|
||||
for content in line.content:
|
||||
print(" " + resolver.resolve_stack_addr(content))
|
||||
|
||||
|
||||
def print_stack(lines, resolver):
|
||||
print("stack:")
|
||||
for line in lines:
|
||||
for content in line.content:
|
||||
out = resolver.resolve_stack_addr(content, full=False)
|
||||
if out is None:
|
||||
continue
|
||||
print(out)
|
||||
|
||||
|
||||
def print_result(parser, resolver, platform, full=True, stack_only=False):
|
||||
if platform == 'ESP8266' and not stack_only:
|
||||
print('Exception: {} ({})'.format(parser.exception, EXCEPTIONS[parser.exception]))
|
||||
|
||||
print("")
|
||||
print_addr("epc1", parser.epc1, resolver)
|
||||
print_addr("epc2", parser.epc2, resolver)
|
||||
print_addr("epc3", parser.epc3, resolver)
|
||||
print_addr("excvaddr", parser.excvaddr, resolver)
|
||||
print_addr("depc", parser.depc, resolver)
|
||||
|
||||
print("")
|
||||
print("ctx: " + parser.ctx)
|
||||
|
||||
print("")
|
||||
print_addr("sp", parser.sp, resolver)
|
||||
print_addr("end", parser.end, resolver)
|
||||
print_addr("offset", parser.offset, resolver)
|
||||
|
||||
print("")
|
||||
if full:
|
||||
print_stack_full(parser.stack, resolver)
|
||||
else:
|
||||
print_stack(parser.stack, resolver)
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description="decode ESP Stacktraces.")
|
||||
|
||||
parser.add_argument("-p", "--platform", help="The platform to decode from", choices=PLATFORMS.keys(),
|
||||
default="ESP32")
|
||||
parser.add_argument("-t", "--tool", help="Path to the xtensa toolchain",
|
||||
default="~/.platformio/packages/toolchain-xtensa32/")
|
||||
parser.add_argument("-e", "--elf", help="path to elf file",
|
||||
default=".pio/build/esp32/firmware.elf")
|
||||
parser.add_argument("-f", "--full", help="Print full stack dump", action="store_true")
|
||||
parser.add_argument("-s", "--stack_only", help="Decode only a stractrace", action="store_true")
|
||||
parser.add_argument("file", help="The file to read the exception data from ('-' for STDIN)", default="-")
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = parse_args()
|
||||
|
||||
if args.file == "-":
|
||||
file = sys.stdin
|
||||
else:
|
||||
if not os.path.exists(args.file):
|
||||
print("ERROR: file " + args.file + " not found")
|
||||
sys.exit(1)
|
||||
file = open(args.file, "r")
|
||||
|
||||
addr2line = os.path.join(os.path.abspath(os.path.expanduser(args.tool)),
|
||||
"bin/xtensa-" + PLATFORMS[args.platform] + "-elf-addr2line")
|
||||
if os.name == 'nt':
|
||||
addr2line += '.exe'
|
||||
if not os.path.exists(addr2line):
|
||||
print("ERROR: addr2line not found (" + addr2line + ")")
|
||||
|
||||
elf_file = os.path.abspath(os.path.expanduser(args.elf))
|
||||
if not os.path.exists(elf_file):
|
||||
print("ERROR: elf file not found (" + elf_file + ")")
|
||||
|
||||
parser = ExceptionDataParser()
|
||||
resolver = AddressResolver(addr2line, elf_file)
|
||||
|
||||
parser.parse_file(file, args.platform, args.stack_only)
|
||||
resolver.fill(parser)
|
||||
|
||||
print_result(parser, resolver, args.platform, args.full, args.stack_only)
|
||||
22
bin/install-bootloader.sh
Executable file
22
bin/install-bootloader.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
# You probably don't want to use this script, it programs a custom bootloader build onto a nrf52 board
|
||||
|
||||
set -e
|
||||
|
||||
BOOTDIR=/home/kevinh/development/meshtastic/Adafruit_nRF52_Bootloader
|
||||
|
||||
nrfjprog --eraseall -f nrf52
|
||||
|
||||
# this generates an intel hex file that can be programmed into a NRF52 to tell the adafruit bootloader that the current app image is valid
|
||||
# Bootloader settings are at BOOTLOADER_SETTINGS (rw) : ORIGIN = 0xFF000, LENGTH = 0x1000
|
||||
# first 4 bytes should be 0x01 to indicate valid app image
|
||||
# second 4 bytes should be 0x00 to indicate no CRC required for image
|
||||
echo "01 00 00 00 00 00 00 00" | xxd -r -p - >/tmp/bootconf.bin
|
||||
srec_cat /tmp/bootconf.bin -binary -offset 0xff000 -output /tmp/bootconf.hex -intel
|
||||
|
||||
echo Generating merged hex file
|
||||
mergehex -m $BOOTDIR/_build/build-ttgo_eink/ttgo_eink_bootloader-0.3.2-124-g69bd8eb-dirty_s140_6.1.1.hex .pio/build/eink/firmware.hex /tmp/bootconf.hex -o ttgo_eink_full.hex
|
||||
|
||||
echo Telling bootloader app region is valid and telling CPU to run
|
||||
nrfjprog --program ttgo_eink_full.hex -f nrf52 --reset
|
||||
|
||||
# nrfjprog --readuicr /tmp/uicr.hex; objdump -s /tmp/uicr.hex | less
|
||||
4
bin/nrf52-console.sh
Executable file
4
bin/nrf52-console.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
|
||||
|
||||
# JLinkRTTViewer
|
||||
JLinkRTTClient
|
||||
3
bin/nrf52832-gdbserver.sh
Executable file
3
bin/nrf52832-gdbserver.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
JLinkGDBServerCLExe -if SWD -select USB -port 2331 -device NRF52840_XXAA
|
||||
3
bin/nrf52840-gdbserver.sh
Executable file
3
bin/nrf52840-gdbserver.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
JLinkGDBServerCLExe -if SWD -select USB -port 2331 -device NRF52832_XXAA
|
||||
6
bin/program-release-heltec.sh
Executable file
6
bin/program-release-heltec.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
source bin/version.sh
|
||||
|
||||
esptool.py --baud 921600 write_flash 0x10000 release/latest/bins/firmware-heltec-US-$VERSION.bin
|
||||
6
bin/program-release-tbeam.sh
Executable file
6
bin/program-release-tbeam.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
source bin/version.sh
|
||||
|
||||
esptool.py --baud 921600 write_flash 0x10000 release/latest/bins/firmware-tbeam-US-$VERSION.bin
|
||||
6
bin/qspi-flash-test.sh
Executable file
6
bin/qspi-flash-test.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
# You probably don't need this - it is a basic test of the serial flash on the TTGO eink board
|
||||
|
||||
nrfjprog -qspiini nrf52/ttgo_eink_qpsi.ini --qspieraseall
|
||||
nrfjprog --qspiini nrf52/ttgo_eink_qpsi.ini --memwr 0x12000000 --val 0xdeadbeef --verify
|
||||
nrfjprog --qspiini nrf52/ttgo_eink_qpsi.ini --readqspi spi.hex
|
||||
objdump -s spi.hex | less
|
||||
1
bin/read-system-info.sh
Executable file
1
bin/read-system-info.sh
Executable file
@@ -0,0 +1 @@
|
||||
esptool.py --baud 921600 read_flash 0x1000 0xf000 system-info.img
|
||||
@@ -1 +1,6 @@
|
||||
/home/kevinh/packages/nanopb-0.4.1-linux-x86/generator-bin/protoc --nanopb_out=-v:src -I=../MeshUtil/app/src/main/proto mesh.proto
|
||||
#!/bin/bash
|
||||
|
||||
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.1"
|
||||
# the nanopb tool seems to require that the .options file be in the current directory!
|
||||
cd proto
|
||||
../../nanopb-0.4.1-linux-x86/generator-bin/protoc --nanopb_out=-v:../src/mesh -I=../proto mesh.proto
|
||||
|
||||
1
bin/run-1-monitor.sh
Executable file
1
bin/run-1-monitor.sh
Executable file
@@ -0,0 +1 @@
|
||||
pio run --upload-port /dev/ttyUSB1 -t upload -t monitor
|
||||
@@ -1 +0,0 @@
|
||||
pio device monitor -b 115200
|
||||
1
bin/start-terminal0.sh
Executable file
1
bin/start-terminal0.sh
Executable file
@@ -0,0 +1 @@
|
||||
pio device monitor -b 921600
|
||||
1
bin/start-terminal1.sh
Executable file
1
bin/start-terminal1.sh
Executable file
@@ -0,0 +1 @@
|
||||
pio device monitor -p /dev/ttyUSB1 -b 921600
|
||||
314
bin/uf2conv.py
Executable file
314
bin/uf2conv.py
Executable file
@@ -0,0 +1,314 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import struct
|
||||
import subprocess
|
||||
import re
|
||||
import os
|
||||
import os.path
|
||||
import argparse
|
||||
|
||||
|
||||
UF2_MAGIC_START0 = 0x0A324655 # "UF2\n"
|
||||
UF2_MAGIC_START1 = 0x9E5D5157 # Randomly selected
|
||||
UF2_MAGIC_END = 0x0AB16F30 # Ditto
|
||||
|
||||
families = {
|
||||
'SAMD21': 0x68ed2b88,
|
||||
'SAML21': 0x1851780a,
|
||||
'SAMD51': 0x55114460,
|
||||
'NRF52': 0x1b57745f,
|
||||
'STM32F0': 0x647824b6,
|
||||
'STM32F1': 0x5ee21072,
|
||||
'STM32F2': 0x5d1a0a2e,
|
||||
'STM32F3': 0x6b846188,
|
||||
'STM32F4': 0x57755a57,
|
||||
'STM32F7': 0x53b80f00,
|
||||
'STM32G0': 0x300f5633,
|
||||
'STM32G4': 0x4c71240a,
|
||||
'STM32H7': 0x6db66082,
|
||||
'STM32L0': 0x202e3a91,
|
||||
'STM32L1': 0x1e1f432d,
|
||||
'STM32L4': 0x00ff6919,
|
||||
'STM32L5': 0x04240bdf,
|
||||
'STM32WB': 0x70d16653,
|
||||
'STM32WL': 0x21460ff0,
|
||||
'ATMEGA32': 0x16573617,
|
||||
'MIMXRT10XX': 0x4FB2D5BD
|
||||
}
|
||||
|
||||
INFO_FILE = "/INFO_UF2.TXT"
|
||||
|
||||
appstartaddr = 0x2000
|
||||
familyid = 0x0
|
||||
|
||||
|
||||
def is_uf2(buf):
|
||||
w = struct.unpack("<II", buf[0:8])
|
||||
return w[0] == UF2_MAGIC_START0 and w[1] == UF2_MAGIC_START1
|
||||
|
||||
def is_hex(buf):
|
||||
try:
|
||||
w = buf[0:30].decode("utf-8")
|
||||
except UnicodeDecodeError:
|
||||
return False
|
||||
if w[0] == ':' and re.match(b"^[:0-9a-fA-F\r\n]+$", buf):
|
||||
return True
|
||||
return False
|
||||
|
||||
def convert_from_uf2(buf):
|
||||
global appstartaddr
|
||||
numblocks = len(buf) // 512
|
||||
curraddr = None
|
||||
outp = b""
|
||||
for blockno in range(numblocks):
|
||||
ptr = blockno * 512
|
||||
block = buf[ptr:ptr + 512]
|
||||
hd = struct.unpack(b"<IIIIIIII", block[0:32])
|
||||
if hd[0] != UF2_MAGIC_START0 or hd[1] != UF2_MAGIC_START1:
|
||||
print("Skipping block at " + ptr + "; bad magic")
|
||||
continue
|
||||
if hd[2] & 1:
|
||||
# NO-flash flag set; skip block
|
||||
continue
|
||||
datalen = hd[4]
|
||||
if datalen > 476:
|
||||
assert False, "Invalid UF2 data size at " + ptr
|
||||
newaddr = hd[3]
|
||||
if curraddr == None:
|
||||
appstartaddr = newaddr
|
||||
curraddr = newaddr
|
||||
padding = newaddr - curraddr
|
||||
if padding < 0:
|
||||
assert False, "Block out of order at " + ptr
|
||||
if padding > 10*1024*1024:
|
||||
assert False, "More than 10M of padding needed at " + ptr
|
||||
if padding % 4 != 0:
|
||||
assert False, "Non-word padding size at " + ptr
|
||||
while padding > 0:
|
||||
padding -= 4
|
||||
outp += b"\x00\x00\x00\x00"
|
||||
outp += block[32 : 32 + datalen]
|
||||
curraddr = newaddr + datalen
|
||||
return outp
|
||||
|
||||
def convert_to_carray(file_content):
|
||||
outp = "const unsigned char bindata[] __attribute__((aligned(16))) = {"
|
||||
for i in range(len(file_content)):
|
||||
if i % 16 == 0:
|
||||
outp += "\n"
|
||||
outp += "0x%02x, " % ord(file_content[i])
|
||||
outp += "\n};\n"
|
||||
return outp
|
||||
|
||||
def convert_to_uf2(file_content):
|
||||
global familyid
|
||||
datapadding = b""
|
||||
while len(datapadding) < 512 - 256 - 32 - 4:
|
||||
datapadding += b"\x00\x00\x00\x00"
|
||||
numblocks = (len(file_content) + 255) // 256
|
||||
outp = b""
|
||||
for blockno in range(numblocks):
|
||||
ptr = 256 * blockno
|
||||
chunk = file_content[ptr:ptr + 256]
|
||||
flags = 0x0
|
||||
if familyid:
|
||||
flags |= 0x2000
|
||||
hd = struct.pack(b"<IIIIIIII",
|
||||
UF2_MAGIC_START0, UF2_MAGIC_START1,
|
||||
flags, ptr + appstartaddr, 256, blockno, numblocks, familyid)
|
||||
while len(chunk) < 256:
|
||||
chunk += b"\x00"
|
||||
block = hd + chunk + datapadding + struct.pack(b"<I", UF2_MAGIC_END)
|
||||
assert len(block) == 512
|
||||
outp += block
|
||||
return outp
|
||||
|
||||
class Block:
|
||||
def __init__(self, addr):
|
||||
self.addr = addr
|
||||
self.bytes = bytearray(256)
|
||||
|
||||
def encode(self, blockno, numblocks):
|
||||
global familyid
|
||||
flags = 0x0
|
||||
if familyid:
|
||||
flags |= 0x2000
|
||||
hd = struct.pack("<IIIIIIII",
|
||||
UF2_MAGIC_START0, UF2_MAGIC_START1,
|
||||
flags, self.addr, 256, blockno, numblocks, familyid)
|
||||
hd += self.bytes[0:256]
|
||||
while len(hd) < 512 - 4:
|
||||
hd += b"\x00"
|
||||
hd += struct.pack("<I", UF2_MAGIC_END)
|
||||
return hd
|
||||
|
||||
def convert_from_hex_to_uf2(buf):
|
||||
global appstartaddr
|
||||
appstartaddr = None
|
||||
upper = 0
|
||||
currblock = None
|
||||
blocks = []
|
||||
for line in buf.split('\n'):
|
||||
if line[0] != ":":
|
||||
continue
|
||||
i = 1
|
||||
rec = []
|
||||
while i < len(line) - 1:
|
||||
rec.append(int(line[i:i+2], 16))
|
||||
i += 2
|
||||
tp = rec[3]
|
||||
if tp == 4:
|
||||
upper = ((rec[4] << 8) | rec[5]) << 16
|
||||
elif tp == 2:
|
||||
upper = ((rec[4] << 8) | rec[5]) << 4
|
||||
assert (upper & 0xffff) == 0
|
||||
elif tp == 1:
|
||||
break
|
||||
elif tp == 0:
|
||||
addr = upper | (rec[1] << 8) | rec[2]
|
||||
if appstartaddr == None:
|
||||
appstartaddr = addr
|
||||
i = 4
|
||||
while i < len(rec) - 1:
|
||||
if not currblock or currblock.addr & ~0xff != addr & ~0xff:
|
||||
currblock = Block(addr & ~0xff)
|
||||
blocks.append(currblock)
|
||||
currblock.bytes[addr & 0xff] = rec[i]
|
||||
addr += 1
|
||||
i += 1
|
||||
numblocks = len(blocks)
|
||||
resfile = b""
|
||||
for i in range(0, numblocks):
|
||||
resfile += blocks[i].encode(i, numblocks)
|
||||
return resfile
|
||||
|
||||
def to_str(b):
|
||||
return b.decode("utf-8")
|
||||
|
||||
def get_drives():
|
||||
drives = []
|
||||
if sys.platform == "win32":
|
||||
r = subprocess.check_output(["wmic", "PATH", "Win32_LogicalDisk",
|
||||
"get", "DeviceID,", "VolumeName,",
|
||||
"FileSystem,", "DriveType"])
|
||||
for line in to_str(r).split('\n'):
|
||||
words = re.split('\s+', line)
|
||||
if len(words) >= 3 and words[1] == "2" and words[2] == "FAT":
|
||||
drives.append(words[0])
|
||||
else:
|
||||
rootpath = "/media"
|
||||
if sys.platform == "darwin":
|
||||
rootpath = "/Volumes"
|
||||
elif sys.platform == "linux":
|
||||
tmp = rootpath + "/" + os.environ["USER"]
|
||||
if os.path.isdir(tmp):
|
||||
rootpath = tmp
|
||||
for d in os.listdir(rootpath):
|
||||
drives.append(os.path.join(rootpath, d))
|
||||
|
||||
|
||||
def has_info(d):
|
||||
try:
|
||||
return os.path.isfile(d + INFO_FILE)
|
||||
except:
|
||||
return False
|
||||
|
||||
return list(filter(has_info, drives))
|
||||
|
||||
|
||||
def board_id(path):
|
||||
with open(path + INFO_FILE, mode='r') as file:
|
||||
file_content = file.read()
|
||||
return re.search("Board-ID: ([^\r\n]*)", file_content).group(1)
|
||||
|
||||
|
||||
def list_drives():
|
||||
for d in get_drives():
|
||||
print(d, board_id(d))
|
||||
|
||||
|
||||
def write_file(name, buf):
|
||||
with open(name, "wb") as f:
|
||||
f.write(buf)
|
||||
print("Wrote %d bytes to %s" % (len(buf), name))
|
||||
|
||||
|
||||
def main():
|
||||
global appstartaddr, familyid
|
||||
def error(msg):
|
||||
print(msg)
|
||||
sys.exit(1)
|
||||
parser = argparse.ArgumentParser(description='Convert to UF2 or flash directly.')
|
||||
parser.add_argument('input', metavar='INPUT', type=str, nargs='?',
|
||||
help='input file (HEX, BIN or UF2)')
|
||||
parser.add_argument('-b' , '--base', dest='base', type=str,
|
||||
default="0x2000",
|
||||
help='set base address of application for BIN format (default: 0x2000)')
|
||||
parser.add_argument('-o' , '--output', metavar="FILE", dest='output', type=str,
|
||||
help='write output to named file; defaults to "flash.uf2" or "flash.bin" where sensible')
|
||||
parser.add_argument('-d' , '--device', dest="device_path",
|
||||
help='select a device path to flash')
|
||||
parser.add_argument('-l' , '--list', action='store_true',
|
||||
help='list connected devices')
|
||||
parser.add_argument('-c' , '--convert', action='store_true',
|
||||
help='do not flash, just convert')
|
||||
parser.add_argument('-D' , '--deploy', action='store_true',
|
||||
help='just flash, do not convert')
|
||||
parser.add_argument('-f' , '--family', dest='family', type=str,
|
||||
default="0x0",
|
||||
help='specify familyID - number or name (default: 0x0)')
|
||||
parser.add_argument('-C' , '--carray', action='store_true',
|
||||
help='convert binary file to a C array, not UF2')
|
||||
args = parser.parse_args()
|
||||
appstartaddr = int(args.base, 0)
|
||||
|
||||
if args.family.upper() in families:
|
||||
familyid = families[args.family.upper()]
|
||||
else:
|
||||
try:
|
||||
familyid = int(args.family, 0)
|
||||
except ValueError:
|
||||
error("Family ID needs to be a number or one of: " + ", ".join(families.keys()))
|
||||
|
||||
if args.list:
|
||||
list_drives()
|
||||
else:
|
||||
if not args.input:
|
||||
error("Need input file")
|
||||
with open(args.input, mode='rb') as f:
|
||||
inpbuf = f.read()
|
||||
from_uf2 = is_uf2(inpbuf)
|
||||
ext = "uf2"
|
||||
if args.deploy:
|
||||
outbuf = inpbuf
|
||||
elif from_uf2:
|
||||
outbuf = convert_from_uf2(inpbuf)
|
||||
ext = "bin"
|
||||
elif is_hex(inpbuf):
|
||||
outbuf = convert_from_hex_to_uf2(inpbuf.decode("utf-8"))
|
||||
elif args.carray:
|
||||
outbuf = convert_to_carray(inpbuf)
|
||||
ext = "h"
|
||||
else:
|
||||
outbuf = convert_to_uf2(inpbuf)
|
||||
print("Converting to %s, output size: %d, start address: 0x%x" %
|
||||
(ext, len(outbuf), appstartaddr))
|
||||
if args.convert or ext != "uf2":
|
||||
drives = []
|
||||
if args.output == None:
|
||||
args.output = "flash." + ext
|
||||
else:
|
||||
drives = get_drives()
|
||||
|
||||
if args.output:
|
||||
write_file(args.output, outbuf)
|
||||
else:
|
||||
if len(drives) == 0:
|
||||
error("No drive to deploy.")
|
||||
for d in drives:
|
||||
print("Flashing %s (%s)" % (d, board_id(d)))
|
||||
write_file(d + "/NEW.UF2", outbuf)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
4
bin/upload-to-bootloader.sh
Executable file
4
bin/upload-to-bootloader.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
|
||||
echo "Converting to uf2 for NRF52 Adafruit bootloader"
|
||||
bin/uf2conv.py .pio/build/lora-relay-v1/firmware.hex -f 0xADA52840
|
||||
# cp flash.uf2 /media/kevinh/FTH*BOOT/
|
||||
3
bin/version.sh
Normal file
3
bin/version.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
export VERSION=1.1.5
|
||||
61
boards/eink.json
Normal file
61
boards/eink.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"ldscript": "nrf52840_s140_v6.ld"
|
||||
},
|
||||
"core": "nRF5",
|
||||
"cpu": "cortex-m4",
|
||||
"extra_flags": "-DARDUINO_NRF52840_LORA_RELAY_V1 -DNRF52840_XXAA",
|
||||
"f_cpu": "64000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x239A",
|
||||
"0x4405"
|
||||
]
|
||||
],
|
||||
"usb_product": "TTGO_eink",
|
||||
"mcu": "nrf52840",
|
||||
"variant": "eink",
|
||||
"variants_dir": "variants",
|
||||
"bsp": {
|
||||
"name": "adafruit"
|
||||
},
|
||||
"softdevice": {
|
||||
"sd_flags": "-DS140",
|
||||
"sd_name": "s140",
|
||||
"sd_version": "6.1.1",
|
||||
"sd_fwid": "0x00B6"
|
||||
},
|
||||
"bootloader": {
|
||||
"settings_addr": "0xFF000"
|
||||
}
|
||||
},
|
||||
"connectivity": [
|
||||
"bluetooth"
|
||||
],
|
||||
"debug": {
|
||||
"jlink_device": "nRF52840_xxAA",
|
||||
"onboard_tools": [
|
||||
"jlink"
|
||||
],
|
||||
"svd_path": "nrf52840.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "TTGO eink (Adafruit BSP)",
|
||||
"upload": {
|
||||
"maximum_ram_size": 248832,
|
||||
"maximum_size": 815104,
|
||||
"require_upload_port": true,
|
||||
"speed": 115200,
|
||||
"protocol": "jlink",
|
||||
"protocols": [
|
||||
"jlink",
|
||||
"nrfjprog",
|
||||
"stlink"
|
||||
]
|
||||
},
|
||||
"url": "FIXME",
|
||||
"vendor": "TTGO"
|
||||
}
|
||||
46
boards/lora-relay-v1.json
Normal file
46
boards/lora-relay-v1.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"ldscript": "nrf52840_s140_v6.ld"
|
||||
},
|
||||
"core": "nRF5",
|
||||
"cpu": "cortex-m4",
|
||||
"extra_flags": "-DARDUINO_NRF52840_LORA_RELAY_V1 -DNRF52840_XXAA",
|
||||
"f_cpu": "64000000L",
|
||||
"hwids": [["0x239A", "0x4404"]],
|
||||
"usb_product": "LORA_RELAY",
|
||||
"mcu": "nrf52840",
|
||||
"variant": "lora_relay_v1",
|
||||
"variants_dir": "variants",
|
||||
"bsp": {
|
||||
"name": "adafruit"
|
||||
},
|
||||
"softdevice": {
|
||||
"sd_flags": "-DS140",
|
||||
"sd_name": "s140",
|
||||
"sd_version": "6.1.1",
|
||||
"sd_fwid": "0x00B6"
|
||||
},
|
||||
"bootloader": {
|
||||
"settings_addr": "0xFF000"
|
||||
}
|
||||
},
|
||||
"connectivity": ["bluetooth"],
|
||||
"debug": {
|
||||
"jlink_device": "nRF52840_xxAA",
|
||||
"onboard_tools": ["jlink"],
|
||||
"svd_path": "nrf52840.svd"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Meshtastic Lora Relay V1 (Adafruit BSP)",
|
||||
"upload": {
|
||||
"maximum_ram_size": 248832,
|
||||
"maximum_size": 815104,
|
||||
"require_upload_port": true,
|
||||
"speed": 115200,
|
||||
"protocol": "jlink",
|
||||
"protocols": ["jlink", "nrfjprog", "stlink"]
|
||||
},
|
||||
"url": "https://github.com/BigCorvus/SX1262-LoRa-BLE-Relay",
|
||||
"vendor": "BigCorvus"
|
||||
}
|
||||
47
boards/nrf52840_dk.json
Normal file
47
boards/nrf52840_dk.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"ldscript": "nrf52840_s140_v6.ld"
|
||||
},
|
||||
"core": "nRF5",
|
||||
"cpu": "cortex-m4",
|
||||
"extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA",
|
||||
"f_cpu": "64000000L",
|
||||
"hwids": [["0x239A", "0x4404"]],
|
||||
"usb_product": "nrf52840dk",
|
||||
"mcu": "nrf52840",
|
||||
"variant": "pca10056",
|
||||
"variants_dir": "variants",
|
||||
"bsp": {
|
||||
"name": "adafruit"
|
||||
},
|
||||
"softdevice": {
|
||||
"sd_flags": "-DS140",
|
||||
"sd_name": "s140",
|
||||
"sd_version": "6.1.1",
|
||||
"sd_fwid": "0x00B6"
|
||||
},
|
||||
"bootloader": {
|
||||
"settings_addr": "0xFF000"
|
||||
}
|
||||
},
|
||||
"connectivity": ["bluetooth"],
|
||||
"debug": {
|
||||
"jlink_device": "nRF52840_xxAA",
|
||||
"onboard_tools": ["jlink"],
|
||||
"svd_path": "nrf52840.svd"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "A modified NRF52840-DK devboard (Adafruit BSP)",
|
||||
"upload": {
|
||||
"maximum_ram_size": 248832,
|
||||
"maximum_size": 815104,
|
||||
"require_upload_port": true,
|
||||
"speed": 115200,
|
||||
"protocol": "jlink",
|
||||
"protocols": ["jlink", "nrfjprog", "stlink"]
|
||||
},
|
||||
"url": "https://meshtastic.org/",
|
||||
"vendor": "Nordic Semi"
|
||||
}
|
||||
|
||||
46
boards/nrf52840_dk_modified.json
Normal file
46
boards/nrf52840_dk_modified.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"ldscript": "nrf52840_s140_v6.ld"
|
||||
},
|
||||
"core": "nRF5",
|
||||
"cpu": "cortex-m4",
|
||||
"extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA",
|
||||
"f_cpu": "64000000L",
|
||||
"hwids": [["0x239A", "0x4404"]],
|
||||
"usb_product": "nrf52840dk",
|
||||
"mcu": "nrf52840",
|
||||
"variant": "pca10056-rc-clock",
|
||||
"variants_dir": "variants",
|
||||
"bsp": {
|
||||
"name": "adafruit"
|
||||
},
|
||||
"softdevice": {
|
||||
"sd_flags": "-DS140",
|
||||
"sd_name": "s140",
|
||||
"sd_version": "6.1.1",
|
||||
"sd_fwid": "0x00B6"
|
||||
},
|
||||
"bootloader": {
|
||||
"settings_addr": "0xFF000"
|
||||
}
|
||||
},
|
||||
"connectivity": ["bluetooth"],
|
||||
"debug": {
|
||||
"jlink_device": "nRF52840_xxAA",
|
||||
"onboard_tools": ["jlink"],
|
||||
"svd_path": "nrf52840.svd"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "A modified NRF52840-DK devboard (Adafruit BSP)",
|
||||
"upload": {
|
||||
"maximum_ram_size": 248832,
|
||||
"maximum_size": 815104,
|
||||
"require_upload_port": true,
|
||||
"speed": 115200,
|
||||
"protocol": "jlink",
|
||||
"protocols": ["jlink", "nrfjprog", "stlink"]
|
||||
},
|
||||
"url": "https://meshtastic.org/",
|
||||
"vendor": "Nordic Semi"
|
||||
}
|
||||
46
boards/ppr.json
Normal file
46
boards/ppr.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"ldscript": "nrf52840_s140_v6.ld"
|
||||
},
|
||||
"core": "nRF5",
|
||||
"cpu": "cortex-m4",
|
||||
"extra_flags": "-DARDUINO_NRF52840_PPR -DNRF52840_XXAA",
|
||||
"f_cpu": "64000000L",
|
||||
"hwids": [["0x239A", "0x4403"]],
|
||||
"usb_product": "PPR",
|
||||
"mcu": "nrf52840",
|
||||
"variant": "ppr",
|
||||
"variants_dir": "variants",
|
||||
"bsp": {
|
||||
"name": "adafruit"
|
||||
},
|
||||
"softdevice": {
|
||||
"sd_flags": "-DS140",
|
||||
"sd_name": "s140",
|
||||
"sd_version": "6.1.1",
|
||||
"sd_fwid": "0x00B6"
|
||||
},
|
||||
"bootloader": {
|
||||
"settings_addr": "0xFF000"
|
||||
}
|
||||
},
|
||||
"connectivity": ["bluetooth"],
|
||||
"debug": {
|
||||
"jlink_device": "nRF52840_xxAA",
|
||||
"onboard_tools": ["jlink"],
|
||||
"svd_path": "nrf52840.svd"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Meshtastic PPR (Adafruit BSP)",
|
||||
"upload": {
|
||||
"maximum_ram_size": 248832,
|
||||
"maximum_size": 815104,
|
||||
"require_upload_port": true,
|
||||
"speed": 115200,
|
||||
"protocol": "jlink",
|
||||
"protocols": ["jlink", "nrfjprog", "stlink"]
|
||||
},
|
||||
"url": "https://meshtastic.org/",
|
||||
"vendor": "Othernet"
|
||||
}
|
||||
55
boards/rak815.json
Normal file
55
boards/rak815.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "nrf52832_s132_v6.ld"
|
||||
},
|
||||
"core": "nRF5",
|
||||
"cpu": "cortex-m4",
|
||||
"extra_flags": "-DNRF52832_XXAA -DNRF52",
|
||||
"f_cpu": "64000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x10c4",
|
||||
"0xea60"
|
||||
]
|
||||
],
|
||||
"usb_product": "RAK815",
|
||||
"mcu": "nrf52832",
|
||||
"variant": "rak815",
|
||||
"bsp": {
|
||||
"name": "adafruit"
|
||||
},
|
||||
"softdevice": {
|
||||
"sd_flags": "-DS132",
|
||||
"sd_name": "s132",
|
||||
"sd_version": "6.1.1",
|
||||
"sd_fwid": "0x00B7"
|
||||
}
|
||||
},
|
||||
"connectivity": [
|
||||
"bluetooth"
|
||||
],
|
||||
"debug": {
|
||||
"jlink_device": "nRF52832_xxAA",
|
||||
"svd_path": "nrf52.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "RAK RAK815",
|
||||
"upload": {
|
||||
"maximum_ram_size": 65536,
|
||||
"maximum_size": 524288,
|
||||
"require_upload_port": true,
|
||||
"speed": 115200,
|
||||
"protocol": "nrfutil",
|
||||
"protocols": [
|
||||
"jlink",
|
||||
"nrfjprog",
|
||||
"nrfutil",
|
||||
"stlink"
|
||||
]
|
||||
},
|
||||
"url": "https://store.rakwireless.com/products/rak815-hybrid-location-tracker",
|
||||
"vendor": "RAK"
|
||||
}
|
||||
9
docs/.well-known/assetlinks.json
Normal file
9
docs/.well-known/assetlinks.json
Normal file
@@ -0,0 +1,9 @@
|
||||
[{
|
||||
"relation": ["delegate_permission/common.handle_all_urls"],
|
||||
"target": {
|
||||
"namespace": "android_app",
|
||||
"package_name": "com.geeksville.mesh",
|
||||
"sha256_cert_fingerprints":
|
||||
["D0:05:E7:8B:D2:1B:FA:94:56:1D:6B:90:EB:53:07:1A:74:4F:D9:C2:6F:13:87:6A:D9:17:4F:C2:59:48:02:9D", "42:17:52:DC:57:40:38:B5:6B:86:61:1C:2F:47:DB:2B:0F:A2:EA:59:E1:18:9C:AA:90:8D:37:D6:CD:40:0E:BB", "A9:3B:45:65:68:C1:75:DB:08:00:A0:9F:06:77:7F:89:2D:81:24:32:AD:B8:A3:DF:73:BC:3E:7F:06:C8:0C:6D"]
|
||||
}
|
||||
}]
|
||||
@@ -1,38 +1,92 @@
|
||||
# What is Meshtastic?
|
||||
|
||||
Meshtastic is a project that lets you use
|
||||
inexpensive GPS mesh radios as an extensible, super long battery life mesh GPS communicator. These radios are great for hiking, skiing, paragliding -
|
||||
essentially any hobby where you don't have reliable internet access. Each member of your private mesh can always see the location and distance of all other
|
||||
members and any text messages sent to your group chat.
|
||||
Meshtastic™ is a project that lets you use
|
||||
inexpensive (\$30 ish) GPS radios as an extensible, long battery life, secure, mesh GPS communicator. These radios are great for hiking, skiing, paragliding - essentially any hobby where you don't have reliable internet access. Each member of your private mesh can always see the location and distance of all other members and any text messages sent to your group chat.
|
||||
|
||||
The radios automatically create a mesh to forward packets as needed, so everyone in the group can receive messages from even the furthest member. The radios
|
||||
will optionally work with your phone, but no phone is required.
|
||||
The radios automatically create a mesh to forward packets as needed, so everyone in the group can receive messages from even the furthest member. The radios will optionally work with your phone, but no phone is required.
|
||||
|
||||
Typical time between recharging the radios should be about eight days.
|
||||
Note: Questions after reading this? See our new [forum](https://meshtastic.discourse.group/).
|
||||
|
||||
This project is currently pre-alpha, but if you have questions please join our chat [](https://gitter.im/Meshtastic/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge).
|
||||
### Uses
|
||||
|
||||
This software is 100% open source and developed by a group of hobbyist experimenters. No warranty is provided, if you'd like to improve it - we'd love your help. Please post in the chat.
|
||||
- Outdoor sports where cellular coverage is limited. (Hiking, Skiing, Boating, Paragliding, Gliders etc..)
|
||||
- Applications where closed source GPS communicators just won't cut it (it is easy to add features for glider pilots etc...)
|
||||
- Secure long-range communication within groups without depending on cellular providers
|
||||
- Finding your lost kids ;-)
|
||||
- Through our [python API](https://pypi.org/project/meshtastic/) use these inexpensive radios to easily add mesh networking to your own projects.
|
||||
|
||||
[](https://www.youtube.com/watch?v=WlNbMbVZlHI "Meshtastic early demo")
|
||||
|
||||
### Features
|
||||
|
||||
Not all of these features are fully implemented yet - see **important** disclaimers below. But they should be in by the time we decide to call this project beta (three months?)
|
||||
|
||||
- Very long battery life (should be about eight days with the beta software)
|
||||
- Built in GPS and [LoRa](https://en.wikipedia.org/wiki/LoRa) radio, but we manage the radio automatically for you
|
||||
- Long range - a few miles per node but each node will forward packets as needed
|
||||
- Secure - channels are encrypted by AES256 (But see important disclaimers below wrt this feature)
|
||||
- Shows direction and distance to all members of your channel
|
||||
- Directed or broadcast text messages for channel members
|
||||
- Open and extensible codebase supporting multiple hardware vendors - no lock in to one vendor
|
||||
- Communication API for bluetooth devices (such as our Android app) to use the mesh. An iOS application is in the works. And [Meshtastic-python](https://pypi.org/project/meshtastic/) provides access from desktop computers.
|
||||
- Very easy sharing of private secured channels. Just share a special link or QR code with friends and they can join your encrypted mesh
|
||||
|
||||
This project is currently in beta testing but it is fairly stable and feature complete - if you have questions please [join our discussion forum](https://meshtastic.discourse.group/).
|
||||
|
||||
This software is 100% open source and developed by a group of hobbyist experimenters. No warranty is provided, if you'd like to improve it - we'd love your help. Please post in the [forum](https://meshtastic.discourse.group/).
|
||||
|
||||
### Beginner's Guide
|
||||
|
||||
For an detailed walk-through aimed at beginners, we recommend [meshtastic.letstalkthis.com](https://meshtastic.letstalkthis.com/).
|
||||
|
||||
# Updates
|
||||
|
||||
Note: Updates are happening almost daily, only major updates are listed below. For more details see our forum.
|
||||
|
||||
- 09/14/2020 - 1.0.0 Now with over 1700 android users, over 2000 nodes and translated into 15 languages. This project will always be a "beta" experiment, but now quite usable. We are currently selecting 1.1 features in our discussion forum.
|
||||
- 06/24/2020 - 0.7.x Now with over 1000 android users, over 600 people using the radios and translated into 22 languages. Fairly stable and we are working through bugs to get to 1.0.
|
||||
- 06/04/2020 - 0.6.7 Beta releases of both the application and the device code are released. Features are fairly solid now with a sizable number of users.
|
||||
- 04/28/2020 - 0.6.0 [Python API](https://pypi.org/project/meshtastic/) released. Makes it easy to use meshtastic devices as "zero config / just works" mesh transport adapters for other projects.
|
||||
- 04/20/2020 - 0.4.3 Pretty solid now both for the android app and the device code. Many people have donated translations and code. Probably going to call it a beta soon.
|
||||
- 03/03/2020 - 0.0.9 of the Android app and device code is released. Still an alpha but fairly functional.
|
||||
- 02/25/2020 - 0.0.4 of the Android app is released. This is a very early alpha, see below to join the alpha-testers group.
|
||||
- 02/23/2020 - 0.0.4 release. Still very bleeding edge but much closer to the final power management, a charged T-BEAM should run for many days with this load. If you'd like to try it, we'd love your feedback. Click [here](https://github.com/meshtastic/Meshtastic-esp32/blob/master/README.md) for instructions.
|
||||
- 02/20/2020 - Our first alpha release (0.0.3) of the radio software is ready brave early people.
|
||||
|
||||
## Meshtastic Android app
|
||||
The source code for the Meshtastic Android app is [here](https://github.com/geeksville/Meshtastic-Android).
|
||||
Soon our first alpha release of will be released here:
|
||||
|
||||
[](https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source%3Dhomepage%26anid%3Dadmob)
|
||||
Our Android application is available here:
|
||||
|
||||
[](https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source%3Dgithub-homepage)
|
||||
|
||||
The link above will return older more stable releases. We would prefer if you join our alpha-test group, because the application is rapidly improving. Three steps to opt-in to the alpha- test:
|
||||
|
||||
If you would like to join our bleeding-edge alpha test group for this app, we'd love to have you. Three steps:
|
||||
1. Join [this Google group](https://groups.google.com/forum/#!forum/meshtastic-alpha-testers) with the account you use in Google Play.
|
||||
2. Go to this [URL](https://play.google.com/apps/testing/com.geeksville.mesh) to opt-in to the alpha test.
|
||||
3. If you encounter any problems or have questions, post in our gitter chat and we'll help.
|
||||
3. If you encounter any problems or have questions, post in our [forum](https://meshtastic.discourse.group/) and we'll help.
|
||||
|
||||
If you'd like to help with development, the source code is [on github](https://github.com/meshtastic/Meshtastic-Android).
|
||||
|
||||
The app is also distributed for Amazon Fire devices via the Amazon appstore: [](https://www.amazon.com/Geeksville-Industries-Meshtastic/dp/B08CY9394Q)
|
||||
|
||||
## Supported hardware
|
||||
We currently support two brands of radios. The [TTGO T-Beam](https://www.aliexpress.com/item/4000119152086.html) and the [Heltec LoRa 32](https://heltec.org/project/wifi-lora-32/). Most users should buy the T-Beam and a 18650 battery (total cost less than $35). Make
|
||||
sure to buy the frequency range which is legal for your country. For the USA, you should buy the 915MHz version. Getting a version that include a screen
|
||||
is optional, but highly recommended.
|
||||
|
||||
We don't yet distribute prebuilt binaries. But soon (by Feb 22) we will have a file that you can easily install on your radio via USB. Once our software is installed, all future software updates happen over bluetooth from your phone.
|
||||
We currently support two brands of radios. The [TTGO T-Beam](https://www.aliexpress.com/item/4001178678568.html) and the [Heltec LoRa 32](https://heltec.org/project/wifi-lora-32/). Most people should buy the T-Beam and a 18650 battery (total cost less than \$35). Also, the version of the T-Beam we link to is shipped with Meshtastic **preinstalled** by TTGO, so you don't have to install it yourself.
|
||||
|
||||
For a nice TTGO 3D printable case see this [design](https://www.thingiverse.com/thing:3773717) by [bsiege](https://www.thingiverse.com/bsiege).
|
||||
For a nice Heltec 3D printable case see this [design](https://www.thingiverse.com/thing:3125854) by [ornotermes](https://www.thingiverse.com/ornotermes).
|
||||
Make sure to buy the frequency range which is legal for your country. For the USA, you should buy the 915MHz version. Getting a version that include a screen is optional, but highly recommended.
|
||||
|
||||
Instructions for installing prebuilt firmware can be found [here](https://github.com/meshtastic/Meshtastic-esp32/blob/master/README.md).
|
||||
|
||||
For a nice looking cases:
|
||||
|
||||
- 3D printable cases
|
||||
1. TTGO T-Beam V0 see this [design](https://www.thingiverse.com/thing:3773717) by [bsiege](https://www.thingiverse.com/bsiege).
|
||||
2. TTGO T_Beam V1 (SMA) see this [design](https://www.thingiverse.com/thing:3830711) by [rwanrooy](https://www.thingiverse.com/rwanrooy) or this [remix](https://www.thingiverse.com/thing:3949330) by [8ung](https://www.thingiverse.com/8ung)
|
||||
3. TTGO T_Beam V1 (IPEX) see this [design](https://www.thingiverse.com/thing:4587297) by [drewsed](https://www.thingiverse.com/drewsed)
|
||||
4. Heltec Lora32 see this [design](https://www.thingiverse.com/thing:3125854) by [ornotermes](https://www.thingiverse.com/ornotermes).
|
||||
- Laser-cut cases
|
||||
1. TTGO T_Beam V1 (SMA) see this [design](https://www.thingiverse.com/thing:4552771) by [jefish](https://www.thingiverse.com/jefish)
|
||||
|
||||
# IMPORTANT DISCLAIMERS AND FAQ
|
||||
|
||||
For a listing of currently missing features and a FAQ click [here](faq.md).
|
||||
|
||||
8
docs/SupportedHardware.md
Normal file
8
docs/SupportedHardware.md
Normal file
@@ -0,0 +1,8 @@
|
||||
| Vendor | Product line | Version | Board labels | Notes | URL |
|
||||
|---|---|---|---|---|---|
|
||||
| TTGO | T-Beam | 0.7 | T22_V07 20180711 | LoRa 433/470MHz *OR* LoRa 868/915MHz , <br/>GPS ublox NEO-6M , <br/>battery holder for Li-Ion 18650 | [buy](https://www.aliexpress.com/item/4000574335430.html) |
|
||||
| TTGO | T-Beam | 1.0 | | | [buy](https://www.aliexpress.com/item/4001178678568.html) |
|
||||
| TTGO | T-Beam | 1.1 | T22_V11 20191212 | LoRa 433/470MHz *OR* LoRa 868/915MHz *OR* LoRa 923MHz , <br/>GPS ublox NEO-M8N , <br/>battery holder for Li-Ion 18650 | [buy](https://www.aliexpress.com/item/4001178678568.html) |
|
||||
| TTGO | Lora32 | 2.0 | *missing* | LoRa 433/470MHz *OR* LoRa 868/915MHz , <br/>OLED SSD1306 , <br/>SD card holder | [buy](https://www.aliexpress.com/item/4000211331316.html) |
|
||||
| TTGO | Lora32 | 2.1 | T3_V1.6 20180606 | LoRa 32 (V2) , <br/>SD card holder | [buy](https://www.aliexpress.com/item/4000119208093.html) |
|
||||
| Heltec | Lora 32 | V2 | V2 | LoRa 433/470MHz *OR* LoRa 868/915MHz | [buy](https://heltec.org/project/wifi-lora-32/) |
|
||||
@@ -1,5 +1,8 @@
|
||||
theme: jekyll-theme-cayman
|
||||
|
||||
title: Meshtastic
|
||||
description: An opensource hiking, pilot, skiing, Signal-App-extending GPS mesh communicator
|
||||
description: An opensource hiking, pilot, skiing, secure GPS mesh communicator
|
||||
google_analytics: G-DRZ5H5EXHV
|
||||
|
||||
include: [".well-known"]
|
||||
|
||||
|
||||
34
docs/faq.md
Normal file
34
docs/faq.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Disclaimers
|
||||
|
||||
This project is still pretty young but moving at a pretty good pace. Not all features are fully implemented in the current alpha builds.
|
||||
Most of these problems should be solved by the beta release (within three months):
|
||||
|
||||
- We don't make these devices and they haven't been tested by UL or the FCC. If you use them you are experimenting and we can't promise they won't burn your house down ;-)
|
||||
- The encryption implementation is good but see this list of [caveats](software/crypto.md#summary-of-strengthsweaknesses-of-our-current-implementation) to determine risks you might face.
|
||||
- A number of (straightforward) software work items have to be completed before battery life matches our measurements, currently battery life is about three days. Join us on chat if you want the spreadsheet of power measurements/calculations.
|
||||
- The Android API needs to be documented better
|
||||
- No one has written an iOS app yet. But some good souls [are talking about it](https://github.com/meshtastic/Meshtastic-esp32/issues/14) ;-)
|
||||
|
||||
For more details see the [device software TODO](https://github.com/meshtastic/Meshtastic-esp32/blob/master/docs/software/TODO.md) or the [Android app TODO](https://github.com/meshtastic/Meshtastic-Android/blob/master/TODO.md).
|
||||
|
||||
# FAQ
|
||||
|
||||
If you have a question missing from this faq, please [ask in our discussion forum](https://meshtastic.discourse.group/). And if you are feeling extra generous send in a pull-request for this faq.md with whatever we answered ;-).
|
||||
|
||||
## Q: Which of the various supported radios should I buy?
|
||||
|
||||
Basically you just need the radio + (optional but recommended) battery. The TBEAM is usually better because it has gps and huge battery socket. The Heltec is basically the same hardware but without the GPS (the phone provides position data to the radio in that case, so the behavior is similar - but it does burn some battery in the phone). Also the battery for the Heltec can be smaller.
|
||||
|
||||
In addition to Aliexpress, (banggood.com) usually has stock and faster shipping, or Amazon. If buying a TBEAM, make sure to buy a version that includes the OLED screen - this project doesn't absolutely require the screen, but we use it if is installed.
|
||||
|
||||
@claesg has added links to various 3D printable cases, you can see them at (www.meshtastic.org).
|
||||
|
||||
## Q: Do you have plans to commercialize this project
|
||||
|
||||
Nope. though if some other person/group wanted to use this software and a more customized device we think that would be awesome (as long as they obey the GPL license).
|
||||
|
||||
## Q: Does this project use patented algorithms?
|
||||
|
||||
(Kindly borrowed from the geeks at [ffmpeg](http://ffmpeg.org/legal.html))
|
||||
|
||||
We do not know, we are not lawyers so we are not qualified to answer this. Also we have never read patents to implement any part of this, so even if we were qualified we could not answer it as we do not know what is patented. Furthermore the sheer number of software patents makes it impossible to read them all so no one (lawyer or not) could answer such a question with a definite no. We are merely geeks experimenting on a fun and free project.
|
||||
BIN
docs/hardware/AN1200_22_Semtech_LoRa_Basics_v2_STD.pdf
Normal file
BIN
docs/hardware/AN1200_22_Semtech_LoRa_Basics_v2_STD.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/AXP192 Datasheet_v1.1_en_draft_2211.pdf
Normal file
BIN
docs/hardware/AXP192 Datasheet_v1.1_en_draft_2211.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/DS_SX1261-2_V1.2.pdf
Normal file
BIN
docs/hardware/DS_SX1261-2_V1.2.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/DS_SX1276-7-8-9_W_APP_V6.pdf
Normal file
BIN
docs/hardware/DS_SX1276-7-8-9_W_APP_V6.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/NEO-6_DataSheet_(GPS.G6-HW-09005).pdf
Normal file
BIN
docs/hardware/NEO-6_DataSheet_(GPS.G6-HW-09005).pdf
Normal file
Binary file not shown.
BIN
docs/hardware/RFM95_96_97_98W.pdf
Normal file
BIN
docs/hardware/RFM95_96_97_98W.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/T-SX1262.pdf
Normal file
BIN
docs/hardware/T-SX1262.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/T_BeamV1.0.pdf
Normal file
BIN
docs/hardware/T_BeamV1.0.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/WIFI_LoRa_32_V2(868-915).PDF
Normal file
BIN
docs/hardware/WIFI_LoRa_32_V2(868-915).PDF
Normal file
Binary file not shown.
BIN
docs/hardware/air530/Air530 GPS Manual Text English.pdf
Normal file
BIN
docs/hardware/air530/Air530 GPS Manual Text English.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/air530/Air530_GPS_User_Booklet.V1.7.pdf
Normal file
BIN
docs/hardware/air530/Air530_GPS_User_Booklet.V1.7.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/axp192-complete-datasheet-chinese.pdf
Normal file
BIN
docs/hardware/axp192-complete-datasheet-chinese.pdf
Normal file
Binary file not shown.
35
docs/hardware/corvus.md
Normal file
35
docs/hardware/corvus.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Notes on @BigCorvus boards
|
||||
|
||||
## Board version 1.1
|
||||
|
||||
variant name lora_relay_v1
|
||||
|
||||
### Remaining TODOs
|
||||
|
||||
- power hold for the ST7735
|
||||
- look at example sketch
|
||||
- turn on xmit boost
|
||||
|
||||
## Recommendations for future boards
|
||||
|
||||
@BigCorvus your board is **really** nice. Here's some ideas for the future:
|
||||
|
||||
- make the SWDIO header more standard (the small ARM 2x5 micro footprint?) or at least througholes so it is easy to solder a header
|
||||
|
||||
## How to program bootloader
|
||||
|
||||
Download from here: https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases
|
||||
|
||||
```
|
||||
nrfjprog -f nrf52 --eraseall
|
||||
Erasing user available code and UICR flash areas.
|
||||
Applying system reset.
|
||||
|
||||
nrfjprog -f nrf52 --program feather_nrf52840_express_bootloader-0.3.2_s140_6.1.1.hex
|
||||
Parsing hex file.
|
||||
Reading flash area to program to guarantee it is erased.
|
||||
Checking that the area to write is not protected.
|
||||
Programming device.
|
||||
```
|
||||
|
||||
Then reboot the board, if all went well it now shows up as a mountable filesystem on your USB bus.
|
||||
6
docs/hardware/cubecell-TODO.md
Normal file
6
docs/hardware/cubecell-TODO.md
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
https://heltec-automation-docs.readthedocs.io/en/latest/cubecell/index.html
|
||||
|
||||
https://github.com/HelTecAutomation/ASR650x-Arduino?utm_source=platformio.org&utm_medium=docs
|
||||
|
||||
* Either portfreertos or make not theaded versions of Lock, WorkerThread, Queue (probably the latter).
|
||||
BIN
docs/hardware/esp32_datasheet_en.pdf
Normal file
BIN
docs/hardware/esp32_datasheet_en.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/heltec-wifi-lora-32-v2-915.pdf
Normal file
BIN
docs/hardware/heltec-wifi-lora-32-v2-915.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/lora-fcc-requirements.pdf
Normal file
BIN
docs/hardware/lora-fcc-requirements.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/nrf52/nrf52-programming.png
Normal file
BIN
docs/hardware/nrf52/nrf52-programming.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 142 KiB |
BIN
docs/hardware/pe4259ds-rf-switch.pdf
Normal file
BIN
docs/hardware/pe4259ds-rf-switch.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/rak815/PE4259.pdf
Normal file
BIN
docs/hardware/rak815/PE4259.pdf
Normal file
Binary file not shown.
BIN
docs/hardware/rak815/RAK813 Module Datasheet V1.0.pdf
Normal file
BIN
docs/hardware/rak815/RAK813 Module Datasheet V1.0.pdf
Normal file
Binary file not shown.
3692
docs/hardware/rak815/RAK813_BLE_LoRa_Schematic_20180322.pdf
Normal file
3692
docs/hardware/rak815/RAK813_BLE_LoRa_Schematic_20180322.pdf
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
8249
docs/hardware/rak815/ublox max7 datasheet.pdf
Normal file
8249
docs/hardware/rak815/ublox max7 datasheet.pdf
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
38977
docs/hardware/u-blox8-M8_ReceiverDescrProtSpec_(UBX-13003221).pdf
Normal file
38977
docs/hardware/u-blox8-M8_ReceiverDescrProtSpec_(UBX-13003221).pdf
Normal file
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@ We don't collect any personal identifying information.
|
||||
If you have opted-in to analytics (thank you - that helps us know what things we need to improve), we'll receive anonymized information about user behavior. i.e. which screens you used in the app etc... We never
|
||||
capture usernames, the contents of your texts or your location.
|
||||
|
||||
This is an open-source project run by hobbyists and we try to be completely transparent. If you have questions on this policy, please file [a github issue](https://github.com/geeksville/meshtastic-esp32/issues) and we'll reply/clarify/correct.
|
||||
This is an open-source project run by hobbyists and we try to be completely transparent. If you have questions on this policy, please file [a github issue](https://github.com/meshtastic/meshtastic-esp32/issues) and we'll reply/clarify/correct.
|
||||
|
||||
Keep being awesome!
|
||||
|
||||
|
||||
@@ -10,6 +10,13 @@ See [this site](https://www.rfwireless-world.com/Tutorials/LoRa-channels-list.ht
|
||||
|
||||
The maximum power allowed is +14dBM.
|
||||
|
||||
### 433 MHz
|
||||
|
||||
There are eight channels defined with a 0.2 MHz gap between them.
|
||||
Channel zero starts at 433.175 MHz
|
||||
|
||||
### 870 MHz
|
||||
|
||||
There are eight channels defined with a 0.3 MHz gap between them.
|
||||
Channel zero starts at 865.20 MHz
|
||||
|
||||
|
||||
92
docs/software/TODO.md
Normal file
92
docs/software/TODO.md
Normal file
@@ -0,0 +1,92 @@
|
||||
# Geeksville's current work queue
|
||||
|
||||
You probably don't care about this section - skip to the next one.
|
||||
|
||||
Threading tasks:
|
||||
|
||||
- Use https://github.com/ivanseidel/ArduinoThread? rather than full coroutines
|
||||
- clean up main loop()
|
||||
- check that we are mostly asleep, show which thread is causing us to wake
|
||||
-
|
||||
- use tickless idle on nrf52, and sleep X msec or until an interrupt occurs or the cooperative scheduling changes. https://devzone.nordicsemi.com/f/nordic-q-a/12363/nrf52-freertos-power-consumption-tickless-idle
|
||||
- BAD IDEA: use vTaskDelay and https://www.freertos.org/xTaskAbortDelay.html if scheduling changes. (define INCLUDE_xTaskAbortDelay on ESP32 and NRF52 - seems impossible to find?)
|
||||
- GOOD IDEA: use xSemaphoreTake to take a semaphore using a timeout. Expect semaphore to not be set, but set it to indicate scheduling has changed.
|
||||
|
||||
Nimble tasks:
|
||||
|
||||
- readerror.txt stress test bug
|
||||
- started RPA long test, jul 22 6pm
|
||||
- implement nimble software update api
|
||||
- update to latest bins, test OTA again (measure times) and then checkin bins
|
||||
- do alpha release
|
||||
|
||||
* update protocol description per cyclomies email thread
|
||||
* update faq with antennas https://meshtastic.discourse.group/t/range-test-ideas-requested/738/2
|
||||
* update faq on recommended android version and phones
|
||||
* add help link inside the app, reference a page on the wiki
|
||||
* turn on amazon reviews support
|
||||
* add a tablet layout (with map next to messages) in the android app
|
||||
|
||||
# Medium priority
|
||||
|
||||
Items to complete before 1.0.
|
||||
|
||||
# Post 1.0 ideas
|
||||
|
||||
- finish DSR for unicast
|
||||
- check fcc rules on duty cycle. we might not need to freq hop. https://www.sunfiretesting.com/LoRa-FCC-Certification-Guide/ . Might need to add enforcement for europe though.
|
||||
- make a no bluetooth configured yet screen - include this screen in the loop if the user hasn't yet paired
|
||||
- if radio params change fundamentally, discard the nodedb
|
||||
- re-enable the bluetooth battery level service on the T-BEAM
|
||||
- provide generalized (but slow) internet message forwarding service if one of our nodes has internet connectivity (MQTT) [ Not a requirement but a personal interest ]
|
||||
|
||||
# Low priority ideas
|
||||
|
||||
Items after the first final candidate release.
|
||||
|
||||
- implement nimble battery level service
|
||||
- Nimble implement device info service remaining fields (hw version etc)
|
||||
- Turn on RPA addresses for the device side in Nimble
|
||||
- Try to teardown less of the Nimble protocol stack across sleep
|
||||
- dynamic frequency scaling could save a lot of power on ESP32, but it seems to corrupt uart (even with ref_tick set correctly)
|
||||
- Change back to using a fixed sized MemoryPool rather than MemoryDynamic (see bug #149)
|
||||
- scan to find channels with low background noise? (Use CAD mode of the RF95 to automatically find low noise channels)
|
||||
- If the phone doesn't read fromradio mailbox within X seconds, assume the phone is gone and we can stop queing location msgs
|
||||
for it (because it will redownload the nodedb when it comes back)
|
||||
- add frequency hopping, dependent on the gps time, make the switch moment far from the time anyone is going to be transmitting
|
||||
- assign every "channel" a random shared 8 bit sync word (per 4.2.13.6 of datasheet) - use that word to filter packets before even checking CRC. This will ensure our CPU will only wake for packets on our "channel"
|
||||
- the BLE stack is leaking about 200 bytes each time we go to light sleep
|
||||
- use fuse bits to store the board type and region. So one load can be used on all boards
|
||||
- Don't store position packets in the to phone fifo if we are disconnected. The phone will get that info for 'free' when it
|
||||
fetches the fresh nodedb.
|
||||
- Use the RFM95 sequencer to stay in idle mode most of the time, then automatically go to receive mode and automatically go from transmit to receive mode. See 4.2.8.2 of manual.
|
||||
- Use fixed32 for node IDs, packetIDs, successid, failid, and lat/lon - will require all nodes to be updated, but make messages slightly smaller.
|
||||
- add "store and forward" support for messages, or move to the DB sync model. This would allow messages to be eventually delivered even if nodes are out of contact at the moment.
|
||||
- use variable length Strings in protobufs (instead of current fixed buffers). This would save lots of RAM
|
||||
- use BLEDevice::setPower to lower our BLE transmit power - extra range doesn't help us, it costs amps and it increases snoopability
|
||||
- make a HAM build: just a new frequency list, a bool to say 'never do encryption' and use hte callsign as that node's unique id. -from Girts
|
||||
- don't forward redundant pings or ping responses to the phone, it just wastes phone battery
|
||||
- don't send location packets if we haven't moved significantly
|
||||
- scrub default radio config settings for bandwidth/range/speed
|
||||
- show radio and gps signal strength as an image
|
||||
- only BLE advertise for a short time after the screen is on and button pressed - to save power and prevent people for sniffing for our BT app.
|
||||
- make mesh aware network timing state machine (sync wake windows to gps time) - this can save LOTS of battery
|
||||
- split out the software update utility so other projects can use it. Have the appload specify the URL for downloads.
|
||||
- read the PMU battery fault indicators and blink/led/warn user on screen
|
||||
- discard very old nodedb records (> 1wk)
|
||||
- handle millis() rollover in GPS.getTime - otherwise we will break after 50 days
|
||||
- report esp32 device code bugs back to the mothership via android
|
||||
- change BLE bonding to something more secure. see comment by pSecurity->setAuthenticationMode(ESP_LE_AUTH_BOND)
|
||||
|
||||
Changes related to wifi support on ESP32:
|
||||
|
||||
- iram space: https://esp32.com/viewtopic.php?t=8460
|
||||
- set https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/external-ram.html spi ram bss
|
||||
- figure out if iram or bluetooth classic caused ble problems
|
||||
- post bug on esp32-arduino with BLE bug findings
|
||||
|
||||
# Spinoff project ideas
|
||||
|
||||
- an open source version of https://www.burnair.ch/skynet/
|
||||
- a paragliding app like http://airwhere.co.uk/
|
||||
- How do avalanche beacons work? Could this do that as well? possibly by using beacon mode feature of the RF95?
|
||||
14
docs/software/ant.md
Normal file
14
docs/software/ant.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# ANT protocol notes
|
||||
|
||||
SD340 terms are reasonable for NRF52
|
||||
https://www.thisisant.com/developer/components/nrf52832#tab_protocol_stacks_tab
|
||||
|
||||
Profiles to implement:
|
||||
|
||||
tracker
|
||||
https://www.thisisant.com/developer/ant-plus/device-profiles/#4365_tab
|
||||
|
||||
ebike
|
||||
https://www.thisisant.com/developer/ant-plus/device-profiles/#527_tab
|
||||
|
||||
no profile for messaging?
|
||||
43
docs/software/build-instructions.md
Normal file
43
docs/software/build-instructions.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Build instructions
|
||||
|
||||
This project uses the simple PlatformIO build system. PlatformIO is an extension to Microsoft VSCode.
|
||||
|
||||
## GUI
|
||||
1. Purchase a suitable [radio](https://github.com/meshtastic/Meshtastic-device/wiki/Hardware-Information).
|
||||
2. Install [Python](https://www.python.org/downloads/).
|
||||
3. Install [Git](https://git-scm.com/downloads).
|
||||
4. Reboot your computer.
|
||||
5. Install [PlatformIO](https://platformio.org/platformio-ide).
|
||||
6. Click the PlatformIO icon on the side bar. 
|
||||
7. Under `Quick Access, Miscellaneous, Clone Git Project` enter the URL of the Meshtastic repo found [here](https://github.com/meshtastic/Meshtastic-device). 
|
||||
8. Select a file location to save the repo.
|
||||
9. Once loaded, open the `platformio.ini` file.
|
||||
10. At the line `default_envs` you can change it to the board type you are building for ie. `tlora-v2, tlora-v1, tlora-v2-1-1.6, tbeam, heltec, tbeam0.7` (boards are listed further down in the file).
|
||||
11. The hardware can be configured for different countries by adding a definition to the `configuration.h` file. `#define HW_VERSION_US` or `HW_VERSION_EU433, HW_VERSION_EU865, HW_VERSION_CN, HW_VERSION_JP`. Other country settings can be found in `MeshRadio.h`. The default is `HW_VERSION_US`.
|
||||
12. Click the PlatformIO icon on the side bar. Under `Project Tasks` you can now build or upload.
|
||||
|
||||
Note - To get a clean build you may have to delete the auto-generated file `./.vscode/c_cpp_properties.json`, close and re-open Visual Studio and WAIT until the file is auto-generated before compiling again.
|
||||
|
||||
## Command Line
|
||||
1. Purchase a suitable [radio](https://github.com/meshtastic/Meshtastic-device/wiki/Hardware-Information).
|
||||
2. Install [PlatformIO](https://platformio.org/platformio-ide)
|
||||
3. Download this git repo and cd into it:
|
||||
|
||||
```
|
||||
git clone https://github.com/meshtastic/Meshtastic-device.git
|
||||
cd Meshtastic-device
|
||||
```
|
||||
4. Run `git submodule update --init --recursive` to pull in dependencies this project needs.
|
||||
5. If you are outside the USA, run "export COUNTRY=EU865" (or whatever) to set the correct frequency range for your country. Options are provided for `EU433`, `EU865`, `CN`, `JP` and `US` (default). Pull-requests eagerly accepted for other countries.
|
||||
6. Plug the radio into your USB port
|
||||
7. Type `pio run --environment XXX -t upload` (This command will fetch dependencies, build the project and install it on the board via USB). For XXX, use the board type you have (either `tlora-v2, tlora-v1, tlora-v2-1-1.6, tbeam, heltec, tbeam0.7`).
|
||||
8. Platform IO also installs a very nice VisualStudio Code based IDE, see their [tutorial](https://docs.platformio.org/en/latest/tutorials/espressif32/arduino_debugging_unit_testing.html) if you'd like to use it.
|
||||
|
||||
## Decoding stack traces
|
||||
|
||||
If you get a crash, you can decode the addresses from the `Backtrace:` line:
|
||||
|
||||
1. Save the `Backtrace: 0x....` line to a file, e.g., `backtrace.txt`.
|
||||
2. Run `bin/exception_decoder.py backtrace.txt` (this uses symbols from the
|
||||
last `firmware.elf`, so you must be running the same binary that's still in
|
||||
your `.pio/build` directory).
|
||||
51
docs/software/crypto.md
Normal file
51
docs/software/crypto.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Encryption in Meshtastic
|
||||
|
||||
Cryptography is tricky, so we've tried to 'simply' apply standard crypto solutions to our implementation. However,
|
||||
the project developers are not cryptography experts. Therefore we ask two things:
|
||||
|
||||
- If you are a cryptography expert, please review these notes and our questions below. Can you help us by reviewing our
|
||||
notes below and offering advice? We will happily give as much or as little credit as you wish ;-).
|
||||
- Consider our existing solution 'alpha' and probably fairly secure against a not particularly aggressive adversary
|
||||
(but we can't yet make a more confident statement).
|
||||
|
||||
## Summary of strengths/weaknesses of our current implementation
|
||||
|
||||
Based on comments from reviewers (see below), here's some tips for usage of these radios. So you can know the level of protection offered:
|
||||
|
||||
* It is pretty likely that the AES256 security is implemented 'correctly' and an observer will not be able to decode your messages.
|
||||
* Warning: If an attacker is able to get one of the radios in their position, they could either a) extract the channel key from that device or b) use that radio to listen to new communications.
|
||||
* Warning: If an attacker is able to get the "Channel QR code/URL" that you share with others - that attacker could then be able to read any messages sent on the channel (either tomorrow or in the past - if they kept a raw copy of those broadcast packets)
|
||||
|
||||
Possible future areas of work (if there is enough interest - post in our [forum](https://meshtastic.discourse.group) if you want this):
|
||||
|
||||
1. Optionally requiring users to provide a PIN to regain access to the mesh. This could be based on: intentionally locking the device, time since last use, or any member could force all members to reauthenticate,
|
||||
2. Until a device reauthenticates, any other access via BLE or USB would be blocked (this would protect against attackers who are not prepared to write custom software to extract and reverse engineer meshtastic flash memory)
|
||||
3. Turning on read-back protection in the device fuse-bits (this would extend protection in #2 to block all but **extremely** advanced attacks involving chip disassembly)
|
||||
4. Time limiting keys used for message transmission and automatically cycling them on a schedule. This would protect past messages from being decoded even if an attacker learns the current key.
|
||||
|
||||
### Notes for reviewers
|
||||
|
||||
If you are reviewing our implementation, this is a brief statement of our method.
|
||||
|
||||
- We do all crypto at the SubPacket (payload) level only, so that all meshtastic nodes will route for others - even those channels which are encrypted with a different key.
|
||||
- Mostly based on reading [Wikipedia](<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_(CTR)>) and using the modes the ESP32 provides support for in hardware.
|
||||
- We use AES256-CTR as a stream cypher (with zero padding on the last BLOCK) because it is well supported with hardware acceleration.
|
||||
- Our AES key is 128 or 256 bits, shared as part of the 'Channel' specification.
|
||||
- The node number concatenated with the packet number is used as the NONCE. This nonce will be stored in flash in the device and should essentially never repeat. If the user makes a new 'Channel' (i.e. picking a new random 256 bit key), the packet number will start at zero.
|
||||
- The packet number is sent in cleartext with each packet. The node number can be derived from the "from" field of each packet. (Cleartext is acceptable because it merely provides IV for each encryption run)
|
||||
- Each 16 byte BLOCK for a packet has an incrementing COUNTER. COUNTER starts at zero for the first block of each packet.
|
||||
- The IV for each block is constructed by concatenating the NONCE as the upper 96 bits of the IV and the COUNTER as the bottom 32 bits. Since our packets are small counter portion will really never be higher than 32 (five bits).
|
||||
|
||||
## Comments from reviewer #1
|
||||
|
||||
This reviewer is a cryptography professional, but would like to remain anonymous. We thank them for their comments ;-):
|
||||
|
||||
I'm assuming that meshtastic is being used to hike in places where someone capable is trying to break it - like you were going to walk around DefCon using these. I spent about an hour reviewing the encryption, and have the following notes:
|
||||
|
||||
* The write-up isn't quite as clear as the code.
|
||||
* The code is using AES-CTR mode correctly to ensure confidentiality.
|
||||
* The comment for initNonce really covers the necessary information.
|
||||
* I think the bigger encryption question is "what does the encryption need to do"? As it stands, an attacker who has yet to capture any of the devices cannot reasonably capture text or location data. An attacker who captures any device in the channel/mesh can read everything going to that device, everything stored on that device, and any other communication within the channel that they captured in encrypted form. If that capability basically matches your expectations, it is suitable for whatever adventures this was intended for, then, based on information publicly available or widely disclosed, the encryption is good. If those properties are distressing (like, device history is deliberately limited and you don't want a device captured today to endanger the information sent over the channel yesterday) we could talk about ways to achieve that (most likely synchronizing time and replacing the key with its own SHA256 every X hours, and ensuring the old key is not retained unnecessarily).
|
||||
* Two other things to keep in mind are that AES-CTR does not itself provide authenticity (e.g. an attacker can flip bits in replaying data and scramble the resulting plaintext), and that the current scheme gives some hints about transmission in the size. So, if you worry about an adversary deliberately messing-up messages or knowing the length of a text message, it looks like those might be possible.
|
||||
|
||||
I'm guessing that the network behaves somewhat like a store-and-forward network - or, at least, that the goal is to avoid establishing a two-way connection to transmit data. I'm afraid I haven't worked with mesh networks much, but remember studying them briefly in school about ten years ago.
|
||||
124
docs/software/device-api.md
Normal file
124
docs/software/device-api.md
Normal file
@@ -0,0 +1,124 @@
|
||||
# Device API
|
||||
|
||||
The Device API is design to have only a simple stream of ToRadio and FromRadio packets and all polymorphism comes from the flexible set of Google Protocol Buffers which are sent over the wire. We use protocol buffers extensively both for the bluetooth API and for packets inside the mesh or when providing packets to other applications on the phone.
|
||||
|
||||
## Streaming version
|
||||
|
||||
This protocol is **almost** identical when it is deployed over BLE, Serial/USB or TCP (our three currently supported transports for connecting to phone/PC). Most of this document is in terms of the original BLE version, but this section describes the small changes when this API is exposed over a Streaming (non datagram) transport. The streaming version has the following changes:
|
||||
|
||||
- We assume the stream is reliable (though the protocol will resynchronize if bytes are lost or corrupted). i.e. we do not include CRCs or error correction codes.
|
||||
- Packets always have a four byte header (described below) prefixed before each packet. This header provides framing characters and length.
|
||||
- The stream going towards the radio is only a series of ToRadio packets (with the extra 4 byte headers)
|
||||
- The stream going towards the PC is a stream of FromRadio packets (with the 4 byte headers), or if the receiver state machine does not see valid header bytes it can (optionally) print those bytes as the debug console from the radio. This allows the device to emit regular serial debugging messages (which can be understood by a terminal program) but also switch to a more structured set of protobufs once it sees that the PC client has sent a protobuf towards it.
|
||||
|
||||
The 4 byte header is constructed to both provide framing and to not look line 'normal' 7 bit ASCII.
|
||||
|
||||
- Byte 0: START1 (0x94)
|
||||
- Byte 1: START2 (0xc3)
|
||||
- Byte 2: MSB of protobuf length
|
||||
- Byte 3: LSB of protobuf length
|
||||
|
||||
The receiver will validate length and if >512 it will assume the packet is corrupted and return to looking for START1. While looking for START1 any other characters are printed as "debug output". For small example implementation of this reader see the meshtastic-python implementation.
|
||||
|
||||
## MeshBluetoothService (the BLE API)
|
||||
|
||||
This is the main bluetooth service for the device and provides the API your app should use to get information about the mesh, send packets or provision the radio.
|
||||
|
||||
For a reference implementation of a client that uses this service see [RadioInterfaceService](https://github.com/meshtastic/Meshtastic-Android/blob/master/app/src/main/java/com/geeksville/mesh/service/RadioInterfaceService.kt).
|
||||
|
||||
Typical flow when a phone connects to the device should be the following (if you want to watch this flow from the python app just run "meshtastic --debug --info" - the flow over BLE is identical):
|
||||
|
||||
- There are only three relevant endpoints (and they have built in BLE documentation - so use a BLE tool of your choice to watch them): FromRadio, FromNum (sends notifies when new data is available in FromRadio) and ToRadio
|
||||
- SetMTU size to 512
|
||||
- Write a ToRadio.startConfig protobuf to the "ToRadio" endpoint" - this tells the radio you are a new connection and you need the entire NodeDB sent down.
|
||||
- Read repeatedly from the "FromRadio" endpoint. Each time you read you will get back a FromRadio protobuf (see Meshtatastic-protobuf). Keep reading from this endpoint until you get back and empty buffer.
|
||||
- See below for the expected sequence for your initial download.
|
||||
- After the initial download, you should subscribe for BLE "notify" on the "FromNum" endpoint. If a notification arrives, that means there are now one or more FromRadio packets waiting inside FromRadio. Read from FromRadio until you get back an empty packet.
|
||||
- Any time you want to send packets to the radio, you should write a ToRadio packet into ToRadio.
|
||||
|
||||
Expected sequence for initial download:
|
||||
|
||||
- After your send startConfig, you will receive a series of FromRadio packets. The sequence of these packets will be as follows (but you are best not counting on this, instead just update your model for whatever packet you receive - based on looking at the type)
|
||||
- Read a RadioConfig from "radio" - used to get the channel and radio settings
|
||||
- Read a User from "user" - to get the username for this node
|
||||
- Read a MyNodeInfo from "mynode" to get information about this local device
|
||||
- Read a series of NodeInfo packets to build the phone's copy of the current NodeDB for the mesh
|
||||
- Read a endConfig packet that indicates that the entire state you need has been sent.
|
||||
- Read a series of MeshPackets until it returns empty to get any messages that arrived for this node while the phone was away
|
||||
|
||||
For definitions (and documentation) on FromRadio, ToRadio, MyNodeInfo, NodeInfo and User protocol buffers see [mesh.proto](https://github.com/meshtastic/Meshtastic-protobufs/blob/master/mesh.proto)
|
||||
|
||||
UUID for the service: 6ba1b218-15a8-461f-9fa8-5dcae273eafd
|
||||
|
||||
Each characteristic is listed as follows:
|
||||
|
||||
UUID
|
||||
Properties
|
||||
Description (including human readable name)
|
||||
|
||||
8ba2bcc2-ee02-4a55-a531-c525c5e454d5
|
||||
read
|
||||
fromradio - contains a newly received FromRadio packet destined towards the phone (up to MAXPACKET bytes per packet).
|
||||
After reading the esp32 will put the next packet in this mailbox. If the FIFO is empty it will put an empty packet in this
|
||||
mailbox.
|
||||
|
||||
f75c76d2-129e-4dad-a1dd-7866124401e7
|
||||
write
|
||||
toradio - write ToRadio protobufs to this characteristic to send them (up to MAXPACKET len)
|
||||
|
||||
ed9da18c-a800-4f66-a670-aa7547e34453
|
||||
read,notify,write
|
||||
fromnum - the current packet # in the message waiting inside fromradio, if the phone sees this notify it should read messages
|
||||
until it catches up with this number.
|
||||
|
||||
The phone can write to this register to go backwards up to FIXME packets, to handle the rare case of a fromradio packet was dropped after the esp32 callback was called, but before it arrives at the phone. If the phone writes to this register the esp32 will discard older packets and put the next packet >= fromnum in fromradio.
|
||||
When the esp32 advances fromnum, it will delay doing the notify by 100ms, in the hopes that the notify will never actally need to be sent if the phone is already pulling from fromradio.
|
||||
|
||||
Note: that if the phone ever sees this number decrease, it means the esp32 has rebooted.
|
||||
|
||||
Re: queue management
|
||||
Not all messages are kept in the fromradio queue (filtered based on SubPacket):
|
||||
|
||||
- only the most recent Position and User messages for a particular node are kept
|
||||
- all Data SubPackets are kept
|
||||
- No WantNodeNum / DenyNodeNum messages are kept
|
||||
A variable keepAllPackets, if set to true will suppress this behavior and instead keep everything for forwarding to the phone (for debugging)
|
||||
|
||||
### A note on MTU sizes
|
||||
|
||||
This device will work with any MTU size, but it is highly recommended that you call your phone's "setMTU function to increase MTU to 512 bytes" as soon as you connect to a service. This will dramatically improve performance when reading/writing packets.
|
||||
|
||||
### Protobuf API
|
||||
|
||||
On connect, you should send a want_config_id protobuf to the device. This will cause the device to send its node DB and radio config via the fromradio endpoint. After sending the full DB, the radio will send a want_config_id to indicate it is done sending the configuration.
|
||||
|
||||
### Other bluetooth services
|
||||
|
||||
This document focuses on the core device protocol, but it is worth noting that the following other Bluetooth services are also
|
||||
provided by the device.
|
||||
|
||||
#### BluetoothSoftwareUpdate
|
||||
|
||||
The software update service. For a sample function that performs a software update using this API see [startUpdate](https://github.com/meshtastic/Meshtastic-Android/blob/master/app/src/main/java/com/geeksville/mesh/service/SoftwareUpdateService.kt).
|
||||
|
||||
SoftwareUpdateService UUID cb0b9a0b-a84c-4c0d-bdbb-442e3144ee30
|
||||
|
||||
Characteristics
|
||||
|
||||
| UUID | properties | description |
|
||||
| ------------------------------------ | ----------- | ----------------------------------------------------------------------------------------------------------------- |
|
||||
| e74dd9c0-a301-4a6f-95a1-f0e1dbea8e1e | write,read | total image size, 32 bit, write this first, then read read back to see if it was acceptable (0 mean not accepted) |
|
||||
| e272ebac-d463-4b98-bc84-5cc1a39ee517 | write | data, variable sized, recommended 512 bytes, write one for each block of file |
|
||||
| 4826129c-c22a-43a3-b066-ce8f0d5bacc6 | write | crc32, write last - writing this will complete the OTA operation, now you can read result |
|
||||
| 5e134862-7411-4424-ac4a-210937432c77 | read,notify | result code, readable but will notify when the OTA operation completes |
|
||||
| GATT_UUID_SW_VERSION_STR/0x2a28 | read | We also implement these standard GATT entries because SW update probably needs them: |
|
||||
| GATT_UUID_MANU_NAME/0x2a29 | read | |
|
||||
| GATT_UUID_HW_VERSION_STR/0x2a27 | read | |
|
||||
|
||||
#### DeviceInformationService
|
||||
|
||||
Implements the standard BLE contract for this service (has software version, hardware model, serial number, etc...)
|
||||
|
||||
#### BatteryLevelService
|
||||
|
||||
Implements the standard BLE contract service, provides battery level in a way that most client devices should automatically understand (i.e. it should show in the bluetooth devices screen automatically)
|
||||
23
docs/software/esp32-arduino-build-notes.md
Normal file
23
docs/software/esp32-arduino-build-notes.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# esp32-arduino build instructions
|
||||
|
||||
We build our own custom version of esp32-arduino, in order to get some fixes we've made but haven't yet been merged in master.
|
||||
|
||||
These are a set of currently unformatted notes on how to build and install them. Most developers should not care about this, because
|
||||
you'll automatically get our fixed libraries.
|
||||
|
||||
```
|
||||
last EDF release in arduino is: https://github.com/espressif/arduino-esp32/commit/1977370e6fc069e93ffd8818798fbfda27ae7d99
|
||||
IDF release/v3.3 46b12a560
|
||||
IDF release/v3.3 367c3c09c
|
||||
https://docs.espressif.com/projects/esp-idf/en/release-v3.3/get-started/linux-setup.html
|
||||
kevinh@kevin-server:~/development/meshtastic/esp32-arduino-lib-builder\$ python /home/kevinh/development/meshtastic/esp32-arduino-lib-builder/esp-idf/components/esptool*py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 /home/kevinh/development/meshtastic/esp32-arduino-lib-builder/build/bootloader/bootloader.bin
|
||||
cp -a out/tools/sdk/* components/arduino/tools/sdk
|
||||
cp -ar components/arduino/* ~/.platformio/packages/framework-arduinoespressif32
|
||||
|
||||
/// @src-fba9d33740f719f712e9f8b07da6ea13/
|
||||
|
||||
or
|
||||
|
||||
cp -ar out/tools/sdk/* ~/.platformio/packages/framework-arduinoespressif32/tools/sdk
|
||||
|
||||
```
|
||||
17
docs/software/gps-todo.txt
Normal file
17
docs/software/gps-todo.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
You probably don't care about this ugly file of personal notes ;-)
|
||||
|
||||
for taiwan region:
|
||||
bin/run.sh --set region 8
|
||||
|
||||
time only mode
|
||||
./bin/run.sh --set gps_operation 3
|
||||
|
||||
ublox parsing failure
|
||||
|
||||
record power measurements and update spreadsheet
|
||||
|
||||
have loop methods return allowable sleep time (from their perspective)
|
||||
increase main cpu sleep time
|
||||
|
||||
warn people about crummy gps antennas - add to faq
|
||||
|
||||
27
docs/software/install-OSX.md
Normal file
27
docs/software/install-OSX.md
Normal file
@@ -0,0 +1,27 @@
|
||||
(Here's some quick tips on installing the device code from OS-X, thanks to @android606)
|
||||
|
||||
First time using LoRa for anything, just checking it out.
|
||||
|
||||
I bought a T-Beam on eBay, followed the instructions to install the firmware here:
|
||||
[https://github.com/meshtastic/Meshtastic-esp32](https://github.com/meshtastic/Meshtastic-esp32)
|
||||
|
||||
I'm using a Mac for this, so that might account for differences in the steps to get it working. I just swapped out my SSD last month, I'm using a pretty fresh install of OS X 10.15.3/Catalina.
|
||||
|
||||
I got it working fairly smoothly, but there were two hang-ups I thought I'd mention:
|
||||
|
||||
1. I am about 0% familiar with Python, so there were some issues getting esptool.py working. Basically, this OS X comes with Python 2.7 and no pip. Pip installed okay, so I used it to install esptool. Esptool appeared to install correctly, but I couldn't get it to work to save my life. Simply typing "esptool.py" doesn't work, and I just don't know enough python to figure out why. For some reason, it installs but isn't in the \$PATH anywhere, and I don't know where it went. Python 2.7 kept giving me warning messages about being old and unsupported, so I figured that might be a hint that I should upgrade.
|
||||
|
||||
I ended up doing this:
|
||||
|
||||
- brew install pyenv (to install pyenv)
|
||||
- pyenv install 3.7.7 (to install and select python 3.7.7)
|
||||
- pyenv global 3.7.7 (to select the new version of python)
|
||||
- brew install pip (to install pip3)
|
||||
- pip3 install --upgrade esptool (note I specifically had to use "pip3", not "pip")
|
||||
|
||||
...then I was able to execute esptool.py
|
||||
|
||||
2. esptool.py didn't work though, because the virtual com port wasn't showing up as a device. I had to install a driver from Silicon Labs, which I got here:
|
||||
[driver for the CP210X USB to UART bridge from Silicon Labs](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)
|
||||
|
||||
After I installed that, esptool.py was completely happy and the firmware loaded right up.
|
||||
218
docs/software/mesh-alg.md
Normal file
218
docs/software/mesh-alg.md
Normal file
@@ -0,0 +1,218 @@
|
||||
# Mesh broadcast algorithm
|
||||
|
||||
## Current algorithm
|
||||
|
||||
The routing protocol for Meshtastic is really quite simple (and suboptimal). It is heavily influenced by the mesh routing algorithm used in [Radiohead](https://www.airspayce.com/mikem/arduino/RadioHead/) (which was used in very early versions of this project). It has four conceptual layers.
|
||||
|
||||
### A note about protocol buffers
|
||||
|
||||
Because we want our devices to work across various vendors and implementations, we use [Protocol Buffers](https://github.com/meshtastic/Meshtastic-protobufs) pervasively. For information on how the protocol buffers are used wrt API clients see [sw-design](sw-design.md), for purposes of this document you mostly only
|
||||
need to consider the MeshPacket and Subpacket message types.
|
||||
|
||||
### Layer 1: Non reliable zero hop messaging
|
||||
|
||||
This layer is conventional non-reliable lora packet transmission. The transmitted packet has the following representation on the ether:
|
||||
|
||||
- A 32 bit LORA preamble (to allow receiving radios to synchronize clocks and start framing). We use a longer than minimum (8 bit) preamble to maximize the amount of time the LORA receivers can stay asleep, which dramatically lowers power consumption.
|
||||
|
||||
After the preamble the 16 byte packet header is transmitted. This header is described directly by the PacketHeader class in the C++ source code. But indirectly it matches the first portion of the "MeshPacket" protobuf definition. But notably: this portion of the packet is sent directly as the following 16 bytes (rather than using the protobuf encoding). We do this to both save airtime and to allow receiving radio hardware the option of filtering packets before even waking the main CPU.
|
||||
|
||||
- to (4 bytes): the unique NodeId of the destination (or 0xffffffff for NodeNum_BROADCAST)
|
||||
- from (4 bytes): the unique NodeId of the sender)
|
||||
- id (4 bytes): the unique (wrt the sending node only) packet ID number for this packet. We use a large (32 bit) packet ID to ensure there is enough unique state to protect any encrypted payload from attack.
|
||||
- flags (4 bytes): Only a few bits are are currently used - 3 bits for for the "HopLimit" (see below) and 1 bit for "WantAck"
|
||||
|
||||
After the packet header the actual packet is placed onto the the wire. These bytes are merely the encrypted packed protobuf encoding of the SubPacket protobuf. A full description of our encryption is available in [crypto](crypto.md). It is worth noting that only this SubPacket is encrypted, headers are not. Which leaves open the option of eventually allowing nodes to route packets without knowing the keys used to encrypt.
|
||||
|
||||
NodeIds are constructed from the bottom four bytes of the macaddr of the bluetooth address. Because the OUI is assigned by the IEEE and we currently only support a few CPU manufacturers, the upper byte is defacto guaranteed unique for each vendor. The bottom 3 bytes are guaranteed unique by that vendor.
|
||||
|
||||
To prevent collisions all transmitters will listen before attempting to send. If they hear some other node transmitting, they will reattempt transmission in x milliseconds. This retransmission delay is random between FIXME and FIXME (these two numbers are currently hardwired, but really should be scaled based on expected packet transmission time at current channel settings).
|
||||
|
||||
### Layer 2: Reliable zero hop messaging
|
||||
|
||||
This layer adds reliable messaging between the node and its immediate neighbors (only).
|
||||
|
||||
The default messaging provided by layer-1 is extended by setting the "want-ack" flag in the MeshPacket protobuf. If want-ack is set the following documentation from mesh.proto applies:
|
||||
|
||||
"""This packet is being sent as a reliable message, we would prefer it to arrive
|
||||
at the destination. We would like to receive a ack packet in response.
|
||||
|
||||
Broadcasts messages treat this flag specially: Since acks for broadcasts would
|
||||
rapidly flood the channel, the normal ack behavior is suppressed. Instead,
|
||||
the original sender listens to see if at least one node is rebroadcasting this
|
||||
packet (because naive flooding algorithm). If it hears that the odds (given
|
||||
typical LoRa topologies) the odds are very high that every node should
|
||||
eventually receive the message. So FloodingRouter.cpp generates an implicit
|
||||
ack which is delivered to the original sender. If after some time we don't
|
||||
hear anyone rebroadcast our packet, we will timeout and retransmit, using the
|
||||
regular resend logic."""
|
||||
|
||||
If a transmitting node does not receive an ACK (or a NAK) packet within FIXME milliseconds, it will use layer-1 to attempt a retransmission of the sent packet. A reliable packet (at this 'zero hop' level) will be resent a maximum of three times. If no ack or nak has been received by then the local node will internally generate a nak (either for local consumption or use by higher layers of the protocol).
|
||||
|
||||
### Layer 3: (Naive) flooding for multi-hop messaging
|
||||
|
||||
Given our use-case for the initial release, most of our protocol is built around [flooding](<https://en.wikipedia.org/wiki/Flooding_(computer_networking)>). The implementation is currently 'naive' - i.e. it doesn't try to optimize flooding other than abandoning retransmission once we've seen a nearby receiver has acked the packet. Therefore, for each source packet up to N retransmissions might occur (if there are N nodes in the mesh).
|
||||
|
||||
Each node in the mesh, if it sees a packet on the ether with HopLimit set to a value other than zero, it will decrement that HopLimit and attempt retransmission on behalf of the original sending node.
|
||||
|
||||
### Layer 4: DSR for multi-hop unicast messaging
|
||||
|
||||
This layer is not yet fully implemented (and not yet used). But eventually (if we stay with our own transport rather than switching to QMesh or Reticulum)
|
||||
we will use conventional DSR for unicast messaging. Currently (even when not requiring 'broadcasts') we send any multi-hop unicasts as 'broadcasts' so that we can
|
||||
leverage our (functional) flooding implementation. This is suboptimal but it is a very rare use-case, because the odds are high that most nodes (given our small networks and 'hiking' use case) are within a very small number of hops. When any node witnesses an ack for a packet, it will realize that it can abandon its own
|
||||
broadcast attempt for that packet.
|
||||
|
||||
## Misc notes on remaining tasks
|
||||
|
||||
This section is currently poorly formatted, it is mostly a mere set of todo lists and notes for @geeksville during his initial development. After release 1.0 ideas for future optimization include:
|
||||
|
||||
- Make flood-routing less naive (because we have GPS and radio signal strength as heuristics to avoid redundant retransmissions)
|
||||
- If nodes have been user marked as 'routers', preferentially do flooding via those nodes
|
||||
- Fully implement DSR to improve unicast efficiency (or switch to QMesh/Reticulum as these projects mature)
|
||||
|
||||
great source of papers and class notes: http://www.cs.jhu.edu/~cs647/
|
||||
|
||||
flood routing improvements
|
||||
|
||||
- DONE if we don't see anyone rebroadcast our want_ack=true broadcasts, retry as needed.
|
||||
|
||||
reliable messaging tasks (stage one for DSR):
|
||||
|
||||
- DONE generalize naive flooding
|
||||
- DONE add a max hops parameter, use it for broadcast as well (0 means adjacent only, 1 is one forward etc...). Store as three bits in the header.
|
||||
- DONE add a 'snoopReceived' hook for all messages that pass through our node.
|
||||
- DONE use the same 'recentmessages' array used for broadcast msgs to detect duplicate retransmitted messages.
|
||||
- DONE in the router receive path?, send an ack packet if want_ack was set and we are the final destination. FIXME, for now don't handle multihop or merging of data replies with these acks.
|
||||
- DONE keep a list of packets waiting for acks
|
||||
- DONE for each message keep a count of # retries (max of three). Local to the node, only for the most immediate hop, ignorant of multihop routing.
|
||||
- DONE delay some random time for each retry (large enough to allow for acks to come in)
|
||||
- DONE once an ack comes in, remove the packet from the retry list and deliver the ack to the original sender
|
||||
- DONE after three retries, deliver a no-ack packet to the original sender (i.e. the phone app or mesh router service)
|
||||
- DONE test one hop ack/nak with the python framework
|
||||
- DONE Do stress test with acks
|
||||
|
||||
dsr tasks
|
||||
|
||||
- DONE oops I might have broken message reception
|
||||
- DONE Don't use broadcasts for the network pings (close open github issue)
|
||||
- DONE add ignoreSenders to radioconfig to allow testing different mesh topologies by refusing to see certain senders
|
||||
- DONE test multihop delivery with the python framework
|
||||
|
||||
optimizations / low priority:
|
||||
|
||||
- read this [this](http://pages.cs.wisc.edu/~suman/pubs/nadv-mobihoc05.pdf) paper and others and make our naive flood routing less naive
|
||||
- read @cyclomies long email with good ideas on optimizations and reply
|
||||
- DONE Remove NodeNum assignment algorithm (now that we use 4 byte node nums)
|
||||
- DONE make android app warn if firmware is too old or too new to talk to
|
||||
- change nodenums and packetids in protobuf to be fixed32
|
||||
- low priority: think more careful about reliable retransmit intervals
|
||||
- make ReliableRouter.pending threadsafe
|
||||
- bump up PacketPool size for all the new ack/nak/routing packets
|
||||
- handle 51 day rollover in doRetransmissions
|
||||
- use a priority queue for the messages waiting to send. Send acks first, then routing messages, then data messages, then broadcasts?
|
||||
|
||||
when we send a packet
|
||||
|
||||
- do "hop by hop" routing
|
||||
- when sending, if destnodeinfo.next_hop is zero (and no message is already waiting for an arp for that node), startRouteDiscovery() for that node. Queue the message in the 'waiting for arp queue' so we can send it later when then the arp completes.
|
||||
- otherwise, use next_hop and start sending a message (with ack request) towards that node (starting with next_hop).
|
||||
|
||||
when we receive any packet
|
||||
|
||||
- sniff and update tables (especially useful to find adjacent nodes). Update user, network and position info.
|
||||
- if we need to route() that packet, resend it to the next_hop based on our nodedb.
|
||||
- if it is broadcast or destined for our node, deliver locally
|
||||
- handle routereply/routeerror/routediscovery messages as described below
|
||||
- then free it
|
||||
|
||||
routeDiscovery
|
||||
|
||||
- if we've already passed through us (or is from us), then it ignore it
|
||||
- use the nodes already mentioned in the request to update our routing table
|
||||
- if they were looking for us, send back a routereply
|
||||
- NOT DOING FOR NOW -if max_hops is zero and they weren't looking for us, drop (FIXME, send back error - I think not though?)
|
||||
- if we receive a discovery packet, and we don't have next_hop set in our nodedb, we use it to populate next_hop (if needed) towards the requester (after decrementing max_hops)
|
||||
- if we receive a discovery packet, and we have a next_hop in our nodedb for that destination we send a (reliable) we send a route reply towards the requester
|
||||
|
||||
when sending any reliable packet
|
||||
|
||||
- if timeout doing retries, send a routeError (nak) message back towards the original requester. all nodes eavesdrop on that packet and update their route caches.
|
||||
|
||||
when we receive a routereply packet
|
||||
|
||||
- update next_hop on the node, if the new reply needs fewer hops than the existing one (we prefer shorter paths). fixme, someday use a better heuristic
|
||||
|
||||
when we receive a routeError packet
|
||||
|
||||
- delete the route for that failed recipient, restartRouteDiscovery()
|
||||
- if we receive routeerror in response to a discovery,
|
||||
- fixme, eventually keep caches of possible other routes.
|
||||
|
||||
TODO:
|
||||
|
||||
- optimize our generalized flooding with heuristics, possibly have particular nodes self mark as 'router' nodes.
|
||||
|
||||
- DONE reread the radiohead mesh implementation - hop to hop acknowledgement seems VERY expensive but otherwise it seems like DSR
|
||||
- DONE read about mesh routing solutions (DSR and AODV)
|
||||
- DONE read about general mesh flooding solutions (naive, MPR, geo assisted)
|
||||
- DONE reread the disaster radio protocol docs - seems based on Babel (which is AODVish)
|
||||
- REJECTED - seems dying - possibly dash7? https://www.slideshare.net/MaartenWeyn1/dash7-alliance-protocol-technical-presentation https://github.com/MOSAIC-LoPoW/dash7-ap-open-source-stack - does the opensource stack implement multihop routing? flooding? their discussion mailing list looks dead-dead
|
||||
- update duty cycle spreadsheet for our typical usecase
|
||||
|
||||
a description of DSR: https://tools.ietf.org/html/rfc4728 good slides here: https://www.slideshare.net/ashrafmath/dynamic-source-routing
|
||||
good description of batman protocol: https://www.open-mesh.org/projects/open-mesh/wiki/BATMANConcept
|
||||
|
||||
interesting paper on lora mesh: https://portal.research.lu.se/portal/files/45735775/paper.pdf
|
||||
It seems like DSR might be the algorithm used by RadioheadMesh. DSR is described in https://tools.ietf.org/html/rfc4728
|
||||
https://en.wikipedia.org/wiki/Dynamic_Source_Routing
|
||||
|
||||
broadcast solution:
|
||||
Use naive flooding at first (FIXME - do some math for a 20 node, 3 hop mesh. A single flood will require a max of 20 messages sent)
|
||||
Then move to MPR later (http://www.olsr.org/docs/report_html/node28.html). Use altitude and location as heursitics in selecting the MPR set
|
||||
|
||||
compare to db sync algorithm?
|
||||
|
||||
what about never flooding gps broadcasts. instead only have them go one hop in the common case, but if any node X is looking at the position of Y on their gui, then send a unicast to Y asking for position update. Y replies.
|
||||
|
||||
If Y were to die, at least the neighbor nodes of Y would have their last known position of Y.
|
||||
|
||||
## approach 1
|
||||
|
||||
- send all broadcasts with a TTL
|
||||
- periodically(?) do a survey to find the max TTL that is needed to fully cover the current network.
|
||||
- to do a study first send a broadcast (maybe our current initial user announcement?) with TTL set to one (so therefore no one will rebroadcast our request)
|
||||
- survey replies are sent unicast back to us (and intervening nodes will need to keep the route table that they have built up based on past packets)
|
||||
- count the number of replies to this TTL 1 attempt. That is the number of nodes we can reach without any rebroadcasts
|
||||
- repeat the study with a TTL of 2 and then 3. stop once the # of replies stops going up.
|
||||
- it is important for any node to do listen before talk to prevent stomping on other rebroadcasters...
|
||||
- For these little networks I bet a max TTL would never be higher than 3?
|
||||
|
||||
## approach 2
|
||||
|
||||
- send a TTL1 broadcast, the replies let us build a list of the nodes (stored as a bitvector?) that we can see (and their rssis)
|
||||
- we then broadcast out that bitvector (also TTL1) asking "can any of ya'll (even indirectly) see anyone else?"
|
||||
- if a node can see someone I missed (and they are the best person to see that node), they reply (unidirectionally) with the missing nodes and their rssis (other nodes might sniff (and update their db) based on this reply but they don't have to)
|
||||
- given that the max number of nodes in this mesh will be like 20 (for normal cases), I bet globally updating this db of "nodenums and who has the best rssi for packets from that node" would be useful
|
||||
- once the global DB is shared, when a node wants to broadcast, it just sends out its broadcast . the first level receivers then make a decision "am I the best to rebroadcast to someone who likely missed this packet?" if so, rebroadcast
|
||||
|
||||
## approach 3
|
||||
|
||||
- when a node X wants to know other nodes positions, it broadcasts its position with want_replies=true. Then each of the nodes that received that request broadcast their replies (possibly by using special timeslots?)
|
||||
- all nodes constantly update their local db based on replies they witnessed.
|
||||
- after 10s (or whatever) if node Y notices that it didn't hear a reply from node Z (that Y has heard from recently ) to that initial request, that means Z never heard the request from X. Node Y will reply to X on Z's behalf.
|
||||
- could this work for more than one hop? Is more than one hop needed? Could it work for sending messages (i.e. for a msg sent to Z with want-reply set).
|
||||
|
||||
## approach 4
|
||||
|
||||
look into the literature for this idea specifically.
|
||||
|
||||
- don't view it as a mesh protocol as much as a "distributed db unification problem". When nodes talk to nearby nodes they work together
|
||||
to update their nodedbs. Each nodedb would have a last change date and any new changes that only one node has would get passed to the
|
||||
other node. This would nicely allow distant nodes to propogate their position to all other nodes (eventually).
|
||||
- handle group messages the same way, there would be a table of messages and time of creation.
|
||||
- when a node has a new position or message to send out, it does a broadcast. All the adjacent nodes update their db instantly (this handles 90% of messages I'll bet).
|
||||
- Occasionally a node might broadcast saying "anyone have anything newer than time X?" If someone does, they send the diffs since that date.
|
||||
- essentially everything in this variant becomes broadcasts of "request db updates for >time X - for _all_ or for a particular nodenum" and nodes sending (either due to request or because they changed state) "here's a set of db updates". Every node is constantly trying to
|
||||
build the most recent version of reality, and if some nodes are too far, then nodes closer in will eventually forward their changes to the distributed db.
|
||||
- construct non ambigious rules for who broadcasts to request db updates. ideally the algorithm should nicely realize node X can see most other nodes, so they should just listen to all those nodes and minimize the # of broadcasts. the distributed picture of nodes rssi could be useful here?
|
||||
- possibly view the BLE protocol to the radio the same way - just a process of reconverging the node/msgdb database.
|
||||
269
docs/software/nrf52-TODO.md
Normal file
269
docs/software/nrf52-TODO.md
Normal file
@@ -0,0 +1,269 @@
|
||||
# NRF52 TODO
|
||||
|
||||
- Possibly switch from softdevice to Apachy Newt: https://github.com/espressif/esp-nimble
|
||||
https://github.com/apache/mynewt-core - use nimble BLE on both ESP32 and NRF52
|
||||
|
||||
## RAK815
|
||||
|
||||
TODO:
|
||||
|
||||
- shrink soft device RAM usage
|
||||
- get nrf52832 working again (currently OOM)
|
||||
- i2c gps comms not quite right
|
||||
- ble: AdafruitBluefruit::begin - adafruit_ble_task was assigned an invalid stack pointer. out of memory?
|
||||
- measure power draw
|
||||
|
||||
### Bootloader
|
||||
|
||||
Install our (temporarily hacked up) adafruit bootloader
|
||||
|
||||
```
|
||||
kevinh@kevin-server:~/development/meshtastic/Adafruit_nRF52_Bootloader$ make BOARD=rak815 sd flash
|
||||
LD rak815_bootloader-0.3.2-111-g9478eb7-dirty.out
|
||||
text data bss dec hex filename
|
||||
20888 1124 15006 37018 909a _build/build-rak815/rak815_bootloader-0.3.2-111-g9478eb7-dirty.out
|
||||
Create rak815_bootloader-0.3.2-111-g9478eb7-dirty.hex
|
||||
Create rak815_bootloader-0.3.2-111-g9478eb7-dirty-nosd.hex
|
||||
Flashing: rak815_bootloader-0.3.2-111-g9478eb7-dirty-nosd.hex
|
||||
nrfjprog --program _build/build-rak815/rak815_bootloader-0.3.2-111-g9478eb7-dirty-nosd.hex --sectoranduicrerase -f nrf52 --reset
|
||||
Parsing hex file.
|
||||
Erasing page at address 0x0.
|
||||
Erasing page at address 0x74000.
|
||||
Erasing page at address 0x75000.
|
||||
Erasing page at address 0x76000.
|
||||
Erasing page at address 0x77000.
|
||||
Erasing page at address 0x78000.
|
||||
Erasing page at address 0x79000.
|
||||
Erasing UICR flash area.
|
||||
Applying system reset.
|
||||
Checking that the area to write is not protected.
|
||||
Programming device.
|
||||
Applying system reset.
|
||||
Run.
|
||||
```
|
||||
|
||||
### Appload
|
||||
|
||||
tips on installing https://github.com/platformio/platform-nordicnrf52/issues/8#issuecomment-374017768
|
||||
|
||||
to see console output over jlink:
|
||||
|
||||
```
|
||||
12:17
|
||||
in one tab run "bin/nrf52832-gdbserver.sh" - leave this running the whole time while developing/debugging
|
||||
12:17
|
||||
~/development/meshtastic/meshtastic-esp32$ bin/nrf52-console.sh
|
||||
###RTT Client: ************************************************************
|
||||
###RTT Client: * SEGGER Microcontroller GmbH *
|
||||
###RTT Client: * Solutions for real time microcontroller applications *
|
||||
###RTT Client: ************************************************************
|
||||
###RTT Client: * *
|
||||
###RTT Client: * (c) 2012 - 2016 SEGGER Microcontroller GmbH *
|
||||
###RTT Client: * *
|
||||
###RTT Client: * www.segger.com Support: support@segger.com *
|
||||
###RTT Client: * *
|
||||
###RTT Client: ************************************************************
|
||||
###RTT Client: * *
|
||||
###RTT Client: * SEGGER J-Link RTT Client Compiled Apr 7 2020 15:01:22 *
|
||||
###RTT Client: * *
|
||||
###RTT Client: ************************************************************
|
||||
###RTT Client: -----------------------------------------------
|
||||
###RTT Client: Connecting to J-Link RTT Server via localhost:19021 ..............
|
||||
###RTT Client: Connected.
|
||||
SEGGER J-Link V6.70c - Real time terminal output
|
||||
SEGGER J-Link ARM V9.6, SN=69663845
|
||||
Process: JLinkGDBServerCLExein another tab run:
|
||||
12:18
|
||||
On NRF52 I've been using the jlink fake serial console. But since the rak815 has the serial port hooked up we can switch back to that once the basics are working.
|
||||
```
|
||||
|
||||
## Misc work items
|
||||
|
||||
RAM investigation.
|
||||
nRF52832-QFAA 64KB ram, 512KB flash vs
|
||||
nrf52832-QFAB 32KB ram, 512kb flash
|
||||
nrf52833 128KB RAM
|
||||
nrf52840 256KB RAM, 1MB flash
|
||||
|
||||
Manual hacks needed to build (for now):
|
||||
|
||||
kevinh@kevin-server:~/.platformio/packages/framework-arduinoadafruitnrf52/variants\$ ln -s ~/development/meshtastic/meshtastic-esp32/variants/\* .
|
||||
|
||||
## Initial work items
|
||||
|
||||
Minimum items needed to make sure hardware is good.
|
||||
|
||||
- DONE set power UICR per https://devzone.nordicsemi.com/f/nordic-q-a/28562/nrf52840-regulator-configuration
|
||||
- switch charge controller into / out of performance mode (see 8.3.1 in datasheet)
|
||||
- write UC1701 wrapper
|
||||
- Test hardfault handler for null ptrs (if one isn't already installed)
|
||||
- test my hackedup bootloader on the real hardware
|
||||
- Use the PMU driver on real hardware
|
||||
- Use new radio driver on real hardware
|
||||
- Use UC1701 LCD driver on real hardware. Still need to create at startup and probe on SPI. Make sure SPI is atomic.
|
||||
- set vbus voltage per https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html?cp=4_0_0_4_2
|
||||
- test the LEDs
|
||||
- test the buttons
|
||||
|
||||
## Secondary work items
|
||||
|
||||
Needed to be fully functional at least at the same level of the ESP32 boards. At this point users would probably want them.
|
||||
|
||||
- DONE get serial API working
|
||||
- get full BLE api working
|
||||
- make power management/sleep work properly
|
||||
- make a settimeofday implementation
|
||||
- DONE increase preamble length? - will break other clients? so all devices must update
|
||||
- DONE enable BLE DFU somehow
|
||||
- report appversion/hwversion in BLE
|
||||
- use new LCD driver from screen.cpp. Still need to hook it to a subclass of (poorly named) OLEDDisplay, and override display() to stream bytes out to the screen.
|
||||
- we need to enable the external tcxo for the sx1262 (on dio3)?
|
||||
- figure out which regulator mode the sx1262 is operating in
|
||||
- turn on security for BLE, make pairing work
|
||||
- make ble endpoints not require "start config", just have them start in config mode
|
||||
- use new PMU to provide battery voltage/% full to app (both bluetooth and screen)
|
||||
- do initial power measurements, measure effects of more preamble bits, measure power management and confirm battery life
|
||||
- set UICR.CUSTOMER to indicate board model & version
|
||||
|
||||
## Items to be 'feature complete'
|
||||
|
||||
- check datasheet about sx1262 temperature compensation
|
||||
- enable brownout detection and watchdog
|
||||
- stop polling for GPS characters, instead stay blocked on read in a thread
|
||||
- figure out what the correct current limit should be for the sx1262, currently we just use the default 100
|
||||
- put sx1262 in sleepmode when processor gets shutdown (or rebooted), ideally even for critical faults (to keep power draw low). repurpose deepsleep state for this.
|
||||
- good power management tips: https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/optimizing-power-on-nrf52-designs
|
||||
- call PMU set_ADC_CONV(0) during sleep, to stop reading PMU adcs and decrease current draw
|
||||
- do final power measurements
|
||||
- backport the common PMU API between AXP192 and PmuBQ25703A
|
||||
- use the new buttons in the UX
|
||||
- currently using soft device SD140, is that ideal?
|
||||
- turn on the watchdog timer, require servicing from key application threads
|
||||
- nrf52setup should call randomSeed(tbd)
|
||||
- implement SYSTEMOFF behavior per https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html?cp=4_0_0_4_2
|
||||
|
||||
## Things to do 'someday'
|
||||
|
||||
Nice ideas worth considering someday...
|
||||
|
||||
- enable monitor mode debugging (need to use real jlink): https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/monitor-mode-debugging-with-j-link-and-gdbeclipse
|
||||
- Improve efficiency of PeriodicTimer by only checking the next queued timer event, and carefully sorting based on schedule
|
||||
- make a Mfg Controller and device under test classes as examples of custom app code for third party devs. Make a post about this. Use a custom payload type code. Have device under test send a broadcast with max hopcount of 0 for the 'mfgcontroller' payload type. mfg controller will read SNR and reply. DOT will declare failure/success and switch to the regular app screen.
|
||||
- Hook Segger RTT to the nordic logging framework. https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/debugging-with-real-time-terminal
|
||||
- Use nordic logging for DEBUG_MSG
|
||||
- use the Jumper simulator to run meshes of simulated hardware: https://docs.jumper.io/docs/install.html
|
||||
- make/find a multithread safe debug logging class (include remote logging and timestamps and levels). make each log event atomic.
|
||||
- turn on freertos stack size checking
|
||||
- Currently we use Nordic's vendor ID, which is apparently okay: https://devzone.nordicsemi.com/f/nordic-q-a/44014/using-nordic-vid-and-pid-for-nrf52840 and I just picked a PID of 0x4403
|
||||
- Use NRF logger module (includes flash logging etc...) instead of DEBUG_MSG
|
||||
- Use "LED softblink" library on NRF52 to do nice pretty "breathing" LEDs. Don't whack LED from main thread anymore.
|
||||
- decrease BLE xmit power "At 0dBm with the DC/DC on, the nRF52832 transmitter draws 5.3mA. Increasing the TX power to +4dBm adds only 2.2mA. Decreasing it to -40 dBm saves only 2.6mA."
|
||||
- in addition to the main CPU watchdog, use the PMU watchdog as a really big emergency hammer
|
||||
- turn on 'shipping mode' in the PMU when device is 'off' - to cut battery draw to essentially zero
|
||||
- make Lorro_BQ25703A read/write operations atomic, current version could let other threads sneak in (once we start using threads)
|
||||
- make the segger logbuffer larger, move it to RAM that is preserved across reboots and support reading it out at runtime (to allow full log messages to be included in crash reports). Share this code with ESP32 (use gcc noinit attribute)
|
||||
- convert hardfaults/panics/asserts/wd exceptions into fault codes sent to phone
|
||||
- stop enumerating all i2c devices at boot, it wastes power & time
|
||||
- consider using "SYSTEMOFF" deep sleep mode, without RAM retension. Only useful for 'truly off - wake only by button press' only saves 1.5uA vs SYSTEMON. (SYSTEMON only costs 1.5uA). Possibly put PMU into shipping mode?
|
||||
- change the BLE protocol to be more symmetric. Have the phone _also_ host a GATT service which receives writes to
|
||||
'fromradio'. This would allow removing the 'fromnum' mailbox/notify scheme of the current approach and decrease the number of packet handoffs when a packet is received.
|
||||
- Using the preceeding, make a generalized 'nrf52/esp32 ble to internet' bridge service. To let nrf52 apps do MQTT/UDP/HTTP POST/HTTP GET operations to web services.
|
||||
- lower advertise interval to save power, lower ble transmit power to save power
|
||||
- the SX126x class does SPI transfers on a byte by byte basis, which is very ineffecient. Much better to do block writes/reads.
|
||||
|
||||
## Old unorganized notes
|
||||
|
||||
## Notes on PCA10059 Dongle
|
||||
|
||||
- docs: https://infocenter.nordicsemi.com/pdf/nRF52840_Dongle_User_Guide_v1.0.pdf
|
||||
|
||||
- Currently using Nordic PCA10059 Dongle hardware
|
||||
- https://community.platformio.org/t/same-bootloader-same-softdevice-different-board-different-pins/11411/9
|
||||
|
||||
- To make Segger JLink more reliable, turn off its fake filesystem. "JLinkExe MSDDisable" per https://learn.adafruit.com/circuitpython-on-the-nrf52/nrf52840-bootloader
|
||||
|
||||
## Done
|
||||
|
||||
- DONE add "DFU trigger library" to application load
|
||||
- DONE: using this: Possibly use this bootloader? https://github.com/adafruit/Adafruit_nRF52_Bootloader
|
||||
- DONE select and install a bootloader (adafruit)
|
||||
- DONE get old radio driver working on NRF52
|
||||
- DONE basic test of BLE
|
||||
- DONE get a debug 'serial' console working via the ICE passthrough feature
|
||||
- DONE switch to RadioLab? test it with current radio. https://github.com/jgromes/RadioLib
|
||||
- DONE change rx95 to radiolib
|
||||
- DONE track rxbad, rxgood, txgood
|
||||
- DONE neg 7 error code from receive
|
||||
- DONE remove unused sx1262 lib from github
|
||||
- at boot we are starting our message IDs at 1, rather we should start them at a random number. also, seed random based on timer. this could be the cause of our first message not seen bug.
|
||||
- add a NMEA based GPS driver to test GPS
|
||||
- DONE use "variants" to get all gpio bindings
|
||||
- DONE plug in correct variants for the real board
|
||||
- turn on DFU assistance in the appload using the nordic DFU helper lib call
|
||||
- make a new boarddef with a variant.h file. Fix pins in that file. In particular (at least):
|
||||
#define PIN_SPI_MISO (46)
|
||||
#define PIN_SPI_MOSI (45)
|
||||
#define PIN_SPI_SCK (47)
|
||||
#define PIN_WIRE_SDA (26)
|
||||
#define PIN_WIRE_SCL (27)
|
||||
- customize the bootloader to use proper button bindings
|
||||
- remove the MeshRadio wrapper - we don't need it anymore, just do everything in RadioInterface subclasses.
|
||||
- DONE use SX126x::startReceiveDutyCycleAuto to save power by sleeping and briefly waking to check for preamble bits. Change xmit rules to have more preamble bits.
|
||||
- scheduleOSCallback doesn't work yet - it is way too fast (causes rapid polling of busyTx, high power draw etc...)
|
||||
- find out why we reboot while debugging - it was bluetooth/softdevice
|
||||
- make a file system implementation (preferably one that can see the files the bootloader also sees) - preferably https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/master/libraries/InternalFileSytem/examples/Internal_ReadWrite/Internal_ReadWrite.ino else use https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fds_usage.html?cp=7_5_0_3_55_3
|
||||
- change packet numbers to be 32 bits
|
||||
|
||||
```
|
||||
|
||||
/*
|
||||
per
|
||||
https://docs.platformio.org/en/latest/tutorials/nordicnrf52/arduino_debugging_unit_testing.html
|
||||
|
||||
ardunino github is here https://github.com/sandeepmistry/arduino-nRF5
|
||||
devboard hw docs here:
|
||||
https://infocenter.nordicsemi.com/topic/ug_nrf52840_dk/UG/nrf52840_DK/hw_buttons_leds.html?cp=4_0_4_7_6
|
||||
|
||||
https://docs.platformio.org/en/latest/boards/nordicnrf52/nrf52840_dk_adafruit.html
|
||||
|
||||
must install adafruit bootloader first!
|
||||
https://learn.adafruit.com/circuitpython-on-the-nrf52/nrf52840-bootloader
|
||||
see link above and turn off jlink filesystem if we see unreliable serial comms
|
||||
over USBCDC
|
||||
|
||||
adafruit bootloader install commands (from their readme)
|
||||
kevinh@kevin-server:~/.platformio/packages/framework-arduinoadafruitnrf52/bootloader$
|
||||
nrfjprog -e -f nrf52 Erasing user available code and UICR flash areas. Applying
|
||||
system reset.
|
||||
kevinh@kevin-server:~/.platformio/packages/framework-arduinoadafruitnrf52/bootloader$
|
||||
nrfjprog --program pca10056/pca10056_bootloader-0.3.2_s140_6.1.1.hex -f nrf52
|
||||
Parsing hex file.
|
||||
Reading flash area to program to guarantee it is erased.
|
||||
Checking that the area to write is not protected.
|
||||
Programming device.
|
||||
kevinh@kevin-server:~/.platformio/packages/framework-arduinoadafruitnrf52/bootloader$
|
||||
nrfjprog --reset -f nrf52 Applying system reset. Run.
|
||||
|
||||
install jlink tools from here:
|
||||
https://www.segger.com/downloads/jlink#J-LinkSoftwareAndDocumentationPack
|
||||
|
||||
install nrf tools from here:
|
||||
https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Command-Line-Tools/Download#infotabs
|
||||
|
||||
examples of turning off the loop call to save power:
|
||||
https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/advertising-beacon
|
||||
|
||||
example of a more complex BLE service:
|
||||
https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/custom-hrm
|
||||
*/
|
||||
|
||||
// See g_ADigitalPinMap to see how arduino maps to the real gpio#s - and all in
|
||||
// P0
|
||||
#define LED1 14
|
||||
#define LED2 13
|
||||
|
||||
/*
|
||||
good led ble demo:
|
||||
https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/master/libraries/Bluefruit52Lib/examples/Peripheral/nrf_blinky/nrf_blinky.ino
|
||||
*/
|
||||
```
|
||||
27
docs/software/pinetab.md
Normal file
27
docs/software/pinetab.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Pinetab
|
||||
|
||||
These are **preliminary** notes on support for Meshtastic in the Pinetab.
|
||||
|
||||
A RF95 is connected via a CS341 USB-SPI chip.
|
||||
|
||||
Pin assignments:
|
||||
CS0 from RF95 goes to CS0 on CS341
|
||||
DIO0 from RF95 goes to INT on CS341
|
||||
RST from RF95 goes to RST on CS341
|
||||
|
||||
This linux driver claims to provide USB-SPI support: https://github.com/gschorcht/spi-ch341-usb
|
||||
Notes here on using that driver: https://www.linuxquestions.org/questions/linux-hardware-18/ch341-usb-to-spi-adaptor-driver-doesn%27t-work-4175622736/
|
||||
|
||||
Or if **absolutely** necessary could bitbang: https://www.cnx-software.com/2018/02/16/wch-ch341-usb-to-serial-chip-gets-linux-driver-to-control-gpios-over-usb/
|
||||
|
||||
## Task list
|
||||
|
||||
* Port meshtastic to build (under platformio) for a poxix target. spec: no screen, no gpios, sim network interface, posix threads, posix semaphores & queues, IO to the console only
|
||||
Use ARM linux: https://platformio.org/platforms/linux_arm
|
||||
And linux native: https://platformio.org/platforms/native
|
||||
|
||||
* Test cs341 driver - just test reading/writing a register and detecting interrupts, confirm can see rf95
|
||||
* Make a radiolib spi module that targets the cs341 (and builds on linux)
|
||||
* use new radiolib module to hook pinebook lora to meshtastic, confirm mesh discovery works
|
||||
* Make a subclass of StreamAPI that works as a posix TCP server
|
||||
* Use new TCP endpoint from meshtastic-python
|
||||
98
docs/software/power.md
Normal file
98
docs/software/power.md
Normal file
@@ -0,0 +1,98 @@
|
||||
# Power Management State Machine
|
||||
|
||||
i.e. sleep behavior
|
||||
|
||||
## Power measurements
|
||||
|
||||
Since one of the main goals of this project is long battery life, it is important to consider that in our software/protocol design. Based on initial measurements it seems that the current code should run about three days between charging, and with a bit more software work (see the [TODO list](TODO.md)) a battery life of eight days should be quite doable. Our current power measurements/model is in [this spreadsheet](https://docs.google.com/spreadsheets/d/1ft1bS3iXqFKU8SApU8ZLTq9r7QQEGESYnVgdtvdT67k/edit?usp=sharing).
|
||||
|
||||
## States
|
||||
|
||||
From lower to higher power consumption.
|
||||
|
||||
- Super-deep-sleep (SDS) - everything is off, CPU, radio, bluetooth, GPS. Only wakes due to timer or button press. We enter this mode only after no radio comms for a few hours, used to put the device into what is effectively "off" mode.
|
||||
onEntry: setBluetoothOn(false), call doDeepSleep
|
||||
onExit: (standard bootup code, starts in DARK)
|
||||
|
||||
- deep-sleep (DS) - CPU is off, radio is on, bluetooth and GPS is off. Note: This mode is never used currently, because it only saves 1.5mA vs light-sleep
|
||||
(Not currently used)
|
||||
|
||||
- light-sleep (LS) - CPU is suspended (RAM stays alive), radio is on, bluetooth is off, GPS is off. Note: currently GPS is not turned
|
||||
off during light sleep, but there is a TODO item to fix this.
|
||||
NOTE: On NRF52 platforms (because CPU current draw is so low), light-sleep state is never used.
|
||||
onEntry: setBluetoothOn(false), setGPSPower(false), doLightSleep()
|
||||
onIdle: (if we wake because our led blink timer has expired) blink the led then go back to sleep until we sleep for ls_secs
|
||||
onExit: setGPSPower(true), start trying to get gps lock: gps.startLock(), once lock arrives service.sendPosition(BROADCAST)
|
||||
|
||||
- No bluetooth (NB) - CPU is running, radio is on, GPS is on but bluetooth is off, screen is off.
|
||||
onEntry: setBluetoothOn(false)
|
||||
onExit:
|
||||
|
||||
- running dark (DARK) - Everything is on except screen
|
||||
onEntry: setBluetoothOn(true)
|
||||
onExit:
|
||||
|
||||
- serial API usage (SERIAL) - Screen is on, device doesn't sleep, bluetooth off
|
||||
onEntry: setBluetooth off, screen on
|
||||
onExit:
|
||||
|
||||
- full on (ON) - Everything is on, can eventually timeout and lower to a lower power state
|
||||
onEntry: setBluetoothOn(true), screen.setOn(true)
|
||||
onExit: screen->setOn(false)
|
||||
|
||||
- has power (POWER) - Screen is on, device doesn't sleep, bluetooth on, will stay in this state as long as we have power
|
||||
onEntry: setBluetooth off, screen on
|
||||
onExit:
|
||||
|
||||
## Behavior
|
||||
|
||||
### events that increase CPU activity
|
||||
|
||||
- At cold boot: The initial state (after setup() has run) is DARK
|
||||
- While in DARK: if we receive EVENT_BOOT, transition to ON (and show the bootscreen). This event will be sent if we detect we woke due to reset (as opposed to deep sleep)
|
||||
- While in LS: Once every position_broadcast_secs (default 15 mins) - the unit will wake into DARK mode and broadcast a "networkPing" (our position) and stay alive for wait_bluetooth_secs (default 30 seconds). This allows other nodes to have a record of our last known position if we go away and allows a paired phone to hear from us and download messages.
|
||||
- While in LS: Every send*owner_interval (defaults to 4, i.e. one hour), when we wake to send our position we \_also* broadcast our owner. This lets new nodes on the network find out about us or correct duplicate node number assignments.
|
||||
- While in LS/NB/DARK: If the user presses a button (EVENT_PRESS) we go to full ON mode for screen_on_secs (default 30 seconds). Multiple presses keeps resetting this timeout
|
||||
- While in LS/NB/DARK: If we receive new text messages (EVENT_RECEIVED_TEXT_MSG), we go to full ON mode for screen_on_secs (same as if user pressed a button)
|
||||
- While in LS: while we receive packets on the radio (EVENT_RECEIVED_PACKET) we will wake and handle them and stay awake in NB mode for min_wake_secs (default 10 seconds)
|
||||
- While in NB: If we do have packets the phone (EVENT_PACKETS_FOR_PHONE) would want we transition to DARK mode for wait_bluetooth secs.
|
||||
- While in DARK/ON: If we receive EVENT_BLUETOOTH_PAIR we transition to ON and start our screen_on_secs timeout
|
||||
- While in NB/DARK/ON: If we receive EVENT_NODEDB_UPDATED we transition to ON (so the new screen can be shown)
|
||||
- While in DARK: While the phone talks to us over BLE (EVENT_CONTACT_FROM_PHONE) reset any sleep timers and stay in DARK (needed for bluetooth sw update and nice user experience if the user is reading/replying to texts)
|
||||
- while in LS/NB/DARK: if SERIAL_CONNECTED, go to serial
|
||||
- while in any state: if we have AC power, go to POWER
|
||||
|
||||
### events that decrease cpu activity
|
||||
|
||||
- While in POWER: if lose AC go to ON
|
||||
- While in SERIAL: if SERIAL_DISCONNECTED, go to NB
|
||||
- While in ON: If PRESS event occurs, reset screen_on_secs timer and tell the screen to handle the pess
|
||||
- While in ON: If it has been more than screen_on_secs since a press, lower to DARK
|
||||
- While in DARK: If time since last contact by our phone exceeds phone_timeout_secs (15 minutes), we transition down into NB mode
|
||||
- While in DARK or NB: If nothing above is forcing us to stay in a higher mode (wait_bluetooth_secs, min_wake_secs) we will lower down to LS state
|
||||
- While in LS: If either phone_sds_timeout_secs (default 2 hr) or mesh_sds_timeout_secs (default 2 hr) are exceeded we will lower into SDS mode for sds_secs (default 1 yr) (or a button press). (Note: phone_sds_timeout_secs is currently disabled for now, because most users
|
||||
are using without a phone)
|
||||
- Any time we enter LS mode: We stay in that until an interrupt, button press or other state transition. Every ls_secs (default 1 hr) and let the arduino loop() run one iteration (FIXME, not sure if we need this at all), and then immediately reenter lightsleep mode on the CPU.
|
||||
|
||||
TODO: Eventually these scheduled intervals should be synchronized to the GPS clock, so that we can consider leaving the lora receiver off to save even more power.
|
||||
TODO: In NB mode we should put cpu into light sleep any time we really aren't that busy (without declaring LS state) - i.e. we should leave GPS on etc...
|
||||
|
||||
# Low power consumption tasks
|
||||
|
||||
General ideas to hit the power draws our spreadsheet predicts. Do the easy ones before beta, the last 15% can be done after 1.0.
|
||||
|
||||
- don't even power on the gps until someone else wants our position, just stay in lora deep sleep until press or rxpacket (except for once an hour updates)
|
||||
- (possibly bad idea - better to have lora radio always listen - check spreadsheet) have every node wake at the same tick and do their position syncs then go back to deep sleep
|
||||
- lower BT announce interval to save battery
|
||||
- change to use RXcontinuous mode and config to drop packets with bad CRC (see section 6.4 of datasheet) - I think this is already the case
|
||||
- have mesh service run in a thread that stays blocked until a packet arrives from the RF95
|
||||
- platformio sdkconfig CONFIG_PM and turn on modem sleep mode
|
||||
- keep cpu 100% in deepsleep until irq from radio wakes it. Then stay awake for 30 secs to attempt delivery to phone.
|
||||
- use https://lastminuteengineers.com/esp32-sleep-modes-power-consumption/ association sleep pattern to save power - but see https://github.com/espressif/esp-idf/issues/2070 and https://esp32.com/viewtopic.php?f=13&t=12182 it seems with BLE on the 'easy' draw people are getting is 80mA
|
||||
- stop using loop() instead use a job queue and let cpu sleep
|
||||
- measure power consumption and calculate battery life assuming no deep sleep
|
||||
- do lowest sleep level possible where BT still works during normal sleeping, make sure cpu stays in that mode unless lora rx packet happens, bt rx packet happens or button press happens
|
||||
- optionally do lora messaging only during special scheduled intervals (unless nodes are told to go to low latency mode), then deep sleep except during those intervals - before implementing calculate what battery life would be with this feature
|
||||
- see section 7.3 of https://cdn.sparkfun.com/assets/learn_tutorials/8/0/4/RFM95_96_97_98W.pdf and have hope radio wake only when a valid packet is received. Possibly even wake the ESP32 from deep sleep via GPIO.
|
||||
- never enter deep sleep while connected to USB power (but still go to other low power modes)
|
||||
- when main cpu is idle (in loop), turn cpu clock rate down and/or activate special sleep modes. We want almost everything shutdown until it gets an interrupt.
|
||||
6
docs/software/rak815.md
Normal file
6
docs/software/rak815.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# RAK815
|
||||
|
||||
Notes on trying to get the RAK815 working with meshtastic.
|
||||
|
||||
good tutorial: https://www.hackster.io/naresh-krish/getting-started-with-rak815-tracker-module-and-arduino-1c7bc9
|
||||
(includes software serial link - possibly useful for GPS)
|
||||
202
docs/software/ramusage-nrf52.txt
Normal file
202
docs/software/ramusage-nrf52.txt
Normal file
@@ -0,0 +1,202 @@
|
||||
23K + messages
|
||||
+ heap of 70ish packets, 300ish bytes per packet: 20KB
|
||||
+ 14KB soft device RAM
|
||||
|
||||
With max length Data inside the packet
|
||||
Size of NodeInfo 104
|
||||
Size of SubPacket 272
|
||||
Size of MeshPacket 304
|
||||
|
||||
If Data was smaller: for 70 data packets we would save 7KB. We would need to make SubPacket.data and MeshPacket.encrypted into "type:FT_POINTER" - variably sized mallocs
|
||||
Size of NodeInfo 104
|
||||
Size of SubPacket 96
|
||||
Size of MeshPacket 292 (could have been much smaller but I forgot to shrink MeshPacket.encrypted)
|
||||
|
||||
therefore:
|
||||
a) we should store all ToPhone message queued messages compressed as protobufs (since they will become that anyways)
|
||||
b) shrink packet pool size because none of that storage will be used for ToPhone packets
|
||||
c) don't allocate any storage in RAM for the tophone messages we save inside device state, instead just use nanopb callbacks to save/load those
|
||||
d) a smarter MeshPacket in memory representation would save about 7KB of RAM. call pb_release before freeing each freshly malloced MeshPacket
|
||||
|
||||
- nrf52 free memory https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/hathach-memory-map
|
||||
|
||||
2000790c 00003558 B devicestate // 16KB
|
||||
2000b53c 00001000 b _cache_buffer // 4KB flash filesystem support
|
||||
20003b1c 000006b0 B console
|
||||
2000d5f4 00000400 b vApplicationGetTimerTaskMemory::uxTimerTaskStack
|
||||
2000da04 00000400 b _acUpBuffer
|
||||
2000c558 0000036c B Bluefruit
|
||||
2000c8d8 00000358 b _cdcd_itf
|
||||
2000e54c 00000258 B _midid_itf
|
||||
2000d0dc 00000200 b ucStaticTimerQueueStorage.9390
|
||||
2000e044 00000200 b _mscd_buf
|
||||
2000e284 000001cc b _vendord_itf
|
||||
2000d410 00000190 b vApplicationGetIdleTaskMemory::uxIdleTaskStack
|
||||
2000374c 0000016c D __global_locale
|
||||
2000de48 0000012c B USBDevice
|
||||
2000afa4 00000100 b Router::send(_MeshPacket*)::bytes
|
||||
2000aea4 00000100 b Router::perhapsDecode(_MeshPacket*)::bytes
|
||||
200039b0 000000f4 B powerFSM
|
||||
20004258 000000f0 B screen
|
||||
2000cd7c 000000c4 b _dcd
|
||||
2000cc68 000000c0 b _usbd_qdef_buf
|
||||
2000b3c4 000000bc B Wire
|
||||
2000cef4 000000a8 B Serial2
|
||||
2000ce4c 000000a8 B Serial1
|
||||
2000e498 000000a8 B _SEGGER_RTT
|
||||
2000b498 000000a4 B InternalFS
|
||||
2000dfb8 0000008c b _hidd_itf
|
||||
2000b260 00000088 b meshtastic::normalFrames
|
||||
2000cfdc 00000064 b pxReadyTasksLists
|
||||
2000b340 00000060 b meshtastic::drawTextMessageFrame(OLEDDisplay*, OLEDDisplayUiState*, short, short)::tempBuf
|
||||
200036ec 00000060 d impure_data
|
||||
2000b104 00000060 B bledfu
|
||||
2000b0a4 00000060 B blebas
|
||||
20003684 00000058 D _usbd_qdef
|
||||
200038c0 00000058 d tzinfo
|
||||
2000d5a0 00000054 b vApplicationGetTimerTaskMemory::xTimerTaskTCB
|
||||
2000d3bc 00000054 b vApplicationGetIdleTaskMemory::xIdleTaskTCB
|
||||
2000d308 00000050 b xStaticTimerQueue.9389
|
||||
2000b1f4 00000050 B hrmc
|
||||
2000b1a4 00000050 B bslc
|
||||
20004360 0000004c B service
|
||||
2000d374 00000048 b m_cb
|
||||
2000df74 00000042 b _desc_str
|
||||
2000cd3c 00000040 b _usbd_ctrl_buf
|
||||
20004214 00000040 B realRouter
|
||||
2000e244 00000040 b _mscd_itf
|
||||
2000b164 00000040 B bledis
|
||||
20003634 00000038 d _InternalFSConfig
|
||||
2000cc30 00000031 b _usbd_dev
|
||||
2000398c 00000020 B periodicScheduler
|
||||
2000cfa4 00000020 b callbacksInt
|
||||
2000de10 0000001f b fw_str.13525
|
||||
20003974 00000018 b object.9934
|
||||
2000ae68 00000018 B nodeDB
|
||||
2000366c 00000018 d _cache
|
||||
2000b314 00000014 b meshtastic::drawNodeInfo(OLEDDisplay*, OLEDDisplayUiState*, short, short)::signalStr
|
||||
2000b300 00000014 b meshtastic::drawNodeInfo(OLEDDisplay*, OLEDDisplayUiState*, short, short)::lastStr
|
||||
2000b2ec 00000014 b meshtastic::drawNodeInfo(OLEDDisplay*, OLEDDisplayUiState*, short, short)::distStr
|
||||
200041e0 00000014 b getDeviceName()::name
|
||||
2000d0b8 00000014 b xTasksWaitingTermination
|
||||
2000d0a4 00000014 b xSuspendedTaskList
|
||||
2000d08c 00000014 b xPendingReadyList
|
||||
2000d06c 00000014 b xDelayedTaskList2
|
||||
2000d058 00000014 b xDelayedTaskList1
|
||||
2000d2f0 00000014 b xActiveTimerList2
|
||||
2000d2dc 00000014 b xActiveTimerList1
|
||||
2000b480 00000014 B SPI
|
||||
2000c8c4 00000014 B Serial
|
||||
2000cd28 00000014 b _ctrl_xfer
|
||||
2000de30 00000011 b serial_str.13534
|
||||
2000c544 00000010 b BLEAdvertising::_start(unsigned short, unsigned short)::gap_adv
|
||||
20003614 00000010 d meshtastic::btPIN
|
||||
2000434c 00000010 b sendOwnerPeriod
|
||||
2000ae8c 00000010 b staticPool
|
||||
2000e484 00000010 B xQueueRegistry
|
||||
20003b04 00000010 B stateSERIAL
|
||||
20003af4 00000010 B stateSDS
|
||||
20003ae4 00000010 B stateON
|
||||
20003ad4 00000010 B stateNB
|
||||
20003ac4 00000010 B stateLS
|
||||
20003ab4 00000010 B stateDARK
|
||||
20003aa4 00000010 B stateBOOT
|
||||
200041f8 00000010 B ledPeriodic
|
||||
2000b244 00000010 B hrms
|
||||
2000d9f4 00000010 b _acDownBuffer
|
||||
2000b3b8 0000000c B preflightSleep
|
||||
20004208 0000000c B powerStatus
|
||||
2000e540 0000000c B nrf_nvic_state
|
||||
2000b3ac 0000000c B notifySleep
|
||||
2000b3a0 0000000c B notifyDeepSleep
|
||||
2000e463 0000000b b __tzname_std
|
||||
2000e458 0000000b b __tzname_dst
|
||||
2000b338 00000008 b meshtastic::estimatedHeading(double, double)::oldLon
|
||||
2000b330 00000008 b meshtastic::estimatedHeading(double, double)::oldLat
|
||||
200041d0 00000008 b zeroOffsetSecs
|
||||
2000ae80 00000008 b spiSettings
|
||||
200038b8 00000008 D _tzname
|
||||
20003b14 00000008 B noopPrint
|
||||
2000cfc4 00000008 b channelMap
|
||||
2000cf9c 00000008 b callbackDeferred
|
||||
200043ac 00000006 b ourMacAddr
|
||||
2000435c 00000004 b MeshService::onGPSChanged(void*)::lastGpsSend
|
||||
2000b32c 00000004 b meshtastic::estimatedHeading(double, double)::b
|
||||
2000b328 00000004 b meshtastic::drawNodeInfo(OLEDDisplay*, OLEDDisplayUiState*, short, short)::simRadian
|
||||
2000362c 00000004 d meshtastic::Screen::setup()::bootFrames
|
||||
20003628 00000004 d meshtastic::Screen::handleStartBluetoothPinScreen(unsigned long)::btFrames
|
||||
200039ac 00000004 b onEnter()::lastPingMs
|
||||
2000ae9c 00000004 b generatePacketId()::i
|
||||
2000ae88 00000004 B RadioLibInterface::instance
|
||||
2000b2e8 00000004 b meshtastic::nodeIndex
|
||||
20003610 00000004 d meshtastic::targetFramerate
|
||||
2000c554 00000004 B BLEService::lastService
|
||||
200041cc 00000004 b timeStartMsec
|
||||
200036dc 00000004 d sbrk_heap_top
|
||||
2000d364 00000004 b _loopHandle
|
||||
2000c540 00000004 b guard variable for BLEAdvertising::_start(unsigned short, unsigned short)::gap_adv
|
||||
2000d0d0 00000004 b xYieldPending
|
||||
2000d35c 00000004 b xTimerTaskHandle
|
||||
2000d358 00000004 b xTimerQueue
|
||||
2000d0cc 00000004 b xTickCount
|
||||
2000d0a0 00000004 b xSchedulerRunning
|
||||
2000d088 00000004 b xNumOfOverflows
|
||||
2000d084 00000004 b xNextTaskUnblockTime
|
||||
2000d304 00000004 b xLastTime.9343
|
||||
2000d080 00000004 b xIdleTaskHandle
|
||||
2000d054 00000004 b uxTopReadyPriority
|
||||
2000d050 00000004 b uxTaskNumber
|
||||
2000d04c 00000004 b uxSchedulerSuspended
|
||||
2000d048 00000004 b uxPendedTicks
|
||||
2000d044 00000004 b uxDeletedTasksWaitingCleanUp
|
||||
2000d040 00000004 b uxCurrentNumberOfTasks
|
||||
2000d360 00000004 b uxCriticalNesting
|
||||
2000cc64 00000004 b _usbd_q
|
||||
2000e478 00000004 B _timezone
|
||||
200036e0 00000004 D SystemCoreClock
|
||||
2000c53c 00000004 b _sem
|
||||
2000d0d8 00000004 b pxOverflowTimerList
|
||||
2000cfd8 00000004 b pxOverflowDelayedTaskList
|
||||
2000cfd4 00000004 b pxDelayedTaskList
|
||||
2000d0d4 00000004 b pxCurrentTimerList
|
||||
2000cfd0 00000004 B pxCurrentTCB
|
||||
2000e470 00000004 b prev_tzenv
|
||||
2000360c 00000004 D preftmp
|
||||
20003608 00000004 D preffile
|
||||
2000b25c 00000004 B nrf52Bluetooth
|
||||
2000d370 00000004 b m_usbevt_handler
|
||||
2000d36c 00000004 b m_sleepevt_handler
|
||||
2000d368 00000004 b m_pofwarn_handler
|
||||
2000e454 00000004 B __malloc_sbrk_start
|
||||
2000e450 00000004 B __malloc_free_list
|
||||
2000e480 00000004 B MAIN_MonCnt
|
||||
2000e47c 00000004 b initial_env
|
||||
200036e8 00000004 D _impure_ptr
|
||||
200041d8 00000004 B gps
|
||||
2000e7a4 00000004 B errno
|
||||
20003918 00000004 D environ
|
||||
2000cfcc 00000004 b enabled
|
||||
2000ae64 00000004 B displayedNodeNum
|
||||
2000e474 00000004 B _daylight
|
||||
2000b254 00000004 B crypto
|
||||
2000ce44 00000004 B count_duration
|
||||
2000de0c 00000004 b _cb_task
|
||||
2000de08 00000004 b _cb_queue
|
||||
2000de04 00000004 b _cb_qdepth
|
||||
2000de44 00000004 B bootloaderVersion
|
||||
200041f5 00000001 b ledBlinker()::ledOn
|
||||
20003604 00000001 d loop::showingBootScreen
|
||||
200041f4 00000001 b loop::wasPressed
|
||||
2000b494 00000001 b DefaultFontTableLookup(unsigned char)::LASTCHAR
|
||||
2000aea0 00000001 b generatePacketId()::didInit
|
||||
20003624 00000001 d meshtastic::prevFrame
|
||||
2000b258 00000001 b bleOn
|
||||
200041dc 00000001 B timeSetFromGPS
|
||||
20004348 00000001 B ssd1306_found
|
||||
2000ce49 00000001 B pin_sound
|
||||
2000e494 00000001 B nrfx_power_irq_enabled
|
||||
2000ce48 00000001 B no_stop
|
||||
20003630 00000001 D neo6M
|
||||
2000ce40 00000001 b _initialized
|
||||
200036e4 00000001 D __fdlib_version
|
||||
20003970 00000001 b completed.9929
|
||||
148
docs/software/read-error.txt
Normal file
148
docs/software/read-error.txt
Normal file
@@ -0,0 +1,148 @@
|
||||
nimble stress test error (private notes for @geeksville)
|
||||
|
||||
findings:
|
||||
only happens when stress testing multiple sleepwake cycles?
|
||||
failed packets all have initial mbuflen of zero (should be 1)
|
||||
restarting the connection on phone sometimes (but not always) fixes it (is the larger config nonce pushing packet size up too large?)
|
||||
- packets >= 79 bytes (FromRadio) cause INVALID_OFFSET (7) gatt errors to be sent to the app
|
||||
- some packets are missing
|
||||
|
||||
theory:
|
||||
some sort of leak in mbuf storage during unfortunately timed sleep shutdowns
|
||||
|
||||
|
||||
device side
|
||||
|
||||
|
||||
connection updated; status=0 handle=0 our_ota_addr_type=0 our_ota_addr=00:24:62:ab:dd:df
|
||||
our_id_addr_type=0 our_id_addr=00:24:62:ab:dd:df
|
||||
peer_ota_addr_type=0 peer_ota_addr=00:7c:d9:5c:ba:2e
|
||||
peer_id_addr_type=0 peer_id_addr=00:7c:d9:5c:ba:2e
|
||||
conn_itvl=36 conn_latency=0 supervision_timeout=500 encrypted=1 authenticated=1 bonded=1
|
||||
|
||||
BLE fromRadio called
|
||||
getFromRadio, !available
|
||||
toRadioWriteCb data 0x3ffc3d72, len 4
|
||||
Trigger powerFSM 9
|
||||
Transition powerFSM transition=Contact from phone, from=DARK to=DARK
|
||||
Client wants config, nonce=6864
|
||||
Reset nodeinfo read pointer
|
||||
toRadioWriteCb data 0x3ffc3d72, len 4
|
||||
Trigger powerFSM 9
|
||||
Transition powerFSM transition=Contact from phone, from=DARK to=DARK
|
||||
Client wants config, nonce=6863
|
||||
Reset nodeinfo read pointer
|
||||
BLE fromRadio called
|
||||
getFromRadio, state=2
|
||||
encoding toPhone packet to phone variant=3, 50 bytes
|
||||
BLE fromRadio called
|
||||
getFromRadio, state=3
|
||||
encoding toPhone packet to phone variant=6, 83 bytes
|
||||
BLE fromRadio called
|
||||
getFromRadio, state=4
|
||||
Sending nodeinfo: num=0xabdddf38, lastseen=1595606850, id=!2462abdddf38, name=Bob b
|
||||
encoding toPhone packet to phone variant=4, 67 bytes
|
||||
BLE fromRadio called
|
||||
getFromRadio, state=4
|
||||
Sending nodeinfo: num=0x28b200b4, lastseen=1595606804, id=!246f28b200b4, name=Unknown 00b4
|
||||
encoding toPhone packet to phone variant=4, 80 bytes
|
||||
BLE fromRadio called
|
||||
getFromRadio, state=4
|
||||
Sending nodeinfo: num=0xabf84098, lastseen=1593680756, id=!2462abf84098, name=bx n
|
||||
encoding toPhone packet to phone variant=4, 72 bytes
|
||||
BLE fromRadio called
|
||||
getFromRadio, state=4
|
||||
Sending nodeinfo: num=0x83f0d8e5, lastseen=1594686931, id=!e8e383f0d8e5, name=Unknown d8e5
|
||||
encoding toPhone packet to phone variant=4, 64 bytes
|
||||
BLE fromRadio called
|
||||
getFromRadio, state=4
|
||||
Sending nodeinfo: num=0xd1dc7764, lastseen=1595602082, id=!f008d1dc7764, name=dg
|
||||
encoding toPhone packet to phone variant=4, 52 bytes
|
||||
BLE fromRadio called
|
||||
getFromRadio, state=4
|
||||
Sending nodeinfo: num=0xd1dc7828, lastseen=1595598298, id=!f008d1dc7828, name=ryan
|
||||
encoding toPhone packet to phone variant=4, 54 bytes
|
||||
BLE fromRadio called
|
||||
getFromRadio, state=4
|
||||
Done sending nodeinfos
|
||||
getFromRadio, state=5
|
||||
|
||||
|
||||
|
||||
phone side
|
||||
|
||||
2020-07-24 09:11:00.642 6478-6545/com.geeksville.mesh W/com.geeksville.mesh.service.BluetoothInterface: Attempting reconnect
|
||||
2020-07-24 09:11:00.642 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: Enqueuing work: connect
|
||||
2020-07-24 09:11:00.642 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth$BluetoothContinuation: Starting work: connect
|
||||
2020-07-24 09:11:00.643 6478-6545/com.geeksville.mesh D/BluetoothGatt: connect() - device: 24:62:AB:DD:DF:3A, auto: false
|
||||
2020-07-24 09:11:00.643 6478-6545/com.geeksville.mesh D/BluetoothGatt: registerApp()
|
||||
2020-07-24 09:11:00.643 6478-6545/com.geeksville.mesh D/BluetoothGatt: registerApp() - UUID=026baf7f-d2de-43f1-961f-4e00e04c6fbb
|
||||
2020-07-24 09:11:00.645 6478-27868/com.geeksville.mesh D/BluetoothGatt: onClientRegistered() - status=0 clientIf=4
|
||||
2020-07-24 09:11:01.022 6478-27868/com.geeksville.mesh D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=4 device=24:62:AB:DD:DF:3A
|
||||
2020-07-24 09:11:01.022 6478-27868/com.geeksville.mesh I/com.geeksville.mesh.service.SafeBluetooth: new bluetooth connection state 2, status 0
|
||||
2020-07-24 09:11:01.023 6478-27868/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: work connect is completed, resuming status=0, res=kotlin.Unit
|
||||
2020-07-24 09:11:01.023 6478-6545/com.geeksville.mesh I/com.geeksville.mesh.service.BluetoothInterface: Connected to radio!
|
||||
2020-07-24 09:11:01.023 6478-6545/com.geeksville.mesh D/BluetoothGatt: refresh() - device: 24:62:AB:DD:DF:3A
|
||||
2020-07-24 09:11:01.526 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: Enqueuing work: discover
|
||||
2020-07-24 09:11:01.526 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth$BluetoothContinuation: Starting work: discover
|
||||
2020-07-24 09:11:01.526 6478-6545/com.geeksville.mesh D/BluetoothGatt: discoverServices() - device: 24:62:AB:DD:DF:3A
|
||||
2020-07-24 09:11:01.829 6478-27868/com.geeksville.mesh D/BluetoothGatt: onConnectionUpdated() - Device=24:62:AB:DD:DF:3A interval=6 latency=0 timeout=500 status=0
|
||||
2020-07-24 09:11:02.008 6478-27868/com.geeksville.mesh D/BluetoothGatt: onSearchComplete() = Device=24:62:AB:DD:DF:3A Status=0
|
||||
2020-07-24 09:11:02.009 6478-27868/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: work discover is completed, resuming status=0, res=kotlin.Unit
|
||||
2020-07-24 09:11:02.009 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.BluetoothInterface: Discovered services!
|
||||
2020-07-24 09:11:02.095 6478-27868/com.geeksville.mesh D/BluetoothGatt: onConnectionUpdated() - Device=24:62:AB:DD:DF:3A interval=36 latency=0 timeout=500 status=0
|
||||
2020-07-24 09:11:03.010 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.RadioInterfaceService: Broadcasting connection=true
|
||||
2020-07-24 09:11:03.012 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: Enqueuing work: readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5
|
||||
2020-07-24 09:11:03.012 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth$BluetoothContinuation: Starting work: readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5
|
||||
2020-07-24 09:11:03.012 6478-6478/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: Received broadcast com.geeksville.mesh.CONNECT_CHANGED
|
||||
2020-07-24 09:11:03.012 6478-6478/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: onConnectionChanged=CONNECTED
|
||||
2020-07-24 09:11:03.012 6478-6478/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: Starting config nonce=6878
|
||||
2020-07-24 09:11:03.013 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.BluetoothInterface: queuing 4 bytes to f75c76d2-129e-4dad-a1dd-7866124401e7 *** sending start config
|
||||
2020-07-24 09:11:03.013 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: Enqueuing work: writeC f75c76d2-129e-4dad-a1dd-7866124401e7
|
||||
2020-07-24 09:11:03.015 6478-6478/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: Received broadcast com.geeksville.mesh.CONNECT_CHANGED
|
||||
2020-07-24 09:11:03.015 6478-6478/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: onConnectionChanged=CONNECTED
|
||||
2020-07-24 09:11:03.015 6478-6478/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: Starting config nonce=6877
|
||||
2020-07-24 09:11:03.016 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: device sleep timeout cancelled
|
||||
2020-07-24 09:11:03.016 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.BluetoothInterface: queuing 4 bytes to f75c76d2-129e-4dad-a1dd-7866124401e7
|
||||
2020-07-24 09:11:03.016 6478-6545/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: Enqueuing work: writeC f75c76d2-129e-4dad-a1dd-7866124401e7
|
||||
2020-07-24 09:11:03.130 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth$BluetoothContinuation: Starting work: writeC f75c76d2-129e-4dad-a1dd-7866124401e7
|
||||
2020-07-24 09:11:03.132 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: work readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5 is completed, resuming status=0, res=android.bluetooth.BluetoothGattCharacteristic@556a315
|
||||
2020-07-24 09:11:03.132 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.BluetoothInterface: Done reading from radio, fromradio is empty
|
||||
2020-07-24 09:11:03.132 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: starting setNotify(ed9da18c-a800-4f66-a670-aa7547e34453, true) *** start notify
|
||||
2020-07-24 09:11:03.132 6478-19966/com.geeksville.mesh D/BluetoothGatt: setCharacteristicNotification() - uuid: ed9da18c-a800-4f66-a670-aa7547e34453 enable: true
|
||||
2020-07-24 09:11:03.133 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: Enqueuing work: writeD
|
||||
2020-07-24 09:11:03.220 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth$BluetoothContinuation: Starting work: writeC f75c76d2-129e-4dad-a1dd-7866124401e7
|
||||
2020-07-24 09:11:03.221 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: work writeC f75c76d2-129e-4dad-a1dd-7866124401e7 is completed, resuming status=0, res=android.bluetooth.BluetoothGattCharacteristic@2d2062a
|
||||
2020-07-24 09:11:03.221 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.BluetoothInterface: write of 4 bytes completed
|
||||
2020-07-24 09:11:03.221 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: Enqueuing work: readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5
|
||||
2020-07-24 09:11:03.310 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth$BluetoothContinuation: Starting work: writeD
|
||||
2020-07-24 09:11:03.311 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: work writeC f75c76d2-129e-4dad-a1dd-7866124401e7 is completed, resuming status=0, res=android.bluetooth.BluetoothGattCharacteristic@2d2062a
|
||||
2020-07-24 09:11:03.311 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.BluetoothInterface: write of 4 bytes completed
|
||||
2020-07-24 09:11:03.400 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth$BluetoothContinuation: Starting work: readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5
|
||||
2020-07-24 09:11:03.402 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: work writeD is completed, resuming status=0, res=android.bluetooth.BluetoothGattDescriptor@fc99c1b
|
||||
2020-07-24 09:11:03.402 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: Notify enable=true completed
|
||||
2020-07-24 09:11:03.769 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: work readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5 is completed, resuming status=0, res=android.bluetooth.BluetoothGattCharacteristic@556a315
|
||||
2020-07-24 09:11:03.769 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.BluetoothInterface: Received 80 bytes from radio **** received an 80 byte fromradio. Why did we miss three previous reads?
|
||||
2020-07-24 09:11:03.774 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: Enqueuing work: readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5
|
||||
2020-07-24 09:11:03.774 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth$BluetoothContinuation: Starting work: readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5
|
||||
2020-07-24 09:11:03.774 6478-6478/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: Received broadcast com.geeksville.mesh.RECEIVE_FROMRADIO
|
||||
2020-07-24 09:11:03.776 6478-6478/com.geeksville.mesh E/com.geeksville.mesh.service.MeshService: Invalid Protobuf from radio, len=80 (exception Protocol message had invalid UTF-8.)
|
||||
2020-07-24 09:11:03.776 6478-6478/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: Received broadcast com.geeksville.mesh.RECEIVE_FROMRADIO
|
||||
2020-07-24 09:11:03.776 6478-6478/com.geeksville.mesh E/com.geeksville.mesh.service.MeshService: Invalid Protobuf from radio, len=80 (exception Protocol message had invalid UTF-8.)
|
||||
2020-07-24 09:11:04.031 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: work readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5 is completed, resuming status=0, res=android.bluetooth.BluetoothGattCharacteristic@556a315
|
||||
2020-07-24 09:11:04.031 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.BluetoothInterface: Received 52 bytes from radio *** received 52 bytes - where did the previous two read results go?
|
||||
2020-07-24 09:11:04.033 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: Enqueuing work: readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5
|
||||
2020-07-24 09:11:04.033 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth$BluetoothContinuation: Starting work: readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5
|
||||
2020-07-24 09:11:04.034 6478-6478/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: Received broadcast com.geeksville.mesh.RECEIVE_FROMRADIO
|
||||
2020-07-24 09:11:04.035 6478-6478/com.geeksville.mesh E/com.geeksville.mesh.service.MeshService: Invalid Protobuf from radio, len=52 (exception While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.)
|
||||
2020-07-24 09:11:04.036 6478-6478/com.geeksville.mesh D/com.geeksville.mesh.service.MeshService: Received broadcast com.geeksville.mesh.RECEIVE_FROMRADIO
|
||||
2020-07-24 09:11:04.036 6478-6478/com.geeksville.mesh E/com.geeksville.mesh.service.MeshService: Invalid Protobuf from radio, len=52 (exception While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.)
|
||||
2020-07-24 09:11:04.210 6478-19966/com.geeksville.mesh D/com.geeksville.mesh.service.SafeBluetooth: work readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5 is completed, resuming status=7, res=android.bluetooth.BluetoothGattCharacteristic@556a315 *** read failed
|
||||
2020-07-24 09:11:04.211 6478-19966/com.geeksville.mesh W/com.geeksville.mesh.service.BluetoothInterface: Scheduling reconnect because error during doReadFromRadio - disconnecting, Bluetooth status=7 while doing readC 8ba2bcc2-ee02-4a55-a531-c525c5e454d5
|
||||
2020-07-24 09:11:04.211 6478-6545/com.geeksville.mesh W/com.geeksville.mesh.service.BluetoothInterface: Forcing disconnect and hopefully device will comeback (disabling forced refresh)
|
||||
2020-07-24 09:11:04.211 6478-6545/com.geeksville.mesh I/com.geeksville.mesh.service.SafeBluetooth: Closing our GATT connection
|
||||
2020-07-24 09:11:04.211 6478-6545/com.geeksville.mesh D/BluetoothGatt: cancelOpen() - device: 24:62:AB:DD:DF:3A
|
||||
2020-07-24 09:11:04.214 6478-19966/com.geeksville.mesh D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=4 device=24:62:AB:DD:DF:3A
|
||||
2020-07-24 09:11:04.215 6478-19966/com.geeksville.mesh I/com.geeksville.mesh.service.SafeBluetooth: new bluetooth connection state 0, status 0
|
||||
2020-07-24 09:11:04.215 6478-19966/com.geeksville.mesh I/com.geeksville.mesh.service.SafeBluetooth: Got disconnect because we are shutting down, closing gatt
|
||||
2020-07-24 09:11:04.215 6478-19966/com.geeksville.mesh D/BluetoothGatt: close()
|
||||
9
docs/software/sw-design.md
Normal file
9
docs/software/sw-design.md
Normal file
@@ -0,0 +1,9 @@
|
||||
This is a mini design doc for developing the meshtastic software.
|
||||
|
||||
* [Build instructions](build-instructions.md)
|
||||
* [TODO](TODO.md) - read this if you are looking for things to do (or curious about currently missing features)
|
||||
* Our [project board](https://github.com/orgs/meshtastic/projects/1) - shows what things we are currently working on and remaining work items for the current release.
|
||||
* [Power Management](power.md)
|
||||
* [Mesh algorithm](mesh-alg.md)
|
||||
* [Device API](device-api.md) and porting guide for new clients (iOS, python, etc...)
|
||||
* TODO: how to port the device code to a new device.
|
||||
19
gdbinit
Normal file
19
gdbinit
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
# Setup Monitor Mode Debugging
|
||||
# Per .platformio/packages/framework-arduinoadafruitnrf52-old/cores/nRF5/linker/nrf52840_s140_v6.ld
|
||||
# our appload starts at 0x26000
|
||||
# Disable for now because our version on board doesn't support monitor mode debugging
|
||||
# mon exec SetMonModeDebug=1
|
||||
# mon exec SetMonModeVTableAddr=0x26000
|
||||
|
||||
# echo setting RTTAddr
|
||||
# eval "monitor exec SetRTTAddr %p", &_SEGGER_RTT
|
||||
|
||||
# the jlink debugger seems to want a pause after reset before we tell it to start running
|
||||
define restart
|
||||
echo Restarting
|
||||
monitor reset
|
||||
shell sleep 1
|
||||
cont
|
||||
end
|
||||
|
||||
BIN
images/amazon-fire-button.png
Normal file
BIN
images/amazon-fire-button.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
images/system-info.bin
Normal file
BIN
images/system-info.bin
Normal file
Binary file not shown.
@@ -2,13 +2,11 @@
|
||||
"name": "BluetoothOTA",
|
||||
"keywords": "esp32, bluetooth",
|
||||
"description": "A BTLE based software OTA update tool",
|
||||
"repository":
|
||||
{
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/geeksville/fixme.git"
|
||||
},
|
||||
"authors":
|
||||
[
|
||||
"authors": [
|
||||
{
|
||||
"name": "Kevin Hester",
|
||||
"email": "kevinh@geeksville.com",
|
||||
@@ -20,7 +18,15 @@
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*",
|
||||
"dependencies": [
|
||||
{ "name": "Update" },
|
||||
{ "name": "ESP32 BLE Arduino" }
|
||||
{
|
||||
"name": "Update"
|
||||
},
|
||||
{
|
||||
"name": "ESP32 BLE Arduino"
|
||||
},
|
||||
{
|
||||
"name": "arduino-fsm",
|
||||
"version": "https://github.com/meshtastic/arduino-fsm.git"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
#include "BluetoothUtil.h"
|
||||
#include "BluetoothSoftwareUpdate.h"
|
||||
#include "configuration.h"
|
||||
#include <esp_gatt_defs.h>
|
||||
#include <BLE2902.h>
|
||||
#include <Arduino.h>
|
||||
#include <Update.h>
|
||||
#include <CRC32.h>
|
||||
|
||||
static BLECharacteristic swUpdateTotalSizeCharacteristic("e74dd9c0-a301-4a6f-95a1-f0e1dbea8e1e", BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_READ);
|
||||
static BLECharacteristic swUpdateDataCharacteristic("e272ebac-d463-4b98-bc84-5cc1a39ee517", BLECharacteristic::PROPERTY_WRITE);
|
||||
static BLECharacteristic swUpdateCRC32Characteristic("4826129c-c22a-43a3-b066-ce8f0d5bacc6", BLECharacteristic::PROPERTY_WRITE);
|
||||
static BLECharacteristic swUpdateResultCharacteristic("5e134862-7411-4424-ac4a-210937432c77", BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);
|
||||
|
||||
CRC32 crc;
|
||||
uint32_t rebootAtMsec = 0; // If not zero we will reboot at this time (used to reboot shortly after the update completes)
|
||||
|
||||
class UpdateCallbacks : public BLECharacteristicCallbacks
|
||||
{
|
||||
void onRead(BLECharacteristic *pCharacteristic) {
|
||||
DEBUG_MSG("Got on read\n");
|
||||
}
|
||||
|
||||
void onWrite(BLECharacteristic *pCharacteristic)
|
||||
{
|
||||
// dumpCharacteristic(pCharacteristic);
|
||||
|
||||
if (pCharacteristic == &swUpdateTotalSizeCharacteristic)
|
||||
{
|
||||
// Check if there is enough to OTA Update
|
||||
uint32_t len = getValue32(pCharacteristic, 0);
|
||||
crc.reset();
|
||||
bool canBegin = Update.begin(len);
|
||||
DEBUG_MSG("Setting update size %u, result %d\n", len, canBegin);
|
||||
if(!canBegin)
|
||||
// Indicate failure by forcing the size to 0
|
||||
pCharacteristic->setValue(0UL);
|
||||
}
|
||||
else if (pCharacteristic == &swUpdateDataCharacteristic)
|
||||
{
|
||||
std::string value = pCharacteristic->getValue();
|
||||
uint32_t len = value.length();
|
||||
uint8_t *data = pCharacteristic->getData();
|
||||
// DEBUG_MSG("Writing %u\n", len);
|
||||
crc.update(data, len);
|
||||
Update.write(data, len);
|
||||
}
|
||||
else if (pCharacteristic == &swUpdateCRC32Characteristic)
|
||||
{
|
||||
uint32_t expectedCRC = getValue32(pCharacteristic, 0);
|
||||
DEBUG_MSG("expected CRC %u\n", expectedCRC);
|
||||
|
||||
uint8_t result = 0xff;
|
||||
|
||||
// Check the CRC before asking the update to happen.
|
||||
if(crc.finalize() != expectedCRC) {
|
||||
DEBUG_MSG("Invalid CRC!\n");
|
||||
result = 0xe0; // FIXME, use real error codes
|
||||
}
|
||||
else {
|
||||
if (Update.end())
|
||||
{
|
||||
DEBUG_MSG("OTA done, rebooting in 5 seconds!\n");
|
||||
rebootAtMsec = millis() + 5000;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_MSG("Error Occurred. Error #: %d\n", Update.getError());
|
||||
}
|
||||
result = Update.getError();
|
||||
}
|
||||
swUpdateResultCharacteristic.setValue(&result, 1);
|
||||
swUpdateResultCharacteristic.notify();
|
||||
}
|
||||
else {
|
||||
DEBUG_MSG("unexpected write\n");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void bluetoothRebootCheck() {
|
||||
if(rebootAtMsec && millis() > rebootAtMsec)
|
||||
ESP.restart();
|
||||
}
|
||||
|
||||
static UpdateCallbacks updateCb;
|
||||
|
||||
/*
|
||||
SoftwareUpdateService UUID cb0b9a0b-a84c-4c0d-bdbb-442e3144ee30
|
||||
|
||||
Characteristics
|
||||
|
||||
UUID properties description
|
||||
e74dd9c0-a301-4a6f-95a1-f0e1dbea8e1e write|read total image size, 32 bit, write this first, then read read back to see if it was acceptable (0 mean not accepted)
|
||||
e272ebac-d463-4b98-bc84-5cc1a39ee517 write data, variable sized, recommended 512 bytes, write one for each block of file
|
||||
4826129c-c22a-43a3-b066-ce8f0d5bacc6 write crc32, write last - writing this will complete the OTA operation, now you can read result
|
||||
5e134862-7411-4424-ac4a-210937432c77 read|notify result code, readable but will notify when the OTA operation completes
|
||||
*/
|
||||
BLEService *createUpdateService(BLEServer* server) {
|
||||
// Create the BLE Service
|
||||
BLEService *service = server->createService("cb0b9a0b-a84c-4c0d-bdbb-442e3144ee30");
|
||||
|
||||
addWithDesc(service, &swUpdateTotalSizeCharacteristic, "total image size");
|
||||
addWithDesc(service, &swUpdateDataCharacteristic, "data");
|
||||
addWithDesc(service, &swUpdateCRC32Characteristic, "crc32");
|
||||
addWithDesc(service, &swUpdateResultCharacteristic, "result code");
|
||||
|
||||
swUpdateTotalSizeCharacteristic.setCallbacks(&updateCb);
|
||||
swUpdateDataCharacteristic.setCallbacks(&updateCb);
|
||||
swUpdateCRC32Characteristic.setCallbacks(&updateCb);
|
||||
|
||||
swUpdateResultCharacteristic.addDescriptor(new BLE2902()); // Needed so clients can request notification
|
||||
|
||||
return service;
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
BLEService *createUpdateService(BLEServer* server);
|
||||
|
||||
void bluetoothRebootCheck();
|
||||
@@ -1,228 +0,0 @@
|
||||
#include "BluetoothUtil.h"
|
||||
#include "BluetoothSoftwareUpdate.h"
|
||||
#include <esp_gatt_defs.h>
|
||||
#include <BLE2902.h>
|
||||
#include <Arduino.h>
|
||||
#include <Update.h>
|
||||
#include "configuration.h"
|
||||
#include "screen.h"
|
||||
|
||||
static BLECharacteristic SWVersionCharacteristic(BLEUUID((uint16_t)ESP_GATT_UUID_SW_VERSION_STR), BLECharacteristic::PROPERTY_READ);
|
||||
static BLECharacteristic ManufacturerCharacteristic(BLEUUID((uint16_t)ESP_GATT_UUID_MANU_NAME), BLECharacteristic::PROPERTY_READ);
|
||||
static BLECharacteristic HardwareVersionCharacteristic(BLEUUID((uint16_t)ESP_GATT_UUID_HW_VERSION_STR), BLECharacteristic::PROPERTY_READ);
|
||||
//static BLECharacteristic SerialNumberCharacteristic(BLEUUID((uint16_t) ESP_GATT_UUID_SERIAL_NUMBER_STR), BLECharacteristic::PROPERTY_READ);
|
||||
|
||||
/**
|
||||
* Create standard device info service
|
||||
**/
|
||||
BLEService *createDeviceInfomationService(BLEServer *server, std::string hwVendor, std::string swVersion, std::string hwVersion = "")
|
||||
{
|
||||
BLEService *deviceInfoService = server->createService(BLEUUID((uint16_t)ESP_GATT_UUID_DEVICE_INFO_SVC));
|
||||
|
||||
/*
|
||||
* Mandatory characteristic for device info service?
|
||||
|
||||
BLECharacteristic *m_pnpCharacteristic = m_deviceInfoService->createCharacteristic(ESP_GATT_UUID_PNP_ID, BLECharacteristic::PROPERTY_READ);
|
||||
|
||||
uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version;
|
||||
uint8_t pnp[] = { sig, (uint8_t) (vid >> 8), (uint8_t) vid, (uint8_t) (pid >> 8), (uint8_t) pid, (uint8_t) (version >> 8), (uint8_t) version };
|
||||
m_pnpCharacteristic->setValue(pnp, sizeof(pnp));
|
||||
*/
|
||||
SWVersionCharacteristic.setValue(swVersion);
|
||||
deviceInfoService->addCharacteristic(&SWVersionCharacteristic);
|
||||
ManufacturerCharacteristic.setValue(hwVendor);
|
||||
deviceInfoService->addCharacteristic(&ManufacturerCharacteristic);
|
||||
if (!hwVersion.empty())
|
||||
{
|
||||
HardwareVersionCharacteristic.setValue(hwVersion);
|
||||
deviceInfoService->addCharacteristic(&HardwareVersionCharacteristic);
|
||||
}
|
||||
//SerialNumberCharacteristic.setValue("FIXME");
|
||||
//deviceInfoService->addCharacteristic(&SerialNumberCharacteristic);
|
||||
|
||||
// m_manufacturerCharacteristic = m_deviceInfoService->createCharacteristic((uint16_t) 0x2a29, BLECharacteristic::PROPERTY_READ);
|
||||
// m_manufacturerCharacteristic->setValue(name);
|
||||
|
||||
/* add these later?
|
||||
ESP_GATT_UUID_SYSTEM_ID
|
||||
*/
|
||||
|
||||
// caller must call service->start();
|
||||
return deviceInfoService;
|
||||
}
|
||||
|
||||
bool _BLEClientConnected = false;
|
||||
|
||||
class MyServerCallbacks : public BLEServerCallbacks
|
||||
{
|
||||
void onConnect(BLEServer *pServer)
|
||||
{
|
||||
_BLEClientConnected = true;
|
||||
};
|
||||
|
||||
void onDisconnect(BLEServer *pServer)
|
||||
{
|
||||
_BLEClientConnected = false;
|
||||
}
|
||||
};
|
||||
|
||||
// Help routine to add a description to any BLECharacteristic and add it to the service
|
||||
// We default to require an encrypted BOND for all these these characterstics
|
||||
void addWithDesc(BLEService *service, BLECharacteristic *c, const char *description)
|
||||
{
|
||||
c->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED);
|
||||
|
||||
BLEDescriptor *desc = new BLEDescriptor(BLEUUID((uint16_t)ESP_GATT_UUID_CHAR_DESCRIPTION), strlen(description) + 1);
|
||||
assert(desc);
|
||||
desc->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED);
|
||||
desc->setValue(description);
|
||||
c->addDescriptor(desc);
|
||||
service->addCharacteristic(c);
|
||||
}
|
||||
|
||||
static BLECharacteristic BatteryLevelCharacteristic(BLEUUID((uint16_t)ESP_GATT_UUID_BATTERY_LEVEL), BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);
|
||||
|
||||
/**
|
||||
* Create a battery level service
|
||||
*/
|
||||
BLEService *createBatteryService(BLEServer *server)
|
||||
{
|
||||
// Create the BLE Service
|
||||
BLEService *pBattery = server->createService(BLEUUID((uint16_t)0x180F));
|
||||
|
||||
addWithDesc(pBattery, &BatteryLevelCharacteristic, "Percentage 0 - 100");
|
||||
BatteryLevelCharacteristic.addDescriptor(new BLE2902()); // Needed so clients can request notification
|
||||
|
||||
// I don't think we need to advertise this
|
||||
// server->getAdvertising()->addServiceUUID(pBattery->getUUID());
|
||||
pBattery->start();
|
||||
|
||||
return pBattery;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the battery level we are currently telling clients.
|
||||
* level should be a pct between 0 and 100
|
||||
*/
|
||||
void updateBatteryLevel(uint8_t level)
|
||||
{
|
||||
// Pretend to update battery levels - fixme do elsewhere
|
||||
BatteryLevelCharacteristic.setValue(&level, 1);
|
||||
BatteryLevelCharacteristic.notify();
|
||||
}
|
||||
|
||||
void dumpCharacteristic(BLECharacteristic *c)
|
||||
{
|
||||
std::string value = c->getValue();
|
||||
|
||||
if (value.length() > 0)
|
||||
{
|
||||
DEBUG_MSG("New value: ");
|
||||
for (int i = 0; i < value.length(); i++)
|
||||
DEBUG_MSG("%c", value[i]);
|
||||
|
||||
DEBUG_MSG("\n");
|
||||
}
|
||||
}
|
||||
|
||||
/** converting endianness pull out a 32 bit value */
|
||||
uint32_t getValue32(BLECharacteristic *c, uint32_t defaultValue)
|
||||
{
|
||||
std::string value = c->getValue();
|
||||
uint32_t r = defaultValue;
|
||||
|
||||
if (value.length() == 4)
|
||||
r = value[0] | (value[1] << 8UL) | (value[2] << 16UL) | (value[3] << 24UL);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
class MySecurity : public BLESecurityCallbacks
|
||||
{
|
||||
|
||||
bool onConfirmPIN(uint32_t pin)
|
||||
{
|
||||
Serial.printf("onConfirmPIN %u\n", pin);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t onPassKeyRequest()
|
||||
{
|
||||
Serial.println("onPassKeyRequest");
|
||||
return 123511; // not used
|
||||
}
|
||||
|
||||
void onPassKeyNotify(uint32_t pass_key)
|
||||
{
|
||||
Serial.printf("onPassKeyNotify %u\n", pass_key);
|
||||
screen_start_bluetooth(pass_key);
|
||||
}
|
||||
|
||||
bool onSecurityRequest()
|
||||
{
|
||||
Serial.println("onSecurityRequest");
|
||||
return true;
|
||||
}
|
||||
|
||||
void onAuthenticationComplete(esp_ble_auth_cmpl_t cmpl)
|
||||
{
|
||||
if (cmpl.success)
|
||||
{
|
||||
uint16_t length;
|
||||
esp_ble_gap_get_whitelist_size(&length);
|
||||
Serial.printf(" onAuthenticationComplete -> success size: %d\n", length);
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.printf("onAuthenticationComplete -> fail %d\n", cmpl.fail_reason);
|
||||
}
|
||||
|
||||
// Remove our custom screen
|
||||
screen_set_frames();
|
||||
}
|
||||
};
|
||||
|
||||
BLEServer *initBLE(std::string deviceName, std::string hwVendor, std::string swVersion, std::string hwVersion)
|
||||
{
|
||||
BLEDevice::init(deviceName);
|
||||
BLEDevice::setEncryptionLevel(ESP_BLE_SEC_ENCRYPT);
|
||||
|
||||
/*
|
||||
* Required in authentication process to provide displaying and/or input passkey or yes/no butttons confirmation
|
||||
*/
|
||||
BLEDevice::setSecurityCallbacks(new MySecurity());
|
||||
|
||||
// Create the BLE Server
|
||||
BLEServer *pServer = BLEDevice::createServer();
|
||||
pServer->setCallbacks(new MyServerCallbacks());
|
||||
|
||||
BLEService *pDevInfo = createDeviceInfomationService(pServer, hwVendor, swVersion, hwVersion);
|
||||
|
||||
// We now let users create the battery service only if they really want (not all devices have a battery)
|
||||
// BLEService *pBattery = createBatteryService(pServer);
|
||||
|
||||
BLEService *pUpdate = createUpdateService(pServer); // We need to advertise this so our android ble scan operation can see it
|
||||
|
||||
// It seems only one service can be advertised - so for now don't advertise our updater
|
||||
// pServer->getAdvertising()->addServiceUUID(pUpdate->getUUID());
|
||||
|
||||
// start all our services (do this after creating all of them)
|
||||
pDevInfo->start();
|
||||
pUpdate->start();
|
||||
|
||||
// FIXME turn on this restriction only after the device is paired with a phone
|
||||
// advert->setScanFilter(false, true); // We let anyone scan for us (FIXME, perhaps only allow that until we are paired with a phone and configured) but only let whitelist phones connect
|
||||
|
||||
BLESecurity *pSecurity = new BLESecurity();
|
||||
pSecurity->setCapability(ESP_IO_CAP_OUT);
|
||||
pSecurity->setAuthenticationMode(ESP_LE_AUTH_REQ_SC_BOND);
|
||||
pSecurity->setInitEncryptionKey(ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK);
|
||||
|
||||
return pServer;
|
||||
}
|
||||
|
||||
// Called from loop
|
||||
void loopBLE()
|
||||
{
|
||||
bluetoothRebootCheck();
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <BLEDevice.h>
|
||||
#include <BLEServer.h>
|
||||
#include <BLEUtils.h>
|
||||
|
||||
|
||||
// Now handled by BluetoothUtil.cpp
|
||||
// BLEService *createDeviceInfomationService(BLEServer* server, uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version);
|
||||
|
||||
// Help routine to add a description to any BLECharacteristic and add it to the service
|
||||
void addWithDesc(BLEService *service, BLECharacteristic *c, const char *description);
|
||||
|
||||
void dumpCharacteristic(BLECharacteristic *c);
|
||||
|
||||
/** converting endianness pull out a 32 bit value */
|
||||
uint32_t getValue32(BLECharacteristic *c, uint32_t defaultValue);
|
||||
|
||||
void loopBLE();
|
||||
BLEServer *initBLE(std::string devName, std::string hwVendor, std::string swVersion, std::string hwVersion = "");
|
||||
@@ -1 +0,0 @@
|
||||
../../RadioHead
|
||||
@@ -11,7 +11,7 @@
|
||||
*****************************************************************/
|
||||
|
||||
/* Enable support for dynamically allocated fields */
|
||||
/* #define PB_ENABLE_MALLOC 1 */
|
||||
#define PB_ENABLE_MALLOC 1
|
||||
|
||||
/* Define this if your CPU / compiler combination does not support
|
||||
* unaligned memory access to packed structures. */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user