Compare commits

...

1050 Commits

Author SHA1 Message Date
Ben Meadors
e09b12ca58 Merge pull request #2072 from meshtastic/hotfix-01
Hotfix for user button not working
2022-12-29 06:22:58 -06:00
Thomas Göttgens
7f3a624ee3 Hotfix for user button not working 2022-12-29 11:55:19 +01:00
Thomas Göttgens
475c87b0e4 Merge pull request #2071 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-12-28 23:18:19 +01:00
thebentern
541f4aa998 [create-pull-request] automated change 2022-12-28 21:27:27 +00:00
Thomas Göttgens
6ea0963f4b fix master too 2022-12-28 16:03:34 +01:00
Thomas Göttgens
63cf01223c Merge pull request #2070 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-12-28 15:43:40 +01:00
caveman99
2505bdbc21 [create-pull-request] automated change 2022-12-28 14:42:46 +00:00
Thomas Göttgens
14be4ee9f0 Release Develop to Master 2022-12-28 15:31:04 +01:00
Thomas Göttgens
d0243d2cd0 Merge pull request #2067 from miaoski/sht31
Support SHT31 temperature sensor
2022-12-27 21:11:30 +01:00
Thomas Göttgens
796e58161d Merge branch 'master' into sht31 2022-12-27 13:58:44 +01:00
Thomas Göttgens
e56f17c658 Merge pull request #2068 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-12-27 13:58:27 +01:00
caveman99
b808ffa9ab [create-pull-request] automated change 2022-12-27 12:53:56 +00:00
miaoski
506bae4a8b Support SHT31 temperature sensor 2022-12-27 19:39:51 +08:00
Thomas Göttgens
f6ee6265e6 Merge pull request #2063 from lewisxhe/master
Fixed<t-beam-s3-core>display model is SH1106
2022-12-25 13:32:29 +01:00
Thomas Göttgens
7539d92857 Merge branch 'master' into master 2022-12-25 13:03:27 +01:00
Thomas Göttgens
21fff392b4 Backport RP2040 update 2022-12-25 13:02:40 +01:00
Thomas Göttgens
580ec590fa something broke pico toolchain. 'twasn'tme .. 2022-12-25 13:01:39 +01:00
lewis
5c9996dfa1 Fixed<t-beam-s3-core>display model is SH1106 2022-12-25 19:01:04 +08:00
Thomas Göttgens
2f7c18303d Merge pull request #2058 from lesykm/serial-module-simple-mode-binary
[modules][serial] switch simple mode from ascii to bytes
2022-12-22 10:46:41 +01:00
Mykhailo Lesyk
b9df41c55f [modules][serial] switch simple mode from ascii to bytes 2022-12-21 22:37:30 -08:00
Thomas Göttgens
4801260440 Merge pull request #2055 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-12-21 20:30:14 +01:00
thebentern
606262e55d [create-pull-request] automated change 2022-12-21 18:54:52 +00:00
Ben Meadors
090e1660fe Merge pull request #2053 from meshtastic/upstream-heltec
Move to upstream espressif arduino
2022-12-21 07:47:27 -06:00
Ben Meadors
92c9b34d4f Copy pasta 2022-12-21 07:46:59 -06:00
Ben Meadors
3f50371ff3 Merge branch 'master' into upstream-heltec 2022-12-21 07:45:18 -06:00
Ben Meadors
815f9bfc5f Move to upstream espressif arduino 2022-12-21 07:41:26 -06:00
Thomas Göttgens
86ff23d13c Merge pull request #2051 from meshtastic/master-next
moving a lot of stuff from develop into Master
2022-12-21 14:35:19 +01:00
Thomas Göttgens
201b786f77 fix RAK build 2022-12-21 14:06:02 +01:00
Thomas Göttgens
755c0b7008 use nanopb 0.4.7 2022-12-21 13:37:38 +01:00
Thomas Göttgens
7396d0f241 Cherry Picking Stuff from develop... 2022-12-21 13:36:38 +01:00
Thomas Göttgens
220859d0aa Merge pull request #2019 from code8buster/gps-toggle-final
Adds a flag to turn the GPS power rail off entirely on tbeam
2022-12-21 13:28:32 +01:00
Thomas Göttgens
941786669b fix compiler warnings 2022-12-21 13:28:29 +01:00
Thomas Göttgens
4eb620d47b Heap Debug: only show if delta occurs 2022-12-21 13:28:29 +01:00
Thomas Göttgens
9794995d7a fix building DIY-1 target 2022-12-21 13:28:29 +01:00
Thomas Göttgens
055146602a support ESP32-S2 CPUs
Note: these don't have Bluetooth and only a single physical core.
2022-12-21 13:28:28 +01:00
Thomas Göttgens
86d7860d86 made a nice PTT/RECV screen for audio module. And cleaned up screen graphics a bit. 2022-12-21 13:28:28 +01:00
Thomas Göttgens
0f2d0d1f07 change on screen graphics to support bicolor screens 2022-12-21 13:28:28 +01:00
Thomas Göttgens
ab6a5a5e07 if we get different frames than our own transmission setup, decode and play them anyway 2022-12-21 13:28:28 +01:00
Thomas Göttgens
44a33ed463 add IO7 to RAK pinouts - only comments changed 2022-12-21 13:28:28 +01:00
Thomas Göttgens
fab08b6451 fix building for screenless devices 2022-12-21 13:28:28 +01:00
Thomas Göttgens
d9cd3dd3e1 Change Boot Message format 2022-12-21 13:28:25 +01:00
Thomas Göttgens
c75ea87f6b Format received message screen like sender in canned messages. 2022-12-21 13:28:25 +01:00
Thomas Göttgens
706ddf6e95 show appropriate message when going into OTA mode 2022-12-21 13:28:25 +01:00
Thomas Göttgens
aec091e7aa manual master merge
# Conflicts:
#	src/Power.cpp
2022-12-21 13:28:25 +01:00
Thomas Göttgens
cea8393a7f Merge pull request #2026 from GUVWAF/develop
TraceRouteModule
2022-12-21 13:27:12 +01:00
Thomas Göttgens
8f94463eac send a 4 byte magic header including the codec version 2022-12-21 13:27:00 +01:00
Thomas Göttgens
a0f5e44967 Audio Module is finished for regression tests. 2022-12-21 13:27:00 +01:00
Thomas Göttgens
feb7181767 debug print thread count. max_threads is 32 2022-12-21 13:27:00 +01:00
Thomas Göttgens
a0c1e9cdc6 Still WIP, but first working version of audio. I2S works good, analogue not so much. 2022-12-21 13:27:00 +01:00
Thomas Göttgens
7d1b6f63b5 Definition cleanup and AudioModule WIP 2022-12-21 13:27:00 +01:00
Thomas Göttgens
ab6b6514cb this define is arch specific 2022-12-21 13:26:59 +01:00
Thomas Göttgens
0e6285edf2 add temp code for heap debugging. Disable -DDEBUG_HEAP for release builds.
DEBUG_MSG output only for now.
2022-12-21 13:26:59 +01:00
Thomas Göttgens
8b58eaac20 fix compile
# Conflicts:
#	protobufs
2022-12-21 13:26:59 +01:00
Thomas Göttgens
8cbf292373 WIP: add digital audio. Needs a proto change, so checking in generated files for now.
# Conflicts:
#	src/mesh/generated/localonly.pb.h
#	src/mesh/generated/module_config.pb.h
2022-12-21 13:26:44 +01:00
Thomas Göttgens
80d0b63c3a hopefully fix compilation errors 2022-12-21 13:26:13 +01:00
Thomas Göttgens
f5120a29ec WIP: audio module still does not work, but enabled for all regions where audio is permitted.
# Conflicts:
#	variants/tlora_v2_1_18/platformio.ini
2022-12-21 13:26:13 +01:00
Thomas Göttgens
efc3f4c0ee remove a few DSR Router bits for S&F Module 2022-12-21 13:25:12 +01:00
Thomas Göttgens
bd2bfd6822 update board definition, update copy/paste errors, fix SX1280. 2022-12-21 13:25:12 +01:00
Thomas Göttgens
88c3ab2636 Merge pull request #2050 from lesykm/serial-module-simple-mode-fix
[modules][serial] fix simple module ability to send
2022-12-21 12:43:13 +01:00
Thomas Göttgens
6a5dd26907 need to trigger new CI run 2022-12-21 12:24:38 +01:00
Mykhailo Lesyk
4de557b4db [modules][serial] fix simple module ability to send 2022-12-21 01:35:19 -08:00
Thomas Göttgens
af9d4328eb Merge pull request #2046 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-12-17 18:42:25 +01:00
caveman99
8c66940b78 [create-pull-request] automated change 2022-12-17 17:41:39 +00:00
Thomas Göttgens
72f1416b30 add variant comment about radiolib 2022-12-16 20:21:56 +01:00
Thomas Göttgens
05f81922e6 Merge pull request #2040 from D4rk4/master
Disable deep sleep for nRF  and force shutdown for RAK463x on discharged battery
2022-12-15 11:21:26 +01:00
Dmitry Galenko
72504a5e8b Merge branch 'master' into master 2022-12-14 20:27:20 +01:00
Thomas Göttgens
e8c034e988 Merge pull request #2041 from markbirss/master
Fix power enable pin used for e-Ink
2022-12-14 17:39:13 +01:00
Dmitry Galenko
aa19718ba4 Change condition for low-voltage killswitch 2022-12-14 17:26:55 +01:00
Mark Trevor Birss
088ab106dd Update variant.h 2022-12-14 17:57:02 +02:00
Mark Trevor Birss
110c3f619a Update variant.h 2022-12-14 17:56:44 +02:00
Dmitry Galenko
d1cc503ca8 Disable shutdown for non ESP32 boards 2022-12-14 14:36:15 +01:00
Thomas Göttgens
d3b3a4c148 fix build error 2022-12-14 10:29:45 +01:00
Dmitry Galenko
46f1cee2a8 Fix missed braces and etc 2022-12-14 10:21:11 +01:00
Dmitry Galenko
0386af721d Merge branch 'meshtastic:master' into master 2022-12-14 09:45:35 +01:00
Thomas Göttgens
de6b752db8 Merge pull request #2039 from ghostop14/master
Enable GPS capabilities on heltec V3
2022-12-14 09:38:06 +01:00
Dmitry Galenko
92fd5511ec Disable nRF sleep on discharge 2022-12-14 09:36:25 +01:00
ghostop14
59ec7f31ab Enable GPS capabilities on heltec V3 2022-12-13 12:31:39 -05:00
Ben Meadors
779d2352bd Merge pull request #2037 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-12-12 16:29:39 -06:00
thebentern
0162db12b8 [create-pull-request] automated change 2022-12-12 19:23:34 +00:00
Ben Meadors
91ff7b9032 Merge pull request #2036 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-12-12 12:18:06 -06:00
thebentern
643f99f577 [create-pull-request] automated change 2022-12-12 18:06:11 +00:00
Ben Meadors
152288b4cc Merge pull request #2025 from meshtastic/power-fsm-experiment
Power FSM experiment
2022-12-12 12:01:00 -06:00
Ben Meadors
45b518baf2 Move sds transition back into esp32 only 2022-12-12 10:24:51 -06:00
Ben Meadors
0c65c73f90 Merge branch 'master' into power-fsm-experiment 2022-12-09 19:50:26 -06:00
Thomas Göttgens
0f0dbc3274 reboot nrf52 on critical error 8 2022-12-09 11:18:43 +01:00
Thomas Göttgens
06d34daeab Merge branch 'master' into power-fsm-experiment 2022-12-08 10:18:01 +01:00
Thomas Göttgens
ba1f68d758 Merge pull request #2027 from lewisxhe/master
Fix the charging parmas error of tbeam-s3core and change the default USB mode
2022-12-06 16:39:38 +01:00
Thomas Göttgens
d4c0977a70 Merge branch 'master' into master 2022-12-06 15:49:32 +01:00
Thomas Göttgens
1a19d71e95 Merge pull request #2023 from meshtastic/2022-bug-recording-critical-error-11-at-srcmeshradiolibinterfacecpp389
Add debug output
2022-12-06 15:48:57 +01:00
Thomas Göttgens
21c10934fc Merge pull request #2018 from arduionoGP/patch-3
Update MQTT.cpp
2022-12-06 15:47:30 +01:00
Thomas Göttgens
13cca91097 Merge branch 'master' into patch-3 2022-12-06 14:09:29 +01:00
Thomas Göttgens
b335b1c66b Merge branch 'master' into 2022-bug-recording-critical-error-11-at-srcmeshradiolibinterfacecpp389 2022-12-06 14:08:48 +01:00
Thomas Göttgens
cc2653bfb5 Merge pull request #2029 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-12-06 14:05:51 +01:00
caveman99
fc5bf5a68f [create-pull-request] automated change 2022-12-06 13:03:26 +00:00
lewishe
63d7338311 fix tbeams3-core PMU charging cut-off voltage 2022-12-06 11:01:14 +08:00
lewishe
37f716d27b Change tbeams3-core the default USB mode to TinyUSB 2022-12-06 10:58:59 +08:00
Ben Meadors
0f2a835359 Remove hard coded !isPowered 2022-12-05 10:13:19 -06:00
Thomas Göttgens
2a84d39e40 Always do battery resampling if we use the ADC. Improves reading a lot. 2022-12-05 16:40:23 +01:00
Ben Meadors
b14289e976 More cleanup 2022-12-05 08:35:54 -06:00
Ben Meadors
1fef6f0656 Clean up on battery shutdown condition 2022-12-05 07:37:01 -06:00
Thomas Göttgens
183ec2124f Add debug output 2022-12-05 11:48:46 +01:00
Ben Meadors
aeb9bfa063 Return false 2022-12-04 20:41:00 -06:00
arduinoGP
b84c7ae49b Oops, added time to the Pos 2022-12-04 19:41:58 -05:00
Thomas Göttgens
61598c5942 Merge pull request #2020 from meshtastic/serial-textmessage
Serial textmessage mode
2022-12-04 23:53:29 +01:00
Ben Meadors
a3a24e0216 Don't put newlines in the text buffer 2022-12-04 16:03:57 -06:00
Ben Meadors
31ec2da0e9 Text message mode for serial 2022-12-04 15:40:28 -06:00
arduinoGP
27a10b395f Update MQTT.cpp
(First real try at writing meaningful C++ but it seems to work.)
Allows sending JSON Position data from MQTT broker for broadcast to a LORA mesh via gateway device.
The new type is "sendposition". Valid envelope looks like:
{
    "sender": "someSender",
    "type": "sendposition",
    "payload": {
        "latitude_i": 399600000,
        "longitude_i": -862600000,
        "altitude": 100
    }
}
This complements the "sendtext" type envelope.
2022-12-04 00:00:43 -05:00
Ben Meadors
7570cdbd22 Fix shell scripts for both linux and darwin 2022-12-03 08:24:11 -06:00
Thomas Göttgens
c857474116 Merge pull request #2013 from arduionoGP/patch-2
Update MQTT.cpp
2022-12-01 22:17:35 +01:00
arduinoGP
8ff5dacc3c Update MQTT.cpp
case Portnum_POSITION_APP adjusted so the various options allways get encoded into JSON as long as lat and long are present. There are circumstances where timestamp, time, or altitude might be missing and this causes silent failures of JSON encoding..
2022-12-01 15:44:47 -05:00
Ben Meadors
f1179d31ba Fixed shell scripts 2022-11-27 07:40:40 -06:00
Ben Meadors
abe60b96f1 Merge pull request #2001 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-11-27 06:11:39 -06:00
thebentern
206520f179 [create-pull-request] automated change 2022-11-27 02:16:21 +00:00
Ben Meadors
97fd5cf2ab Merge pull request #2000 from meshtastic/develop
Develop upstream
2022-11-26 19:16:24 -06:00
Ben Meadors
d13a095516 Merge pull request #1990 from GUVWAF/develop
Send 'ACK' response for handled admin message
2022-11-26 19:15:36 -06:00
Ben Meadors
4dc7d92cf1 Merge pull request #1999 from meshtastic/master
Fix conditional syntax
2022-11-26 15:09:56 -06:00
Ben Meadors
e7dbbeb606 Fix conditional syntax 2022-11-26 14:50:07 -06:00
GUVWAF
3e892fc391 Merge branch 'meshtastic:develop' into develop 2022-11-26 21:14:52 +01:00
Ben Meadors
dfec37dfd0 Merge pull request #1996 from meshtastic/master
Develop downstream
2022-11-26 12:59:54 -06:00
Ben Meadors
b82ab34f85 Merge pull request #1993 from meshtastic/potential-sx1262-fix
Don't set DIO2 switch if TXEN is defined
2022-11-26 12:59:02 -06:00
Ben Meadors
18a2cfeda4 Merge branch 'master' into potential-sx1262-fix 2022-11-26 10:18:14 -06:00
Thomas Göttgens
082aa07e7f update batch scripts to further check filename. 2022-11-26 17:00:33 +01:00
Ben Meadors
a703ab4418 Merge branch 'master' into potential-sx1262-fix 2022-11-26 09:07:59 -06:00
Thomas Göttgens
185ceac9df Merge pull request #1994 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-11-26 16:06:12 +01:00
caveman99
7c9cada50e [create-pull-request] automated change 2022-11-26 15:04:12 +00:00
Thomas Göttgens
a5ba3dd445 revert protobuf change to develop 2022-11-26 16:03:17 +01:00
Ben Meadors
63838a1632 Merge branch 'master' into potential-sx1262-fix 2022-11-26 08:19:13 -06:00
Ben Meadors
30d7f188e2 Merge pull request #1991 from meshtastic/develop
Merge develop to master
2022-11-26 08:18:59 -06:00
Ben Meadors
47a47f1e69 Merge branch 'master' into develop 2022-11-26 08:18:35 -06:00
Ben Meadors
daac79f314 Merge branch 'master' into potential-sx1262-fix 2022-11-26 08:13:05 -06:00
Ben Meadors
1864216e78 Merge pull request #1992 from lewisxhe/master
Fix the format of t-echo Bluetooth pairing display page
2022-11-26 08:12:55 -06:00
Ben Meadors
71c0cf9b9a Don't set DIO2 switch if TXEN is defined 2022-11-26 08:11:32 -06:00
Ben Meadors
ef87ddb798 Merge branch 'master' into master 2022-11-26 07:44:19 -06:00
Ben Meadors
711c748b44 Merge pull request #1986 from IhorNehrutsa/MESSAGES
Some DEBUG_MSG added/changed/commented.
2022-11-26 07:44:12 -06:00
lewis
6eff09a260 Merge branch 'master' of https://github.com/meshtastic/Meshtastic-device 2022-11-26 21:38:07 +08:00
lewis
c5fe878a6f Fix the format of t-echo Bluetooth pairing display page 2022-11-26 21:37:32 +08:00
Thomas Göttgens
39948c76de Merge branch 'master' into develop 2022-11-26 14:19:27 +01:00
Ben Meadors
10f14d27b7 Merge branch 'master' into MESSAGES 2022-11-26 07:13:20 -06:00
Ben Meadors
5e9d722b7d Merge pull request #1987 from lewisxhe/master
Add t-echo to the operation after the flash operation fails
2022-11-26 06:59:03 -06:00
Ben Meadors
b324c04097 Merge branch 'master' into master 2022-11-26 06:44:28 -06:00
Ben Meadors
84a9d95b1f Merge branch 'master' into MESSAGES 2022-11-26 06:43:52 -06:00
lewis
cdd499f147 Add missing restart parameters 2022-11-26 12:10:10 +08:00
GUVWAF
c45a85547e Send 'ACK' response for admin message 2022-11-25 20:33:24 +01:00
GUVWAF
8815746006 Fix wrong comment 2022-11-25 20:33:23 +01:00
Garth Vander Houwen
32a1e8ef0d Create feature.yml 2022-11-25 09:44:26 -08:00
lewis
0dff4538f3 Add t-echo to the operation after the flash operation fails 2022-11-26 00:17:54 +08:00
Ihor Nehrutsa
6507683909 Squashed commit of the following:
commit c8d1bcf04fae5f7ac5b639ddd15a738045014c95
Author: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
Date:   Fri Nov 25 15:11:18 2022 +0200

    Revert "variants\tbeam\variant.h: Use LORA_CS instead of RF95_NSS"

    This reverts commit 8d225ced9c.

commit 1c37097448393ea9364c2b9bf10522802c61d5c4
Author: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
Date:   Fri Nov 25 15:04:09 2022 +0200

    Some little debugs added

commit f1b55e11af
Author: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
Date:   Wed Nov 23 15:24:58 2022 +0200

    Update variant.h

commit 8d225ced9c
Author: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
Date:   Wed Nov 23 13:06:49 2022 +0200

    variants\tbeam\variant.h: Use LORA_CS instead of RF95_NSS
2022-11-25 15:17:24 +02:00
Ben Meadors
c71e32970c Merge pull request #1982 from meshtastic/master
Master to Develop
2022-11-24 08:07:24 -06:00
Thomas Göttgens
fcf21da843 one radiolib to rule them all 2022-11-24 13:55:57 +01:00
Thomas Göttgens
ab464fe038 compress better 2022-11-24 13:07:37 +01:00
Thomas Göttgens
fd546af2a5 don't package meshtasticd simulator
that saves 5 MB on every zip.
2022-11-24 12:36:47 +01:00
Thomas Göttgens
acfbe202b6 include alternative update bin without bootloader and settings 2022-11-24 12:33:19 +01:00
Thomas Göttgens
29fb283daf adaptig for #1938 2022-11-24 12:30:15 +01:00
Thomas Göttgens
51ef9b7fbe fix RP2040 and Portduino Platforms 2022-11-24 12:24:57 +01:00
Thomas Göttgens
025d2264a2 m5stack runs with native tone support now. 2022-11-24 10:44:43 +01:00
Thomas Göttgens
b2284b2097 Tone now included in arduino core for ESP32. 2022-11-24 10:30:11 +01:00
Thomas Göttgens
5f8267c956 use the buzzer for external notification module 2022-11-24 10:11:42 +01:00
Thomas Göttgens
cf783a5bae make GPS pins configurable through protos 2022-11-24 09:23:17 +01:00
Thomas Göttgens
32e5ced814 regen protos 2022-11-24 09:22:50 +01:00
Thomas Göttgens
605fadabcf Merge branch 'master' of github.com:meshtastic/firmware 2022-11-24 00:03:45 +01:00
Thomas Göttgens
e91ace7329 Merge pull request #1980 from meshtastic/master
Master Merge again
2022-11-24 00:02:35 +01:00
Thomas Göttgens
c87cd136d4 Merge pull request #1979 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-11-24 00:01:39 +01:00
Thomas Göttgens
0d7d59609a Remove gpio binding for notification module. 2022-11-23 23:49:29 +01:00
thebentern
75ed0e5906 [create-pull-request] automated change 2022-11-23 22:49:22 +00:00
Thomas Göttgens
8e3b500307 ---EXPERIMENTAL--- reboot the board if the NO_AP_FOUND error comes back. 2022-11-23 23:47:50 +01:00
Thomas Göttgens
d6f77bf07e Merge pull request #1978 from meshtastic/master
Master to Develop
2022-11-23 23:44:42 +01:00
Ben Meadors
65e8209d51 Merge pull request #1976 from markbirss/master
M5Stack CoreInk enable buzzer
2022-11-23 14:32:18 -06:00
Ben Meadors
aae5247caa Merge pull request #1977 from meshtastic/hotfix-reset-nodedb
Hotfix Add reset nodedb handler back
2022-11-23 14:31:50 -06:00
Ben Meadors
2fedb6b774 Add reset nodedb handler back 2022-11-23 14:12:44 -06:00
Mark Trevor Birss
02d18d4831 Merge branch 'master' into master 2022-11-23 21:53:12 +02:00
Ben Meadors
b70c2d088d Merge pull request #1975 from GUVWAF/master
Revert "Override RoutingModule's ACK if on wrong channel"
2022-11-23 13:50:42 -06:00
Mark Trevor Birss
b3c396683e Update platformio.ini 2022-11-23 21:25:19 +02:00
Mark Trevor Birss
f08874dd37 Update platformio.ini 2022-11-23 21:24:34 +02:00
Mark Trevor Birss
648054da9b Add files via upload 2022-11-23 21:19:20 +02:00
GUVWAF
70bf7c490c Revert "Override RoutingModule's ACK if on wrong channel"
This reverts commit 71c163a8ee.
2022-11-23 19:27:57 +01:00
Thomas Göttgens
adbed5de95 - fix NTP sync on connect
- disable extended GPS mode again
- add --inline-suppr to cppflags
2022-11-22 17:19:24 +01:00
Thomas Göttgens
fe989f0bff Merge pull request #1973 from meshtastic/master
Develop refresh to Master
2022-11-22 17:08:04 +01:00
Thomas Göttgens
679e346bcb change old field denominator 2022-11-22 16:47:54 +01:00
Thomas Göttgens
832439b336 strange enough _that_ suppression works 2022-11-22 15:56:13 +01:00
Thomas Göttgens
71c2af04ec why is this working on pio/windows? 2022-11-22 15:03:01 +01:00
Ben Meadors
0f4261d02f Merge pull request #1972 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-11-22 07:40:41 -06:00
Thomas Göttgens
23466d8eee yank that dreaded json11 - first try 2022-11-22 14:29:00 +01:00
thebentern
8edbba2180 [create-pull-request] automated change 2022-11-22 00:56:46 +00:00
Ben Meadors
5417671332 Merge pull request #1971 from GUVWAF/master
Cover two ACK/NAK edge cases for admin packets
2022-11-21 18:11:25 -06:00
Ben Meadors
35d7e11678 Merge branch 'master' into master 2022-11-21 16:36:11 -06:00
Ben Meadors
7a63ba827b Merge pull request #1965 from meshtastic/transactional-config-edits
Only save and reboot while a transaction isnt open
2022-11-21 16:12:55 -06:00
GUVWAF
71c163a8ee Override RoutingModule's ACK if on wrong channel 2022-11-21 20:43:17 +01:00
GUVWAF
5d8e661807 Send NAK on primary channel if it cannot decode it 2022-11-21 20:43:17 +01:00
Ben Meadors
24244e8474 Update AdminModule.cpp 2022-11-21 12:24:05 -06:00
Ben Meadors
fb4f9bdc40 Merge branch 'master' into transactional-config-edits 2022-11-21 12:10:49 -06:00
Ben Meadors
668c46e0cf Merge pull request #1968 from meshtastic/develop
Merge develop upstream
2022-11-21 12:10:14 -06:00
Ben Meadors
abf8fdb661 Merge branch 'master' into develop 2022-11-21 09:39:22 -06:00
Ben Meadors
a28a04b7a0 Merge pull request #1964 from meshtastic/mqtt-init-defaults
Init default mqtt configurations
2022-11-21 09:39:10 -06:00
Ben Meadors
cd9671650b Merge branch 'master' into mqtt-init-defaults 2022-11-21 09:39:05 -06:00
Ben Meadors
00bc762bf1 Merge branch 'master' into develop 2022-11-21 09:38:46 -06:00
Thomas Göttgens
9a065bce03 Merge pull request #1970 from meshtastic/caveman99-OLED-FIX
fix TLora V1 Boards Display Init
2022-11-21 16:37:55 +01:00
Thomas Göttgens
3b2b0bdc97 fix TLora V1 Boards Display Init 2022-11-21 15:50:47 +01:00
Ben Meadors
53cd6bdf15 Merge branch 'master' into develop 2022-11-21 07:35:46 -06:00
Thomas Göttgens
edc97c1c07 Merge branch 'master' of github.com:meshtastic/firmware 2022-11-21 14:28:45 +01:00
Ben Meadors
6a24ef2263 Merge branch 'master' into transactional-config-edits 2022-11-21 07:26:18 -06:00
Ben Meadors
50ba523fb4 Merge branch 'master' into mqtt-init-defaults 2022-11-21 07:14:47 -06:00
Thomas Göttgens
a33325f90f update web server reference to latest commit 2022-11-21 13:46:22 +01:00
Thomas Göttgens
a173b7159a Merge pull request #1967 from D4rk4/SAST
Remove empty workflow file
2022-11-21 09:01:16 +01:00
Thomas Göttgens
91295d3772 Merge branch 'master' of github.com:meshtastic/firmware 2022-11-21 08:50:53 +01:00
Dmitry Galenko
9c1c04a8db Merge branch 'master' into SAST 2022-11-21 08:14:39 +01:00
Dmitry Galenko
51d0d0d779 Fix empty workflow 2022-11-21 08:13:28 +01:00
Dmitry Galenko
9cdf627ae3 Revert "Fix empty workflow"
This reverts commit 4b9c482384.
2022-11-21 08:12:52 +01:00
Dmitry Galenko
4b9c482384 Fix empty workflow 2022-11-21 08:10:21 +01:00
Ben Meadors
b1ba807ec9 Only save and reboot while a transaction isnt open 2022-11-20 19:50:45 -06:00
Ben Meadors
c844f153e1 Merge branch 'master' into mqtt-init-defaults 2022-11-20 15:31:54 -06:00
Thomas Göttgens
4a2b02347f Keymatrix Bugfix: Allow key 3 to send associated text
Feature: setting a text "~" emulates IO5/Userbutton with keymatrix.
2022-11-20 20:59:48 +01:00
Thomas Göttgens
e8a05d1874 Merge pull request #1947 from meshtastic/bug-1821
testing issues with RAK11200/13300
2022-11-20 19:40:52 +01:00
Ben Meadors
08c4e3fbd6 Merge branch 'master' into mqtt-init-defaults 2022-11-20 12:29:47 -06:00
Ben Meadors
1c5292ac86 Init default mqtt configurations 2022-11-20 12:29:10 -06:00
Ben Meadors
aa553ea5d8 Merge pull request #1958 from D4rk4/SAST
Implement automatic static code scan with Semgrep & Flawfinder
2022-11-20 11:10:19 -06:00
Thomas Göttgens
a00bd59e27 Merge branch 'master' of github.com:meshtastic/firmware 2022-11-20 18:03:18 +01:00
Thomas Göttgens
f02c6c49ee Merge branch 'master' into bug-1821 2022-11-20 17:26:42 +01:00
Dmitry Galenko
e54e37a600 Rename security workflows to sec_* 2022-11-20 16:17:58 +01:00
Dmitry Galenko
b95103cab0 Run flawfinder only on push to specific branch 2022-11-20 16:16:04 +01:00
Dmitry Galenko
9b43e49116 Ignore upstream defect 2022-11-20 16:14:32 +01:00
Ben Meadors
457538c8f6 Merge branch 'master' into SAST 2022-11-20 08:13:47 -06:00
Ben Meadors
da48f0704b Merge pull request #1960 from D4rk4/SEC
Security fixes
2022-11-20 08:05:04 -06:00
Dmitry Galenko
cf8d953bba Merge branch 'master' into SAST 2022-11-20 14:41:51 +01:00
Dmitry Galenko
5f2b859e38 Merge branch 'master' into SEC 2022-11-20 14:37:46 +01:00
Dmitry Galenko
3187b5abda Revert "Missed STDC_LIB_EXT1"
This reverts commit 4392df0676.
2022-11-20 14:29:05 +01:00
Ben Meadors
ce16b50d5f Change docker push critera 2022-11-20 07:05:49 -06:00
Dmitry Galenko
4295720770 Add flawfinder for cover C++ codebase 2022-11-20 13:50:38 +01:00
Dmitry Galenko
4392df0676 Missed STDC_LIB_EXT1 2022-11-20 13:27:55 +01:00
Dmitry Galenko
4ec3b025f0 look like https://sg.run/jkdn not hit us 2022-11-20 13:19:47 +01:00
Dmitry Galenko
f4704181e9 Fix potential buffer clean issue 2022-11-20 13:12:51 +01:00
Dmitry Galenko
0e04bea39e Fix for Dockerfile-related security defects and rewrite to follow best practices 2022-11-20 12:57:55 +01:00
Thomas Göttgens
b54044fd00 if we have a filename, 'address' is the line number. Don't print that in hex ;-)
If it's really a hex address, prefix it with 0x
2022-11-20 12:00:57 +01:00
Dmitry Galenko
08c69c09c8 Fix branch name 2022-11-20 11:58:15 +01:00
Dmitry Galenko
681ea420c1 Implement automatic static code scan with Semgrep 2022-11-20 10:53:11 +01:00
Sacha Weatherstone
48ea54748f Fix build instructions link 2022-11-20 06:38:17 +00:00
Ben Meadors
4b7627595a Merge branch 'master' into bug-1821 2022-11-19 20:05:03 -06:00
Ben Meadors
6299e5483b Input boards 2022-11-19 19:39:39 -06:00
Ben Meadors
6118a966a6 Move em up 2022-11-19 19:30:19 -06:00
Ben Meadors
1fac9ee1f2 More reusable workflows 2022-11-19 19:23:35 -06:00
Ben Meadors
1e06b2d51e I think understand now 2022-11-19 18:57:06 -06:00
Ben Meadors
f3a6ed9d61 Rename to action 2022-11-19 18:53:42 -06:00
Ben Meadors
f71cbb6f6e Move to actions folder 2022-11-19 18:50:50 -06:00
Ben Meadors
23ea22c741 Checkout master first 2022-11-19 18:42:27 -06:00
Ben Meadors
8be65bb0ab Move the checkout 2022-11-19 18:40:17 -06:00
Ben Meadors
57e2e75d24 Add shells 2022-11-19 18:35:00 -06:00
Ben Meadors
29cd7568f5 Try a composite action instead 2022-11-19 18:30:43 -06:00
Ben Meadors
581076a5a1 Now let's take it further 2022-11-19 18:07:07 -06:00
Ben Meadors
27401bb9b8 Remove runs-on 2022-11-19 17:48:01 -06:00
Ben Meadors
10837ce549 With block 2022-11-19 17:45:33 -06:00
Ben Meadors
1dcd411d00 Fix indention 2022-11-19 17:43:18 -06:00
Ben Meadors
0533fd9227 Uses 2022-11-19 17:35:47 -06:00
Ben Meadors
5ce7ffc888 Show contents 2022-11-19 16:51:33 -06:00
Ben Meadors
9e914de995 Try going up a dir 2022-11-19 16:46:36 -06:00
Ben Meadors
0cc653263e Indent 2022-11-19 16:39:05 -06:00
Ben Meadors
d2d2f278cf Apparently checkout before using a local workflow 2022-11-19 16:25:00 -06:00
Ben Meadors
eb34a95ab7 Why fight me? 2022-11-19 16:23:09 -06:00
Ben Meadors
eb1f6c0de6 Root path? 2022-11-19 16:13:26 -06:00
Ben Meadors
8de79e8fb6 Path 2022-11-19 16:08:11 -06:00
Ben Meadors
fe00f0c369 Uses block 2022-11-19 16:06:59 -06:00
Ben Meadors
f9ee8583b0 Merge pull request #1956 from meshtastic/docker-hub-and-ci-overhaul
Docker hub and ci overhaul
2022-11-19 16:04:21 -06:00
Ben Meadors
a4d5f8c717 Reusable workflow 2022-11-19 16:03:55 -06:00
Ben Meadors
35c50f074b Build and push to docker hub 2022-11-19 15:44:59 -06:00
Ben Meadors
dcfa226509 Remove extra git submodule update 2022-11-19 15:42:08 -06:00
Thomas Göttgens
a9fde30a58 Merge branch 'master' into bug-1821 2022-11-19 10:00:41 +01:00
Thomas Göttgens
7ceb52103e Cleaning up GPS Code a bit 2022-11-19 09:58:29 +01:00
Thomas Göttgens
8da5d37888 Merge branch 'master' of github.com:meshtastic/firmware 2022-11-19 09:56:11 +01:00
Thomas Göttgens
95cc328b5c That wifi update didn't go down well. 2022-11-18 19:37:56 +01:00
Thomas Göttgens
990c0119a7 fix portduino - again 2022-11-18 18:22:35 +01:00
Thomas Göttgens
144afee29e trigger wifi reconnect by mqtt or ntp failures. 2022-11-18 18:03:30 +01:00
Thomas Göttgens
9665c08b59 MQTT: don't subscribe to JSON topic if JSON is disabled in config. 2022-11-17 21:14:49 +01:00
Ben Meadors
20ee6a509d Remove more targets from checks 2022-11-17 13:35:16 -06:00
Thomas Göttgens
70d44b8838 next try. 2022-11-17 20:19:11 +01:00
Thomas Göttgens
b260c8b058 tryfix wifi issues 2022-11-17 20:09:08 +01:00
Thomas Göttgens
5991b59ba3 try fixing Wifi reconnects - don't manually reconnect and set auto-reconnect at the same time. 2022-11-17 17:48:46 +01:00
Ben Meadors
bc1fed0fb4 Merge branch 'bug-1821' of https://github.com/meshtastic/firmware into bug-1821 2022-11-15 16:23:08 -06:00
Ben Meadors
b23c364fc0 Test it this way 2022-11-15 16:22:53 -06:00
Thomas Göttgens
28b428c5a0 potential fix for 13300 2022-11-15 22:54:31 +01:00
Thomas Göttgens
5bfc58ed64 testing issues with RAK11200/13300 2022-11-15 21:55:27 +01:00
Thomas Göttgens
e9a34fca7b Portduino Radiolib upstream 2022-11-15 17:01:15 +01:00
Thomas Göttgens
6ce9734ddd Merge pull request #1944 from meshtastic/master
Master Merge
2022-11-15 11:06:14 +01:00
Thomas Göttgens
d42797ffeb fix Portduino Step 1 2022-11-15 10:49:55 +01:00
Thomas Göttgens
b5ebfa9cc3 Portduino WIP 2022-11-15 07:59:01 +01:00
Thomas Göttgens
79eff42c3c Fix and Break radiolib 2022-11-14 10:53:16 +01:00
Thomas Göttgens
7022807fa3 Merge pull request #1943 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-11-14 10:01:13 +01:00
Thomas Göttgens
50a301899e start to sort radiolib out. If we have macros, use them! :-)
Also we need Godmode for the SX1280 for now, hopefully can revert to more sane operation.
2022-11-14 09:49:50 +01:00
thebentern
351db5f6ef [create-pull-request] automated change 2022-11-14 08:40:21 +00:00
Ben Meadors
09fe616ac5 This number is a joke 2022-11-13 18:16:40 -06:00
Ben Meadors
2d7ff39ecc Merge pull request #1942 from meshtastic/develop
Develop to Master
2022-11-13 15:42:41 -06:00
Ben Meadors
6e856efd0e Merge branch 'master' into develop 2022-11-13 14:45:48 -06:00
Ben Meadors
c3c899bc85 Upstream protos for resolving conflicts 2022-11-13 14:45:26 -06:00
Ben Meadors
916f3cac41 Sync protos 2022-11-13 14:40:18 -06:00
Ben Meadors
9b5f358823 Add new heltec targets 2022-11-13 14:30:32 -06:00
Ben Meadors
22119c272d Merge pull request #1941 from meshtastic/add-heltec-wsl
Add Heltec Wireless Stick Lite V3 support
2022-11-13 14:09:50 -06:00
Ben Meadors
8d4c526d16 Add Heltec Wireless Stick Lite V3 support 2022-11-13 13:28:02 -06:00
Ben Meadors
83aebb7a00 Merge pull request #1940 from meshtastic/add-heltec-v3
Added support for Heltec V3
2022-11-13 10:31:37 -06:00
Ben Meadors
33cd5ce6c1 Cleanup 2022-11-13 09:48:38 -06:00
Ben Meadors
f22c2e768e Reorder 2022-11-13 09:47:55 -06:00
Ben Meadors
3d7dea0606 Added support for Heltec V3 2022-11-13 09:45:16 -06:00
Thomas Göttgens
263a421c4a fix pico build 2022-11-13 15:35:18 +01:00
Thomas Göttgens
401b92bdbb reverted too much 2022-11-13 15:28:43 +01:00
Thomas Göttgens
6a696af8f6 Revert "remember which devices were scanned on which bus and set them accordingly." - this is not working at all. 2022-11-13 14:56:52 +01:00
Thomas Göttgens
037d6c253b fix portduino 2022-11-13 11:58:02 +01:00
Thomas Göttgens
b6de79b21a fix build for RP2040 which actually has 2 TwoWire interfaces. 2022-11-12 17:50:33 +01:00
Thomas Göttgens
52cf530356 missing 2 sensor changes 2022-11-12 17:18:17 +01:00
Thomas Göttgens
861ded37db remember which devices were scanned on which bus and set them accordingly. 2022-11-12 17:12:40 +01:00
Thomas Göttgens
7a67388a97 Merge branch 'master' of github.com:meshtastic/firmware into develop 2022-11-12 14:34:51 +01:00
Thomas Göttgens
4f60fad3f6 Merge pull request #1936 from lewisxhe/master
Update tbeam-s3 variant
2022-11-12 14:12:11 +01:00
lewis he
67efd8172a Merge branch 'master' into master 2022-11-12 20:11:52 +08:00
lewis
60fdf9fcb2 Place PMU initialization before scanI2Cdevice 2022-11-12 20:09:25 +08:00
Thomas Göttgens
a606e9b7b5 Merge pull request #1935 from puzzled-pancake/patch-1
Update NZ_865 to 36dBm
2022-11-12 11:55:37 +01:00
Thomas Göttgens
65197a8e48 - Add new Compass Sensor
- speed up I2C Scanning
- make adding sensors less error prone
2022-11-12 11:03:29 +01:00
lewishe
43f769ebac Resolve compilation conflicts 2022-11-12 16:01:30 +08:00
lewishe
dff6eeb90e Merge branch 'master' of https://github.com/lewisxhe/Meshtastic-device 2022-11-12 15:16:54 +08:00
lewishe
61ebdb3367 Add SD card initialization 2022-11-12 15:14:13 +08:00
lewishe
cd95d0865f Repair the sharing of Wire1 between RTC and PMU in tbeams3 2022-11-12 15:12:53 +08:00
lewishe
b68a026627 Update tbeam-s3 variant mapping 2022-11-12 14:39:42 +08:00
lewishe
68ccebafbf Add low-speed crystal initialization for ESP32S3 2022-11-12 14:38:48 +08:00
puzzled-pancake
3737252d39 Update NZ_865 to 36dBm
Updated NZ_865 to 36dBm as per:
https://rrf.rsm.govt.nz/smart-web/smart/page/-smart/domain/licence/LicenceSummary.wdk?id=219752

6dBW = 36dBm/4watt
2022-11-12 17:55:28 +13:00
lewis he
888a8d05c4 Merge branch 'meshtastic:master' into master 2022-11-12 09:56:18 +08:00
Thomas Göttgens
f25f902c20 max power for the 1280 is +13dBm 2022-11-11 08:59:16 +01:00
Thomas Göttgens
a6ea5496b4 Fixed DIO Pin mapping. SX1280 is working 2022-11-10 23:26:31 +01:00
Thomas Göttgens
222424a80c no excuses, this was a SNAFU 2022-11-10 23:06:37 +01:00
Thomas Göttgens
74f31d7d68 Fix SX1280 init 2022-11-10 23:00:01 +01:00
Thomas Göttgens
5c59c8d701 GPS Update 2022-11-10 22:21:07 +01:00
Ben Meadors
30a87e3145 Switch to a smaller sample of devices for cppcheck 2022-11-10 07:26:28 -06:00
Thomas Göttgens
87f7a60f71 fix #1931 coordinates inserted into NMES stream 2022-11-10 13:51:22 +01:00
Thomas Göttgens
f7d8885257 update coordinates for DMS display too 2022-11-10 13:50:38 +01:00
Thomas Göttgens
77410dc3c3 Merge pull request #1932 from meshtastic/master
Master Merge
2022-11-10 11:02:38 +01:00
Thomas Göttgens
d1acf02ee8 Master Merge 2022-11-10 11:01:36 +01:00
Thomas Göttgens
de0954f307 switch to upstream Ethernet lib 2022-11-10 09:35:56 +01:00
Ben Meadors
7da1e5c3e8 Merge pull request #1930 from meshtastic/bug-1928
fix #1928 valid NMEA sentences
2022-11-09 18:06:01 -06:00
Thomas Göttgens
3c11e87197 Merge pull request #1927 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-11-09 23:43:35 +01:00
Thomas Göttgens
b004706eff fix #1928 valid NMEA sentences 2022-11-09 23:42:52 +01:00
thebentern
2247e71a52 [create-pull-request] automated change 2022-11-09 21:39:27 +00:00
Ben Meadors
8146e84200 Merge pull request #1926 from GUVWAF/master
Set preamble length back to 32
2022-11-09 14:29:54 -06:00
GUVWAF
1213ec2d57 Set preamble length back to 32 2022-11-09 21:21:50 +01:00
Thomas Göttgens
30b6cca366 Merge pull request #1925 from meshtastic/bug-1914
fix #1914 and clean up rangetest a bit
2022-11-09 15:14:47 +01:00
Thomas Göttgens
4dd140a887 fix #1914 and clean up rangetest a bit 2022-11-09 15:12:57 +01:00
Ben Meadors
87c555bde3 Changed retention policy 2022-11-09 14:48:53 +01:00
Ben Meadors
c4951b1236 Build cleanup and update deprecated platformio cmd 2022-11-09 14:48:53 +01:00
thebentern
0249eb1307 [create-pull-request] automated change 2022-11-09 14:48:53 +01:00
Ben Meadors
f0279e7f92 Merge pull request #1923 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-11-09 07:33:27 -06:00
Ben Meadors
1a50181ace Merge branch 'master' into create-pull-request/patch 2022-11-09 07:33:02 -06:00
Ben Meadors
d77bc239c1 Changed retention policy 2022-11-09 07:20:53 -06:00
Ben Meadors
cb283f4c57 Build cleanup and update deprecated platformio cmd 2022-11-09 07:14:08 -06:00
Thomas Göttgens
803858ab0a change default pins for codec2 to work on TLORA 2.1-1.8 2022-11-09 11:50:13 +01:00
thebentern
728fc8cbad [create-pull-request] automated change 2022-11-08 22:51:44 +00:00
Thomas Göttgens
ad05b91f89 Merge pull request #1922 from meshtastic/develop
fix #1916
2022-11-08 23:15:04 +01:00
Thomas Göttgens
671e6cde44 Merge branch 'master' into develop 2022-11-08 22:33:38 +01:00
Thomas Göttgens
7a3ad0afba fix #1916 2022-11-08 22:32:53 +01:00
Ben Meadors
d9f1704e36 Merge pull request #1921 from meshtastic/update-phoneapi
Updated admin module and protobufs
2022-11-08 15:32:20 -06:00
Ben Meadors
32223a818c Updated admin module and protobufs 2022-11-08 15:04:24 -06:00
Thomas Göttgens
31e13d4de3 Merge pull request #1920 from meshtastic/develop
rename wifi_mode to eth_mode
2022-11-08 21:55:06 +01:00
Thomas Göttgens
815bd6321b Merge branch 'master' into develop 2022-11-08 21:54:38 +01:00
Thomas Göttgens
9f9bd40343 rename wifi_mode to eth_mode 2022-11-08 21:53:44 +01:00
Ben Meadors
2331226bb6 Bump version 2022-11-08 07:27:48 -06:00
Ben Meadors
80ff118f0f Merge pull request #1918 from meshtastic/develop
Develop to master
2022-11-08 07:26:14 -06:00
Ben Meadors
d6eeda7136 Merge pull request #1917 from meshtastic/master
Master Rollup
2022-11-08 07:25:40 -06:00
Ben Meadors
fb92e498f0 Merge pull request #1902 from GUVWAF/develop
Change preambleLength to 8 symbols to reduce airtime
2022-11-08 07:25:02 -06:00
Ben Meadors
bf8d8886fd Merge branch 'develop' into master 2022-11-08 07:20:29 -06:00
Ben Meadors
a695726f2a Merge pull request #1912 from meshtastic/docker-compose
Added docker compose multiple nodes example
2022-11-08 07:12:36 -06:00
Ben Meadors
6dc4172110 Merge branch 'master' into docker-compose 2022-11-08 07:12:21 -06:00
Thomas Göttgens
25a9ee8eb6 Merge branch 'master' of github.com:meshtastic/firmware 2022-11-08 13:40:07 +01:00
Ben Meadors
e122232761 Removed defunct line 2022-11-07 13:29:34 -06:00
Ben Meadors
b13eaee6b3 More fun 2022-11-07 13:28:37 -06:00
Ben Meadors
f0f5107a5d Added docker compose 4 nodes example 2022-11-06 19:22:20 -06:00
Ben Meadors
0832cc50a8 Add a docker-compose 2022-11-06 13:19:49 -06:00
Thomas Göttgens
962a3d0c55 Merge pull request #1911 from meshtastic/caveman99-patch-1
Fix assert
2022-11-06 19:06:26 +01:00
Thomas Göttgens
6934e0bce7 Fix assert 2022-11-06 18:36:17 +01:00
Ben Meadors
3492d64177 Alpine 2022-11-06 18:22:52 +01:00
Thomas Göttgens
057109dcac Reduce retention to 30 days. 2022-11-06 18:22:52 +01:00
Ben Meadors
12fa08007d Docker is back 2022-11-06 18:22:52 +01:00
Ben Meadors
3562d34555 Remove flag 2022-11-06 18:22:52 +01:00
Ben Meadors
3ca6f645d4 Portduino build flags 2022-11-06 18:22:52 +01:00
Ben Meadors
6694d31d07 Somehow I still missed one :-| 2022-11-06 18:22:52 +01:00
Ben Meadors
d15edf1955 Update NMEAWPL.h 2022-11-06 18:22:52 +01:00
Ben Meadors
e1ce037550 Update NMEAWPL.cpp 2022-11-06 18:22:52 +01:00
Ben Meadors
f9c376a524 Update NMEAWPL.cpp 2022-11-06 18:22:52 +01:00
Ben Meadors
26a907444c Fix for alpine linux builds 2022-11-06 18:22:52 +01:00
Ben Meadors
5c214bf4d8 Merge pull request #1908 from meshtastic/docker-returns
Docker is back
2022-11-06 09:31:24 -06:00
Ben Meadors
5151a5641e Merge branch 'master' into docker-returns 2022-11-06 09:31:02 -06:00
Ben Meadors
9513209b70 Alpine 2022-11-06 09:30:46 -06:00
Thomas Göttgens
f1416ac9f7 Reduce retention to 30 days. 2022-11-06 14:49:02 +01:00
Thomas Göttgens
631db56a44 Next try, plus change cppcheck defines back. 2022-11-06 14:32:02 +01:00
Thomas Göttgens
7b378d36cc try to make cppcheck happy again 2022-11-06 13:29:01 +01:00
Thomas Göttgens
8ab269e1b3 revert BME680 to default settings, they are working good. Our init was just replicating what's in the lib anyway. 2022-11-06 10:52:54 +01:00
Thomas Göttgens
7652253b8d optimize BME680 usage 2022-11-06 10:37:14 +01:00
Ben Meadors
9805319940 Docker is back 2022-11-05 21:08:29 -05:00
Ben Meadors
e1e607cba3 Remove flag 2022-11-05 19:09:04 -05:00
Ben Meadors
d74bcd3583 Portduino build flags 2022-11-05 18:21:35 -05:00
Ben Meadors
9c0483975c Somehow I still missed one :-| 2022-11-05 15:34:54 -05:00
Ben Meadors
2fb85dc129 Merge pull request #1906 from meshtastic/thebentern-patch-1
Fix for alpine linux builds
2022-11-05 15:30:10 -05:00
Ben Meadors
d641adc0fc Update NMEAWPL.h 2022-11-05 15:20:09 -05:00
Ben Meadors
a7a020f431 Update NMEAWPL.cpp 2022-11-05 15:14:08 -05:00
Ben Meadors
a08ac5a47e Update NMEAWPL.cpp 2022-11-05 15:11:11 -05:00
Ben Meadors
30e5706eaa Fix for alpine linux builds 2022-11-05 15:10:43 -05:00
Thomas Göttgens
16444c190d Ignore Band power limits for licensed HAMs 2022-11-05 20:13:47 +01:00
Thomas Göttgens
3d9633a56c Different Sensor access, should prevent overheating/wrong measurements. 2022-11-05 20:12:41 +01:00
GUVWAF
c0e630522c Merge branch 'meshtastic:develop' into develop 2022-11-05 19:09:36 +01:00
Ben Meadors
9422d31f55 Merge pull request #1905 from meshtastic/trying-again
Trying again
2022-11-05 09:35:51 -05:00
Ben Meadors
087c7c19af Update protos 2022-11-05 09:34:33 -05:00
Ben Meadors
3476b35fca Merge remote-tracking branch 'origin/master' into trying-again 2022-11-05 09:33:39 -05:00
Ben Meadors
950d5defda Master to develop (resolves conflicts) (#1903)
* Rearranging deck chairs, 900M22S working, 30S not

* We do have wire, just not where it's expected

* Put more of the module specific pins in their blocks

* tryfix compile with NO_SCREEN

* Portduino only: don't continue to try rebooting (#1887)

Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>

* Support for TLORA 2.1-1.8

* Don't allow arbitrary channel name for admin (#1886)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Experimental DIY nrf52840 feather support (#1884)

* Experimental DIY nrf52840 feather support

* Fix target

* sx1262 wiring

* Remove lib

* Don't consider Response as ACK for FloodingRouter (#1885)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Fix feather diy (#1892)

* Fix variant

* Fix feather diy target

* [modules][external notifications] allow select channel to listen to

* Fix feather diy pin mapping (#1894)

Thanks to @markbirss

* [create-pull-request] automated change

* Override Screen Autodtect

* Maybe fix crash of this board.

* Fixes reset loop with new espressif32 platform on tlora-v2

 Sending a pulse to the OLED_RESET Pin 16 results in a reset loop using recent version of the espressif32 platform.

* Experiment with self hosted action runner

* Fix MQTT on ETH

* revert the tryfix

* Cheating

* Cleanup artifacts older than 1 month

* Update cleanup_artifacts.yml

* Update cleanup_artifacts.yml

* Update cleanup_artifacts.yml

* Delete cleanup_artifacts.yml

* fix: use RF95_IRQ for wakeup source in doLightSleep (#1899)

Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Update protos

* Update protos

Co-authored-by: code8buster <communismisgreat@national.shitposting.agency>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com>
Co-authored-by: Mykhailo Lesyk <m@lesyk.org>
Co-authored-by: Mykhailo Lesyk <lesykm@users.noreply.github.com>
Co-authored-by: caveman99 <caveman99@users.noreply.github.com>
Co-authored-by: he-leon <he-leon@users.noreply.github.com>
Co-authored-by: Lars Weber <weber@weber-software.com>
2022-11-05 09:28:41 -05:00
Ben Meadors
c6f060a24f Add develop to CI 2022-11-05 09:21:51 -05:00
Thomas Göttgens
1716c4d6f9 Allow static IP for WLAN
and portentially fix reconnect issues
2022-11-05 15:02:06 +01:00
Ben Meadors
cda7a60734 Update protos 2022-11-05 08:43:44 -05:00
Lars Weber
ed26ab801c fix: use RF95_IRQ for wakeup source in doLightSleep (#1899)
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-11-05 08:37:00 -05:00
Thomas Göttgens
8874a6e488 update protos 2022-11-05 14:18:57 +01:00
Thomas Göttgens
657ae44b6f Merge branch 'master' of github.com:meshtastic/firmware 2022-11-05 14:11:19 +01:00
Ben Meadors
01381057c5 Delete cleanup_artifacts.yml 2022-11-05 08:06:28 -05:00
Ben Meadors
3dc6ed5672 Update cleanup_artifacts.yml 2022-11-05 06:57:47 -05:00
Ben Meadors
764b48e04a Update cleanup_artifacts.yml 2022-11-05 06:47:00 -05:00
Ben Meadors
4c931967c7 Update cleanup_artifacts.yml 2022-11-05 06:44:08 -05:00
Ben Meadors
a547a791ba Cleanup artifacts older than 1 month 2022-11-05 06:42:53 -05:00
GUVWAF
176072801b Change preambleLength to 8 symbols to reduce airtime 2022-11-05 09:58:10 +01:00
Thomas Göttgens
b941c51cf7 Merge pull request #1900 from meshtastic/mqtt-eth
Mqtt eth
2022-11-04 23:13:18 +01:00
Thomas Göttgens
8a9fd6846e Merge branch 'master' into mqtt-eth 2022-11-04 22:44:42 +01:00
Ben Meadors
a49355133c Cheating 2022-11-04 14:23:22 -05:00
Thomas Göttgens
09cdc20440 manual merge of changes from Master 2022-11-04 19:56:44 +01:00
Thomas Göttgens
1c0dfe47c8 Merge branch 'master' of github.com:meshtastic/firmware 2022-11-04 19:51:22 +01:00
Thomas Göttgens
66623693eb Merge branch 'master' into mqtt-eth 2022-11-04 19:48:57 +01:00
Thomas Göttgens
7c692444e5 revert the tryfix 2022-11-04 19:48:28 +01:00
Thomas Göttgens
4ccb4393c5 Fix MQTT on ETH 2022-11-04 19:44:45 +01:00
Ben Meadors
b2e540b114 Experiment with self hosted action runner 2022-11-04 13:43:16 -05:00
Thomas Göttgens
a5d1165c54 Merge branch 'master' of github.com:meshtastic/firmware 2022-11-04 19:34:35 +01:00
Thomas Göttgens
aa321e06dd Merge pull request #1898 from he-leon/patch-1
Fixes reset loop with new espressif32 platform on tlora-v2
2022-11-04 19:26:16 +01:00
he-leon
8b84ac8a6c Fixes reset loop with new espressif32 platform on tlora-v2
Sending a pulse to the OLED_RESET Pin 16 results in a reset loop using recent version of the espressif32 platform.
2022-11-04 16:48:49 +01:00
Thomas Göttgens
6c07fbfc12 Merge pull request #1896 from meshtastic/oled-config
Oled config
2022-11-03 23:05:09 +01:00
Thomas Göttgens
04a478a5ad Maybe fix crash of this board. 2022-11-03 22:50:54 +01:00
Thomas Göttgens
acfa186d44 Override Screen Autodtect 2022-11-03 22:44:22 +01:00
Thomas Göttgens
3db504c470 Merge branch 'master' of github.com:meshtastic/firmware 2022-11-03 22:38:05 +01:00
Thomas Göttgens
3e5955be44 Merge pull request #1895 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-11-03 22:36:16 +01:00
caveman99
f1afbf2c0f [create-pull-request] automated change 2022-11-03 21:35:06 +00:00
Thomas Göttgens
20c559382d Merge branch 'master' of github.com:meshtastic/firmware 2022-11-03 22:32:27 +01:00
Thomas Göttgens
a3f1c02347 Merge pull request #1882 from lesykm/ext_notification_channel
[modules][external notifications] allow select channel to listen to
2022-11-03 22:21:43 +01:00
Ben Meadors
f5945d429e Merge branch 'master' into ext_notification_channel 2022-11-03 14:29:15 -05:00
Ben Meadors
a3eced53bb Fix feather diy pin mapping (#1894)
Thanks to @markbirss
2022-11-03 14:28:49 -05:00
Thomas Göttgens
20686cc66a Show boot logo / OEM Logo longer - 5 seconds each now. 2022-11-03 09:46:32 +01:00
Thomas Göttgens
5608fa32f7 Merge branch 'master' of github.com:meshtastic/firmware 2022-11-03 08:29:28 +01:00
Mykhailo Lesyk
a0c5defda6 Merge branch 'master' into ext_notification_channel 2022-11-02 20:34:23 -07:00
Mykhailo Lesyk
25a3a09d5f [modules][external notifications] allow select channel to listen to 2022-11-02 20:31:28 -07:00
Ben Meadors
593301146e Fix feather diy (#1892)
* Fix variant

* Fix feather diy target
2022-11-02 15:57:47 -05:00
GUVWAF
5715ddc361 Don't consider Response as ACK for FloodingRouter (#1885)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-11-02 14:32:18 -05:00
Thomas Göttgens
09ddde177c codec2 Audio Support for SX1280 (untested) 2022-11-02 18:23:41 +01:00
Ben Meadors
ef18b173cd Experimental DIY nrf52840 feather support (#1884)
* Experimental DIY nrf52840 feather support

* Fix target

* sx1262 wiring

* Remove lib
2022-11-02 18:19:09 +01:00
GUVWAF
ac4e88e0d2 Don't allow arbitrary channel name for admin (#1886)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-11-02 18:19:09 +01:00
Thomas Göttgens
3e82cd7dd4 Support for TLORA 2.1-1.8 2022-11-02 18:19:09 +01:00
GUVWAF
b1f2025558 Portduino only: don't continue to try rebooting (#1887)
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2022-11-02 18:19:09 +01:00
Thomas Göttgens
57ca5fea81 tryfix compile with NO_SCREEN 2022-11-02 18:19:09 +01:00
code8buster
0ce018cf97 Put more of the module specific pins in their blocks 2022-11-02 18:19:09 +01:00
code8buster
15a8710e69 We do have wire, just not where it's expected 2022-11-02 18:19:09 +01:00
code8buster
cae75dcb6d Rearranging deck chairs, 900M22S working, 30S not 2022-11-02 18:19:09 +01:00
Thomas Göttgens
d5e2b70b71 Merge pull request #1888 from meshtastic/TLORA-18
Support for TLORA 2.1-1.8
2022-11-02 18:16:44 +01:00
Thomas Göttgens
05b9fd04c6 switch submodule branch to develop 2022-11-02 15:08:49 +01:00
Thomas Göttgens
4650989774 Merge branch 'master' into TLORA-18 2022-11-02 15:01:40 +01:00
Thomas Göttgens
bcc77efb88 Merge branch 'master' of github.com:meshtastic/firmware 2022-11-02 14:13:04 +01:00
Ben Meadors
39c1637030 Experimental DIY nrf52840 feather support (#1884)
* Experimental DIY nrf52840 feather support

* Fix target

* sx1262 wiring

* Remove lib
2022-11-02 07:48:14 -05:00
Ben Meadors
6d3028f213 Merge branch 'master' into TLORA-18 2022-11-02 07:20:39 -05:00
GUVWAF
b2969b2faf Don't allow arbitrary channel name for admin (#1886)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-11-02 07:18:15 -05:00
Thomas Göttgens
d07350e4a4 Merge branch 'master' into TLORA-18 2022-11-02 13:14:51 +01:00
Thomas Göttgens
12df55c3d4 Support for TLORA 2.1-1.8 2022-11-02 13:12:15 +01:00
GUVWAF
85b541bfd9 Portduino only: don't continue to try rebooting (#1887)
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2022-11-02 06:58:14 -05:00
Thomas Göttgens
a9c6d6a80c Merge pull request #1878 from code8buster/master
Making meshtastic-dr-dev E22-900M22S/M30S work alternately
2022-11-02 10:34:08 +01:00
Thomas Göttgens
32ad8aaa4e tryfix compile with NO_SCREEN 2022-11-02 10:17:59 +01:00
code8buster
3d8e6aead2 Put more of the module specific pins in their blocks 2022-10-31 21:54:05 -04:00
code8buster
2747600a3a Merge branch 'meshtastic:master' into master 2022-11-01 01:35:34 +00:00
Thomas Göttgens
b7ef63230b new location of ota firmware 2022-10-31 14:50:31 +01:00
Ben Meadors
b4d6c8f37b Update verbiage 2022-10-31 08:32:21 -05:00
Ben Meadors
6a907348b4 Merge branch 'master' into master 2022-10-31 08:17:37 -05:00
Ben Meadors
18ab8749ff Update protobuf ref 2022-10-31 08:09:22 -05:00
Ben Meadors
a1ed5cdffc 2.0 (To be merged Nov 1) (#1870)
* 2.0

* Catch the right version of the common files
2022-10-31 07:51:44 -05:00
Ben Meadors
760d463bf5 Merge branch 'master' into master 2022-10-31 06:12:16 -05:00
Sacha Weatherstone
5ed2a4e8bb Merge pull request #1879 from meshtastic/update-repo-links
Update links
2022-10-31 20:09:37 +11:00
Sacha Weatherstone
60e95ef3bd Fix typo 2022-10-31 18:54:47 +10:00
Sacha Weatherstone
5b648be2a5 More renaming 2022-10-31 18:47:10 +10:00
Sacha Weatherstone
0149171e1a update repobeats url 2022-10-31 18:21:10 +10:00
Sacha Weatherstone
b24caa1e06 Update links 2022-10-31 17:32:38 +10:00
code8buster
8fa71afb72 We do have wire, just not where it's expected 2022-10-30 22:30:33 -04:00
code8buster
309a3d5396 Rearranging deck chairs, 900M22S working, 30S not 2022-10-30 22:28:25 -04:00
Ben Meadors
afafb3ba32 Fixing a number of T-Beam poweroff display issues (#1876) 2022-10-30 20:40:30 -05:00
Ben Meadors
311835a231 Implement extended device metadata (#1874)
* Implement extended device metadata

* HAS_BLUETOOTH should be global
2022-10-30 10:02:11 -05:00
code8buster
1f9db0a8fe Disaster.radio dev board support update (#1873)
* Bringing changes from 1.2-legacy over to the new structure in 1.3/2.0

* Add meshtastic-dr-dev to CI artifact workflow
2022-10-29 16:37:27 -05:00
Ben Meadors
d6c9327aef Opposite logic for use_preset based channel name (#1871) 2022-10-29 11:40:05 -05:00
Thomas Göttgens
0091863888 Merge pull request #1867 from t413/techo-shutdown-backlight
Powers off eink backlights before shutdown
2022-10-28 11:23:05 +02:00
Ben Meadors
051ce5e09f Merge branch 'master' into techo-shutdown-backlight 2022-10-27 20:17:31 -05:00
timo
6146b773cf Better #define guard for PIN_EINK_EN 2022-10-27 17:59:53 -07:00
Thomas Göttgens
8a4341fec4 use new lora.use_preset bool (#1868) 2022-10-27 19:15:16 -05:00
Tim O'Brien
154b7d256c Powers off eink backlights before shutdown
- t-echo boards in particular need this
- follows the existing defines structure
2022-10-27 11:03:27 -07:00
Thomas Göttgens
548b0d0b53 Merge pull request #1866 from markbirss/master
Enable RAK14000 2.13 inch b/w E-Ink partial update support
2022-10-27 11:36:06 +02:00
Mark Trevor Birss
e59361425f Merge branch 'master' into master 2022-10-27 09:06:38 +02:00
Thomas Göttgens
713e0f4260 Merge pull request #1865 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-27 09:06:22 +02:00
Mark Trevor Birss
8a1bf8cd86 RAK14000 2.13" b/w E-Ink partial update support
Changed from GxEPD2_213_B74 (which was not going to give partial update support on this display) to GxEPD2_213_BN - RAK14000 2.13 inch b/w 250x122
2022-10-27 08:59:39 +02:00
Mark Trevor Birss
f474953b51 RAK14000 2.13 inch b/w E-Ink partial update support
Changed from GxEPD2_213_B74 (which was not going to give partial update support on this display) to GxEPD2_213_BN - RAK14000 2.13 inch b/w 250x122
2022-10-27 08:56:04 +02:00
thebentern
d5ded53f05 [create-pull-request] automated change 2022-10-26 22:21:43 +00:00
Ben Meadors
82bcd391cd Fix those refs 2022-10-26 16:50:58 -05:00
Thomas Göttgens
058689709f Merge pull request #1864 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-26 23:33:49 +02:00
thebentern
23c9fa0b56 [create-pull-request] automated change 2022-10-26 21:29:46 +00:00
Thomas Göttgens
eb29f10634 Merge pull request #1861 from meshtastic/lib-fix
Lib fix + NTP fix
2022-10-26 19:24:20 +02:00
Thomas Göttgens
d5a9e3114a Update ethClient.cpp 2022-10-26 18:37:51 +02:00
Thomas Göttgens
7417729482 debug removed 2022-10-26 18:37:20 +02:00
Thomas Göttgens
d5c407c098 remove accidental commit 2022-10-26 18:36:41 +02:00
Thomas Göttgens
a1256818d9 update library location 2022-10-26 18:25:31 +02:00
Thomas Göttgens
689cec14aa Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-26 18:15:07 +02:00
Thomas Göttgens
04225826f6 Bump ConfigDB Version.
this forces a factory reset on upgrade.
2022-10-26 18:12:31 +02:00
Thomas Göttgens
86787e60f3 Merge pull request #1860 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-26 17:56:41 +02:00
caveman99
0c3ec9254d [create-pull-request] automated change 2022-10-26 15:56:26 +00:00
Thomas Göttgens
c0770402ce Merge pull request #1855 from meshtastic/remove-softap
Remove Captive Portal and SoftAP Mode
2022-10-26 17:55:45 +02:00
Thomas Göttgens
d7c98062ce Merge remote-tracking branch 'remotes/origin/master' into remove-softap 2022-10-26 17:54:21 +02:00
Thomas Göttgens
497c0b7a47 don't rush failed time updates 2022-10-26 17:38:53 +02:00
Thomas Göttgens
d588dde007 Merge pull request #1842 from meshtastic/RAK13800
Rak13800
2022-10-26 11:33:22 +02:00
Thomas Göttgens
3de0a3adfc Merge branch 'RAK13800' of github.com:meshtastic/Meshtastic-device 2022-10-26 11:10:17 +02:00
Thomas Göttgens
b7ebe03ca8 API Server and DHCP Lease Management 2022-10-26 11:09:59 +02:00
Thomas Göttgens
a7fb88e293 make cppcheck happy about stuff it shouldn't care for 2022-10-26 09:16:54 +02:00
Thomas Göttgens
6e1b1e3ed7 Merge branch 'RAK13800' of github.com:meshtastic/Meshtastic-device 2022-10-26 00:07:33 +02:00
Thomas Göttgens
a66538fe55 MQTT is working over ethernet 2022-10-26 00:07:02 +02:00
Ben Meadors
b2913be086 Merge branch 'master' into RAK13800 2022-10-25 07:04:46 -05:00
Thomas Göttgens
602e65d898 fix non-ESP32 builds 2022-10-25 12:42:08 +02:00
Thomas Göttgens
338c9c1e0c Remove Captive Portal and SoftAP Mode 2022-10-25 11:53:22 +02:00
Thomas Göttgens
9fac57b713 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-24 23:11:56 +02:00
Ben Meadors
761804b17a Send network ping on triple-click (#1852)
* Send network ping on multi-press

* Refresh myNodeInfo before sending

* Cleanup and screen print

* Update ButtonThread.h
2022-10-24 11:03:54 -05:00
Ben Meadors
c47401d729 Remove setting fixed pin on double-click (#1851)
* Remove setting fixed pin on double-click

* Remove disablePin method
2022-10-24 07:16:13 -05:00
Thomas Göttgens
aab52f1e8d Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-23 16:41:04 +02:00
Ben Meadors
4d2e44d64b Merge branch 'master' into RAK13800 2022-10-22 19:56:12 -05:00
Mykhailo Lesyk
41267a42f7 [rak4630] enable 3.3v periphery before scan for i2c devices (#1847)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-10-22 19:55:34 -05:00
Ben Meadors
568434d0fa Use preset wiring (#1845)
* When we init default, set use_preset to true

* Only use modem_preset when we use_preset

* When we init default, set use_preset to true (#1843) (#1844)
2022-10-22 18:51:22 -05:00
Ben Meadors
2c1bbf1ac6 When we init default, set use_preset to true (#1843) 2022-10-22 15:42:21 -05:00
Thomas Göttgens
1e97dcbb4c Portduino is always special. 2022-10-22 16:53:57 +02:00
Thomas Göttgens
103c82bc2c only build on vanilla RAK4631 for now. 2022-10-22 16:42:36 +02:00
Thomas Göttgens
f3fee5f4fb first murmurs of ethernet support 2022-10-22 16:29:50 +02:00
Thomas Göttgens
564feadc0d Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-22 16:28:57 +02:00
Thomas Göttgens
f05e0f3a81 Merge pull request #1841 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-22 16:20:57 +02:00
caveman99
cb26bc3871 [create-pull-request] automated change 2022-10-22 14:18:18 +00:00
Thomas Göttgens
f6251eef27 Merge pull request #1840 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-22 16:17:46 +02:00
thebentern
a9d6ef5990 [create-pull-request] automated change 2022-10-22 13:28:36 +00:00
Thomas Göttgens
60da55d6dd Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-22 14:25:43 +02:00
Thomas Göttgens
05147c016c Merge pull request #1839 from meshtastic/pwm-notify
use PWM buzzer on notification module.
2022-10-22 14:25:32 +02:00
Thomas Göttgens
f7655f3abe fix compiler warning 2022-10-22 14:18:47 +02:00
Thomas Göttgens
62b3509009 missed one 2022-10-22 14:13:45 +02:00
Thomas Göttgens
d817889255 don't depend on EXT_NOTIFY_OUT being defined. 2022-10-22 13:45:43 +02:00
Thomas Göttgens
d4ddcdd91e use PWM buzzer on notification module. To activate set moduleConfig.external_notification.output equal to the PIN_BUZZER. If another value is set, the traditional digital mode is used 2022-10-22 13:35:34 +02:00
Thomas Göttgens
0bda4c2f76 Merge pull request #1838 from meshtastic/filebrowser-fix
fix json filebrowser in web server
2022-10-22 12:35:31 +02:00
lewis he
da2279c295 Merge branch 'meshtastic:master' into master 2022-10-22 18:22:12 +08:00
Thomas Göttgens
be8da851a6 fix json filebrowser in web server 2022-10-22 11:55:01 +02:00
Thomas Göttgens
d4459a48b9 Merge pull request #1831 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-21 09:43:30 +02:00
thebentern
197bd2c3e1 [create-pull-request] automated change 2022-10-20 22:04:56 +00:00
Ben Meadors
d4ea9568ac Save devicestate (nodedb) on position config change (#1829) 2022-10-20 13:14:53 -05:00
Ben Meadors
97968213ff Factory reset should include modules and channels (#1828) 2022-10-20 07:51:52 -05:00
Thomas Göttgens
995885962d Merge pull request #1826 from meshtastic/oem-proto
wire in OEM.proto keystore
2022-10-20 09:10:01 +02:00
Ben Meadors
ddc1928bbb Merge branch 'master' into oem-proto 2022-10-19 19:22:35 -05:00
Ben Meadors
056a93f0c9 Consolidate reboots (#1827) 2022-10-19 19:19:04 -05:00
Ben Meadors
3d9845ff6d Update checkout version and release string 2022-10-19 11:43:24 -05:00
Ben Meadors
b615463981 Update download-artifiact version 2022-10-19 11:35:25 -05:00
Ben Meadors
d3540e82ff I think these tokens are extra 2022-10-19 10:44:09 -05:00
Ben Meadors
15ec8ba6a3 Whoops 2022-10-19 08:58:14 -05:00
Ben Meadors
db12eab083 Update setup-python 2022-10-19 08:51:00 -05:00
Thomas Göttgens
7d8c77a4b2 Merge branch 'master' into oem-proto 2022-10-19 15:42:21 +02:00
Thomas Göttgens
7c8c479b96 wire in OEM.proto keystore 2022-10-19 15:39:06 +02:00
Ben Meadors
e29ae1cc91 Update upload-artifact version 2022-10-19 08:11:28 -05:00
Ben Meadors
089dd5b4d7 Update github cache action version 2022-10-19 07:38:44 -05:00
Ben Meadors
06285b599c Update deprecated ::set-output commands 2022-10-19 07:35:16 -05:00
Thomas Göttgens
1b6395b4e4 Merge pull request #1825 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-19 13:45:12 +02:00
caveman99
2236f74a55 [create-pull-request] automated change 2022-10-19 11:44:12 +00:00
Thomas Göttgens
43c9ab1faa Merge pull request #1824 from meshtastic/caveman99-patch1
Dont retransmit packets destined for ourselves.
2022-10-19 11:56:44 +02:00
Thomas Göttgens
b56f9b3b16 Dont retransmit packets destined for ourselves.
Solves assert failed: virtual ErrorCode Router::send(MeshPacket*) Router.cpp:189 (p->to != nodeDB.getNodeNum())
2022-10-19 11:44:26 +02:00
Thomas Göttgens
303396dfc3 Merge pull request #1823 from meshtastic/json-cleanup
Json cleanup
2022-10-19 11:20:24 +02:00
Thomas Göttgens
075a53ced0 Update MQTT.cpp 2022-10-19 11:04:13 +02:00
Thomas Göttgens
18ccb38824 Update MQTT.cpp 2022-10-19 11:01:23 +02:00
Thomas Göttgens
c97831963b just for good measure, correct json type field 2022-10-19 10:58:46 +02:00
Thomas Göttgens
7c3dc076d2 only convert and send JSON topics with type 'sendtext' 2022-10-19 10:54:56 +02:00
Thomas Göttgens
b859347ecd Merge pull request #1822 from meshtastic/json-cleanup
possible fix for stuck MQTT handler.
2022-10-19 00:02:00 +02:00
Thomas Göttgens
ea87193c8f possible fix for stuck MQTT handler. 2022-10-18 21:51:40 +02:00
Thomas Göttgens
c1381b9ebd Merge pull request #1818 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-18 12:21:02 +02:00
caveman99
227cd93e67 [create-pull-request] automated change 2022-10-18 10:20:06 +00:00
Thomas Göttgens
f68f8e5547 Merge pull request #1817 from meshtastic/json-cleanup
fix JSON red herring error messages and Redirectable Print's new fixed buffer
2022-10-18 11:57:11 +02:00
Thomas Göttgens
943e6f02d4 Merge branch 'master' into json-cleanup 2022-10-18 11:18:34 +02:00
Thomas Göttgens
01298a7b01 Update RedirectablePrint.cpp 2022-10-18 11:18:12 +02:00
Thomas Göttgens
46aee8274f fix JSON red herring error messages and Redirectable Print's new fixed buffer. 2022-10-18 11:16:21 +02:00
Thomas Göttgens
f76a2eeb9e Merge pull request #1816 from meshtastic/wifi-disconnect-fix
If wifi credentials ever go stale, dump them.
2022-10-18 11:15:19 +02:00
Thomas Göttgens
3b7c0be842 don't irritate people with non working options 2022-10-18 10:30:50 +02:00
Thomas Göttgens
49378a9145 If wifi credentials ever go stale, dump them.
This solves the dreaded 5 - STA_DISCONNECTED / 2 - AUTH_EXPIRE loops
2022-10-18 10:16:47 +02:00
Thomas Göttgens
139f61d03e Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-17 16:45:28 +02:00
Ben Meadors
f10d04591d Don't make a nested json object payload (#1815) 2022-10-17 09:09:28 -05:00
Thomas Göttgens
e65d9e8ccd Add support for SX1281 on 2.4 GHz (#1809)
* Add support for SX1281 on 2.4 GHz

* only allow wide BW settings when the right chip is detected

* portduino cannot use this chip yet as it uses an old modified version of radiolib

* missed a spot

* Attempt to supress false positive

* Attempt to supress false positive

* Trying casing from the cpp-check manual

* Trying casing from the cpp-check manual

* Inline suppr should be default but...

* Maybe casting it will make the damn thing shut up

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-10-17 08:33:41 -05:00
Ben Meadors
1fc3c0af70 Update variant.h (#1814) 2022-10-17 08:07:18 -05:00
Thomas Göttgens
e4751e34ae missed a spot 2022-10-17 10:34:43 +02:00
Thomas Göttgens
e922169e72 Merge branch 'LORA-24' of github.com:meshtastic/Meshtastic-device 2022-10-17 10:32:35 +02:00
Thomas Göttgens
2b851ef6ae Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-17 10:32:05 +02:00
Thomas Göttgens
5f4b93aba2 portduino cannot use this chip yet as it uses an old modified version of radiolib 2022-10-17 10:31:29 +02:00
Thomas Göttgens
b66d1a5dab Merge branch 'master' into LORA-24 2022-10-17 10:05:15 +02:00
Thomas Göttgens
867525eff8 Merge pull request #1813 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-17 10:05:00 +02:00
caveman99
7dcc981a2c [create-pull-request] automated change 2022-10-17 08:04:36 +00:00
Thomas Göttgens
38fed8a61e Merge branch 'LORA-24' of github.com:meshtastic/Meshtastic-device 2022-10-17 10:00:41 +02:00
Thomas Göttgens
31c2c8a7a3 only allow wide BW settings when the right chip is detected 2022-10-17 10:00:00 +02:00
Thomas Göttgens
a081d28e36 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-17 09:45:39 +02:00
Ben Meadors
93bb4f84f9 Merge branch 'master' into LORA-24 2022-10-16 17:27:18 -05:00
github-actions[bot]
72e04edd7f [create-pull-request] automated change (#1812)
Co-authored-by: thebentern <thebentern@users.noreply.github.com>
2022-10-16 17:26:55 -05:00
Ben Meadors
b0d05522c0 Make telemetry packets minimum priority (#1810) 2022-10-16 15:59:59 -05:00
Thomas Göttgens
f6119639bb Add support for SX1281 on 2.4 GHz 2022-10-16 19:07:58 +02:00
Ben Meadors
fc57a9daa4 Send environment telemetry every minute (#1808) 2022-10-16 11:36:38 -05:00
Thomas Göttgens
d8f44d7b1b Merge pull request #1807 from meshtastic/nmea-serial
Add NMEA output mode to serial module
2022-10-16 17:15:24 +02:00
Ben Meadors
efe2e90a03 Merge branch 'master' into nmea-serial 2022-10-16 09:59:30 -05:00
Ben Meadors
45f9dee89a Telemetry phone api guard (#1805)
* Delay start of telemetry modules

* Don't send unless our toPhoneQueue is empty

* Get wrecked, checks!
2022-10-16 09:58:58 -05:00
Thomas Göttgens
cc73d2c2f2 Sigh... 2022-10-16 16:51:17 +02:00
Thomas Göttgens
b1f789dddd fix cppcheck 2022-10-16 16:45:32 +02:00
Thomas Göttgens
d3e9dbf6a9 Add NMEA output mode (my own position, and other devices as waypoints) to serial module 2022-10-16 16:37:38 +02:00
Thomas Göttgens
44529620ad Merge pull request #1806 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-16 16:25:34 +02:00
caveman99
7a9673dc37 [create-pull-request] automated change 2022-10-16 14:24:27 +00:00
Thomas Göttgens
27bcf67c0c add routine to output waypoint data 2022-10-16 12:28:49 +02:00
Ben Meadors
7fde56b8ac Make telemetry logging more concise (#1804)
* Make telemetry logging more concise

* Whoops
2022-10-15 18:48:34 -05:00
Ben Meadors
6b614a2d6a Added LPS22HB (RAK-1902) sensor support (#1802) 2022-10-15 14:55:57 -05:00
Ben Meadors
1e1509fbf5 Use pio registry (#1801) 2022-10-15 12:34:52 -05:00
Ben Meadors
a3e67f8e4b SHTC3 Sensor (RAK-1901) support (#1800) 2022-10-15 09:11:05 -05:00
Ben Meadors
028b25cfe8 Change RTCQuality acceptance criteria (#1797)
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2022-10-14 19:12:55 -05:00
Ben Meadors
2555e082d6 Add nrf52 to serial module registration (#1799)
* Add nrf52 to serial module registration

* Update Modules.cpp

* Update Modules.cpp

* Update Modules.cpp
2022-10-14 11:38:56 -05:00
Thomas Göttgens
f8fa721c72 Merge pull request #1798 from meshtastic/i2cscan
Scan for I2C devices twice on all CPU's
2022-10-14 15:33:46 +02:00
Thomas Göttgens
a7e0127793 scan i2c twice for all devices, not just tbeam 2022-10-13 23:46:25 +02:00
Thomas Göttgens
603f60d86a Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-13 19:13:09 +02:00
Thomas Göttgens
6febf6b17c Merge pull request #1796 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-13 17:58:41 +02:00
thebentern
53aaf766dd [create-pull-request] automated change 2022-10-13 14:54:05 +00:00
Thomas Göttgens
4fa8d02b08 update FromRadio UUID for nRF52 devices (#1795) 2022-10-13 09:32:54 -05:00
Thomas Göttgens
efa423c8ad update FromRadio UUID for nRF52 devices 2022-10-13 16:20:27 +02:00
Thomas Göttgens
43fb0d80f1 Merge pull request #1794 from meshtastic/canned-spice
Display looks better that way...
2022-10-13 15:56:13 +02:00
Thomas Göttgens
b25ace14e5 Update CannedMessageModule.h 2022-10-13 15:44:27 +02:00
Thomas Göttgens
8734751bc4 make screen timeout work again 2022-10-13 15:31:57 +02:00
Thomas Göttgens
5559a1edb0 Display looks better that way... 2022-10-13 15:22:57 +02:00
Thomas Göttgens
bf503354f3 Merge pull request #1792 from meshtastic/atecca
Support for ATECCA608B Cryptographic Coprocessor
2022-10-13 14:34:44 +02:00
Thomas Göttgens
7b10441a28 update raspberry pi framework some more... 2022-10-13 14:21:48 +02:00
Thomas Göttgens
994e396c00 update Raspberry Pico Framework 2022-10-13 13:57:17 +02:00
Thomas Göttgens
6e22ee9061 make nRF52 happy 2022-10-13 13:31:19 +02:00
Thomas Göttgens
b5fb0f60b0 don't compile on Portduino 2022-10-13 13:01:24 +02:00
Thomas Göttgens
a7fe69ed6b Support for ATECCA608B Cryptographic Coprocessor 2022-10-13 12:55:28 +02:00
Thomas Göttgens
7f05298172 Merge pull request #1790 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-13 08:45:13 +02:00
thebentern
92a2505056 [create-pull-request] automated change 2022-10-12 23:42:47 +00:00
Ben Meadors
aae9d2fcf6 Package ota zip in final firmware bundle 2022-10-12 13:03:19 -05:00
Ben Meadors
b59e928589 Secure DFU mode for OTA updates with pin (#1789) 2022-10-12 10:31:39 -05:00
Ben Meadors
1db08b3b0e Add pico 2022-10-12 08:06:08 -05:00
Ben Meadors
2cf3c105a1 Add DFU package for nrf52 assets to build assets 2022-10-12 08:06:08 -05:00
Ben Meadors
505e4e8176 Run dfu begin first (#1786)
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2022-10-12 07:55:17 -05:00
Thomas Göttgens
49a9973548 Merge pull request #1788 from meshtastic/bug-1787
fixes #1787
2022-10-12 13:26:21 +02:00
Thomas Göttgens
18af9d734d fixes #1787 2022-10-12 13:13:02 +02:00
Ben Meadors
3e22aafea8 Change UUID for FromRadio characteristic (#1785) 2022-10-11 20:01:26 -05:00
Ben Meadors
434db4347b Send device telemetry to phone every minute (#1784) 2022-10-11 10:21:30 -05:00
Thomas Göttgens
b2c3b405b1 Merge pull request #1783 from meshtastic/ota
debug print on early boot when OTA firmware is detected.
2022-10-10 23:40:19 +02:00
Thomas Göttgens
4bc8f6a6b9 Merge branch 'master' into ota 2022-10-10 23:14:26 +02:00
Thomas Göttgens
4534d17d79 debug print on early boot when OTA firmware is detected. 2022-10-10 23:05:24 +02:00
Ben Meadors
f88dde2f60 Send channels over phoneapi on want config (#1780)
* Send channels

* Doh!

* Adjust comments

* Missed a spot

* Consolidate

* Skipped disabled ones

* Fixed bounding

* Change order

* comment out disabled check for build artefact

* Remove loop

* Off by one

* Probably should start at zero

* Zero

* Oops

* enable dubug log

* Reset to index zero

Co-authored-by: Sacha Weatherstone <sachaw100@hotmail.com>
2022-10-10 10:36:49 -05:00
Thomas Göttgens
f8982ddaf8 Best Practise Platformio 6.x dependency definitions 2022-10-10 15:42:05 +02:00
Thomas Göttgens
784cd8c6f1 Merge pull request #1768 from meshtastic/nrf52-Rollup
Nrf52 rollup
2022-10-10 15:30:45 +02:00
Thomas Göttgens
c3ab8f12cf Merge branch 'master' into nrf52-Rollup 2022-10-10 15:09:49 +02:00
Thomas Göttgens
b5adb7babc Update nrf52840.ini 2022-10-10 15:09:31 +02:00
Thomas Göttgens
62c809a596 Merge pull request #1782 from meshtastic/lora-freq-check
Lora freq check
2022-10-10 12:53:14 +02:00
Thomas Göttgens
d2fe4426c1 Revert Platform Change for now. 2022-10-10 12:32:08 +02:00
Thomas Göttgens
984f0ca12c check allowed range for lora.channel_num 2022-10-10 12:28:31 +02:00
Thomas Göttgens
9d3eba9ea4 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-10 12:15:09 +02:00
Thomas Göttgens
323f81eaba Merge branch 'master' into nrf52-Rollup 2022-10-10 12:06:44 +02:00
lewishe
13e635b74e Add judgment on t-beam-s3-core to scanI2Cdevice in main.cpp 2022-10-10 11:50:18 +08:00
Thomas Göttgens
8d0e25fd82 Merge pull request #1770 from meshtastic/ota
Switch to OTA firmware
2022-10-09 11:54:16 +02:00
Thomas Göttgens
20eaddee58 - fix conditional include for nRF52 (no OTA there)
- fix compiler warning in Canned Messages
2022-10-09 11:35:19 +02:00
Thomas Göttgens
30b1bd85d9 fix build for non-esp32 2022-10-09 11:19:33 +02:00
Thomas Göttgens
09cce094d1 Merge branch 'master' into ota 2022-10-09 11:00:20 +02:00
Thomas Göttgens
33a208e3c4 Merge pull request #1777 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-09 11:00:01 +02:00
caveman99
dd4c4fba80 [create-pull-request] automated change 2022-10-09 08:55:33 +00:00
Sacha Weatherstone
a17c40ad09 Merge branch 'master' into ota 2022-10-09 16:44:24 +10:00
Sacha Weatherstone
9d73e606ac Merge pull request #1774 from meshtastic/node-db
erase oldest entry from NodeDB if it is full
2022-10-09 16:40:46 +10:00
Ben Meadors
da12360105 Merge branch 'master' into node-db 2022-10-08 13:48:35 -05:00
GUVWAF
ee1ae627a3 Model the time it is busy receiving/transmitting (#1776)
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2022-10-08 12:10:50 -05:00
Thomas Göttgens
137a8dcfdf Merge pull request #1775 from meshtastic/i2cscan-fix
move and repeat i2c scan to fix BLE PIN
2022-10-08 17:52:32 +02:00
Thomas Göttgens
b2d753ed86 move and repeat i2c scan to fix BLE PIN 2022-10-08 17:36:39 +02:00
Thomas Göttgens
6e40102f26 - use bigger screen fonts on Wiphone
- erase oldest entry from NodeDB if it is full.
2022-10-08 17:07:16 +02:00
Ben Meadors
511fe23b8a Merge branch 'master' into ota 2022-10-08 08:22:16 -05:00
Thomas Göttgens
e433895873 Merge pull request #1773 from meshtastic/canned-messages
Fix another crash in Canned Messages
2022-10-08 15:09:58 +02:00
Thomas Göttgens
5572195af9 Fix another crash in Canned Messages 2022-10-08 14:52:21 +02:00
Thomas Göttgens
cb956cd35b Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-08 14:35:07 +02:00
Ben Meadors
b551c7738e Merge branch 'master' into ota 2022-10-08 07:28:35 -05:00
GUVWAF
3d45c4dbd8 Don't resend ACK if another module sent a response (#1772)
* strcmp returns zero if strings are equal

* Make debug message more clear

* Don't resend ACK if another module sent a response

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2022-10-08 07:27:59 -05:00
Thomas Göttgens
8681489cb7 Merge pull request #1771 from meshtastic/compass-size
Scale Compass circle to bigger screens
2022-10-08 13:22:14 +02:00
Thomas Göttgens
ed328766b2 Scale Compass circle to bigger screens 2022-10-08 12:32:48 +02:00
Thomas Göttgens
fb852ee6eb Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-08 11:25:46 +02:00
Thomas Göttgens
a6ee708b90 Merge branch 'master' into ota 2022-10-08 11:21:33 +02:00
Thomas Göttgens
c9398e7b8a - prevent crash when no messages defined
- remove debug print
2022-10-08 11:20:54 +02:00
Thomas Göttgens
b591e35442 Switch to OTA firmware 2022-10-08 11:10:29 +02:00
Thomas Göttgens
e50e15dc04 Merge pull request #1769 from meshtastic/RTC
1.0.1 RTC LIB is released on PIO Registry
2022-10-08 11:09:54 +02:00
Thomas Göttgens
d4e65d8607 1.0.1 RTC LIB is released on PIO Registry 2022-10-08 11:09:16 +02:00
Thomas Göttgens
63ced7da7c use upstream nRF52 toolkit. (TEST)
also RTC Lib 1.0.1 is finally out.
2022-10-07 20:28:20 +02:00
Thomas Göttgens
03868d05db Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-07 20:23:00 +02:00
Thomas Göttgens
186374525a Don't mix MQTT Payloads of Firmware 1.2 and 1.3/2.0 (#1767) 2022-10-07 12:54:42 -05:00
Thomas Göttgens
f116585c2a Don't mix MQTT Payloads of Firmware 1.2 and 1.3/2.0 2022-10-07 19:26:45 +02:00
Thomas Göttgens
f4945729bc Merge pull request #1766 from meshtastic/new-sounds
use F# as startup and shutdown sound triple
2022-10-07 19:16:50 +02:00
Thomas Göttgens
a3c76232c8 use F# as startup and shutdown sound triple. The existing tuuut-tut-tut was getting on my nerves 2022-10-07 19:03:49 +02:00
Thomas Göttgens
5bc41118e2 Merge pull request #1760 from meshtastic/support-rak14004
Use small font for freetext messages
2022-10-07 18:58:28 +02:00
Thomas Göttgens
9445a96b3a Merge branch 'support-rak14004' of github.com:meshtastic/Meshtastic-device 2022-10-07 18:40:51 +02:00
Thomas Göttgens
a5761069ca Finalize destination selection. Primary Channel only for now. 2022-10-07 18:40:15 +02:00
Thomas Göttgens
2d4bfe183c Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-07 16:42:29 +02:00
Ben Meadors
bf4115a80f Telemetry sensors re-map (#1765)
* Add factory erase uf2 to the release assets

* Sensors map

* Uncomment sensors
2022-10-07 08:33:07 -05:00
Ben Meadors
b2e84dfd29 Merge branch 'master' into support-rak14004 2022-10-07 06:58:08 -05:00
lewis he
004f6fa4d6 Add t-beam-s3-core onboard device support. (#1764)
* Change t-beam-s3-core pins definitions

* Add t-beam-s3-core power initialization to properly initialize the I2C device

* Add 6-axis and 3-axis sensor detection
2022-10-07 06:57:55 -05:00
Thomas Göttgens
cefd4cd647 Merge pull request #1762 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-10-06 23:15:59 +02:00
thebentern
fd2ae61e3e [create-pull-request] automated change 2022-10-06 20:53:47 +00:00
Thomas Göttgens
7cda61ca01 - preliminary work for node selection
- show sending screen on immediate click
2022-10-06 22:34:55 +02:00
Thomas Göttgens
98e1d52eaa Merge branch 'support-rak14004' of github.com:meshtastic/Meshtastic-device 2022-10-06 18:41:33 +02:00
Thomas Göttgens
1d09beb8a7 word wrap long input and fix compiler warnings 2022-10-06 18:40:31 +02:00
Thomas Göttgens
d44cce2928 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-10-06 17:24:48 +02:00
Thomas Göttgens
51b3d4d06e Merge branch 'master' into support-rak14004 2022-10-06 17:24:33 +02:00
Thomas Göttgens
a17ddaa951 Use small font for freetext messages 2022-10-06 17:24:08 +02:00
Thomas Göttgens
9bd925226c Merge pull request #1759 from meshtastic/support-rak14004
support RAK14004 in Canned Messages
2022-10-06 16:37:25 +02:00
Thomas Göttgens
e34ada3ff1 support RAK14004 in Canned Messages 2022-10-06 16:00:33 +02:00
Thomas Göttgens
1ec1ff0773 Merge pull request #1758 from andrekir/PCF8563-lib
update PCF8563_Library to 1.0.0
2022-10-06 09:12:38 +02:00
Thomas Göttgens
7f935717db Update platformio.ini 2022-10-06 08:56:02 +02:00
Thomas Göttgens
5b1d3a0c51 Update platformio.ini 2022-10-06 08:55:58 +02:00
andrekir
484f340023 update PCF8563_Library to 1.0.0 2022-10-06 01:05:21 -03:00
Ben Meadors
ab0cf025c5 Remove flag 2022-10-05 11:41:53 -05:00
Ben Meadors
b384d9ea88 Remove yml exclusion for now 2022-10-05 11:18:37 -05:00
Ben Meadors
bb2094c4de Fixed move 2022-10-05 11:11:14 -05:00
Ben Meadors
6708121ba6 Add factory erase uf2 to the release assets (#1756)
* Add factory erase uf2 to the release assets

* Copy single file

* Overwrite hopefully
2022-10-05 10:52:51 -05:00
Thomas Göttgens
46a9bb3f7d Merge pull request #1755 from meshtastic/gps-rollup
GPS Rollup, incorporates changes from @pmarches and @lewisxhe
2022-10-05 15:32:27 +02:00
Thomas Göttgens
62498d0935 GPS Rollup, incorporates changes from @pmarches and @lewisxhe 2022-10-05 14:59:07 +02:00
Thomas Göttgens
c70184fbed Merge pull request #1754 from meshtastic/issue-1707
wire in part 2 of serial mode - implements #1228
2022-10-05 13:45:11 +02:00
Thomas Göttgens
4d2cb45f9f wire in part 1 of serial mode... select if you want textmsg or own portnum via config. 2022-10-05 11:39:50 +02:00
Thomas Göttgens
e5605cc6fe Merge pull request #1753 from meshtastic/bug-1713
fix #1713
2022-10-05 10:51:56 +02:00
Thomas Göttgens
f7331a2e41 fix #1713
stop output to serial debug after config has been loaded (if serial is disabled), and only accept protobuf packets from that point on.
2022-10-05 10:33:39 +02:00
Thomas Göttgens
838271a14f Merge pull request #1751 from rjmcdougall/radiolib-5.4.0-fix
Switch to 5.4.0 using latest fix (170ce9) to error check after calibr…
2022-10-05 09:25:05 +02:00
Thomas Göttgens
b6b23907ed Merge pull request #1752 from meshtastic/flash-save
Flash saver
2022-10-05 09:12:11 +02:00
Thomas Göttgens
b240b9a088 Use the global radiolib... 2022-10-05 09:02:46 +02:00
Thomas Göttgens
b3a484f1e5 update to Radiolib 5.4.1 2022-10-05 09:01:39 +02:00
Thomas Göttgens
f3042ddf37 Update NodeDB.cpp 2022-10-05 08:56:00 +02:00
Thomas Göttgens
54816231e9 Calculate CRC32 of Protobuf and compare before save. 2022-10-05 08:52:27 +02:00
Richard McDougall
1c168d7d62 Switch to 5.4.0 using latest fix (170ce9) to error check after calibration 2022-10-04 10:52:23 -07:00
Thomas Göttgens
063c4904ff only save files when they changed - also clamp app version 2022-10-04 17:25:03 +02:00
Thomas Göttgens
fefcbb147b fix #1646 2022-10-04 15:27:18 +02:00
Thomas Göttgens
53d48e8f61 use radiolib 5.3 for now 2022-10-04 15:19:00 +02:00
Thomas Göttgens
ce5bce5cdc Merge pull request #1749 from meshtastic/flash-save
Only save the changed parts of config to disk.
2022-10-04 14:52:10 +02:00
Thomas Göttgens
3597685b23 Only save the changed parts of config to disk. 2022-10-04 14:32:07 +02:00
Thomas Göttgens
dc097c7230 Merge pull request #1729 from rjmcdougall/pcf8563rtc
Adjust year, hour, minute for PCF8563
2022-10-04 13:40:40 +02:00
Thomas Göttgens
b148781e4b Missed one. 2022-10-04 13:29:06 +02:00
Thomas Göttgens
5d8826e8ef Merge branch 'master' into pcf8563rtc 2022-10-04 13:27:49 +02:00
Thomas Göttgens
39a51c7fbb update lib to make this work 2022-10-04 13:26:20 +02:00
Thomas Göttgens
129edde338 Merge pull request #1746 from meshtastic/feature-1406
implement #1406
2022-10-04 10:01:19 +02:00
Thomas Göttgens
93cc278eee implement #1406 2022-10-04 09:47:54 +02:00
Thomas Göttgens
c34198264a Merge branch 'master' into pcf8563rtc 2022-10-04 09:38:33 +02:00
Thomas Göttgens
054b12325d Merge pull request #1745 from meshtastic/compiler-warning
fix compiler warning
2022-10-04 09:27:34 +02:00
Thomas Göttgens
0f7a126828 fix compiler warning 2022-10-04 09:11:24 +02:00
Thomas Göttgens
7ff72fb981 Merge pull request #1744 from meshtastic/dependency-scan
add versioning to all lib depends
2022-10-04 09:10:28 +02:00
Thomas Göttgens
0fe99595a9 Lib update and fix include errors 2022-10-04 08:59:03 +02:00
Thomas Göttgens
b2ff628cec add versioning to all lib depends (compatible upgrade allowed) and move as many as possible off github and into PIO registry.
Also add a script to check for lib updates (maybe in CI?)
2022-10-04 08:40:39 +02:00
Thomas Göttgens
86a3bd6db8 Merge pull request #1742 from meshtastic/bug-1740
Clean up GPS code and add some flags per #1740
2022-10-04 08:38:57 +02:00
Thomas Göttgens
73a5357d0e Brainfart. This is already km/h 2022-10-04 08:11:07 +02:00
Richard McDougall
2faf507c0d Merge branch 'meshtastic:master' into pcf8563rtc 2022-10-03 13:55:49 -07:00
Thomas Göttgens
cf124d97b8 Clean up GPS code and add some flags per #1740 2022-10-03 20:30:11 +02:00
Sacha Weatherstone
482c0766af Merge pull request #1741 from andrekir/channel_num
move channel_num to loraConfig
2022-10-03 16:34:42 +10:00
Ben Meadors
7e5a26fde5 Merge branch 'master' into channel_num 2022-10-02 19:45:32 -05:00
Ben Meadors
e85af2f732 regen protos 2022-10-02 19:45:15 -05:00
Sacha Weatherstone
4df81008bc Merge branch 'master' into channel_num 2022-10-03 10:32:56 +10:00
Ben Meadors
803dc69ccd Update radiolib 2022-10-02 09:48:48 -05:00
Thomas Göttgens
42308cca5b Merge branch 'master' into pcf8563rtc 2022-10-01 17:31:02 +02:00
Thomas Göttgens
ea991a4eee Merge pull request #1737 from GUVWAF/EnhancedSimRadio
Let SimRadio communicate via TCP
2022-10-01 17:24:26 +02:00
GUVWAF
04db2d4410 Merge branch 'EnhancedSimRadio' of https://github.com/GUVWAF/Meshtastic-device into EnhancedSimRadio 2022-10-01 17:07:59 +02:00
GUVWAF
076c1ed2ee Merge branch 'EnhancedSimRadio' of https://github.com/GUVWAF/Meshtastic-device into EnhancedSimRadio 2022-10-01 17:05:49 +02:00
Thomas Göttgens
75aa4ea325 suppress cppcheck warning 2022-10-01 17:05:04 +02:00
GUVWAF
e54be07dc0 Update include path in MeshService 2022-10-01 17:04:19 +02:00
GUVWAF
d439d00e25 Move SimRadio to platform/portduino 2022-10-01 17:03:40 +02:00
GUVWAF
c4bea793af Mark WifiServerPort constructor as explicit 2022-10-01 17:02:16 +02:00
GUVWAF
b53dcb932e Adapt conditional include 2022-10-01 17:01:25 +02:00
Thomas Göttgens
371428d6ab Fix compile error on nRF52 2022-10-01 16:41:49 +02:00
Thomas Göttgens
1970d0c00f Merge branch 'master' into EnhancedSimRadio 2022-10-01 15:59:44 +02:00
github-actions[bot]
1dd7aa935f [create-pull-request] automated change (#1738)
Co-authored-by: thebentern <thebentern@users.noreply.github.com>
2022-10-01 08:47:35 -05:00
Thomas Göttgens
6b40f9d95c Unfork this lib, we're done here now. 2022-10-01 15:27:13 +02:00
Thomas Göttgens
b3717d0396 Merge branch 'master' into pcf8563rtc 2022-10-01 15:20:16 +02:00
GUVWAF
82ba95833b strcmp returns zero if strings are equal (#1736)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-10-01 08:18:25 -05:00
Thomas Göttgens
28384df702 Merge pull request #1734 from meshtastic/Build-Image
Build image
2022-10-01 15:17:41 +02:00
GUVWAF
aee06f4738 Suppress debug messages in PhoneAPI as they flood the logs when a TCP connection is open 2022-10-01 12:09:43 +02:00
GUVWAF
ab282765d4 Let SimRadio start receive a packet if its PortNum is Simulator_App 2022-10-01 12:06:59 +02:00
GUVWAF
5d464badc8 Give TCP port as argument to API server 2022-10-01 12:05:20 +02:00
GUVWAF
68282682de Use new SimRadio in main for Portduino 2022-10-01 12:03:35 +02:00
GUVWAF
2696b04138 Allow Portduino to set the TCP port 2022-10-01 12:02:29 +02:00
GUVWAF
31dc37150b Fix typo 2022-10-01 12:00:31 +02:00
GUVWAF
e66d9d0add Add content to SimRadio, similar to RadioInterface 2022-10-01 11:59:20 +02:00
GUVWAF
067bde321b Remove old SimRadio from RadioInterface 2022-10-01 11:57:27 +02:00
GUVWAF
84ec364ac2 Add enhanced SimRadio files 2022-10-01 11:56:16 +02:00
Thomas Göttgens
32990856e3 Merge branch 'master' into Build-Image 2022-10-01 10:31:59 +02:00
Thomas Göttgens
a1bd5c9ea0 Accomodate for new flash files 2022-10-01 10:31:25 +02:00
Thomas Göttgens
51f0e7879a use the right firmware artefact 2022-10-01 10:06:13 +02:00
Thomas Göttgens
0bdb90d133 remove hard to maintain system-info bootloader 2022-10-01 09:50:16 +02:00
Thomas Göttgens
e98c11ff89 The new combined firmware starts flashing at offset 0, no need to flash system-info or partitions any more. 2022-10-01 09:46:56 +02:00
andrekir
8f84d7089c move channel_num to loraConfig 2022-09-30 17:33:43 -03:00
Thomas Göttgens
b0712c4186 make other platforms happy again 2022-09-29 21:23:01 +02:00
Thomas Göttgens
8f92383ce4 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-09-29 17:05:11 +02:00
Thomas Göttgens
c571fc9e24 generate a monolithic flash image for the app. 2022-09-29 17:04:56 +02:00
Thomas Göttgens
05126bc6dc Merge branch 'master' into pcf8563rtc 2022-09-29 16:33:43 +02:00
Thomas Göttgens
de56a370c6 Merge pull request #1733 from meshtastic/TLORA-fix
Tlora fix
2022-09-29 13:37:51 +02:00
Thomas Göttgens
daf189bf4b Check in variant.h change 2022-09-29 13:23:23 +02:00
Thomas Göttgens
d95ec7e6b9 fix TLORA-V2.1-1.6 2022-09-29 13:21:48 +02:00
Ben Meadors
ac235bcabb Reset nodedb wiring (#1724) 2022-09-28 16:47:26 -05:00
Neil Hao
ab4b3a50ee 'battery_gauge_fix' (#1731) 2022-09-28 15:53:26 -05:00
Thomas Göttgens
7f0fb2a2b6 Move file to right spot in source tree 2022-09-28 20:13:41 +02:00
Richard McDougall
ade1edfdfc Adjust year, hour, minute for PCF8563 2022-09-27 22:51:40 -07:00
Thomas Göttgens
4723faa95f Merge pull request #1728 from meshtastic/bug-1669
fixes #1669
2022-09-27 14:15:38 +02:00
Thomas Göttgens
93f83b0fcb Merge branch 'master' into bug-1669 2022-09-27 14:03:48 +02:00
Thomas Göttgens
8f84f7c0a5 fixes #1669 2022-09-27 14:03:02 +02:00
Ben Meadors
48e4101f1c Move it 2022-09-27 06:08:24 -05:00
Thomas Göttgens
e6bb79f4c1 Merge pull request #1727 from meshtastic/ESPIDF-Littlefs
use the native littlefs builder of newer framework
2022-09-27 00:50:41 +02:00
Thomas Göttgens
0bef3464f5 Merge branch 'master' into ESPIDF-Littlefs 2022-09-27 00:50:33 +02:00
Thomas Göttgens
3c038a8c50 Update main_matrix.yml 2022-09-27 00:50:16 +02:00
Thomas Göttgens
b8eb751316 Update build-esp32.sh 2022-09-27 00:23:50 +02:00
Thomas Göttgens
5332db1eca Include OTA Firmware in Build 2022-09-27 00:21:45 +02:00
Thomas Göttgens
9deda962aa Merge branch 'master' into ESPIDF-Littlefs 2022-09-27 00:16:41 +02:00
Thomas Göttgens
c53434539b use the native littlefs builder of newer framework 2022-09-27 00:16:12 +02:00
Ben Meadors
7f179deaf3 Update build-esp32.sh 2022-09-26 16:01:28 -05:00
Ben Meadors
da29fa139f Copy the current one 2022-09-26 16:00:20 -05:00
Thomas Göttgens
1d8a562fd9 Merge pull request #1725 from meshtastic/AsyncOTA
Changes for OTA Support on ESP32
2022-09-26 22:57:48 +02:00
Thomas Göttgens
0dbf97afab Merge branch 'master' into AsyncOTA 2022-09-26 22:57:23 +02:00
Thomas Göttgens
e5720fba3e Merge pull request #1726 from meshtastic/partitions
Include partitions.bin
2022-09-26 22:56:59 +02:00
Ben Meadors
498ac00b92 Copy cpartitions.bin 2022-09-26 15:51:09 -05:00
Ben Meadors
226a2dfe04 Include partitions.bin 2022-09-26 15:48:02 -05:00
Thomas Göttgens
7e9a233296 - new Bootloader for ESP-IDF 4.2
- save partition table to device
- modify partition table for async OTA
2022-09-26 22:42:58 +02:00
Ben Meadors
ae311c838e Try to decode mqtt packets first (#1705)
* Try to decode first

* Remove GPS pins from TLoRAv1 so that it can boot

* Use release version of radio lib

* Use fixed versions of esp framework and tool chain
2022-09-25 09:39:50 -05:00
Thomas Göttgens
de769db3bc Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-09-23 23:29:52 +02:00
Thomas Göttgens
5fa96c7fd1 missed one, sorry 2022-09-23 23:29:32 +02:00
Thomas Göttgens
2ee0c9a67a Merge pull request #1720 from meshtastic/axe-framerate-debug
get rid of framerate debug messages
2022-09-23 23:21:21 +02:00
Thomas Göttgens
347af0210e Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-09-23 23:09:20 +02:00
Thomas Göttgens
d8455d687c Merge branch 'master' into axe-framerate-debug 2022-09-23 23:08:46 +02:00
Thomas Göttgens
34fef4c4e7 get rid of framerate debug messages 2022-09-23 23:07:26 +02:00
Thomas Göttgens
18bb373219 switch Bluetooth back on when wifi is disabled and bluetooth is enabled. This still had the old behaviour to check for a set ssid... (#1719) 2022-09-23 15:10:33 -05:00
Thomas Göttgens
2f74f9ca15 Merge pull request #1718 from meshtastic/ESPIDF-Rollup
Suppress compiler warning
2022-09-23 21:33:37 +02:00
Thomas Göttgens
5775c390f3 Merge branch 'master' into ESPIDF-Rollup 2022-09-23 21:19:19 +02:00
Thomas Göttgens
80826b8712 Merge pull request #1711 from meshtastic/ESPIDF-Littlefs
Filesystem fixes for LittleFS
2022-09-23 21:14:40 +02:00
Thomas Göttgens
664d18cf58 t'ell that came from? 2022-09-23 21:03:53 +02:00
Thomas Göttgens
bc2cddcb11 Filesystem abstraction would work really well, if it wasn't for crap vendor toolchains. 2022-09-23 20:43:42 +02:00
Thomas Göttgens
4949bda606 Don't delete OEM.proto on factory reset 2022-09-23 19:52:42 +02:00
Thomas Göttgens
b4f75ad042 use exception decoder 2022-09-23 19:52:07 +02:00
Thomas Göttgens
af4d11e17b fix and refactor FSCommon for new ESPIDF 2022-09-23 19:51:08 +02:00
Thomas Göttgens
e8f4a8b739 Merge branch 'master' into ESPIDF-Littlefs 2022-09-23 18:45:37 +02:00
Thomas Göttgens
fae6693f8f fix (or better suppress) another compiler warning 2022-09-23 12:37:59 +02:00
Thomas Göttgens
0646ecdec4 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-09-23 12:32:07 +02:00
Thomas Göttgens
544c89460f Nullify older saved proto files once more
this will be neccessary for the 1.3.42 release, since we renumbered some protos again. Subsequent additions to protos don't need this, just when we reshuffle.
2022-09-23 12:28:32 +02:00
Thomas Göttgens
15089f5b01 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-09-23 09:55:00 +02:00
Ben Meadors
8ef510035d Owner reboot (#1716) 2022-09-22 08:02:58 -05:00
Sacha Weatherstone
864b1f754c Merge branch 'master' into ESPIDF-Littlefs 2022-09-22 14:58:53 +10:00
Sacha Weatherstone
883a2ebac0 Merge pull request #1717 from ajmcquilkin/ajmcquilkin/imperial-screen-units
Add Support for Imperial Units on Screen
2022-09-22 13:22:22 +10:00
Adam McQuilkin
bbe5b2e42c Remove accidental whitespace changes 2022-09-21 22:48:12 -04:00
Adam McQuilkin
1b316b111f Initial commit 2022-09-21 22:37:36 -04:00
Thomas Göttgens
d0720620e8 fix compiler warning 2022-09-21 17:22:31 +02:00
Thomas Göttgens
cf4947d898 Fix build for non-ESP32 2022-09-21 17:05:10 +02:00
Thomas Göttgens
b5a8efa16b Filesystem fixes for LittleFS 2022-09-21 16:47:10 +02:00
Thomas Göttgens
b38ae783b9 Merge pull request #1706 from meshtastic/communicator
Freetext Input with CardKB
2022-09-21 16:33:49 +02:00
Thomas Göttgens
cbd8346c93 Merge branch 'master' into communicator 2022-09-21 16:10:28 +02:00
Thomas Göttgens
c0bfb979fd Merge pull request #1710 from meshtastic/serial-flush
Fix Serial comms with new framework
2022-09-21 16:01:01 +02:00
Thomas Göttgens
7c5a36ce38 Update SerialConsole.cpp 2022-09-21 15:46:56 +02:00
Thomas Göttgens
fc729b0cbb Send PROTOBUF over serial without delay 2022-09-21 15:36:17 +02:00
Thomas Göttgens
0b81a25fda Output serial console data without buffering 2022-09-21 15:34:48 +02:00
Thomas Göttgens
011db443ba Bugfixes in Freetext Module.
- work without fixed messages defined
- honour cursor position on backspace
- don't send an empty string
- compiler warnings in font engine fixed
2022-09-21 10:42:10 +02:00
Thomas Göttgens
b73e240f4d relative paths are relative 2022-09-20 16:36:50 +02:00
Thomas Göttgens
6de77ee310 use cyrillic font if defined 2022-09-20 16:30:21 +02:00
Thomas Göttgens
0a8293a2d6 Cursor editing 2022-09-20 16:21:32 +02:00
Thomas Göttgens
d0ad5dd4cf - don't swallow keystrokes
- switch back and forth between the 2 modes.
2022-09-20 14:28:42 +02:00
Thomas Göttgens
ab342ce904 Freetext Input with CardKB Take 1 - Also removes FacesKB support, this thing is ancient. 2022-09-20 13:50:18 +02:00
Thomas Göttgens
140250ef03 Merge pull request #1704 from meshtastic/ESPIDF-Rollup
ESP and TFT misc fixes
2022-09-19 17:57:12 +02:00
Thomas Göttgens
ed90275370 use double buffering on TFT screens 2022-09-19 16:57:18 +02:00
Thomas Göttgens
e8b28faaf1 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-09-19 16:18:16 +02:00
Thomas Göttgens
afcc7b6a56 Always use the latest framework for ESP32 2022-09-19 16:18:01 +02:00
Thomas Göttgens
e27a507a28 Merge pull request #1703 from meshtastic/ESPIDF-Rollup
Small fixes for ESP Serial Init and Power FSM debug garble.
2022-09-19 15:57:47 +02:00
Thomas Göttgens
207f701f0a Update GPS.cpp 2022-09-19 15:46:59 +02:00
Thomas Göttgens
dd8cb1c7fb Small fixes for ESP Serial Init and Power FSM debug garble. 2022-09-19 15:36:48 +02:00
Thomas Göttgens
ccf93b8c23 Merge pull request #1687 from meshtastic/ESPIDF-Rollup
use the new ESP Framework for our older boards too
2022-09-19 12:18:09 +02:00
Thomas Göttgens
4c6f3ead60 fixing I2C requests and Wifi Power Saving Modes. 2022-09-19 12:05:57 +02:00
Thomas Göttgens
2d81d359b8 Update esp32.ini
Update arch by hand
2022-09-19 09:36:13 +02:00
Thomas Göttgens
1f96d5d957 Merge branch 'master' into ESPIDF-Rollup 2022-09-19 09:33:50 +02:00
Thomas Göttgens
033f45d4da Merge pull request #1702 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-09-19 09:32:01 +02:00
thebentern
ae2c514ee7 [create-pull-request] automated change 2022-09-18 20:55:27 +00:00
Andre K
80ddb81fac fix yet another typo 2022-09-18 17:31:59 -03:00
Andre K
4bc29200be fix default channel names (#1701) 2022-09-18 09:41:27 -05:00
Ben Meadors
55c55fb705 pip versions back in order 2022-09-17 20:03:11 -05:00
Ben Meadors
0e2ab75bb0 Set tx_enabled upon initial region assignment (#1700) 2022-09-17 14:49:09 -05:00
Ben Meadors
128d20b290 tx_enabled fix (#1699)
* Defaults

* Print
2022-09-17 12:18:32 -05:00
Ben Meadors
ad9cc40b97 Increasebaud for local except for RAK11200 2022-09-17 08:25:40 -05:00
Ben Meadors
e0d3ac01b0 Merge branch 'master' into ESPIDF-Rollup 2022-09-17 08:22:44 -05:00
Ben Meadors
0f87adad7b Power state lies and other fixes (#1698)
* Power interval defaults and factory reset

* Ternary

* Fixes
2022-09-16 11:00:05 -05:00
lewis he
9481461145 Add GNSS model recognition functio (#1696)
* Add GNSS model recognition function

* Fix GNSS initialization failure

* GPS.cpp difference between runOnce and ESP32S3 and ESP32 versions

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-09-15 13:43:04 -05:00
Ben Meadors
accd23eddc Factory reset on device state expired (#1695) 2022-09-15 12:15:16 -05:00
Thomas Göttgens
7c202b6069 Merge branch 'master' into ESPIDF-Rollup 2022-09-13 19:18:20 +02:00
Thomas Göttgens
e93b98ff98 Merge pull request #1694 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-09-13 14:32:29 +02:00
caveman99
b1ac2cf821 [create-pull-request] automated change 2022-09-13 12:31:51 +00:00
Ben Meadors
bfd1fecc2a Merge branch 'master' into ESPIDF-Rollup 2022-09-13 06:36:56 -05:00
Ben Meadors
c622a9b4be Update python temp hack 2022-09-12 20:21:19 -05:00
Ben Meadors
ade66cd8f4 Merge branch 'master' into ESPIDF-Rollup 2022-09-12 18:07:42 -05:00
Ben Meadors
397030b5a6 GPS intervals (#1693)
* GPS intervals

* Backwards logic

* Oops
2022-09-12 18:07:21 -05:00
Ben Meadors
adc50f40b1 Merge branch 'master' into ESPIDF-Rollup 2022-09-12 14:56:09 -05:00
Ben Meadors
32d92d9b75 Qualify tbeam filesystem bins 2022-09-12 14:30:54 -05:00
Ben Meadors
18f37981bb Spelling and fixing defaults 2022-09-12 07:55:17 -05:00
Ben Meadors
a8711bc54a Add tbeam-s3-core 2022-09-12 07:39:41 -05:00
Thomas Göttgens
eac2613743 make platformio.ini even more modular 2022-09-12 14:02:21 +02:00
Thomas Göttgens
4a0c18c4cd Merge branch 'ESPIDF-Rollup' of github.com:meshtastic/Meshtastic-device 2022-09-12 13:40:52 +02:00
Thomas Göttgens
e376a3a28e just use the general toolkit 2022-09-12 13:40:20 +02:00
Thomas Göttgens
a6bdff53c9 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-09-12 13:25:54 +02:00
Thomas Göttgens
b5c5483ced Merge branch 'master' into ESPIDF-Rollup 2022-09-12 12:50:38 +02:00
Thomas Göttgens
601422e92b Merge pull request #1692 from meshtastic/caveman99-1542
implement #1542
2022-09-12 11:05:07 +02:00
Thomas Göttgens
dbbe5e59ae Merge branch 'caveman99-1542' of github.com:meshtastic/Meshtastic-device 2022-09-12 10:54:09 +02:00
Thomas Göttgens
b96dd6d36d T-Echo does not have Serial2 2022-09-12 10:53:11 +02:00
Thomas Göttgens
e6b6e175b8 Merge branch 'master' into caveman99-1542 2022-09-12 10:10:08 +02:00
Thomas Göttgens
2ff549d458 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-09-12 10:09:24 +02:00
Thomas Göttgens
a1230500fd Merge pull request #1691 from meshtastic/proto-fix
Reinstate GPS Flag
2022-09-12 10:09:07 +02:00
Thomas Göttgens
17db87e042 implement #1542 2022-09-12 10:08:32 +02:00
Thomas Göttgens
42d2986cb8 Reinstate GPS Flag 2022-09-12 09:37:21 +02:00
Thomas Göttgens
cc054a13e2 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-09-12 09:25:04 +02:00
Sacha Weatherstone
60b4dbfdcd More default inits. (#1689)
* More default inits.

* update protobufs

* Try checking has_device first

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-09-11 08:36:47 -05:00
Sacha Weatherstone
c446a0f222 Merge branch 'master' into ESPIDF-Rollup 2022-09-11 10:45:27 +10:00
Ben Meadors
f98e96cf1b Slots for upcoming telemetry sensor support 2022-09-10 17:28:01 -05:00
Thomas Göttgens
3102777a71 Update platformio.ini 2022-09-10 20:53:23 +02:00
Thomas Göttgens
ed95f382cf Merge branch 'master' into ESPIDF-Rollup 2022-09-10 20:39:54 +02:00
Ben Meadors
7f18c0fb77 Init default intervals (#1688)
* Init default intervals

* Spacing

* move isrouter check

* Line break

* Oops
2022-09-10 12:35:36 -05:00
Sacha Weatherstone
52e4f93760 Merge branch 'master' into ESPIDF-Rollup 2022-09-10 22:13:56 +10:00
Sacha Weatherstone
0167304300 Merge pull request #1656 from meshtastic/pref_defaults
Set `config.lora.hop_limit` to `HOP_RELIABLE`
2022-09-10 18:24:27 +10:00
Sacha Weatherstone
7aaca3d486 Merge branch 'master' into pref_defaults 2022-09-10 18:11:16 +10:00
Thomas Göttgens
bf3306fbc8 use the new ESP Framework for our older boards too 2022-09-09 22:31:30 +02:00
Thomas Göttgens
e375a8460b Merge pull request #1676 from lewisxhe/master
Add tbeam esp32s3 version support, replace AXP202X_Library with XPowersLib.
2022-09-09 22:01:20 +02:00
Thomas Göttgens
ff88900982 wrong name for constant in merge 2022-09-09 21:49:54 +02:00
Thomas Göttgens
7f293bfda3 Merge branch 'master' into master 2022-09-09 21:39:29 +02:00
Ben Meadors
99de0a76a5 Temporary hack (undo after 1.3.41 release) 2022-09-09 13:54:03 -05:00
Ben Meadors
47ffb9c70d Make a change to trigger CI (#1686) 2022-09-09 13:41:01 -05:00
Thomas Göttgens
1231f926ea Merge pull request #1684 from meshtastic/proto-shakeup
Adapt to new protobufs - TODO: factory_reset rewire
2022-09-09 13:26:59 +02:00
Thomas Göttgens
e05e888fca Update admin config field 2022-09-09 13:14:15 +02:00
Thomas Göttgens
03580f5be8 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-09-09 13:11:23 +02:00
Thomas Göttgens
90dabfea30 Merge pull request #1685 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-09-09 13:11:01 +02:00
caveman99
c8d7b1aba0 [create-pull-request] automated change 2022-09-09 11:10:31 +00:00
Thomas Göttgens
6065ef3a54 catch renamed targets 2022-09-09 13:04:37 +02:00
Thomas Göttgens
86c7eefc91 add missing files 2022-09-09 12:55:31 +02:00
Thomas Göttgens
f7b12f0695 Adapt to new protobufs - TODO: factory_reset rewire 2022-09-09 12:51:41 +02:00
Thomas Göttgens
0c46ad91ef Merge pull request #1683 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-09-09 12:04:43 +02:00
caveman99
96cab75ccd [create-pull-request] automated change 2022-09-09 10:04:11 +00:00
Thomas Göttgens
a7138b7213 Merge pull request #1682 from meshtastic/create-pull-request/patch
Changes by create-pull-request action
2022-09-09 11:20:51 +02:00
caveman99
11590e33d3 [create-pull-request] automated change 2022-09-09 09:19:18 +00:00
lewishe
a3a92d2d13 Remove unnecessary edits 2022-09-08 10:54:33 +08:00
lewishe
2088036521 Differentiate t-beam-s3 GNSS from t-echo 2022-09-08 10:52:03 +08:00
lewishe
7d0e16d1b6 Add some explanations about PMU and prevent null pointer judgment 2022-09-08 10:45:12 +08:00
lewishe
35c77ef99c Simplify HAS_PMU macro definition 2022-09-08 10:36:53 +08:00
lewishe
9244d03cf9 Rename axp192_found to pmu_found to avoid confusion 2022-09-08 10:32:12 +08:00
lewishe
a50a461675 Change mesh.pd.h t-beam-s3-core index to 12 2022-09-08 10:28:53 +08:00
Thomas Göttgens
f78911666e Merge branch 'master' into master 2022-09-07 20:25:38 +02:00
github-actions[bot]
f1e6585726 [create-pull-request] automated change (#1678)
Co-authored-by: thebentern <thebentern@users.noreply.github.com>
2022-09-07 09:18:37 -05:00
lewishe
b8f862ac46 Merge remote-tracking branch 'origin/master' 2022-09-07 09:48:39 +08:00
Ben Meadors
94a572aee6 Merge branch 'master' into pref_defaults 2022-09-06 20:25:20 -05:00
Ben Meadors
e87ecc210a Wifi enabled plumbed in (#1677)
* Wifi enabled

* Wifi requires reboot

* Increment DEVICESTATE_CUR_VER
2022-09-06 14:06:44 -05:00
lewis he
a9e7a33473 Merge branch 'master' into master 2022-09-06 18:53:22 +08:00
lewishe
5621719eef Add tbeam esp32s3 version support, replace AXP202X_Library with XPowersLIb 2022-09-06 15:58:33 +08:00
Vladislav Osmanov
cb3010b58c OLED Cyrillic Support for v1.3 (#1640)
* Extended ASCII codes and cyrillic support

(cherry picked from commit e977840805)

* Fixed `ё`, `Ё` letters

(cherry picked from commit 2f4a2ccb2f)

* Fixed `customFontTableLookup` execution flow

(cherry picked from commit 377f909f36)

* [OLED] Specifying the language by defining it in `platformio.ini`

(cherry picked from commit ddd8132b24)

* [OLED] localization guide

(cherry picked from commit a3267c886f)

* [OLED] Cyrillic support

Localization guide has been moved to https://github.com/meshtastic/Meshtastic/tree/master/docs/developers/Firmware

https://meshtastic.org/docs/developers/Firmware/oled-l10n-guide

Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-09-04 15:00:10 -05:00
Ben Meadors
a27a07956f Merge branch 'master' into pref_defaults 2022-09-03 22:10:37 -05:00
Ben Meadors
285ba9639e Fix screen on secs (#1673)
* Fix screen on secs

* getIntervalOrDefaultMs

* Display correction

* Paren
2022-09-03 22:10:11 -05:00
Ben Meadors
f54f60c31c Merge branch 'master' into pref_defaults 2022-09-03 14:06:27 -05:00
Ben Meadors
84e438f72f Mqtt json_enabled (#1672)
* Payload variants

* Waypoints and fixes

* Remove json send to mesh. I think protobuf messages already do that

* whoops

* Added json_enabled mqtt config
2022-09-03 14:06:10 -05:00
lewis
f767fd5075 Modified to be compatible with the new version of sdk, compatible with esp32s3 2022-09-03 23:38:40 +08:00
lewis he
8fb8212434 i2cScan probe adds another ssd1306 subclass new to output logs correctly (#1671) 2022-09-03 07:26:49 -05:00
lewis
8d5ffb7262 i2cScan probe adds another ssd1306 subclass new to output logs correctly 2022-09-03 16:44:32 +08:00
Neil Hao
70e1a208d5 'snow_screen_hotfix' (#1670) 2022-09-02 19:43:33 -05:00
Ben Meadors
9d3cac7cdb MQTT Json Payload variants (#1667)
* Payload variants

* Waypoints and fixes

* Remove json send to mesh. I think protobuf messages already do that

* whoops
2022-09-01 17:54:24 -05:00
Ben Meadors
84f1edab18 Merge branch 'master' into pref_defaults 2022-08-30 13:28:53 -05:00
Thomas Göttgens
221843e176 Merge pull request #1663 from lewisxhe/master 2022-08-30 20:27:41 +02:00
Ben Meadors
0063ae6512 Merge branch 'master' into pref_defaults 2022-08-30 08:24:34 -05:00
lewishe
1922034c44 Add t-beam sx1268 support 2022-08-30 11:59:57 +08:00
Ben Meadors
7f586f7099 Better logging and cleanup (#1662) 2022-08-29 07:31:02 -05:00
lewis he
0efa1b25c5 Add t-echo sx1268 support (#1657) 2022-08-29 07:26:17 -05:00
Sacha Weatherstone
1b25ea714d Set config.lora.hop_limit to HOP_RELIABLE 2022-08-27 19:03:26 +10:00
Tom
fd27a40edb Reboot after factory reset (#1653)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-08-25 12:07:20 -05:00
Ben Meadors
1013aff9b6 Screen changes and fixes (#1651)
* Fixed bluetooth reinit bug

* Remove screen transition ms

* Whoops

* hasScreen is smarter now

* Oops
2022-08-25 11:25:05 -05:00
Ben Meadors
d7e5eb4d22 Upgrade unishox-2 to 1.0.3 (#1650) 2022-08-25 07:12:38 -05:00
Ben Meadors
9a03b2e49d Same as NodeDB position_broadcast_secs bug but different (#1645)
* intervalMs
2022-08-24 17:29:09 -05:00
github-actions[bot]
e7831f13c5 [create-pull-request] automated change (#1641)
Co-authored-by: thebentern <thebentern@users.noreply.github.com>
2022-08-24 17:28:43 -05:00
Ben Meadors
ddc3727155 Fixed NRF52 bluetooth 2022-08-23 14:03:10 -05:00
Ben Meadors
ef9bfc9104 Enable external notification module for nrf52 2022-08-23 13:16:20 -05:00
Ben Meadors
3bb645d4fe Fixed huge nodeinfo bug 2022-08-23 13:12:41 -05:00
Ben Meadors
8f99258fc4 Update main_matrix.yml 2022-08-22 18:31:56 -05:00
Ben Meadors
b54073a8a1 Bluetooth mode unification and behavior tweaks (#1636)
* Esp32 bluetooth modes

* Comment

* Gutting bluetooth

* Cleanup

* Security

* Testing

* NRF bluetooth security

* Reboot on saved lora or bluetooth settings

* Cleanup

* Fixes

* Stub for platforms without screens

* Fixed just-works in esp32

* Cleanup

* Display device name in boot screen

* Added waypoint module routing

* chmod

* Words

* Protos

* Backing out partition changes for testing

* Revert "Backing out partition changes for testing"

This reverts commit 191ed6489c.

* Chmod PR artifacts

* Trying setInitialState again

* Revert "Trying setInitialState again"

This reverts commit 703eac7277.

* External notification module

* Cleanup

* Pin display formatting
2022-08-22 16:41:23 -05:00
Ben Meadors
c85e9f53c7 Chmod PR artifacts 2022-08-20 12:53:34 -05:00
Ben Meadors
4cfc229e77 Update device-update.sh 2022-08-19 13:35:54 -05:00
Ben Meadors
bbd7c5063d Removed ota erasure 2022-08-19 13:34:41 -05:00
Ben Meadors
05df849a6d Repartitioned 2022-08-19 13:33:58 -05:00
Ben Meadors
ccbc01a753 Repartitioned 2022-08-19 13:33:02 -05:00
Sacha Weatherstone
d6d936b5d2 Remove OTA partition (#1635) 2022-08-18 16:19:32 -05:00
Ben Meadors
b028af0d82 Bluetooth modes (#1633)
* Formatting and comments

* Esp32 bluetooth modes

* Comment
2022-08-16 20:42:43 -05:00
Ben Meadors
86d3759f55 New bluetooth config protos and canned messages consolidation (#1632)
* Bluetooth and canned messages refactor

* More can of worms messages

* Set has_bluetooth and default pin

* Defaults
2022-08-15 21:06:55 -05:00
majbthrd
aadaf332cf add stm32wl5e platform and wio-e5 variant (#1631)
Co-authored-by: Peter Lawrence <12226419+majbthrd@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-08-15 07:54:45 -05:00
Ben Meadors
4dea95d03f Update version.properties 2022-08-14 20:22:52 -05:00
Ben Meadors
1253abd138 Syntax error 2022-08-14 15:56:55 -05:00
Ben Meadors
80e3cee006 NimBLE enhanced logging (do not merge) (#1629)
* Change log level to debug

* Don't reinit active bluetooth services

* Chmod +x before zip and adding to release
2022-08-14 15:27:21 -05:00
Ben Meadors
ca9113ad05 Update version.properties 2022-08-14 15:16:47 -05:00
GUVWAF
63c8f15d38 Resend implicit ACK for a repeated broadcast (#1628) 2022-08-13 10:09:43 -05:00
Ben Meadors
73a1ea59f4 Update BMP280Sensor.cpp (#1627) 2022-08-12 20:11:32 -05:00
Ben Meadors
97712a9dc4 Update ESP32Bluetooth.cpp (#1625)
* Update ESP32Bluetooth.cpp

* Update ESP32Bluetooth.h
2022-08-12 14:14:14 -05:00
Ben Meadors
20e43fcf34 Update version.properties 2022-08-12 13:55:02 -05:00
majbthrd
f66c8572b4 use fixed-size buffer in RedirectablePrint::vprintf() (#1622)
Co-authored-by: Peter Lawrence <12226419+majbthrd@users.noreply.github.com>
Co-authored-by: Garth Vander Houwen <garthvh@yahoo.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2022-08-12 13:41:16 -05:00
Ben Meadors
64f852e3f7 Update main_matrix.yml 2022-08-12 07:21:20 -05:00
Ben Meadors
ea90e4d2de Update main_matrix.yml 2022-08-12 07:04:36 -05:00
Ben Meadors
dd720f2fe6 Tweak 2022-08-11 19:23:51 -05:00
Ben Meadors
808fef7e91 Update main_matrix.yml 2022-08-11 18:50:02 -05:00
Ben Meadors
70e6dc3c67 chmod 2022-08-11 17:54:48 -05:00
Ben Meadors
279149e40f version.properties bump 2022-08-11 17:35:32 -05:00
Ben Meadors
4588995fba Chmod bump_version 2022-08-11 16:30:22 -05:00
Ben Meadors
11ae248c5e Update main_matrix.yml 2022-08-11 16:19:27 -05:00
Ben Meadors
a0a5147c42 Update main_matrix.yml 2022-08-11 15:58:16 -05:00
Ben Meadors
b8aac2c5b6 Create bump_version.py 2022-08-11 15:27:44 -05:00
Ben Meadors
de22f20876 Turn region screen back on (#1621) 2022-08-11 14:24:35 -05:00
Ben Meadors
9b5211dc65 Syntax 2022-08-11 09:03:18 -05:00
Ben Meadors
0b4fb72d58 Guard the assets (#1618)
* Guard the assets

* Indicated legacy build-all

* Hopefully fixed
2022-08-11 08:56:38 -05:00
Ben Meadors
7e03019cc4 Zip elfs 2022-08-11 07:22:19 -05:00
Ben Meadors
780f4383f4 Trying elves again 2022-08-11 07:07:04 -05:00
Ben Meadors
8148f06773 Paths 2022-08-10 20:59:45 -05:00
Ben Meadors
d5780af362 Elves live in trees 2022-08-10 20:24:37 -05:00
Ben Meadors
82ed7a2084 Elves are released 2022-08-10 20:09:01 -05:00
Ben Meadors
dd5fd3744d Debug elfs 2022-08-10 19:25:27 -05:00
Ben Meadors
afb5fca6e1 Correct path 2022-08-10 19:21:59 -05:00
Ben Meadors
95d75fdfee Bins 2022-08-10 19:06:31 -05:00
Ben Meadors
029a6b16ba Release the correct archiva 2022-08-10 18:47:06 -05:00
Ben Meadors
9be3099ca6 Remove release workflow 2022-08-10 18:10:15 -05:00
Ben Meadors
b6126e6e63 Disable release workflow 2022-08-10 18:07:11 -05:00
Ben Meadors
d6dfdc314e Update version.properties 2022-08-10 18:05:32 -05:00
Ben Meadors
78666e9b36 Oops 2022-08-10 18:00:41 -05:00
Ben Meadors
3abba0ce39 Release in CI hopefully 2022-08-10 17:59:47 -05:00
Ben Meadors
2c8e030b3d Bump whitespace for build 2022-08-10 16:32:27 -05:00
Ben Meadors
eed7408f00 Remove checks from pico for now 2022-08-10 16:28:11 -05:00
Ben Meadors
cabd1eb8c0 plz work 2022-08-10 16:17:49 -05:00
Ben Meadors
f46c11a047 Line break 2022-08-10 16:12:35 -05:00
Ben Meadors
cdd5e16e25 Path 2022-08-10 16:10:03 -05:00
Ben Meadors
a6c9a819f8 Chmod path 2022-08-10 16:05:10 -05:00
Ben Meadors
2e72397898 Chmod 2022-08-10 16:03:41 -05:00
Ben Meadors
f554226226 Add print back 2022-08-10 15:53:19 -05:00
Ben Meadors
2d1897a36f chmod 2022-08-10 15:52:53 -05:00
Ben Meadors
fe1ed3f284 Pico build in PR (#1617)
* Pico build in PR

* Missed refs

* Update main_matrix.yml
2022-08-10 15:33:42 -05:00
Ben Meadors
3251cd510a Bump version 2022-08-10 13:11:32 -05:00
Ben Meadors
7d0411cd15 Esp32 NimBLE experiments (#1613)
* Delete callbacks on bleServer on destruct

* Trying things
2022-08-10 12:44:52 -05:00
Thomas Göttgens
1d1ccd6b19 Merge pull request #1615 from meshtastic/src-cleanup
Put a bit of order in the src directory
2022-08-10 16:04:44 +02:00
Thomas Göttgens
3b8566747c Merge branch 'master' into src-cleanup 2022-08-10 15:47:08 +02:00
Thomas Göttgens
3cc584d855 Merge pull request #1616 from neilhao/master
'Station-g1-patch1'
2022-08-10 15:46:26 +02:00
neil
90d3cc2ff8 'Station-g1-patch1' 2022-08-10 19:26:43 +08:00
Thomas Göttgens
d125b0ec3c Merge branch 'master' into src-cleanup 2022-08-10 11:39:47 +02:00
Thomas Göttgens
5e842dd735 Put a bit of order in the src directory, group and name things appropriately 2022-08-10 11:31:29 +02:00
Thomas Göttgens
bbc0baa31d Merge pull request #1611 from meshtastic/RP2040-Platform
Raspberry Pi Pico target (with sparkfun lora hat)
2022-08-10 10:14:43 +02:00
Thomas Göttgens
31788feab1 Update platformio.ini 2022-08-10 10:03:47 +02:00
Thomas Göttgens
2c37be58ac Merge branch 'RP2040-Platform' of github.com:meshtastic/Meshtastic-device 2022-08-10 10:01:58 +02:00
Thomas Göttgens
836782b3c1 Merge branch 'master' into RP2040-Platform 2022-08-10 10:01:36 +02:00
Thomas Göttgens
cfc44cd608 Merge branch 'master' of github.com:meshtastic/Meshtastic-device 2022-08-10 10:00:40 +02:00
Thomas Göttgens
519f31ed60 fix portduino build 2022-08-10 10:00:23 +02:00
Sacha Weatherstone
e04d6b3f56 Update protobufs 2022-08-09 12:22:46 +10:00
Thomas Göttgens
25c851a929 Merge branch 'master' into RP2040-Platform 2022-08-08 23:17:33 +02:00
Thomas Göttgens
0c8fb6e27f Raspberry Pi Pico target (with sparkfun lora hat) does compile but needs further work.
Also contains a small fix to make PRIVATE_HW targets build again for nRF52 architectures
2022-08-08 23:11:19 +02:00
Thomas Göttgens
8490bdd14e Merge pull request #1609 from meshtastic/AXP192-CLEANUP
Axp192 cleanup
2022-08-08 16:50:57 +02:00
Thomas Göttgens
22a5cf04d3 Another one. 2022-08-08 16:29:34 +02:00
Thomas Göttgens
ddc5a59ece Missed one or two 2022-08-08 16:16:50 +02:00
Thomas Göttgens
6382f67b89 Replace TBEAM_V10 macro guards with more appropriate HAS_AXP192. Also eliminates symbol redefinition of AXP192_SLAVE_ADDRESS 2022-08-08 16:13:38 +02:00
Ben Meadors
401b5d92aa 1.3.34 2022-08-08 07:29:36 -05:00
Ben Meadors
572f9f9295 Get device metadata admin message (#1607)
* Get device metadata admin message

* Bump device state version
2022-08-08 07:19:04 -05:00
Thomas Göttgens
96ce40040c Merge pull request #1608 from meshtastic/compass-orientation
wire in compass display setting
2022-08-08 09:30:30 +02:00
Thomas Göttgens
d0a1aad7d1 wire in compass display setting 2022-08-08 09:00:29 +02:00
325 changed files with 13782 additions and 7438 deletions

27
.github/ISSUE_TEMPLATE/feature.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Feature Request
description: Request a new feature
title: "[Feature Request]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for your request this will not gurantee that we will implement it, but it will be reviewed.
- type: dropdown
id: soc
attributes:
label: Platform
description: What device platform will support your feature?
multiple: true
options:
- NRF52
- ESP32
validations:
required: true
- type: textarea
id: body
attributes:
label: Description
description: Please provide details about your enhancement.
validations:
required: true

41
.github/actions/setup-base/action.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: 'Setup Build Base Composite Action'
description: 'Base build actions for Meshtastic Platform IO steps'
runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Install cppcheck
shell: bash
run: |
sudo apt-get install -y cppcheck
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Cache python libs
uses: actions/cache@v3
id: cache-pip # needed in if test
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Upgrade python tools
shell: bash
run: |
python -m pip install --upgrade pip
pip install -U platformio adafruit-nrfutil
pip install -U meshtastic --pre
- name: Upgrade platformio
shell: bash
run: |
pio upgrade

54
.github/workflows/build_esp32.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Build ESP32
on:
workflow_call:
inputs:
board:
required: true
type: string
jobs:
build-esp32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build base
id: base
uses: ./.github/actions/setup-base
- name: Pull web ui
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "meshtastic/web"
file: "build.tar"
target: "build.tar"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unpack web ui
run: |
tar -xf build.tar -C data/static
rm build.tar
- name: Build ESP32
run: bin/build-esp32.sh ${{ inputs.board }}
- name: Pull OTA Firmware
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "meshtastic/firmware-ota"
file: "firmware.bin"
target: "release/bleota.bin"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get release version string
shell: bash
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
id: version
- name: Store binaries as an artifact
uses: actions/upload-artifact@v3
with:
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
path: |
release/*.bin
release/*.elf

33
.github/workflows/build_nrf52.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Build NRF52
on:
workflow_call:
inputs:
board:
required: true
type: string
jobs:
build-nrf52:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build base
id: base
uses: ./.github/actions/setup-base
- name: Build NRF52
run: bin/build-nrf52.sh ${{ inputs.board }}
- name: Get release version string
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
id: version
- name: Store binaries as an artifact
uses: actions/upload-artifact@v3
with:
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
path: |
release/*.uf2
release/*.elf
release/*.zip

32
.github/workflows/build_rpi2040.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Build RPI2040
on:
workflow_call:
inputs:
board:
required: true
type: string
jobs:
build-rpi2040:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build base
id: base
uses: ./.github/actions/setup-base
- name: Build Raspberry Pi 2040
run: ./bin/build-rpi2040.sh ${{ inputs.board }}
- name: Get release version string
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
id: version
- name: Store binaries as an artifact
uses: actions/upload-artifact@v3
with:
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
path: |
release/*.uf2
release/*.elf

View File

@@ -2,18 +2,17 @@ name: CI
on:
# # Triggers the workflow on push but only for the master branch
push:
branches: [master]
branches: [master, develop]
paths-ignore:
- "**.md"
- "**.yml"
- "version.properties"
# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
pull_request_target:
branches: [master]
branches: [master, develop]
paths-ignore:
- "**.md"
- "**.yml"
#- "**.yml"
workflow_dispatch:
@@ -24,57 +23,22 @@ jobs:
matrix:
include:
- board: rak11200
- board: tlora-v2
- board: tlora-v1
- board: tlora_v1_3
- board: tlora-v2-1-1.6
- board: tbeam
- board: heltec-v1
- board: heltec-v2.0
- board: heltec-v2.1
- board: tbeam0.7
- board: meshtastic-diy-v1
- board: rak4631
- board: rak4631_eink
- board: t-echo
- board: nano-g1
- board: station-g1
- board: m5stack-core
- board: m5stack-coreink
- board: tbeam-s3-core
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Install cppcheck
run: |
sudo apt-get install -y cppcheck
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Cache python libs
uses: actions/cache@v1
id: cache-pip # needed in if test
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Upgrade python tools and install platformio
run: |
python -m pip install --upgrade pip
pip install -U platformio
- name: Upgrade platformio
run: |
pio upgrade
- uses: actions/checkout@v3
- name: Build base
id: base
uses: ./.github/actions/setup-base
- name: Check ${{ matrix.board }}
run: bin/check-all.sh ${{ matrix.board }}
@@ -93,72 +57,19 @@ jobs:
- board: heltec-v1
- board: heltec-v2.0
- board: heltec-v2.1
- board: heltec-v3
- board: heltec-wsl-v3
- board: tbeam0.7
- board: meshtastic-diy-v1
- board: meshtastic-dr-dev
- board: nano-g1
- board: station-g1
- board: m5stack-core
- board: m5stack-coreink
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- board: tbeam-s3-core
uses: ./.github/workflows/build_esp32.yml
with:
submodules: "recursive"
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Cache python libs
uses: actions/cache@v1
id: cache-pip # needed in if test
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Upgrade python tools
run: |
python -m pip install --upgrade pip
pip install -U platformio adafruit-nrfutil littlefs-python
pip install -U --pre meshtastic
- name: Upgrade platformio
run: |
pio upgrade
- name: Pull web ui
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "meshtastic/meshtastic-web"
file: "build.tar"
target: "build.tar"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unpack web ui
run: |
tar -xf build.tar -C data/static
rm build.tar
- name: Build ESP32
run: bin/build-esp32.sh ${{ matrix.board }}
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
id: version
- name: Store binaries as an artifact
uses: actions/upload-artifact@v2
with:
name: firmware-${{ matrix.board }}-${{ steps.version.outputs.version }}.zip
path: |
release/*.bin
release/*.elf
retention-days: 90
board: ${{ matrix.board }}
build-nrf52:
strategy:
@@ -170,85 +81,29 @@ jobs:
- board: rak4631_eink
- board: t-echo
- board: pca10059_diy_eink
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- board: feather_diy
uses: ./.github/workflows/build_nrf52.yml
with:
submodules: "recursive"
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
board: ${{ matrix.board }}
- name: Setup Python
uses: actions/setup-python@v2
build-rpi2040:
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- board: pico
uses: ./.github/workflows/build_rpi2040.yml
with:
python-version: 3.x
- name: Cache python libs
uses: actions/cache@v1
id: cache-pip # needed in if test
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Upgrade python tools
run: |
python -m pip install --upgrade pip
pip install -U platformio adafruit-nrfutil
pip install -U --pre meshtastic
- name: Upgrade platformio
run: |
pio upgrade
- name: Build NRF52
run: bin/build-nrf52.sh ${{ matrix.board }}
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
id: version
- name: Store binaries as an artifact
uses: actions/upload-artifact@v2
with:
name: firmware-${{ matrix.board }}-${{ steps.version.outputs.version }}.zip
path: |
release/*.uf2
release/*.elf
retention-days: 90
board: ${{ matrix.board }}
build-native:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Cache python libs
uses: actions/cache@v1
id: cache-pip # needed in if test
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Upgrade python tools
run: |
python -m pip install --upgrade pip
pip install -U platformio adafruit-nrfutil
pip install -U --pre meshtastic
- name: Upgrade platformio
run: |
pio upgrade
- uses: actions/checkout@v3
- name: Build base
id: base
uses: ./.github/actions/setup-base
# We now run integration test before other build steps (to quickly see runtime failures)
- name: Build for native
@@ -264,18 +119,36 @@ jobs:
run: bin/build-native.sh
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
id: version
- name: Store binaries as an artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: firmware-native-${{ steps.version.outputs.version }}.zip
path: |
release/meshtasticd_linux_amd64
release/device-*.sh
release/device-*.bat
retention-days: 90
- name: Docker login
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v2
with:
username: meshtastic
password: ${{ secrets.DOCKER_TOKEN }}
- name: Docker setup
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/setup-buildx-action@v2
- name: Docker build and push
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: meshtastic/device-simulator:latest
after-checks:
runs-on: ubuntu-latest
@@ -289,7 +162,7 @@ jobs:
gather-artifacts:
runs-on: ubuntu-latest
needs: [build-esp32, build-nrf52, build-native]
needs: [build-esp32, build-nrf52, build-native, build-rpi2040]
steps:
- name: Checkout code
uses: actions/checkout@v3
@@ -297,30 +170,30 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
path: ./
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
id: version
- name: Move files up
run: mv -b -t ./ ./*tbeam-*/littlefs*.bin ./*tbeam-*/system-info.bin ./**/firmware*.bin ./**/*.uf2 ./**/*.elf ./**/meshtasticd_linux_amd64 ./*native*/*device-*.sh ./*native*/*device-*.bat
run: mv -b -t ./ ./*tbeam-2*/littlefs*.bin ./*tbeam-2*/bleota.bin ./**/firmware*.bin ./*t-echo*/Meshtastic_nRF52_factory_erase.uf2 ./**/firmware-*.uf2 ./**/firmware-*-ota.zip ./**/*.elf ./*native*/*device-*.sh ./*native*/*device-*.bat
- name: Repackage in single firmware zip
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: firmware-${{ steps.version.outputs.version }}
path: |
./*.bin
./*.uf2
./meshtasticd_linux_amd64
./firmware-*-ota.zip
./device-*.sh
./device-*.bat
retention-days: 90
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: firmware-${{ steps.version.outputs.version }}
path: ./output
@@ -329,15 +202,20 @@ jobs:
- name: Show artifacts
run: ls -lR
- name: Device scripts permissions
run: |
chmod +x ./output/device-install.sh
chmod +x ./output/device-update.sh
- name: Zip firmware
run: zip -j -r ./firmware-${{ steps.version.outputs.version }}.zip ./output
run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output
- name: Repackage in single elfs zip
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: debug-elfs-${{ steps.version.outputs.version }}.zip
path: ./*.elf
retention-days: 90
retention-days: 30
- name: Create request artifacts
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
@@ -350,3 +228,88 @@ jobs:
artifacts-branch: device
artifacts-dir: pr
artifacts: ./firmware-${{ steps.version.outputs.version }}.zip
release-artifacts:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }}
needs: [gather-artifacts, after-checks]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Get release version string
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
id: version
- uses: actions/download-artifact@v3
with:
name: firmware-${{ steps.version.outputs.version }}
path: ./output
- name: Device scripts permissions
run: |
chmod +x ./output/device-install.sh
chmod +x ./output/device-update.sh
- name: Zip firmware
run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output
- uses: actions/download-artifact@v3
with:
name: debug-elfs-${{ steps.version.outputs.version }}.zip
path: ./elfs
- name: Zip Elfs
run: zip -j -9 -r ./debug-elfs-${{ steps.version.outputs.version }}.zip ./elfs
# For diagnostics
- name: Show artifacts
run: ls -lR
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: true
release_name: Meshtastic Firmware ${{ steps.version.outputs.version }}
tag_name: v${{ steps.version.outputs.version }}
body: |
Autogenerated by github action, developer should edit as required before publishing...
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Add bins to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./firmware-${{ steps.version.outputs.version }}.zip
asset_name: firmware-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
- name: Add debug elfs to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./debug-elfs-${{ steps.version.outputs.version }}.zip
asset_name: debug-elfs-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
- name: Bump version.properties
run: >-
bin/bump_version.py
- name: Create version.properties pull request
uses: peter-evans/create-pull-request@v3
with:
add-paths: |
version.properties

View File

@@ -1,92 +0,0 @@
name: Make Release
on:
# Can optionally take parameters from the github UI, more info here https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/#:~:text=You%20can%20now%20create%20workflows,the%20workflow%20is%20run%20on.
workflow_dispatch:
# inputs:
# Only want to run if version.properties is bumped in master
push:
branches:
- master
paths:
- "version.properties"
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x
# Will be available in steps.version.outputs.version
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
id: version
# Note: we don't use caches on release builds because we don't want to accidentally not have a virgin build machine
- name: Upgrade python tools
# We actually want to run this every time
# if: steps.cache-pip.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install -U platformio meshtastic adafruit-nrfutil littlefs-python
- name: Upgrade platformio
run: |
pio upgrade
- name: Pull web ui
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "meshtastic/meshtastic-web"
file: "build.tar"
target: "build.tar"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unpack web ui
run: |
tar -xf build.tar -C data/static
rm build.tar
- name: Build everything
run: bin/build-all.sh
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: true
release_name: ${{ steps.version.outputs.version }} alpha
tag_name: v${{ steps.version.outputs.version }}
body: |
Autogenerated by github action, developer should edit as required before publishing...
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Add bins to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release/archive/firmware-${{ steps.version.outputs.version }}.zip
asset_name: firmware-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
- name: Add debug elfs to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release/archive/elfs-${{ steps.version.outputs.version }}.zip
asset_name: debug-elfs-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip

View File

@@ -0,0 +1,40 @@
---
name: Flawfinder Scan
on:
push:
branches: [master, develop]
paths-ignore:
- "**.md"
- "version.properties"
jobs:
flawfinder:
runs-on: ubuntu-latest
name: Flawfinder
steps:
# step 1
- name: clone application source code
uses: actions/checkout@v3
# step 2
- name: flawfinder_scan
uses: david-a-wheeler/flawfinder@2.0.19
with:
arguments: '--sarif ./'
output: 'flawfinder_report.sarif'
# step 3
- name: save report as pipeline artifact
uses: actions/upload-artifact@v3
with:
name: flawfinder_report.sarif
path: flawfinder_report.sarif
# step 4
- name: publish code scanning alerts
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: flawfinder_report.sarif
category: flawfinder

View File

@@ -0,0 +1,44 @@
---
name: Semgrep Full Scan
on:
workflow_dispatch:
branches:
- master
schedule:
- cron: '0 1 * * 6'
jobs:
semgrep-full:
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep
steps:
# step 1
- name: clone application source code
uses: actions/checkout@v3
# step 2
- name: full scan
run: |
semgrep \
--sarif --output report.sarif \
--metrics=off \
--config="p/default"
# step 3
- name: save report as pipeline artifact
uses: actions/upload-artifact@v3
with:
name: report.sarif
path: report.sarif
# step 4
- name: publish code scanning alerts
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: report.sarif
category: semgrep

View File

@@ -0,0 +1,28 @@
---
name: Semgrep Differential Scan
on:
pull_request
jobs:
semgrep-diff:
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep
steps:
# step 1
- name: clone application source code
uses: actions/checkout@v3
with:
fetch-depth: 0
# step 2
- name: differential scan
run: |
semgrep scan \
--error \
--metrics=off \
--baseline-commit ${{ github.event.pull_request.base.sha }} \
--config="p/default"

View File

@@ -17,9 +17,9 @@ jobs:
- name: Download nanopb
run: |
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.6-linux-x86.tar.gz
tar xvzf nanopb-0.4.6-linux-x86.tar.gz
mv nanopb-0.4.6-linux-x86 nanopb-0.4.6
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.7-linux-x86.tar.gz
tar xvzf nanopb-0.4.7-linux-x86.tar.gz
mv nanopb-0.4.7-linux-x86 nanopb-0.4.7
- name: Re-generate protocol buffers
run: |

1
.gitignore vendored
View File

@@ -29,3 +29,4 @@ __pycache__
venv/
release/
.vscode/extensions.json

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "protobufs"]
path = protobufs
url = https://github.com/meshtastic/Meshtastic-protobufs.git
url = https://github.com/meshtastic/protobufs.git

2
.semgrepignore Normal file
View File

@@ -0,0 +1,2 @@
.github/workflows/main_matrix.yml
src/mesh/compression/unishox2.c

View File

@@ -52,7 +52,9 @@
"shared_mutex": "cpp",
"iostream": "cpp",
"esp_nimble_hci.h": "c",
"map": "cpp"
"map": "cpp",
"random": "cpp",
"*.tpp": "cpp"
},
"cSpell.words": [
"Blox",

41
Dockerfile Normal file
View File

@@ -0,0 +1,41 @@
FROM debian:bullseye-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install build deps
USER root
RUN apt-get update && \
apt-get -y install wget python3 g++ zip python3-venv git vim ca-certificates
# create a non-priveleged user & group
RUN groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh
USER mesh
RUN wget https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -qO /tmp/get-platformio.py && \
chmod +x /tmp/get-platformio.py && \
python3 /tmp/get-platformio.py && \
git clone https://github.com/meshtastic/firmware --recurse-submodules /tmp/firmware && \
cd /tmp/firmware && \
chmod +x /tmp/firmware/bin/build-native.sh && \
source ~/.platformio/penv/bin/activate && \
./bin/build-native.sh
FROM frolvlad/alpine-glibc
RUN apk --update add --no-cache g++ shadow && \
groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh
COPY --from=builder /tmp/firmware/release/meshtasticd_linux_amd64 /home/mesh/
USER mesh
WORKDIR /home/mesh
CMD sh -cx "./meshtasticd_linux_amd64 --hwid '$RANDOM'"
HEALTHCHECK NONE

View File

@@ -1,8 +1,8 @@
# Meshtastic Firmware
![GitHub release downloads](https://img.shields.io/github/downloads/meshtastic/meshtastic-device/total)
[![CI](https://img.shields.io/github/workflow/status/meshtastic/Meshtastic-device/CI?label=actions&logo=github&color=yellow)](https://github.com/meshtastic/repo/actions/workflows/main_matrix.yml)
[![CLA assistant](https://cla-assistant.io/readme/badge/meshtastic/Meshtastic-device)](https://cla-assistant.io/meshtastic/Meshtastic-device)
![GitHub release downloads](https://img.shields.io/github/downloads/meshtastic/firmware/total)
[![CI](https://img.shields.io/github/workflow/status/meshtastic/firmware/CI?label=actions&logo=github&color=yellow)](https://github.com/meshtastic/firmware/actions/workflows/main_matrix.yml)
[![CLA assistant](https://cla-assistant.io/readme/badge/meshtastic/firmware)](https://cla-assistant.io/meshtastic/firmware)
[![Fiscal Contributors](https://opencollective.com/meshtastic/tiers/badge.svg?label=Fiscal%20Contributors&color=deeppink)](https://opencollective.com/meshtastic/)
[![Vercel](https://img.shields.io/static/v1?label=Powered%20by&message=Vercel&style=flat&logo=vercel&color=000000)](https://vercel.com?utm_source=meshtastic&utm_campaign=oss)
@@ -10,10 +10,9 @@
This repository contains the device firmware for the Meshtastic project.
**[Building Instructions](https://meshtastic.org/docs/developers/Firmware/build)**
**[Building Instructions](https://meshtastic.org/docs/development/firmware/build)**
**[Flashing Instructions](https://meshtastic.org/docs/getting-started/flashing-firmware/)**
## Stats
![Alt](https://repobeats.axiom.co/api/embed/99a2cf5622bb4807f9e8c3b86589f1133cce58a2.svg 'Repobeats analytics image')
![Alt](https://repobeats.axiom.co/api/embed/a92f097d9197ae853e780ec53d7d126e545629ab.svg "Repobeats analytics image")

54
arch/esp32/esp32.ini Normal file
View File

@@ -0,0 +1,54 @@
; Common settings for ESP targes, mixin with extends = esp32_base
[esp32_base]
extends = arduino_base
platform = platformio/espressif32@^5.2.0
build_src_filter =
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040> -<mesh/eth/>
upload_speed = 921600
debug_init_break = tbreak setup
monitor_filters = esp32_exception_decoder
board_build.filesystem = littlefs
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
# This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h
build_flags =
${arduino_base.build_flags}
-Wall
-Wextra
-Isrc/platform/esp32
-std=c++11
-DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
-DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
-DAXP_DEBUG_PORT=Serial
-DCONFIG_BT_NIMBLE_ENABLED
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
-DDEBUG_HEAP
lib_deps =
${arduino_base.lib_deps}
${networking_base.lib_deps}
${environmental_base.lib_deps}
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
h2zero/NimBLE-Arduino@^1.4.0
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
caveman99/ESP32 Codec2@^1.0.1
lib_ignore =
segger_rtt
ESP32 BLE Arduino
; leave this commented out to avoid breaking Windows
;upload_port = /dev/ttyUSB0
;monitor_port = /dev/ttyUSB0
; Please don't delete these lines. JM uses them.
;upload_port = /dev/cu.SLAB_USBtoUART
;monitor_port = /dev/cu.SLAB_USBtoUART
; customize the partition table
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
board_build.partitions = partition-table.csv

47
arch/esp32/esp32s2.ini Normal file
View File

@@ -0,0 +1,47 @@
[esp32s2_base]
extends = arduino_base
platform = platformio/espressif32@^5.2.0
build_src_filter =
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040> -<mesh/eth/> -<nimble/>
upload_speed = 961200
monitor_speed = 115200
debug_init_break = tbreak setup
monitor_filters = esp32_exception_decoder
board_build.filesystem = littlefs
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
# This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h
build_flags =
${arduino_base.build_flags}
-Wall
-Wextra
-Isrc/platform/esp32
-std=c++11
-DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
-DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
-DAXP_DEBUG_PORT=Serial
-DCONFIG_BT_NIMBLE_ENABLED
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
-DHAS_BLUETOOTH=0
-DDEBUG_HEAP
lib_deps =
${arduino_base.lib_deps}
${networking_base.lib_deps}
${environmental_base.lib_deps}
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
caveman99/ESP32 Codec2@^1.0.1
lib_ignore =
segger_rtt
ESP32 BLE Arduino
; customize the partition table
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
board_build.partitions = partition-table.csv

47
arch/esp32/esp32s3.ini Normal file
View File

@@ -0,0 +1,47 @@
[esp32s3_base]
extends = arduino_base
platform = platformio/espressif32@^5.2.0
build_src_filter =
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040> -<mesh/eth/>
upload_speed = 961200
monitor_speed = 115200
debug_init_break = tbreak setup
monitor_filters = esp32_exception_decoder
board_build.filesystem = littlefs
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
# This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h
build_flags =
${arduino_base.build_flags}
-Wall
-Wextra
-Isrc/platform/esp32
-std=c++11
-DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
-DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
-DAXP_DEBUG_PORT=Serial
-DCONFIG_BT_NIMBLE_ENABLED
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
-DDEBUG_HEAP
lib_deps =
${arduino_base.lib_deps}
${networking_base.lib_deps}
${environmental_base.lib_deps}
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
h2zero/NimBLE-Arduino@^1.4.0
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
caveman99/ESP32 Codec2@^1.0.1
lib_ignore =
segger_rtt
ESP32 BLE Arduino
; customize the partition table
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
board_build.partitions = partition-table.csv

18
arch/nrf52/nrf52.ini Normal file
View File

@@ -0,0 +1,18 @@
[nrf52_base]
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
platform = platformio/nordicnrf52@^9.4.0
extends = arduino_base
build_type = debug ; I'm debugging with ICE a lot now
build_flags =
${arduino_base.build_flags} -Wno-unused-variable
-Isrc/platform/nrf52
build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<platform/stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mqtt/> -<platform/rp2040> -<mesh/eth/>
lib_ignore =
BluetoothOTA
; Note: By default no lora device is created for this build - it uses a simulated interface
[env:feather_nrf52832]
extends = nrf52_base
board = adafruit_feather_nrf52832

14
arch/nrf52/nrf52840.ini Normal file
View File

@@ -0,0 +1,14 @@
[nrf52840_base]
extends = nrf52_base
build_flags = ${nrf52_base.build_flags}
lib_deps =
${arduino_base.lib_deps}
${environmental_base.lib_deps}
https://github.com/Kongduino/Adafruit_nRFCrypto.git#e31a8825ea3300b163a0a3c1ddd5de34e10e1371
; Note: By default no lora device is created for this build - it uses a simulated interface
[env:nrf52840dk]
extends = nrf52840_base
board = nrf52840_dk

View File

@@ -0,0 +1,21 @@
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
[portduino_base]
platform = https://github.com/meshtastic/platform-native.git#096b3c3e9c5c8e19d4c3b6cd803fffef2a9be4c5
framework = arduino
build_src_filter =
${env.build_src_filter}
-<platform/esp32/>
-<nimble/>
-<platform/nrf52/>
-<platform/stm32wl/>
-<platform/rp2040>
-<mesh/http/>
-<mesh/eth/>
-<modules/esp32>
-<modules/Telemetry>
+<../variants/portduino>
lib_deps =
${env.lib_deps}
${networking_base.lib_deps}
rweather/Crypto@^0.4.0
build_flags = ${arduino_base.build_flags} -Isrc/platform/portduino

21
arch/rp2040/rp2040.ini Normal file
View File

@@ -0,0 +1,21 @@
; Common settings for rp2040 Processor based targets
[rp2040_base]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#20c7dbfcfe6677c5305fa28ecf5e3870321cb157
platform_packages =
earlephilhower/toolchain-rp2040-earlephilhower@^5.100300.221223
extends = arduino_base
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
build_flags =
${arduino_base.build_flags} -Wno-unused-variable
-Isrc/platform/rp2040
-D__PLAT_RP2040__
# -D _POSIX_THREADS
build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mqtt/> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/>
lib_ignore =
BluetoothOTA
lib_deps =
${arduino_base.lib_deps}
${environmental_base.lib_deps}
https://github.com/kokke/tiny-AES-c.git#f06ac37fc31dfdaca2e0d9bec83f90d5663c319b

18
arch/stm32/stm32wl5e.ini Normal file
View File

@@ -0,0 +1,18 @@
[stm32wl5e_base]
platform = platformio/ststm32@^15.4.1
board = generic_wl5e
framework = arduino
build_type = debug
build_flags =
${arduino_base.build_flags}
-Isrc/platform/stm32wl -g
-DHAL_SUBGHZ_MODULE_ENABLED
# Arduino/PlatformIO framework-arduinoststm32 package does not presently have SUBGHZSPI support
# -DPIN_SPI_MOSI=PINSUBGHZSPIMOSI -DPIN_SPI_MISO=PINSUBGHZSPIMISO -DPIN_SPI_SCK=PINSUBGHZSPISCK
build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<mqtt/> -<graphics> -<input> -<buzz> -<modules/Telemetry> -<platform/nrf52> -<platform/portduino> -<platform/rp2040>
lib_deps =
${env.lib_deps}
https://github.com/kokke/tiny-AES-c.git#f06ac37fc31dfdaca2e0d9bec83f90d5663c319b
lib_ignore =
mathertel/OneButton@^2.0.3

Binary file not shown.

View File

@@ -1,109 +0,0 @@
#!/usr/bin/env bash
set -e
VERSION=`bin/buildinfo.py long`
SHORT_VERSION=`bin/buildinfo.py short`
BOARDS_ESP32="rak11200 tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 nano-g1 station-g1 m5stack-core m5stack-coreink"
#BOARDS_ESP32=tbeam
# FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine
BOARDS_NRF52="rak4631 rak4631_eink t-echo pca10059_diy_eink"
#BOARDS_NRF52=""
OUTDIR=release/latest
# We keep all old builds (and their map files in the archive dir)
ARCHIVEDIR=release/archive
rm -f $OUTDIR/firmware*
mkdir -p $OUTDIR/bins $ARCHIVEDIR
rm -r $OUTDIR/bins/* || true
mkdir -p $OUTDIR/bins/universal $OUTDIR/elfs/universal
# build the named environment and copy the bins to the release directory
function do_build() {
BOARD=$1
isNrf=$3
echo "Building for $BOARD ($isNrf) with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$BOARD/firmware.*
# The shell vars the build tool expects to find
export APP_VERSION=$VERSION
basename=universal/firmware-$BOARD-$VERSION
pio run --environment $BOARD # -v
SRCELF=.pio/build/$BOARD/firmware.elf
cp $SRCELF $OUTDIR/elfs/$basename.elf
if [ "$isNrf" = "false" ]
then
echo "Copying ESP32 bin file"
SRCBIN=.pio/build/$BOARD/firmware.bin
cp $SRCBIN $OUTDIR/bins/$basename.bin
else
echo "Generating NRF52 uf2 file"
SRCHEX=.pio/build/$BOARD/firmware.hex
bin/uf2conv.py $SRCHEX -c -o $OUTDIR/bins/$basename.uf2 -f 0xADA52840
fi
}
function do_boards() {
declare boards=$1
declare isNrf=$2
for board in $boards; do
# Build universal
echo "about to build $board $isNrf"
do_build $board "" "$isNrf"
done
}
# Make sure our submodules are current
git submodule update
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio lib update
do_boards "$BOARDS_ESP32" "false"
do_boards "$BOARDS_NRF52" "true"
pio run --environment native
cp .pio/build/native/program $OUTDIR/bins/universal/meshtasticd_linux_amd64
echo "Building Filesystem for ESP32 targets"
pio run --environment tbeam -t buildfs
cp .pio/build/tbeam/spiffs.bin $OUTDIR/bins/universal/littlefs-$VERSION.bin
# keep the bins in archive also
cp $OUTDIR/bins/universal/littlefs* $OUTDIR/bins/universal/firmware* $OUTDIR/elfs/universal/firmware* $ARCHIVEDIR
echo Updating android bins $OUTDIR/forandroid
rm -rf $OUTDIR/forandroid
mkdir -p $OUTDIR/forandroid
cp -a $OUTDIR/bins/universal/*.bin $OUTDIR/forandroid/
cat >$OUTDIR/curfirmwareversion.xml <<XML
<?xml version="1.0" encoding="utf-8"?>
<!-- This file is kept in source control because it reflects the last stable
release. It is used by the android app for forcing software updates. Do not edit.
Generated by bin/buildall.sh -->
<resources>
<string name="cur_firmware_version" translatable="false">$VERSION</string>
<string name="short_firmware_version" translatable="false">$SHORT_VERSION</string>
</resources>
XML
echo Generating $ARCHIVEDIR/firmware-$VERSION.zip
rm -f $ARCHIVEDIR/firmware-$VERSION.zip
zip --junk-paths $ARCHIVEDIR/firmware-$VERSION.zip $ARCHIVEDIR/littlefs-$VERSION.bin $OUTDIR/bins/universal/firmware-*-$VERSION.* $OUTDIR/bins/universal/meshtasticd* images/system-info.bin bin/device-install.* bin/device-update.*
echo Generating $ARCHIVEDIR/elfs-$VERSION.zip
rm -f $ARCHIVEDIR/elfs-$VERSION.zip
zip --junk-paths $ARCHIVEDIR/elfs-$VERSION.zip $OUTDIR/elfs/universal/firmware-*-$VERSION.*
echo BUILT ALL

View File

@@ -10,11 +10,8 @@ OUTDIR=release/
rm -f $OUTDIR/firmware*
rm -r $OUTDIR/* || true
# Make sure our submodules are current
git submodule update
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio lib update
platformio pkg update
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$1/firmware.*
@@ -29,13 +26,15 @@ SRCELF=.pio/build/$1/firmware.elf
cp $SRCELF $OUTDIR/$basename.elf
echo "Copying ESP32 bin file"
SRCBIN=.pio/build/$1/firmware.bin
SRCBIN=.pio/build/$1/firmware.factory.bin
cp $SRCBIN $OUTDIR/$basename.bin
echo "Copying ESP32 update bin file"
SRCBIN=.pio/build/$1/firmware.bin
cp $SRCBIN $OUTDIR/$basename-update.bin
echo "Building Filesystem for ESP32 targets"
pio run --environment tbeam -t buildfs
cp .pio/build/tbeam/spiffs.bin $OUTDIR/littlefs-$VERSION.bin
cp images/system-info.bin $OUTDIR/system-info.bin
cp .pio/build/tbeam/littlefs.bin $OUTDIR/littlefs-$VERSION.bin
cp bin/device-install.* $OUTDIR
cp bin/device-update.* $OUTDIR

View File

@@ -12,11 +12,8 @@ rm -f $OUTDIR/firmware*
mkdir -p $OUTDIR/
rm -r $OUTDIR/* || true
# Make sure our submodules are current
git submodule update
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio lib update
platformio pkg update
pio run --environment native
cp .pio/build/native/program $OUTDIR/meshtasticd_linux_amd64

View File

@@ -10,11 +10,8 @@ OUTDIR=release/
rm -f $OUTDIR/firmware*
rm -r $OUTDIR/* || true
# Make sure our submodules are current
git submodule update
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio lib update
platformio pkg update
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$1/firmware.*
@@ -26,7 +23,9 @@ basename=firmware-$1-$VERSION
pio run --environment $1 # -v
SRCELF=.pio/build/$1/firmware.elf
DFUPKG=.pio/build/$1/firmware.zip
cp $SRCELF $OUTDIR/$basename.elf
cp $DFUPKG $OUTDIR/$basename-ota.zip
echo "Generating NRF52 uf2 file"
SRCHEX=.pio/build/$1/firmware.hex
@@ -34,3 +33,4 @@ bin/uf2conv.py $SRCHEX -c -o $OUTDIR/$basename.uf2 -f 0xADA52840
cp bin/device-install.* $OUTDIR
cp bin/device-update.* $OUTDIR
cp bin/*.uf2 $OUTDIR

33
bin/build-rpi2040.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -e
VERSION=`bin/buildinfo.py long`
SHORT_VERSION=`bin/buildinfo.py short`
OUTDIR=release/
rm -f $OUTDIR/firmware*
rm -r $OUTDIR/* || true
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio pkg update
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$1/firmware.*
# The shell vars the build tool expects to find
export APP_VERSION=$VERSION
basename=firmware-$1-$VERSION
pio run --environment $1 # -v
SRCELF=.pio/build/$1/firmware.elf
cp $SRCELF $OUTDIR/$basename.elf
echo "Copying uf2 file"
SRCBIN=.pio/build/$1/firmware.uf2
cp $SRCBIN $OUTDIR/$basename.uf2
cp bin/device-install.* $OUTDIR
cp bin/device-update.* $OUTDIR

16
bin/bump_version.py Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python
"""Bump the version number"""
lines = None
with open('version.properties', 'r', encoding='utf-8') as f:
lines = f.readlines()
with open('version.properties', 'w', encoding='utf-8') as f:
for line in lines:
if line.lstrip().startswith("build = "):
words = line.split(" = ")
ver = f'build = {int(words[1]) + 1}'
f.write(f'{ver}\n')
else:
f.write(line)

23
bin/check-dependencies.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Note: This is a prototype for how we could add static code analysis to the CI.
set -e
if [[ $# -gt 0 ]]; then
# can override which environment by passing arg
BOARDS="$@"
else
BOARDS="rak4631 rak4631_eink t-echo pca10059_diy_eink pico rak11200 tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 nano-g1 station-g1 m5stack-core m5stack-coreink tbeam-s3-core"
fi
echo "BOARDS:${BOARDS}"
CHECK=""
for BOARD in $BOARDS; do
CHECK="${CHECK} -e ${BOARD}"
done
echo $CHECK
pio pkg outdated -e $CHECK

11
bin/device-install.bat Normal file → Executable file
View File

@@ -26,14 +26,17 @@ IF "__%FILENAME%__" == "____" (
echo "Missing FILENAME"
goto HELP
)
IF EXIST %FILENAME% (
IF EXIST %FILENAME% IF x%FILENAME:update=%==x%FILENAME% (
echo Trying to flash update %FILENAME%, but first erasing and writing system information"
%PYTHON% -m esptool --baud 115200 erase_flash
%PYTHON% -m esptool --baud 115200 write_flash 0x1000 system-info.bin
%PYTHON% -m esptool --baud 115200 write_flash 0x00 %FILENAME%
%PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota.bin
for %%f in (littlefs-*.bin) do (
%PYTHON% -m esptool --baud 115200 write_flash 0x00390000 %%f
%PYTHON% -m esptool --baud 115200 write_flash 0x300000 %%f
)
%PYTHON% -m esptool --baud 115200 write_flash 0x10000 %FILENAME%
) else (
echo "Invalid file: %FILENAME%"
goto HELP
) else (
echo "Invalid file: %FILENAME%"
goto HELP

View File

@@ -14,6 +14,7 @@ Flash image file to device, but first erasing and writing system information"
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous).
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
-f FILENAME The .bin file to flash. Custom to your device type and region.
EOF
}
@@ -44,15 +45,16 @@ shift "$((OPTIND-1))"
shift
}
if [ -f "${FILENAME}" ]; then
if [ -f "${FILENAME}" ] && [ ! -z "${FILENAME##*"update"*}" ]; then
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
"$PYTHON" -m esptool erase_flash
"$PYTHON" -m esptool write_flash 0x1000 system-info.bin
"$PYTHON" -m esptool write_flash 0x00390000 littlefs-*.bin
"$PYTHON" -m esptool write_flash 0x10000 ${FILENAME}
"$PYTHON" -m esptool write_flash 0x00 ${FILENAME}
"$PYTHON" -m esptool write_flash 0x260000 bleota.bin
"$PYTHON" -m esptool write_flash 0x300000 littlefs-*.bin
else
echo "Invalid file: ${FILENAME}"
show_help
echo "Invalid file: ${FILENAME}"
fi
exit 0

9
bin/device-update.bat Normal file → Executable file
View File

@@ -10,7 +10,7 @@ echo.
echo -h Display this help and exit
echo -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous).
echo -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: %PYTHON%)
echo -f FILENAME The .bin file to flash. Custom to your device type and region.
echo -f FILENAME The *update.bin file to flash. Custom to your device type.
goto EOF
:GETOPTS
@@ -26,11 +26,12 @@ IF "__%FILENAME%__" == "____" (
echo "Missing FILENAME"
goto HELP
)
IF EXIST %FILENAME% (
IF EXIST %FILENAME% IF NOT x%FILENAME:update=%==x%FILENAME% (
echo Trying to flash update %FILENAME%
%PYTHON% -m esptool --baud 115200 write_flash 0x10000 %FILENAME%
echo Erasing the otadata partition, which will turn off flash flippy-flop and force the first image to be used
%PYTHON% -m esptool --baud 115200 erase_region 0xe000 0x2000
) else (
echo "Invalid file: %FILENAME%"
goto HELP
) else (
echo "Invalid file: %FILENAME%"
goto HELP

View File

@@ -11,7 +11,8 @@ 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).
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
-f FILENAME The .bin file to flash. Custom to your device type and region.
-f FILENAME The *update.bin file to flash. Custom to your device type.
EOF
}
@@ -42,14 +43,12 @@ shift "$((OPTIND-1))"
shift
}
if [ -f "${FILENAME}" ]; then
echo "Trying to flash update ${FILENAME}."
if [ -f "${FILENAME}" ] && [ -z "${FILENAME##*"update"*}" ]; then
printf "Trying to flash update ${FILENAME}"
$PYTHON -m esptool --baud 115200 write_flash 0x10000 ${FILENAME}
echo "Erasing the otadata partition, which will turn off flash flippy-flop and force the first image to be used"
$PYTHON -m esptool --baud 115200 erase_region 0xe000 0x2000
else
echo "Invalid file: ${FILENAME}"
show_help
echo "Invalid file: ${FILENAME}"
fi
exit 0

View File

@@ -1,51 +0,0 @@
#!/usr/bin/env python3
import getopt
import sys
import os
from littlefs import LittleFS
from pathlib import Path
print( "Building LittleFS image..." )
argList = sys.argv[1:]
arxx = { argList[i]: argList[i+1] for i in range(0, len(argList)-1, 2) }
dataPath = arxx["-c"]
blockSize = int(arxx["-b"])
blockCount = int(arxx["-s"]) / blockSize
cwd = os.getcwd()
os.chdir(dataPath)
fileList = []
dirList = []
for (dirpath, dirnames, filenames) in os.walk('.'):
for f in filenames:
if (f[:1] != '.'):
fileList.append( os.path.join(dirpath, f) )
for d in dirnames:
if (d[:1] != '.'):
dirList.append( os.path.join(dirpath, d) )
fs = LittleFS(block_size=blockSize, block_count=blockCount) # create a 448kB partition
for curDir in dirList:
print( "Creating dir " + curDir )
fs.mkdir( curDir )
for curFile in fileList:
print( "Adding file " + curFile )
with open( curFile, 'rb' ) as f:
data = f.read()
with fs.open( curFile, 'wb') as fh:
fh.write( data )
outName = argList[-1]
os.chdir(cwd)
with open(outName, 'wb') as fh:
fh.write(fs.context.buffer)

View File

@@ -1,24 +1,70 @@
import subprocess
import configparser
import traceback
import sys
from os.path import join
from readprops import readProps
Import("env")
env.Replace( MKSPIFFSTOOL=env.get("PROJECT_DIR") + '/bin/mklittlefs.py' )
try:
import littlefs
except ImportError:
env.Execute("$PYTHONEXE -m pip install littlefs-python")
platform = env.PioPlatform()
def esp32_create_combined_bin(source, target, env):
# this sub is borrowed from ESPEasy build toolchain. It's licensed under GPL V3
# https://github.com/letscontrolit/ESPEasy/blob/mega/tools/pio/post_esp32.py
print("Generating combined binary for serial flashing")
app_offset = 0x10000
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.factory.bin")
sections = env.subst(env.get("FLASH_EXTRA_IMAGES"))
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin")
chip = env.get("BOARD_MCU")
flash_size = env.BoardConfig().get("upload.flash_size")
flash_freq = env.BoardConfig().get("build.f_flash", '40m')
flash_freq = flash_freq.replace('000000L', 'm')
flash_mode = env.BoardConfig().get("build.flash_mode", "dio")
memory_type = env.BoardConfig().get("build.arduino.memory_type", "qio_qspi")
if flash_mode == "qio" or flash_mode == "qout":
flash_mode = "dio"
if memory_type == "opi_opi" or memory_type == "opi_qspi":
flash_mode = "dout"
cmd = [
"--chip",
chip,
"merge_bin",
"-o",
new_file_name,
"--flash_mode",
flash_mode,
"--flash_freq",
flash_freq,
"--flash_size",
flash_size,
]
print(" Offset | File")
for section in sections:
sect_adr, sect_file = section.split(" ", 1)
print(f" - {sect_adr} | {sect_file}")
cmd += [sect_adr, sect_file]
print(f" - {hex(app_offset)} | {firmware_name}")
cmd += [hex(app_offset), firmware_name]
print('Using esptool.py arguments: %s' % ' '.join(cmd))
esptool.main(cmd)
if (platform.name == "espressif32"):
sys.path.append(join(platform.get_package_dir("tool-esptoolpy")))
import esptool
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_combined_bin)
Import("projenv")
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
verObj = readProps(prefsLoc)
print("Using meshtastic platformio-custom.py, firmware version " + verObj['long'])
# print("path is" + ','.join(sys.path))
# General options that are passed to the C and C++ compilers
projenv.Append(CCFLAGS=[

View File

@@ -9,9 +9,6 @@ VERSION=`bin/buildinfo.py long`
# Must have a V prefix to trigger github
git tag "v${VERSION}"
# Commented out per https://github.com/meshtastic/Meshtastic-device/issues/947
#git push root "v${VERSION}" # push the tag
git push origin "v${VERSION}" # push the tag
echo "Tag ${VERSION} pushed to github, github actions should now be building the draft release. If it seems good, click to publish it"

View File

@@ -1 +1 @@
cd protobufs && ..\nanopb-0.4.6\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs *.proto
cd protobufs && ..\nanopb-0.4.7\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs *.proto

View File

@@ -2,13 +2,13 @@
set -e
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.6 to be located in the"
echo "meshtastic-device root directory if the following step fails, you should download the correct"
echo "prebuilt binaries for your computer into nanopb-0.4.6"
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.7 to be located in the"
echo "firmware root directory if the following step fails, you should download the correct"
echo "prebuilt binaries for your computer into nanopb-0.4.7"
# the nanopb tool seems to require that the .options file be in the current directory!
cd protobufs
../nanopb-0.4.6/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs *.proto
../nanopb-0.4.7/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs *.proto
#echo "Regenerating protobuf documentation - if you see an error message"
#echo "you can ignore it unless doing a new protobuf release to github."

31
boards/generic_wl5e.json Normal file
View File

@@ -0,0 +1,31 @@
{
"build": {
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32WLxx -DSTM32WLE5xx -DARDUINO_GENERIC_WLE5CCUX",
"f_cpu": "48000000L",
"mcu": "stm32wle5ccu",
"variant": "STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U",
"product_line": "STM32WLE5xx"
},
"debug": {
"default_tools": [
"stlink"
],
"jlink_device": "STM32WLE5CC",
"openocd_target": "stm32wlx",
"svd_path": "STM32WLE5_CM4.svd"
},
"frameworks": ["arduino"],
"name": "BB-STM32WL",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 262144,
"protocol": "cmsis-dap",
"protocols": [
"cmsis-dap"
]
},
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32wl-series.html",
"vendor": "ST"
}

46
boards/tbeam-s3-core.json Normal file
View File

@@ -0,0 +1,46 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DLILYGO_TBEAM_S3_CORE",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"hwids": [
[
"0X303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "tbeam-s3-core"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino"
],
"name": "LilyGo TBeam-S3-Core",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"require_upload_port": true,
"speed": 921600
},
"url": "http://www.lilygo.cn/",
"vendor": "LilyGo"
}

47
boards/tlora-t3s3-v1.json Normal file
View File

@@ -0,0 +1,47 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld"
},
"core": "esp32",
"extra_flags": [
"-DLILYGO_T3S3_V1",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"hwids": [
[
"0X303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "tlora-t3s3-v1"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "LilyGo TLora-T3S3-V1",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},
"url": "http://www.lilygo.cn/",
"vendor": "LilyGo"
}

13
docker-compose.yml Normal file
View File

@@ -0,0 +1,13 @@
version: "3.7"
services:
meshtastic-node:
build: .
deploy:
mode: replicated
replicas: 4
networks:
- mesh
networks:
mesh:

Binary file not shown.

View File

@@ -1,8 +1,8 @@
# FIXME! using the genpartitions based table doesn't work on TTGO so for now I stay with my old memory map
# This is a layout for 4MB of flash
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x1c0000,
app1, app, ota_1, 0x1d0000,0x1c0000,
spiffs, data, spiffs, 0x390000,0x070000,
nvs, data, nvs, 0x009000, 0x005000,
otadata, data, ota, 0x00e000, 0x002000,
app, app, ota_0, 0x010000, 0x250000,
flashApp, app, ota_1, 0x260000, 0x0A0000,
spiffs, data, spiffs, 0x300000, 0x100000,
1 # FIXME! using the genpartitions based table doesn't work on TTGO so for now I stay with my old memory map
2 # This is a layout for 4MB of flash
3 # Name, Type, SubType, Offset, Size, Flags
4 nvs, data, nvs, 0x9000, 0x5000, nvs, data, nvs, 0x009000, 0x005000,
5 otadata, data, ota, 0xe000, 0x2000, otadata, data, ota, 0x00e000, 0x002000,
6 app0, app, ota_0, 0x10000, 0x1c0000, app, app, ota_0, 0x010000, 0x250000,
7 app1, app, ota_1, 0x1d0000,0x1c0000, flashApp, app, ota_1, 0x260000, 0x0A0000,
8 spiffs, data, spiffs, 0x390000,0x070000, spiffs, data, spiffs, 0x300000, 0x100000,

View File

@@ -2,13 +2,14 @@
; https://docs.platformio.org/page/projectconf.html
[platformio]
default_envs = tbeam
;default_envs = tbeam
;default_envs = pico
;default_envs = tbeam-s3-core
;default_envs = tbeam0.7
;default_envs = heltec-v1
;default_envs = heltec-v2.0
;default_envs = heltec-v2.1
;default_envs = tlora-v1
;default_envs = tlora-v1
;default_envs = tlora_v1_3
;default_envs = tlora-v2
;default_envs = tlora-v2-1-1.6
@@ -20,9 +21,13 @@ default_envs = tbeam
;default_envs = pca10059_diy_eink
;default_envs = meshtastic-diy-v1
;default_envs = meshtastic-diy-v1.1
;default_envs = meshtastic-dr-dev
;default_envs = m5stack-coreink
;default_envs = rak4631
extra_configs = variants/*/platformio.ini
extra_configs =
arch/*/*.ini
variants/*/platformio.ini
[env]
extra_scripts = bin/platformio-custom.py
@@ -31,47 +36,63 @@ extra_scripts = bin/platformio-custom.py
; note: TINYGPS_OPTION_NO_CUSTOM_FIELDS is VERY important. We don't use custom fields and somewhere in that pile
; of code is a heap corruption bug!
; FIXME: fix lib/BluetoothOTA dependency back on src/ so we can remove -Isrc
; The Radiolib stuff will speed up building considerably. Exclud all the stuff we dont need.
build_flags = -Wno-missing-field-initializers
-Wno-format
-Isrc -Isrc/mesh -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map
-DUSE_THREAD_NAMES
-DTINYGPS_OPTION_NO_CUSTOM_FIELDS
-DPB_ENABLE_MALLOC=1
-DRADIOLIB_EXCLUDE_CC1101
-DRADIOLIB_EXCLUDE_NRF24
-DRADIOLIB_EXCLUDE_RF69
-DRADIOLIB_EXCLUDE_SX1231
-DRADIOLIB_EXCLUDE_SI443X
-DRADIOLIB_EXCLUDE_RFM2X
-DRADIOLIB_EXCLUDE_AFSK
-DRADIOLIB_EXCLUDE_HELLSCHREIBER
-DRADIOLIB_EXCLUDE_MORSE
-DRADIOLIB_EXCLUDE_RTTY
-DRADIOLIB_EXCLUDE_SSTV
monitor_speed = 115200
lib_deps =
https://github.com/meshtastic/esp8266-oled-ssd1306.git#53580644255b48ebb7a737343c6b4e71c7e11cf2 ; ESP8266_SSD1306
mathertel/OneButton@^2.0.3 ; OneButton library for non-blocking button debounce
1202 ; CRC32, explicitly needed because dependency is missing in the ble ota update lib
https://github.com/meshtastic/arduino-fsm.git
https://github.com/meshtastic/TinyGPSPlus.git
Wire ; explicitly needed here because the AXP202 library forgets to add it
SPI
https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159
https://github.com/meshtastic/TinyGPSPlus.git#127ad674ef85f0201cb68a065879653ed94792c4
https://github.com/meshtastic/ArduinoThread.git#72921ac222eed6f526ba1682023cee290d9aa1b3
nanopb/Nanopb@^0.4.6
erriez/ErriezCRC32@^1.0.1
; jgromes/RadioLib@^5.5.1
https://github.com/jgromes/RadioLib.git#395844922c5d88d5db0481a9c91479931172428d
; Used for the code analysis in PIO Home / Inspect
check_tool = cppcheck
check_skip_packages = yes
check_flags =
-DAPP_VERSION=1.0.0
--suppressions-list=suppressions.txt
--inline-suppr
; Common settings for conventional (non Portduino) Arduino targets
[arduino_base]
framework = arduino
lib_deps =
${env.lib_deps}
; Portduino is using meshtastic fork for now
https://github.com/jgromes/RadioLib.git
mprograms/QMC5883LCompass@^1.1.1
end2endzone/NonBlockingRTTTL@^1.3.0
https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#52b5282639d08a8cbd4b748363089eed6102dc76
build_flags = ${env.build_flags} -Os
# -DRADIOLIB_GODMODE
build_src_filter = ${env.build_src_filter} -<portduino/>
build_flags = ${env.build_flags} -Os -DRADIOLIB_SPI_PARANOID=0
build_src_filter = ${env.build_src_filter} -<platform/portduino/>
; Common libs for communicating over TCP/IP networks such as MQTT
[networking_base]
lib_deps =
PubSubClient
meshtastic/json11@^1.0.2
knolleary/PubSubClient@^2.8
arduino-libraries/NTPClient@^3.1.0
; Common libs for environmental measurements in telemetry module
; (not included in native / portduino)
@@ -79,89 +100,12 @@ lib_deps =
lib_deps =
adafruit/Adafruit BusIO@^1.11.4
adafruit/Adafruit Unified Sensor@^1.1.4
paulstoffregen/OneWire@^2.3.5
robtillaart/DS18B20@^0.1.11
adafruit/Adafruit BMP280 Library@^2.6.3
adafruit/Adafruit BMP280 Library@^2.6.6
adafruit/Adafruit BME280 Library@^2.2.2
adafruit/Adafruit BME680 Library@^2.0.1
adafruit/Adafruit MCP9808 Library@^2.0.0
adafruit/Adafruit INA260 Library@^1.5.0
adafruit/Adafruit INA219@^1.2.0
; Common settings for ESP targes, mixin with extends = esp32_base
[esp32_base]
extends = arduino_base
platform = espressif32@3.5.0
build_src_filter =
${arduino_base.build_src_filter} -<nrf52/> -<stm32wl>
upload_speed = 115200
debug_init_break = tbreak setup
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
# This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h
# -DUSE_NEW_ESP32_BLUETOOTH will enable the new NimBLE C++ api
build_flags =
${arduino_base.build_flags} -Wall -Wextra -Isrc/esp32 -Isrc/esp32-mfix-esp32-psram-cache-issue -lnimble -std=c++11
-DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
-DAXP_DEBUG_PORT=Serial -DUSE_NEW_ESP32_BLUETOOTH -DCONFIG_BT_NIMBLE_ENABLED -DCONFIG_NIMBLE_CPP_LOG_LEVEL=1
lib_deps =
${arduino_base.lib_deps}
${networking_base.lib_deps}
${environmental_base.lib_deps}
https://github.com/meshtastic/esp32_https_server.git
h2zero/NimBLE-Arduino@1.4.0
arduino-libraries/NTPClient@^3.1.0
lorol/LittleFS_esp32@^1.0.6
https://github.com/meshtastic/AXP202X_Library.git#8404abb6d4b486748636bc6ad72d2a47baaf5460
lib_ignore =
segger_rtt
ESP32 BLE Arduino
platform_packages =
framework-arduinoespressif32@https://github.com/meshtastic/arduino-esp32.git#4cde0f5d412d2695184f32e8a47e9bea57b45276
; leave this commented out to avoid breaking Windows
;upload_port = /dev/ttyUSB0
;monitor_port = /dev/ttyUSB0
; Please don't delete these lines. JM uses them.
;upload_port = /dev/cu.SLAB_USBtoUART
;monitor_port = /dev/cu.SLAB_USBtoUART
; customize the partition table
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
board_build.partitions = partition-table.csv
[nrf52_base]
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
; platform = nordicnrf52 ;pending https://github.com/platformio/builder-framework-arduino-nrf5/pull/7
platform = https://github.com/meshtastic/platform-nordicnrf52.git#merge
extends = arduino_base
build_type = debug ; I'm debugging with ICE a lot now
; note: liboberon provides the AES256 implementation for NRF52 (though not using the hardware acceleration of the NRF52840 - FIXME)
build_flags =
${arduino_base.build_flags} -Wno-unused-variable
-Isrc/nrf52
build_src_filter =
${arduino_base.build_src_filter} -<esp32/> -<stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mqtt/>
lib_ignore =
BluetoothOTA
[nrf52840_base]
extends = nrf52_base
build_flags = ${nrf52_base.build_flags}
lib_deps =
${arduino_base.lib_deps}
${environmental_base.lib_deps}
https://github.com/Kongduino/Adafruit_nRFCrypto.git
; Note: By default no lora device is created for this build - it uses a simulated interface
[env:nrf52840dk]
extends = nrf52840_base
board = nrf52840_dk
; Note: By default no lora device is created for this build - it uses a simulated interface
[env:feather_nrf52832]
extends = nrf52_base
board = adafruit_feather_nrf52832
adafruit/Adafruit SHTC3 Library@^1.0.0
adafruit/Adafruit LPS2X@^2.0.4
adafruit/Adafruit SHT31 Library@^2.2.0

View File

@@ -7,7 +7,7 @@ const uint8_t MESH_SERVICE_UUID_16[16u] = {0xfd, 0xea, 0x73, 0xe2, 0xca, 0x5d, 0
0x1f, 0x46, 0xa8, 0x15, 0x18, 0xb2, 0xa1, 0x6b};
const uint8_t TORADIO_UUID_16[16u] = {0xe7, 0x01, 0x44, 0x12, 0x66, 0x78, 0xdd, 0xa1,
0xad, 0x4d, 0x9e, 0x12, 0xd2, 0x76, 0x5c, 0xf7};
const uint8_t FROMRADIO_UUID_16[16u] = {0xd5, 0x54, 0xe4, 0xc5, 0x25, 0xc5, 0x31, 0xa5,
0x55, 0x4a, 0x02, 0xee, 0xc2, 0xbc, 0xa2, 0x8b};
const uint8_t FROMRADIO_UUID_16[16u] = {0x02, 0x00, 0x12, 0xac, 0x42, 0x02, 0x78, 0xb8,
0xed, 0x11, 0x93, 0x49, 0x9e, 0xe6, 0x55, 0x2c};
const uint8_t FROMNUM_UUID_16[16u] = {0x53, 0x44, 0xe3, 0x47, 0x75, 0xaa, 0x70, 0xa6,
0x66, 0x4f, 0x00, 0xa8, 0x8c, 0xa1, 0x9d, 0xed};

View File

@@ -9,7 +9,7 @@
#define MESH_SERVICE_UUID "6ba1b218-15a8-461f-9fa8-5dcae273eafd"
#define TORADIO_UUID "f75c76d2-129e-4dad-a1dd-7866124401e7"
#define FROMRADIO_UUID "8ba2bcc2-ee02-4a55-a531-c525c5e454d5"
#define FROMRADIO_UUID "2c55e69e-4993-11ed-b878-0242ac120002"
#define FROMNUM_UUID "ed9da18c-a800-4f66-a670-aa7547e34453"
// NRF52 wants these constants as byte arrays

View File

@@ -7,10 +7,6 @@
#include "power.h"
#include <OneButton.h>
#ifdef ARCH_ESP32
#include "nimble/BluetoothUtil.h"
#endif
namespace concurrency
{
/**
@@ -55,6 +51,7 @@ class ButtonThread : public concurrency::OSThread
pinMode(BUTTON_PIN, INPUT_PULLUP_SENSE);
#endif
userButton.attachClick(userButtonPressed);
userButton.setClickTicks(300);
userButton.attachDuringLongPress(userButtonPressedLong);
userButton.attachDoubleClick(userButtonDoublePressed);
userButton.attachMultiClick(userButtonMultiPressed);
@@ -132,8 +129,8 @@ class ButtonThread : public concurrency::OSThread
#endif
// If user button is held down for 5 seconds, shutdown the device.
if ((millis() - longPressTime > 5 * 1000) && (longPressTime > 0)) {
#ifdef TBEAM_V10
if (axp192_found == true) {
#ifdef HAS_PMU
if (pmu_found == true) {
setLed(false);
power->shutdown();
}
@@ -163,21 +160,28 @@ class ButtonThread : public concurrency::OSThread
static void userButtonDoublePressed()
{
#ifdef ARCH_ESP32
disablePin();
#elif defined(USE_EINK)
#if defined(USE_EINK) && defined(PIN_EINK_EN)
digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW);
#endif
#endif
#if defined(GPS_POWER_TOGGLE)
if(config.position.gps_enabled)
{
DEBUG_MSG("Flag set to false for gps power\n");
}
else
{
DEBUG_MSG("Flag set to true to restore power\n");
}
config.position.gps_enabled = !(config.position.gps_enabled);
doGPSpowersave(config.position.gps_enabled);
#endif
}
static void userButtonMultiPressed()
{
#ifdef ARCH_ESP32
clearNVS();
#endif
#ifdef ARCH_NRF52
clearBonds();
#endif
screen->print("Sent ad-hoc ping\n");
service.refreshMyNodeInfo();
service.sendNetworkPing(NODENUM_BROADCAST, true);
}
static void userButtonPressedLongStart()

View File

@@ -1,6 +1,18 @@
#include "configuration.h"
#include "FSCommon.h"
#ifdef HAS_SDCARD
#include <SPI.h>
#include <SD.h>
#ifdef SDCARD_USE_SPI1
SPIClass SPI1(HSPI);
#define SDHandler SPI1
#endif
#endif //HAS_SDCARD
bool copyFile(const char* from, const char* to)
{
@@ -9,13 +21,13 @@ bool copyFile(const char* from, const char* to)
File f1 = FSCom.open(from, FILE_O_READ);
if (!f1){
DEBUG_MSG("Failed to open file");
DEBUG_MSG("Failed to open source file %s\n", from);
return false;
}
File f2 = FSCom.open(to, FILE_O_WRITE);
if (!f2) {
DEBUG_MSG("Failed to open file");
DEBUG_MSG("Failed to open destination file %s\n", to);
return false;
}
@@ -33,18 +45,26 @@ bool copyFile(const char* from, const char* to)
bool renameFile(const char* pathFrom, const char* pathTo)
{
#ifdef FSCom
#ifdef ARCH_ESP32
// rename was fixed for ESP32 IDF LittleFS in April
return FSCom.rename(pathFrom, pathTo);
#else
if (copyFile(pathFrom, pathTo) && FSCom.remove(pathFrom) ) {
return true;
} else{
return false;
}
#endif
#endif
}
void listDir(const char * dirname, uint8_t levels)
void listDir(const char * dirname, uint8_t levels, boolean del = false)
{
#ifdef FSCom
File root = FSCom.open(dirname);
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
char buffer[255];
#endif
File root = FSCom.open(dirname, FILE_O_READ);
if(!root){
return;
}
@@ -56,55 +76,92 @@ void listDir(const char * dirname, uint8_t levels)
while(file){
if(file.isDirectory() && !String(file.name()).endsWith(".")) {
if(levels){
listDir(file.name(), levels -1);
#ifdef ARCH_ESP32
listDir(file.path(), levels -1, del);
if(del) {
DEBUG_MSG("Removing %s\n", file.path());
strcpy(buffer, file.path());
file.close();
FSCom.rmdir(buffer);
} else {
file.close();
}
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
listDir(file.name(), levels -1, del);
if(del) {
DEBUG_MSG("Removing %s\n", file.name());
strcpy(buffer, file.name());
file.close();
FSCom.rmdir(buffer);
} else {
file.close();
}
#else
listDir(file.name(), levels -1, del);
file.close();
#endif
}
} else {
DEBUG_MSG(" %s (%i Bytes)\n", file.name(), file.size());
}
#ifdef ARCH_ESP32
if(del) {
DEBUG_MSG("Deleting %s\n", file.path());
strcpy(buffer, file.path());
file.close();
FSCom.remove(buffer);
} else {
DEBUG_MSG(" %s (%i Bytes)\n", file.path(), file.size());
file.close();
}
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
if(del) {
DEBUG_MSG("Deleting %s\n", file.name());
strcpy(buffer, file.name());
file.close();
FSCom.remove(buffer);
} else {
DEBUG_MSG(" %s (%i Bytes)\n", file.name(), file.size());
file.close();
}
#else
DEBUG_MSG(" %s (%i Bytes)\n", file.name(), file.size());
file.close();
#endif
}
file = root.openNextFile();
}
file.close();
#ifdef ARCH_ESP32
if(del) {
DEBUG_MSG("Removing %s\n", root.path());
strcpy(buffer, root.path());
root.close();
FSCom.rmdir(buffer);
} else {
root.close();
}
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
if(del) {
DEBUG_MSG("Removing %s\n", root.name());
strcpy(buffer, root.name());
root.close();
FSCom.rmdir(buffer);
} else {
root.close();
}
#else
root.close();
#endif
#endif
}
void rmDir(const char * dirname)
{
#ifdef FSCom
File file = FSCom.open(dirname);
if(!file){
return;
}
if(!file.isDirectory()){
file.close();
FSCom.remove(file.name());
// DEBUG_MSG("Remove FILE %s\n", file.name());
return;
}
file.rewindDirectory();
while (true) {
File entry = file.openNextFile();
if (!entry) {
break;
}
char dirpath[100]; // array to hold the result.
strcpy(dirpath, dirname); // copy string one into the result.
strcat(dirpath,"/"); // append string two to the result.
strcat(dirpath,entry.name()); // append string two to the result.
if(entry.isDirectory() && !String(entry.name()).endsWith(".")) {
entry.close();
// DEBUG_MSG("Descend DIR %s\n", dirpath);
rmDir(dirpath);
} else {
entry.close();
// DEBUG_MSG("Remove FILE %s\n", entry.name());
FSCom.remove(entry.name());
}
}
FSCom.rmdir(dirname);
// DEBUG_MSG("Remove DIR %s\n", dirname);
file.close();
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
listDir(dirname, 10, true);
#elif defined(ARCH_NRF52)
// nRF52 implementation of LittleFS has a recursive delete function
FSCom.rmdir_r(dirname);
#endif
#endif
}
@@ -116,8 +173,47 @@ void fsInit()
DEBUG_MSG("ERROR filesystem mount Failed. Formatting...\n");
assert(0); // FIXME - report failure to phone
}
#ifdef ARCH_ESP32
DEBUG_MSG("Filesystem files (%d/%d Bytes):\n", FSCom.usedBytes(), FSCom.totalBytes());
#else
DEBUG_MSG("Filesystem files:\n");
#endif
listDir("/", 10);
#endif
}
void setupSDCard()
{
#ifdef HAS_SDCARD
SDHandler.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
if (!SD.begin(SDCARD_CS, SDHandler)) {
DEBUG_MSG("No SD_MMC card detected\n");
return ;
}
uint8_t cardType = SD.cardType();
if (cardType == CARD_NONE) {
DEBUG_MSG("No SD_MMC card attached\n");
return ;
}
DEBUG_MSG("SD_MMC Card Type: ");
if (cardType == CARD_MMC) {
DEBUG_MSG("MMC\n");
} else if (cardType == CARD_SD) {
DEBUG_MSG("SDSC\n");
} else if (cardType == CARD_SDHC) {
DEBUG_MSG("SDHC\n");
} else {
DEBUG_MSG("UNKNOWN\n");
}
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
DEBUG_MSG("SD Card Size: %lluMB\n", cardSize);
DEBUG_MSG("Total space: %llu MB\n", SD.totalBytes() / (1024 * 1024));
DEBUG_MSG("Used space: %llu MB\n", SD.usedBytes() / (1024 * 1024));
#endif
}

View File

@@ -13,10 +13,19 @@
#define FILE_O_READ "r"
#endif
#if defined(ARCH_RP2040)
// RP2040
#include "LittleFS.h"
#define FSCom LittleFS
#define FSBegin() FSCom.begin()
#define FILE_O_WRITE "w"
#define FILE_O_READ "r"
#endif
#if defined(ARCH_ESP32)
// ESP32 version
#include "LITTLEFS.h"
#define FSCom LITTLEFS
#include "LittleFS.h"
#define FSCom LittleFS
#define FSBegin() FSCom.begin(true)
#define FILE_O_WRITE "w"
#define FILE_O_READ "r"
@@ -31,6 +40,8 @@ using namespace Adafruit_LittleFS_Namespace;
#endif
void fsInit();
bool copyFile(const char* from, const char* to);
bool renameFile(const char* pathFrom, const char* pathTo);
void listDir(const char * dirname, uint8_t levels);
void listDir(const char * dirname, uint8_t levels, boolean del);
void rmDir(const char * dirname);
void setupSDCard();

View File

@@ -20,32 +20,19 @@ class GPSStatus : public Status
bool hasLock = false; // default to false, until we complete our first read
bool isConnected = false; // Do we have a GPS we are talking to
bool isPowerSaving = false; //Are we in power saving state
Position p = Position_init_default;
public:
GPSStatus() { statusType = STATUS_TYPE_GPS; }
// proposed for deprecation
GPSStatus(bool hasLock, bool isConnected, int32_t latitude, int32_t longitude, int32_t altitude, uint32_t dop,
uint32_t heading, uint32_t numSatellites)
: Status()
{
this->hasLock = hasLock;
this->isConnected = isConnected;
this->p.latitude_i = latitude;
this->p.longitude_i = longitude;
this->p.altitude = altitude;
this->p.PDOP = dop;
this->p.ground_track = heading;
this->p.sats_in_view = numSatellites;
}
// preferred method
GPSStatus(bool hasLock, bool isConnected, const Position &pos) : Status()
GPSStatus(bool hasLock, bool isConnected, bool isPowerSaving, const Position &pos) : Status()
{
this->hasLock = hasLock;
this->isConnected = isConnected;
this->isPowerSaving = isPowerSaving;
// all-in-one struct copy
this->p = pos;
@@ -60,6 +47,8 @@ class GPSStatus : public Status
bool getIsConnected() const { return isConnected; }
bool getIsPowerSaving() const { return isPowerSaving;}
int32_t getLatitude() const
{
if (config.position.fixed_position) {
@@ -110,10 +99,11 @@ class GPSStatus : public Status
#ifdef GPS_EXTRAVERBOSE
DEBUG_MSG("GPSStatus.match() new pos@%x to old pos@%x\n", newStatus->p.pos_timestamp, p.pos_timestamp);
#endif
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected ||
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected || newStatus->isPowerSaving !=isPowerSaving ||
newStatus->p.latitude_i != p.latitude_i || newStatus->p.longitude_i != p.longitude_i ||
newStatus->p.altitude != p.altitude || newStatus->p.altitude_hae != p.altitude_hae ||
newStatus->p.PDOP != p.PDOP || newStatus->p.ground_track != p.ground_track ||
newStatus->p.ground_speed != p.ground_speed ||
newStatus->p.sats_in_view != p.sats_in_view);
}
@@ -122,7 +112,7 @@ class GPSStatus : public Status
// Only update the status if values have actually changed
bool isDirty = matches(newStatus);
if (isDirty && p.pos_timestamp && (newStatus->p.pos_timestamp == p.pos_timestamp)) {
if (isDirty && p.timestamp && (newStatus->p.timestamp == p.timestamp)) {
// We can NEVER be in two locations at the same time! (also PR #886)
DEBUG_MSG("BUG!! positional timestamp unchanged from prev solution\n");
}
@@ -136,9 +126,9 @@ class GPSStatus : public Status
if (isDirty) {
if (hasLock) {
// In debug logs, identify position by @timestamp:stage (stage 3 = notify)
DEBUG_MSG("New GPS pos@%x:3 lat=%f, lon=%f, alt=%d, pdop=%.2f, track=%.2f, sats=%d\n", p.pos_timestamp,
DEBUG_MSG("New GPS pos@%x:3 lat=%f, lon=%f, alt=%d, pdop=%.2f, track=%.2f, speed=%.2f, sats=%d\n", p.timestamp,
p.latitude_i * 1e-7, p.longitude_i * 1e-7, p.altitude, p.PDOP * 1e-2, p.ground_track * 1e-5,
p.sats_in_view);
p.ground_speed * 1e-2, p.sats_in_view);
} else
DEBUG_MSG("No GPS lock\n");
onNewStatus.notifyObservers(this);

View File

@@ -7,12 +7,11 @@
#include "utils.h"
#include "buzz/buzz.h"
#ifdef TBEAM_V10
// FIXME. nasty hack cleanup how we load axp192
#undef AXP192_SLAVE_ADDRESS
#include "axp20x.h"
AXP20X_Class axp;
#ifdef HAS_PMU
#include "XPowersLibInterface.hpp"
#include "XPowersAXP2101.tpp"
#include "XPowersAXP192.tpp"
XPowersLibInterface *PMU = NULL;
#else
// Copy of the base class defined in axp20x.h.
// I'd rather not inlude axp20x.h as it brings Wire dependency.
@@ -22,20 +21,20 @@ class HasBatteryLevel
/**
* Battery state of charge, from 0 to 100 or -1 for unknown
*/
virtual int getBattPercentage() { return -1; }
virtual int getBatteryPercent() { return -1; }
/**
* The raw voltage of the battery or NAN if unknown
*/
virtual float getBattVoltage() { return NAN; }
virtual uint16_t getBattVoltage() { return 0; }
/**
* return true if there is a battery installed in this unit
*/
virtual bool isBatteryConnect() { return false; }
virtual bool isVBUSPlug() { return false; }
virtual bool isChargeing() { return false; }
virtual bool isVbusIn() { return false; }
virtual bool isCharging() { return false; }
};
#endif
@@ -77,7 +76,7 @@ class AnalogBatteryLevel : public HasBatteryLevel
*
* FIXME - use a lipo lookup table, the current % full is super wrong
*/
virtual int getBattPercentage() override
virtual int getBatteryPercent() override
{
float v = getBattVoltage();
@@ -96,13 +95,17 @@ class AnalogBatteryLevel : public HasBatteryLevel
/**
* The raw voltage of the batteryin millivolts or NAN if unknown
*/
virtual float getBattVoltage() override
virtual uint16_t getBattVoltage() override
{
#ifndef ADC_MULTIPLIER
#define ADC_MULTIPLIER 2.0
#endif
#ifndef BATTERY_SENSE_SAMPLES
#define BATTERY_SENSE_SAMPLES 30
#endif
#ifdef BATTERY_PIN
// Override variant or default ADC_MULTIPLIER if we have the override pref
float operativeAdcMultiplier = config.power.adc_multiplier_override > 0
@@ -113,16 +116,12 @@ class AnalogBatteryLevel : public HasBatteryLevel
if (millis() - last_read_time_ms > min_read_interval) {
last_read_time_ms = millis();
#ifdef BATTERY_SENSE_SAMPLES
//Set the number of samples, it has an effect of increasing sensitivity, especially in complex electromagnetic environment.
uint32_t raw = 0;
for(uint32_t i=0; i<BATTERY_SENSE_SAMPLES;i++){
for(uint32_t i=0; i<BATTERY_SENSE_SAMPLES; i++){
raw += analogRead(BATTERY_PIN);
}
raw = raw/BATTERY_SENSE_SAMPLES;
#else
uint32_t raw = analogRead(BATTERY_PIN);
#endif
float scaled;
#ifndef VBAT_RAW_TO_SCALED
@@ -137,29 +136,42 @@ class AnalogBatteryLevel : public HasBatteryLevel
return last_read_value;
}
#else
return NAN;
return 0;
#endif
}
/**
* return true if there is a battery installed in this unit
*/
virtual bool isBatteryConnect() override { return getBattPercentage() != -1; }
virtual bool isBatteryConnect() override { return getBatteryPercent() != -1; }
/// If we see a battery voltage higher than physics allows - assume charger is pumping
/// in power
virtual bool isVBUSPlug() override { return getBattVoltage() > chargingVolt; }
virtual bool isVbusIn() override { return getBattVoltage() > chargingVolt; }
/// Assume charging if we have a battery and external power is connected.
/// we can't be smart enough to say 'full'?
virtual bool isChargeing() override { return isBatteryConnect() && isVBUSPlug(); }
virtual bool isCharging() override { return isBatteryConnect() && isVbusIn(); }
private:
/// If we see a battery voltage higher than physics allows - assume charger is pumping
/// in power
#ifndef BAT_FULLVOLT
#define BAT_FULLVOLT 4200
#endif
#ifndef BAT_EMPTYVOLT
#define BAT_EMPTYVOLT 3270
#endif
#ifndef BAT_CHARGINGVOLT
#define BAT_CHARGINGVOLT 4210
#endif
#ifndef BAT_NOBATVOLT
#define BAT_NOBATVOLT 2230
#endif
/// For heltecs with no battery connected, the measured voltage is 2204, so raising to 2230 from 2100
const float fullVolt = 4200, emptyVolt = 3270, chargingVolt = 4210, noBatVolt = 2230;
const float fullVolt = BAT_FULLVOLT, emptyVolt = BAT_EMPTYVOLT, chargingVolt = BAT_CHARGINGVOLT, noBatVolt = BAT_NOBATVOLT;
float last_read_value = 0.0;
uint32_t last_read_time_ms = 0;
};
@@ -170,6 +182,9 @@ Power::Power() : OSThread("Power")
{
statusHandler = {};
low_voltage_counter = 0;
#ifdef DEBUG_HEAP
lastheap = ESP.getFreeHeap();
#endif
}
bool Power::analogInit()
@@ -208,7 +223,7 @@ bool Power::analogInit()
bool Power::setup()
{
bool found = axp192Init();
bool found = axpChipInit();
if (!found) {
found = analogInit();
@@ -221,10 +236,17 @@ bool Power::setup()
void Power::shutdown()
{
#ifdef TBEAM_V10
screen->setOn(false);
#if defined(USE_EINK) && defined(PIN_EINK_EN)
digitalWrite(PIN_EINK_EN, LOW); //power off backlight first
#endif
#ifdef HAS_PMU
DEBUG_MSG("Shutting down\n");
axp.setChgLEDMode(AXP20X_LED_OFF);
axp.shutdown();
if(PMU) {
PMU->setChargingLedMode(XPOWERS_CHG_LED_OFF);
PMU->shutdown();
}
#elif defined(ARCH_NRF52)
playBeep();
ledOff(PIN_LED1);
@@ -245,8 +267,8 @@ void Power::readPowerStatus()
if (hasBattery) {
batteryVoltageMv = batteryLevel->getBattVoltage();
// If the AXP192 returns a valid battery percentage, use it
if (batteryLevel->getBattPercentage() >= 0) {
batteryChargePercent = batteryLevel->getBattPercentage();
if (batteryLevel->getBatteryPercent() >= 0) {
batteryChargePercent = batteryLevel->getBatteryPercent();
} else {
// If the AXP192 returns a percentage less than 0, the feature is either not supported or there is an error
// In that case, we compute an estimate of the charge percent based on maximum and minimum voltages defined in
@@ -259,11 +281,17 @@ void Power::readPowerStatus()
// Notify any status instances that are observing us
const PowerStatus powerStatus2 =
PowerStatus(hasBattery ? OptTrue : OptFalse, batteryLevel->isVBUSPlug() ? OptTrue : OptFalse,
batteryLevel->isChargeing() ? OptTrue : OptFalse, batteryVoltageMv, batteryChargePercent);
PowerStatus(hasBattery ? OptTrue : OptFalse, batteryLevel->isVbusIn() ? OptTrue : OptFalse,
batteryLevel->isCharging() ? OptTrue : OptFalse, batteryVoltageMv, batteryChargePercent);
DEBUG_MSG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d\n", powerStatus2.getHasUSB(),
powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent());
newStatus.notifyObservers(&powerStatus2);
#ifdef DEBUG_HEAP
if (lastheap != ESP.getFreeHeap()){
DEBUG_MSG("Heap status: %d/%d bytes free (%d), running %d threads\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreeHeap() - lastheap , concurrency::mainController.size(false));
lastheap = ESP.getFreeHeap();
}
#endif
// If we have a battery at all and it is less than 10% full, force deep sleep if we have more than 3 low readings in a row
// Supect fluctuating voltage on the RAK4631 to force it to deep sleep even if battery is at 85% after only a few days
@@ -271,8 +299,12 @@ void Power::readPowerStatus()
if (powerStatus2.getHasBattery() && !powerStatus2.getHasUSB()) {
if (batteryLevel->getBattVoltage() < MIN_BAT_MILLIVOLTS) {
low_voltage_counter++;
if (low_voltage_counter > 3)
powerFSM.trigger(EVENT_LOW_BATTERY);
DEBUG_MSG("Warning RAK4631 Low voltage counter: %d/10\n", low_voltage_counter);
if (low_voltage_counter > 10) {
// We can't trigger deep sleep on NRF52, it's freezing the board
//powerFSM.trigger(EVENT_LOW_BATTERY);
DEBUG_MSG("Low voltage detected, but not triggering deep sleep\n");
}
} else {
low_voltage_counter = 0;
}
@@ -293,41 +325,47 @@ int32_t Power::runOnce()
{
readPowerStatus();
#ifdef TBEAM_V10
#ifdef HAS_PMU
// WE no longer use the IRQ line to wake the CPU (due to false wakes from sleep), but we do poll
// the IRQ status by reading the registers over I2C
axp.readIRQ();
if(PMU) {
if (axp.isVbusRemoveIRQ()) {
PMU->getIrqStatus();
if(PMU->isVbusRemoveIrq()){
DEBUG_MSG("USB unplugged\n");
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
}
if (axp.isVbusPlugInIRQ()) {
if (PMU->isVbusInsertIrq()) {
DEBUG_MSG("USB plugged In\n");
powerFSM.trigger(EVENT_POWER_CONNECTED);
}
/*
Other things we could check if we cared...
if (axp.isChargingIRQ()) {
if (PMU->isBatChagerStartIrq()) {
DEBUG_MSG("Battery start charging\n");
}
if (axp.isChargingDoneIRQ()) {
if (PMU->isBatChagerDoneIrq()) {
DEBUG_MSG("Battery fully charged\n");
}
if (axp.isBattPlugInIRQ()) {
if (PMU->isBatInsertIrq()) {
DEBUG_MSG("Battery inserted\n");
}
if (axp.isBattRemoveIRQ()) {
if (PMU->isBatRemoveIrq()) {
DEBUG_MSG("Battery removed\n");
}
if (axp.isPEKShortPressIRQ()) {
DEBUG_MSG("PEK short button press\n");
}
*/
axp.clearIRQ();
#endif
if (PMU->isPekeyLongPressIrq()) {
DEBUG_MSG("PEK long button press\n");
screen->setOn(false);
}
PMU->clearIrqStatus();
}
#endif
// Only read once every 20 seconds once the power status for the app has been initialized
return (statusHandler && statusHandler->isInitialized()) ? (1000 * 20) : RUN_SAME;
}
@@ -340,128 +378,244 @@ int32_t Power::runOnce()
share the same i2c bus, instead use ssd1306 sleep mode DCDC2 -> unused DCDC3 0.7-3.5V @ 700mA max -> ESP32 (keep this on!) LDO1
30mA -> charges GPS backup battery // charges the tiny J13 battery by the GPS to power the GPS ram (for a couple of days), can
not be turned off LDO2 200mA -> LORA LDO3 200mA -> GPS
*
*/
bool Power::axp192Init()
bool Power::axpChipInit()
{
#ifdef TBEAM_V10
if (axp192_found) {
if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) {
batteryLevel = &axp;
DEBUG_MSG("AXP192 Begin PASS\n");
#ifdef HAS_PMU
// axp.setChgLEDMode(LED_BLINK_4HZ);
DEBUG_MSG("DCDC1: %s\n", axp.isDCDC1Enable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("DCDC2: %s\n", axp.isDCDC2Enable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("LDO2: %s\n", axp.isLDO2Enable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("LDO3: %s\n", axp.isLDO3Enable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("DCDC3: %s\n", axp.isDCDC3Enable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("Exten: %s\n", axp.isExtenEnable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("----------------------------------------\n");
TwoWire * w = NULL;
axp.setPowerOutPut(AXP192_LDO2, AXP202_ON); // LORA radio
// axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); // GPS main power - now turned on in setGpsPower
axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON);
axp.setPowerOutPut(AXP192_EXTEN, AXP202_ON);
axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON);
axp.setDCDC1Voltage(3300); // for the OLED power
// Use macro to distinguish which wire is used by PMU
#ifdef PMU_USE_WIRE1
w = &Wire1;
#else
w = &Wire;
#endif
DEBUG_MSG("DCDC1: %s\n", axp.isDCDC1Enable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("DCDC2: %s\n", axp.isDCDC2Enable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("LDO2: %s\n", axp.isLDO2Enable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("LDO3: %s\n", axp.isLDO3Enable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("DCDC3: %s\n", axp.isDCDC3Enable() ? "ENABLE" : "DISABLE");
DEBUG_MSG("Exten: %s\n", axp.isExtenEnable() ? "ENABLE" : "DISABLE");
switch (config.power.charge_current) {
case Config_PowerConfig_ChargeCurrent_MAUnset:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_450MA);
break;
case Config_PowerConfig_ChargeCurrent_MA100:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_100MA);
break;
case Config_PowerConfig_ChargeCurrent_MA190:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_190MA);
break;
case Config_PowerConfig_ChargeCurrent_MA280:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_280MA);
break;
case Config_PowerConfig_ChargeCurrent_MA360:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_360MA);
break;
case Config_PowerConfig_ChargeCurrent_MA450:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_450MA);
break;
case Config_PowerConfig_ChargeCurrent_MA550:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_550MA);
break;
case Config_PowerConfig_ChargeCurrent_MA630:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_630MA);
break;
case Config_PowerConfig_ChargeCurrent_MA700:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_700MA);
break;
case Config_PowerConfig_ChargeCurrent_MA780:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_780MA);
break;
case Config_PowerConfig_ChargeCurrent_MA880:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_880MA);
break;
case Config_PowerConfig_ChargeCurrent_MA960:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_960MA);
break;
case Config_PowerConfig_ChargeCurrent_MA1000:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_1000MA);
break;
case Config_PowerConfig_ChargeCurrent_MA1080:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_1080MA);
break;
case Config_PowerConfig_ChargeCurrent_MA1160:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_1160MA);
break;
case Config_PowerConfig_ChargeCurrent_MA1240:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_1240MA);
break;
case Config_PowerConfig_ChargeCurrent_MA1320:
axp.setChargeControlCur(AXP1XX_CHARGE_CUR_1320MA);
break;
/**
* It is not necessary to specify the wire pin,
* just input the wire, because the wire has been initialized in main.cpp
*/
if (!PMU) {
PMU = new XPowersAXP2101(*w);
if (!PMU->init()) {
DEBUG_MSG("Warning: Failed to find AXP2101 power management\n");
delete PMU;
PMU = NULL;
} else {
DEBUG_MSG("AXP2101 PMU init succeeded, using AXP2101 PMU\n");
}
}
#if 0
if (!PMU) {
PMU = new XPowersAXP192(*w);
if (!PMU->init()) {
DEBUG_MSG("Warning: Failed to find AXP192 power management\n");
delete PMU;
PMU = NULL;
} else {
DEBUG_MSG("AXP192 PMU init succeeded, using AXP192 PMU\n");
}
}
// Not connected
//val = 0xfc;
//axp._writeByte(AXP202_VHTF_CHGSET, 1, &val); // Set temperature protection
//not used
//val = 0x46;
//axp._writeByte(AXP202_OFF_CTL, 1, &val); // enable bat detection
if (!PMU) {
/*
* In XPowersLib, if the XPowersAXPxxx object is released, Wire.end() will be called at the same time.
* In order not to affect other devices, if the initialization of the PMU fails, Wire needs to be re-initialized once,
* if there are multiple devices sharing the bus.
* * */
#ifndef PMU_USE_WIRE1
w->begin(I2C_SDA, I2C_SCL);
#endif
axp.debugCharging();
return false;
}
batteryLevel = PMU;
if (PMU->getChipModel() == XPOWERS_AXP192) {
// lora radio power channel
PMU->setPowerChannelVoltage(XPOWERS_LDO2, 3300);
PMU->enablePowerOutput(XPOWERS_LDO2);
// oled module power channel,
// disable it will cause abnormal communication between boot and AXP power supply,
// do not turn it off
PMU->setPowerChannelVoltage(XPOWERS_DCDC1, 3300);
// enable oled power
PMU->enablePowerOutput(XPOWERS_DCDC1);
// gnss module power channel - now turned on in setGpsPower
PMU->setPowerChannelVoltage(XPOWERS_LDO3, 3300);
// PMU->enablePowerOutput(XPOWERS_LDO3);
//protected oled power source
PMU->setProtectedChannel(XPOWERS_DCDC1);
//protected esp32 power source
PMU->setProtectedChannel(XPOWERS_DCDC3);
//disable not use channel
PMU->disablePowerOutput(XPOWERS_DCDC2);
//disable all axp chip interrupt
PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ);
// Set constant current charging current
PMU->setChargerConstantCurr(XPOWERS_AXP192_CHG_CUR_450MA);
//Set up the charging voltage
PMU->setChargeTargetVoltage(XPOWERS_AXP192_CHG_VOL_4V2);
} else if (PMU->getChipModel() == XPOWERS_AXP2101) {
// t-beam s3 core
/**
* gnss module power channel
* The default ALDO4 is off, you need to turn on the GNSS power first, otherwise it will be invalid during initialization
*/
PMU->setPowerChannelVoltage(XPOWERS_ALDO4, 3300);
PMU->enablePowerOutput(XPOWERS_ALDO4);
// lora radio power channel
PMU->setPowerChannelVoltage(XPOWERS_ALDO3, 3300);
PMU->enablePowerOutput(XPOWERS_ALDO3);
// m.2 interface
PMU->setPowerChannelVoltage(XPOWERS_DCDC3, 3300);
PMU->enablePowerOutput(XPOWERS_DCDC3);
/**
* ALDO2 cannot be turned off.
* It is a necessary condition for sensor communication.
* It must be turned on to properly access the sensor and screen
* It is also responsible for the power supply of PCF8563
*/
PMU->setPowerChannelVoltage(XPOWERS_ALDO2, 3300);
PMU->enablePowerOutput(XPOWERS_ALDO2);
// 6-axis , magnetometer ,bme280 , oled screen power channel
PMU->setPowerChannelVoltage(XPOWERS_ALDO1, 3300);
PMU->enablePowerOutput(XPOWERS_ALDO1);
// sdcard power channle
PMU->setPowerChannelVoltage(XPOWERS_BLDO1, 3300);
PMU->enablePowerOutput(XPOWERS_BLDO1);
// PMU->setPowerChannelVoltage(XPOWERS_DCDC4, 3300);
// PMU->enablePowerOutput(XPOWERS_DCDC4);
//not use channel
PMU->disablePowerOutput(XPOWERS_DCDC2); //not elicited
PMU->disablePowerOutput(XPOWERS_DCDC5); //not elicited
PMU->disablePowerOutput(XPOWERS_DLDO1); //Invalid power channel, it does not exist
PMU->disablePowerOutput(XPOWERS_DLDO2); //Invalid power channel, it does not exist
PMU->disablePowerOutput(XPOWERS_VBACKUP);
//disable all axp chip interrupt
PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ);
//Set the constant current charging current of AXP2101, temporarily use 500mA by default
PMU->setChargerConstantCurr(XPOWERS_AXP2101_CHG_CUR_500MA);
//Set up the charging voltage
PMU->setChargeTargetVoltage(XPOWERS_AXP2101_CHG_VOL_4V2);
}
PMU->clearIrqStatus();
// TBeam1.1 /T-Beam S3-Core has no external TS detection,
// it needs to be disabled, otherwise it will cause abnormal charging
PMU->disableTSPinMeasure();
// PMU->enableSystemVoltageMeasure();
PMU->enableVbusVoltageMeasure();
PMU->enableBattVoltageMeasure();
DEBUG_MSG("=======================================================================\n");
if (PMU->isChannelAvailable(XPOWERS_DCDC1)) {
DEBUG_MSG("DC1 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC1) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_DCDC1));
}
if (PMU->isChannelAvailable(XPOWERS_DCDC2)) {
DEBUG_MSG("DC2 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC2) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_DCDC2));
}
if (PMU->isChannelAvailable(XPOWERS_DCDC3)) {
DEBUG_MSG("DC3 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC3) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_DCDC3));
}
if (PMU->isChannelAvailable(XPOWERS_DCDC4)) {
DEBUG_MSG("DC4 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC4) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_DCDC4));
}
if (PMU->isChannelAvailable(XPOWERS_LDO2)) {
DEBUG_MSG("LDO2 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_LDO2) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_LDO2));
}
if (PMU->isChannelAvailable(XPOWERS_LDO3)) {
DEBUG_MSG("LDO3 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_LDO3) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_LDO3));
}
if (PMU->isChannelAvailable(XPOWERS_ALDO1)) {
DEBUG_MSG("ALDO1: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO1) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_ALDO1));
}
if (PMU->isChannelAvailable(XPOWERS_ALDO2)) {
DEBUG_MSG("ALDO2: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO2) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_ALDO2));
}
if (PMU->isChannelAvailable(XPOWERS_ALDO3)) {
DEBUG_MSG("ALDO3: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO3) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_ALDO3));
}
if (PMU->isChannelAvailable(XPOWERS_ALDO4)) {
DEBUG_MSG("ALDO4: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO4) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_ALDO4));
}
if (PMU->isChannelAvailable(XPOWERS_BLDO1)) {
DEBUG_MSG("BLDO1: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_BLDO1) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_BLDO1));
}
if (PMU->isChannelAvailable(XPOWERS_BLDO2)) {
DEBUG_MSG("BLDO2: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_BLDO2) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_BLDO2));
}
DEBUG_MSG("=======================================================================\n");
// We can safely ignore this approach for most (or all) boards because MCU turned off
// earlier than battery discharged to 2.6V.
//
// Unfortanly for now we can't use this killswitch for RAK4630-based boards because they have a bug with
// battery voltage measurement. Probably it sometimes drops to low values.
#ifndef RAK4630
// Set PMU shutdown voltage at 2.6V to maximize battery utilization
PMU->setSysPowerDownVoltage(2600);
#endif
#ifdef PMU_IRQ
uint64_t pmuIrqMask = 0;
if (PMU->getChipModel() == XPOWERS_AXP192) {
pmuIrqMask = XPOWERS_AXP192_VBUS_INSERT_IRQ | XPOWERS_AXP192_BAT_INSERT_IRQ | XPOWERS_AXP192_PKEY_SHORT_IRQ;
} else if (PMU->getChipModel() == XPOWERS_AXP2101) {
pmuIrqMask = XPOWERS_AXP2101_VBUS_INSERT_IRQ | XPOWERS_AXP2101_BAT_INSERT_IRQ | XPOWERS_AXP2101_PKEY_SHORT_IRQ;
}
pinMode(PMU_IRQ, INPUT);
attachInterrupt(
PMU_IRQ, [] { pmu_irq = true; }, FALLING);
axp.adc1Enable(AXP202_BATT_CUR_ADC1, 1);
// we do not look for AXP202_CHARGING_FINISHED_IRQ & AXP202_CHARGING_IRQ because it occurs repeatedly while there is
// we do not look for AXPXXX_CHARGING_FINISHED_IRQ & AXPXXX_CHARGING_IRQ because it occurs repeatedly while there is
// no battery also it could cause inadvertent waking from light sleep just because the battery filled
// we don't look for AXP202_BATT_REMOVED_IRQ because it occurs repeatedly while no battery installed
// we don't look at AXP202_VBUS_REMOVED_IRQ because we don't have anything hooked to vbus
axp.enableIRQ(AXP202_BATT_CONNECT_IRQ | AXP202_VBUS_CONNECT_IRQ | AXP202_PEK_SHORTPRESS_IRQ, 1);
// we don't look for AXPXXX_BATT_REMOVED_IRQ because it occurs repeatedly while no battery installed
// we don't look at AXPXXX_VBUS_REMOVED_IRQ because we don't have anything hooked to vbus
PMU->enableIRQ(pmuIrqMask);
PMU->clearIrqStatus();
#endif /*PMU_IRQ*/
axp.clearIRQ();
#endif
readPowerStatus();
} else {
DEBUG_MSG("AXP192 Begin FAIL\n");
}
} else {
DEBUG_MSG("AXP192 not found\n");
}
return axp192_found;
pmu_found = true;
return pmu_found;
#else
return false;
#endif

View File

@@ -12,11 +12,11 @@
static bool isPowered()
{
// Circumvent the battery sensing logic and assumes constant power if no battery pin or power mgmt IC
#if !defined(BATTERY_PIN) && !defined(AXP192_SLAVE_ADDRESS)
#if !defined(BATTERY_PIN) && !defined(HAS_AXP192) && !defined(HAS_AXP2101)
return true;
#endif
bool isRouter = (config.device.role == Config_DeviceConfig_Role_Router ? 1 : 0);
bool isRouter = (config.device.role == Config_DeviceConfig_Role_ROUTER ? 1 : 0);
// If we are not a router and we already have AC power go to POWER state after init, otherwise go to ON
// We assume routers might be powered all the time, but from a low current (solar) source
@@ -34,7 +34,7 @@ static void sdsEnter()
{
DEBUG_MSG("Enter state: SDS\n");
// FIXME - make sure GPS and LORA radio are off first - because we want close to zero current draw
doDeepSleep(config.power.sds_secs ? config.power.sds_secs : default_sds_secs * 1000LL);
doDeepSleep(getConfiguredOrDefaultMs(config.power.sds_secs));
}
extern Power *power;
@@ -51,8 +51,7 @@ static uint32_t secsSlept;
static void lsEnter()
{
DEBUG_MSG("lsEnter begin, ls_secs=%u\n",
config.power.ls_secs ? config.power.ls_secs : default_ls_secs);
DEBUG_MSG("lsEnter begin, ls_secs=%u\n", config.power.ls_secs);
screen->setOn(false);
secsSlept = 0; // How long have we been sleeping this time
@@ -66,7 +65,7 @@ static void lsIdle()
#ifdef ARCH_ESP32
// Do we have more sleeping to do?
if (secsSlept < config.power.ls_secs ? config.power.ls_secs : default_ls_secs * 1000) {
if (secsSlept < config.power.ls_secs) {
// Briefly come out of sleep long enough to blink the led once every few seconds
uint32_t sleepTime = 30;
@@ -200,8 +199,7 @@ static void onEnter()
uint32_t now = millis();
if (now - lastPingMs >
30 * 1000) { // if more than a minute since our last press, ask node we are looking at to update their state
if ((now - lastPingMs) > 30 * 1000) { // if more than a minute since our last press, ask node we are looking at to update their state
if (displayedNodeNum)
service.sendNetworkPing(displayedNodeNum, true); // Refresh the currently displayed node
lastPingMs = now;
@@ -239,10 +237,10 @@ Fsm powerFSM(&stateBOOT);
void PowerFSM_setup()
{
bool isRouter = (config.device.role == Config_DeviceConfig_Role_Router ? 1 : 0);
bool isRouter = (config.device.role == Config_DeviceConfig_Role_ROUTER ? 1 : 0);
bool hasPower = isPowered();
DEBUG_MSG("PowerFSM init, USB power=%d\n", hasPower);
DEBUG_MSG("PowerFSM init, USB power=%d\n", hasPower ? 1 : 0);
powerFSM.add_timed_transition(&stateBOOT, hasPower ? &statePOWER : &stateON, 3 * 1000, NULL, "boot timeout");
// wake timer expired or a packet arrived
@@ -251,8 +249,7 @@ void PowerFSM_setup()
// We need this transition, because we might not transition if we were waiting to enter light-sleep, because when we wake from
// light sleep we _always_ transition to NB or dark and
powerFSM.add_transition(&stateLS, isRouter ? &stateNB : &stateDARK, EVENT_PACKET_FOR_PHONE, NULL,
"Received packet, exiting light sleep");
powerFSM.add_transition(&stateLS, isRouter ? &stateNB : &stateDARK, EVENT_PACKET_FOR_PHONE, NULL, "Received packet, exiting light sleep");
powerFSM.add_transition(&stateNB, &stateNB, EVENT_PACKET_FOR_PHONE, NULL, "Received packet, resetting win wake");
// Handle press events - note: we ignore button presses when in API mode
@@ -261,8 +258,7 @@ void PowerFSM_setup()
powerFSM.add_transition(&stateDARK, &stateON, EVENT_PRESS, NULL, "Press");
powerFSM.add_transition(&statePOWER, &statePOWER, EVENT_PRESS, screenPress, "Press");
powerFSM.add_transition(&stateON, &stateON, EVENT_PRESS, screenPress, "Press"); // reenter On to restart our timers
powerFSM.add_transition(&stateSERIAL, &stateSERIAL, EVENT_PRESS, screenPress,
"Press"); // Allow button to work while in serial API
powerFSM.add_transition(&stateSERIAL, &stateSERIAL, EVENT_PRESS, screenPress, "Press"); // Allow button to work while in serial API
// Handle critically low power battery by forcing deep sleep
powerFSM.add_transition(&stateBOOT, &stateSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
@@ -328,50 +324,22 @@ void PowerFSM_setup()
powerFSM.add_transition(&stateDARK, &stateDARK, EVENT_CONTACT_FROM_PHONE, NULL, "Contact from phone");
// each time we get a new update packet make sure we are staying in the ON state so the screen stays awake (also we don't
// shutdown bluetooth if is_router)
powerFSM.add_transition(&stateDARK, &stateON, EVENT_FIRMWARE_UPDATE, NULL, "Got firmware update");
powerFSM.add_transition(&stateON, &stateON, EVENT_FIRMWARE_UPDATE, NULL, "Got firmware update");
powerFSM.add_timed_transition(&stateON, &stateDARK,
config.display.screen_on_secs ? config.display.screen_on_secs
: 60 * 1000 * 10,
NULL, "Screen-on timeout");
// On most boards we use light-sleep to be our main state, but on NRF52 we just stay in DARK
State *lowPowerState = &stateLS;
uint32_t meshSds = 0;
powerFSM.add_timed_transition(&stateON, &stateDARK, getConfiguredOrDefaultMs(config.display.screen_on_secs, default_screen_on_secs), NULL, "Screen-on timeout");
#ifdef ARCH_ESP32
State *lowPowerState = &stateLS;
// We never enter light-sleep or NB states on NRF52 (because the CPU uses so little power normally)
// See: https://github.com/meshtastic/Meshtastic-device/issues/1071
// See: https://github.com/meshtastic/firmware/issues/1071
if (isRouter || config.power.is_power_saving) {
powerFSM.add_timed_transition(&stateNB, &stateLS,
config.power.min_wake_secs ? config.power.min_wake_secs
: default_min_wake_secs * 1000,
NULL, "Min wake timeout");
powerFSM.add_timed_transition(&stateDARK, &stateLS,
config.power.wait_bluetooth_secs
? config.power.wait_bluetooth_secs
: default_wait_bluetooth_secs * 1000,
NULL, "Bluetooth timeout");
meshSds = config.power.mesh_sds_timeout_secs ? config.power.mesh_sds_timeout_secs
: default_mesh_sds_timeout_secs;
} else {
meshSds = UINT32_MAX;
powerFSM.add_timed_transition(&stateNB, &stateLS, getConfiguredOrDefaultMs(config.power.min_wake_secs, default_min_wake_secs), NULL, "Min wake timeout");
powerFSM.add_timed_transition(&stateDARK, &stateLS, getConfiguredOrDefaultMs(config.power.wait_bluetooth_secs, default_wait_bluetooth_secs), NULL, "Bluetooth timeout");
}
#else
lowPowerState = &stateDARK;
meshSds = UINT32_MAX; // Workaround for now: Don't go into deep sleep on the RAK4631
if (config.power.sds_secs != UINT32_MAX)
powerFSM.add_timed_transition(lowPowerState, &stateSDS, getConfiguredOrDefaultMs(config.power.sds_secs), NULL, "mesh timeout");
#endif
if (meshSds != UINT32_MAX)
powerFSM.add_timed_transition(lowPowerState, &stateSDS, meshSds * 1000, NULL, "mesh timeout");
powerFSM.run_machine(); // run one interation of the state machine, so we run our on enter tasks for the initial DARK state
}

View File

@@ -27,10 +27,8 @@ class PowerFSMThread : public OSThread
if (powerStatus->getHasUSB()) {
timeLastPowered = millis();
} else if (config.power.on_battery_shutdown_after_secs > 0 &&
millis() >
timeLastPowered +
(1000 *
config.power.on_battery_shutdown_after_secs)) { // shutdown after 30 minutes unpowered
config.power.on_battery_shutdown_after_secs != UINT32_MAX &&
millis() > (timeLastPowered + getConfiguredOrDefaultMs(config.power.on_battery_shutdown_after_secs))) { // shutdown after 30 minutes unpowered
powerFSM.trigger(EVENT_SHUTDOWN);
}

View File

@@ -1,6 +1,7 @@
#include "configuration.h"
#include "RedirectablePrint.h"
#include "RTC.h"
#include "NodeDB.h"
#include "concurrency/OSThread.h"
// #include "wifi/WiFiServerAPI.h"
#include <assert.h>
@@ -30,7 +31,9 @@ size_t RedirectablePrint::write(uint8_t c)
// optionally send chars to TCP also
//WiFiServerPort::debugOut(c);
if (!config.has_lora || config.device.serial_enabled)
dest->write(c);
return 1; // We always claim one was written, rather than trusting what the
// serial port said (which could be zero)
}
@@ -38,19 +41,17 @@ size_t RedirectablePrint::write(uint8_t c)
size_t RedirectablePrint::vprintf(const char *format, va_list arg)
{
va_list copy;
static char printBuf[160];
va_copy(copy, arg);
int len = vsnprintf(printBuf, printBufLen, format, copy);
size_t len = vsnprintf(printBuf, sizeof(printBuf), format, copy);
va_end(copy);
if (len < 0) {
va_end(arg);
return 0;
};
if (len >= (int)printBufLen) {
delete[] printBuf;
printBufLen *= 2;
printBuf = new char[printBufLen];
len = vsnprintf(printBuf, printBufLen, format, arg);
// If the resulting string is longer than sizeof(printBuf)-1 characters, the remaining characters are still counted for the return value
if (len > sizeof(printBuf) - 1) {
len = sizeof(printBuf) - 1;
printBuf[sizeof(printBuf) - 2] = '\n';
}
len = Print::write(printBuf, len);

View File

@@ -12,10 +12,6 @@ class RedirectablePrint : public Print
{
Print *dest;
/// We dynamically grow this scratch buffer if necessary
char *printBuf = new char[64];
size_t printBufLen = 64;
/// Used to allow multiple logDebug messages to appear on a single log line
bool isContinuationMessage = false;

View File

@@ -20,9 +20,12 @@ void consolePrintf(const char *format, ...)
va_start(arg, format);
console->vprintf(format, arg);
va_end(arg);
#ifdef ARCH_ESP32
console->flush();
#endif
}
SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port), concurrency::OSThread("SerialConsole")
{
assert(!console);
console = this;
@@ -43,6 +46,10 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
emitRebooted();
}
int32_t SerialConsole::runOnce()
{
return runOncePart();
}
// For the serial port we can't really detect if any client is on the other side, so instead just look for recent messages
bool SerialConsole::checkIsConnected()
@@ -57,10 +64,15 @@ bool SerialConsole::checkIsConnected()
*/
bool SerialConsole::handleToRadio(const uint8_t *buf, size_t len)
{
// only talk to the API once the configuration has been loaded and we're sure the serial port is not disabled.
if (config.has_lora && config.device.serial_enabled) {
// Turn off debug serial printing once the API is activated, because other threads could print and corrupt packets
if (!config.device.debug_log_enabled)
setDestination(&noopPrint);
canWrite = true;
return StreamAPI::handleToRadio(buf, len);
}else{
return false;
}
}

View File

@@ -6,7 +6,7 @@
* Provides both debug printing and, if the client starts sending protobufs to us, switches to send/receive protobufs
* (and starts dropping debug printing - FIXME, eventually those prints should be encapsulated in protobufs).
*/
class SerialConsole : public StreamAPI, public RedirectablePrint
class SerialConsole : public StreamAPI, public RedirectablePrint, private concurrency::OSThread
{
public:
SerialConsole();
@@ -24,6 +24,8 @@ class SerialConsole : public StreamAPI, public RedirectablePrint
return RedirectablePrint::write(c);
}
virtual int32_t runOnce() override;
protected:
/// Check the current underlying physical link to see if the client is currently connected

View File

@@ -117,6 +117,20 @@ float AirTime::utilizationTXPercent()
return (float(sum) / float(MS_IN_HOUR)) * 100;
}
// Get the amount of minutes we have to be silent before we can send again
uint8_t AirTime::getSilentMinutes(float txPercent, float dutyCycle)
{
float newTxPercent = txPercent;
for (int8_t i = MINUTES_IN_HOUR-1; i >= 0; --i) {
newTxPercent -= ((float)this->utilizationTX[i] / (MS_IN_MINUTE * MINUTES_IN_HOUR / 100));
if (newTxPercent < dutyCycle)
return MINUTES_IN_HOUR-1-i;
}
return MINUTES_IN_HOUR;
}
AirTime::AirTime() : concurrency::OSThread("AirTime"),airtimes({}) {
}

View File

@@ -29,6 +29,7 @@
#define PERIODS_TO_LOG 8
#define MINUTES_IN_HOUR 60
#define SECONDS_IN_MINUTE 60
#define MS_IN_MINUTE (SECONDS_IN_MINUTE * 1000)
#define MS_IN_HOUR (MINUTES_IN_HOUR * SECONDS_IN_MINUTE * 1000)
@@ -57,6 +58,7 @@ class AirTime : private concurrency::OSThread
uint32_t getSecondsPerPeriod();
uint32_t getSecondsSinceBoot();
uint32_t *airtimeReport(reportTypes reportType);
uint8_t getSilentMinutes(float txPercent, float dutyCycle);
private:
bool firstTime = true;

View File

@@ -1,22 +1,14 @@
#include "buzz.h"
#include "configuration.h"
#include "NodeDB.h"
#ifndef PIN_BUZZER
// Noop methods for boards w/o buzzer
void playBeep(){};
void playStartMelody(){};
void playShutdownMelody(){};
#else
#ifdef M5STACK
#include "Speaker.h"
TONE Tone;
#else
#if !defined(ARCH_ESP32) && !defined(ARCH_RP2040) && !defined(ARCH_PORTDUINO)
#include "Tone.h"
#endif
#if !defined(ARCH_PORTDUINO)
extern "C" void delay(uint32_t dwMs);
#endif
struct ToneDuration {
int frequency_khz;
@@ -36,45 +28,42 @@ struct ToneDuration {
#define NOTE_A3 220
#define NOTE_AS3 233
#define NOTE_B3 247
#define NOTE_CS4 277
const int DURATION_1_8 = 125; // 1/8 note
const int DURATION_1_4 = 250; // 1/4 note
void playTones(const ToneDuration *tone_durations, int size) {
#ifdef PIN_BUZZER
if (!config.device.buzzer_gpio)
config.device.buzzer_gpio = PIN_BUZZER;
#endif
if (config.device.buzzer_gpio) {
for (int i = 0; i < size; i++) {
const auto &tone_duration = tone_durations[i];
#ifdef M5STACK
Tone.tone(tone_duration.frequency_khz);
delay(tone_duration.duration_ms);
Tone.mute();
#else
tone(PIN_BUZZER, tone_duration.frequency_khz, tone_duration.duration_ms);
#endif
tone(config.device.buzzer_gpio, tone_duration.frequency_khz, tone_duration.duration_ms);
// to distinguish the notes, set a minimum time between them.
delay(1.3 * tone_duration.duration_ms);
}
}
}
#ifdef M5STACK
void playBeep() {
ToneDuration melody[] = {{NOTE_B3, DURATION_1_4}};
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
}
#else
void playBeep() { tone(PIN_BUZZER, NOTE_B3, DURATION_1_4); }
#endif
void playStartMelody() {
ToneDuration melody[] = {{NOTE_B3, DURATION_1_4},
{NOTE_B3, DURATION_1_8},
{NOTE_B3, DURATION_1_8}};
ToneDuration melody[] = {{NOTE_FS3, DURATION_1_8},
{NOTE_AS3, DURATION_1_8},
{NOTE_CS4, DURATION_1_4}};
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
}
void playShutdownMelody() {
ToneDuration melody[] = {{NOTE_B3, DURATION_1_4},
{NOTE_G3, DURATION_1_8},
{NOTE_D3, DURATION_1_8}};
ToneDuration melody[] = {{NOTE_CS4, DURATION_1_8},
{NOTE_AS3, DURATION_1_8},
{NOTE_FS3, DURATION_1_4}};
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
}
#endif

View File

@@ -14,4 +14,5 @@ enum class Cmd {
STOP_BOOT_SCREEN,
PRINT,
START_SHUTDOWN_SCREEN,
START_REBOOT_SCREEN,
};

View File

@@ -81,7 +81,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// #define DISABLE_NTP
// Disable the welcome screen and allow
#define DISABLE_WELCOME_UNSET
//#define DISABLE_WELCOME_UNSET
// -----------------------------------------------------------------------------
// OLED & Input
@@ -94,19 +94,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Define this if you know you have that controller or your "SSD1306" misbehaves.
//#define USE_SH1106
// Flip the screen upside down by default as it makes more sense on T-BEAM
// devices. Comment this out to not rotate screen 180 degrees.
#define SCREEN_FLIP_VERTICALLY
// Define if screen should be mirrored left to right
// #define SCREEN_MIRROR
// The m5stack I2C Keyboard (also RAK14004)
#define CARDKB_ADDR 0x5F
// The older M5 Faces I2C Keyboard
#define FACESKB_ADDR 0x88
// -----------------------------------------------------------------------------
// SENSOR
// -----------------------------------------------------------------------------
@@ -115,6 +108,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MCP9808_ADDR 0x18
#define INA_ADDR 0x40
#define INA_ADDR_ALTERNATE 0x41
#define QMC6310_ADDR 0x1C
#define QMI8658_ADDR 0x6B
#define QMC5883L_ADDR 0x1E
#define SHTC3_ADDR 0x70
#define LPS22HB_ADDR 0x5C
#define LPS22HB_ADDR_ALT 0x5D
#define SHT31_ADDR 0x44
// -----------------------------------------------------------------------------
// Security
// -----------------------------------------------------------------------------
#define ATECC608B_ADDR 0x35
// -----------------------------------------------------------------------------
// GPS
@@ -138,6 +144,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef HAS_WIFI
#define HAS_WIFI 0
#endif
#ifndef HAS_ETHERNET
#define HAS_ETHERNET 0
#endif
#ifndef HAS_SCREEN
#define HAS_SCREEN 0
#endif
@@ -159,6 +168,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef HAS_RTC
#define HAS_RTC 0
#endif
#ifndef HAS_CPU_SHUTDOWN
#define HAS_CPU_SHUTDOWN 0
#endif
#ifndef HAS_BLUETOOTH
#define HAS_BLUETOOTH 0
#endif
#include "RF95Configuration.h"
#include "DebugConfiguration.h"

View File

@@ -1 +0,0 @@
// Placeholder FIXME

View File

@@ -1,159 +0,0 @@
#include "../configuration.h"
#include "../main.h"
#include <Wire.h>
#include "mesh/generated/telemetry.pb.h"
#if HAS_WIRE
uint16_t getRegisterValue(uint8_t address, uint8_t reg, uint8_t length) {
uint16_t value = 0x00;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delay(20);
Wire.requestFrom(address, length);
DEBUG_MSG("Wire.available() = %d\n", Wire.available());
if (Wire.available() == 2) {
// Read MSB, then LSB
value = (uint16_t)Wire.read() << 8;
value |= Wire.read();
} else if (Wire.available()) {
value = Wire.read();
}
return value;
}
uint8_t oled_probe(byte addr)
{
uint8_t r = 0;
uint8_t r_prev = 0;
uint8_t c = 0;
uint8_t o_probe = 0;
do {
r_prev = r;
Wire.beginTransmission(addr);
Wire.write(0x00);
Wire.endTransmission();
Wire.requestFrom((int)addr, 1);
if (Wire.available()) {
r = Wire.read();
}
r &= 0x0f;
if (r == 0x08 || r == 0x00) {
o_probe = 2; // SH1106
} else if ( r == 0x03 || r == 0x06 || r == 0x07) {
o_probe = 1; // SSD1306
}
c++;
} while ((r != r_prev) && (c < 4));
DEBUG_MSG("0x%x subtype probed in %i tries \n", r, c);
return o_probe;
}
void scanI2Cdevice(void)
{
byte err, addr;
uint16_t registerValue = 0x00;
int nDevices = 0;
for (addr = 1; addr < 127; addr++) {
Wire.beginTransmission(addr);
err = Wire.endTransmission();
if (err == 0) {
DEBUG_MSG("I2C device found at address 0x%x\n", addr);
nDevices++;
if (addr == SSD1306_ADDRESS) {
screen_found = addr;
screen_model = oled_probe(addr);
if (screen_model == 1){
DEBUG_MSG("ssd1306 display found\n");
} else if (screen_model == 2){
DEBUG_MSG("sh1106 display found\n");
} else {
DEBUG_MSG("unknown display found\n");
}
}
#ifdef RV3028_RTC
if (addr == RV3028_RTC){
rtc_found = addr;
DEBUG_MSG("RV3028 RTC found\n");
Melopero_RV3028 rtc;
rtc.initI2C();
rtc.writeToRegister(0x35,0x07); // no Clkout
rtc.writeToRegister(0x37,0xB4);
}
#endif
#ifdef PCF8563_RTC
if (addr == PCF8563_RTC){
rtc_found = addr;
DEBUG_MSG("PCF8563 RTC found\n");
}
#endif
if (addr == CARDKB_ADDR) {
cardkb_found = addr;
// Do we have the RAK14006 instead?
registerValue = getRegisterValue(addr, 0x04, 1);
if (registerValue == 0x02) { // KEYPAD_VERSION
DEBUG_MSG("RAK14004 found\n");
kb_model = 0x02;
} else {
DEBUG_MSG("m5 cardKB found\n");
kb_model = 0x00;
}
}
if (addr == FACESKB_ADDR) {
faceskb_found = addr;
DEBUG_MSG("m5 Faces found\n");
}
if (addr == ST7567_ADDRESS) {
screen_found = addr;
DEBUG_MSG("st7567 display found\n");
}
#ifdef AXP192_SLAVE_ADDRESS
if (addr == AXP192_SLAVE_ADDRESS) {
axp192_found = true;
DEBUG_MSG("axp192 PMU found\n");
}
#endif
if (addr == BME_ADDR || addr == BME_ADDR_ALTERNATE) {
registerValue = getRegisterValue(addr, 0xD0, 1); // GET_ID
if (registerValue == 0x61) {
DEBUG_MSG("BME-680 sensor found at address 0x%x\n", (uint8_t)addr);
nodeTelemetrySensorsMap[TelemetrySensorType_BME680] = addr;
} else if (registerValue == 0x60) {
DEBUG_MSG("BME-280 sensor found at address 0x%x\n", (uint8_t)addr);
nodeTelemetrySensorsMap[TelemetrySensorType_BME280] = addr;
} else {
DEBUG_MSG("BMP-280 sensor found at address 0x%x\n", (uint8_t)addr);
nodeTelemetrySensorsMap[TelemetrySensorType_BMP280] = addr;
}
}
if (addr == INA_ADDR || addr == INA_ADDR_ALTERNATE) {
registerValue = getRegisterValue(addr, 0xFE, 2);
DEBUG_MSG("Register MFG_UID: 0x%x\n", registerValue);
if (registerValue == 0x5449) {
DEBUG_MSG("INA260 sensor found at address 0x%x\n", (uint8_t)addr);
nodeTelemetrySensorsMap[TelemetrySensorType_INA260] = addr;
} else { // Assume INA219 if INA260 ID is not found
DEBUG_MSG("INA219 sensor found at address 0x%x\n", (uint8_t)addr);
nodeTelemetrySensorsMap[TelemetrySensorType_INA219] = addr;
}
}
if (addr == MCP9808_ADDR) {
nodeTelemetrySensorsMap[TelemetrySensorType_MCP9808] = addr;
DEBUG_MSG("MCP9808 sensor found at address 0x%x\n", (uint8_t)addr);
}
} else if (err == 4) {
DEBUG_MSG("Unknow error at address 0x%x\n", addr);
}
}
if (nDevices == 0)
DEBUG_MSG("No I2C devices found\n");
else
DEBUG_MSG("%i I2C devices found\n",nDevices);
}
#else
void scanI2Cdevice(void) {}
#endif

232
src/detect/i2cScan.h Normal file
View File

@@ -0,0 +1,232 @@
#include "../configuration.h"
#include "../main.h"
#include <Wire.h>
#include "mesh/generated/telemetry.pb.h"
// AXP192 and AXP2101 have the same device address, we just need to identify it in Power.cpp
#ifndef XPOWERS_AXP192_AXP2101_ADDRESS
#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34
#endif
#if HAS_WIRE
void printATECCInfo()
{
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
atecc.readConfigZone(false);
DEBUG_MSG("ATECC608B Serial Number: ");
for (int i = 0 ; i < 9 ; i++) {
DEBUG_MSG("%02x",atecc.serialNumber[i]);
}
DEBUG_MSG(", Rev Number: ");
for (int i = 0 ; i < 4 ; i++) {
DEBUG_MSG("%02x",atecc.revisionNumber[i]);
}
DEBUG_MSG("\n");
DEBUG_MSG("ATECC608B Config %s",atecc.configLockStatus ? "Locked" : "Unlocked");
DEBUG_MSG(", Data %s",atecc.dataOTPLockStatus ? "Locked" : "Unlocked");
DEBUG_MSG(", Slot 0 %s\n",atecc.slot0LockStatus ? "Locked" : "Unlocked");
if (atecc.configLockStatus && atecc.dataOTPLockStatus && atecc.slot0LockStatus) {
if (atecc.generatePublicKey() == false) {
DEBUG_MSG("ATECC608B Error generating public key\n");
} else {
DEBUG_MSG("ATECC608B Public Key: ");
for (int i = 0 ; i < 64 ; i++) {
DEBUG_MSG("%02x",atecc.publicKey64Bytes[i]);
}
DEBUG_MSG("\n");
}
}
#endif
}
uint16_t getRegisterValue(uint8_t address, uint8_t reg, uint8_t length) {
uint16_t value = 0x00;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delay(20);
Wire.requestFrom(address, length);
DEBUG_MSG("Wire.available() = %d\n", Wire.available());
if (Wire.available() == 2) {
// Read MSB, then LSB
value = (uint16_t)Wire.read() << 8;
value |= Wire.read();
} else if (Wire.available()) {
value = Wire.read();
}
return value;
}
uint8_t oled_probe(byte addr)
{
uint8_t r = 0;
uint8_t r_prev = 0;
uint8_t c = 0;
uint8_t o_probe = 0;
do {
r_prev = r;
Wire.beginTransmission(addr);
Wire.write(0x00);
Wire.endTransmission();
Wire.requestFrom((int)addr, 1);
if (Wire.available()) {
r = Wire.read();
}
r &= 0x0f;
if (r == 0x08 || r == 0x00) {
o_probe = 2; // SH1106
} else if ( r == 0x03 || r == 0x04 || r == 0x06 || r == 0x07) {
o_probe = 1; // SSD1306
}
c++;
} while ((r != r_prev) && (c < 4));
DEBUG_MSG("0x%x subtype probed in %i tries \n", r, c);
return o_probe;
}
void scanI2Cdevice()
{
byte err, addr;
uint16_t registerValue = 0x00;
int nDevices = 0;
for (addr = 1; addr < 127; addr++) {
Wire.beginTransmission(addr);
err = Wire.endTransmission();
if (err == 0) {
DEBUG_MSG("I2C device found at address 0x%x\n", addr);
nDevices++;
if (addr == SSD1306_ADDRESS) {
screen_found = addr;
screen_model = oled_probe(addr);
if (screen_model == 1) {
DEBUG_MSG("ssd1306 display found\n");
} else if (screen_model == 2) {
DEBUG_MSG("sh1106 display found\n");
} else {
DEBUG_MSG("unknown display found\n");
}
}
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
if (addr == ATECC608B_ADDR) {
keystore_found = addr;
if (atecc.begin(keystore_found) == true) {
DEBUG_MSG("ATECC608B initialized\n");
} else {
DEBUG_MSG("ATECC608B initialization failed\n");
}
printATECCInfo();
}
#endif
#ifdef RV3028_RTC
if (addr == RV3028_RTC){
rtc_found = addr;
DEBUG_MSG("RV3028 RTC found\n");
Melopero_RV3028 rtc;
rtc.initI2C();
rtc.writeToRegister(0x35,0x07); // no Clkout
rtc.writeToRegister(0x37,0xB4);
}
#endif
#ifdef PCF8563_RTC
if (addr == PCF8563_RTC){
rtc_found = addr;
DEBUG_MSG("PCF8563 RTC found\n");
}
#endif
if (addr == CARDKB_ADDR) {
cardkb_found = addr;
// Do we have the RAK14006 instead?
registerValue = getRegisterValue(addr, 0x04, 1);
if (registerValue == 0x02) { // KEYPAD_VERSION
DEBUG_MSG("RAK14004 found\n");
kb_model = 0x02;
} else {
DEBUG_MSG("m5 cardKB found\n");
kb_model = 0x00;
}
}
if (addr == ST7567_ADDRESS) {
screen_found = addr;
DEBUG_MSG("st7567 display found\n");
}
#ifdef HAS_PMU
if (addr == XPOWERS_AXP192_AXP2101_ADDRESS) {
pmu_found = true;
DEBUG_MSG("axp192/axp2101 PMU found\n");
}
#endif
if (addr == BME_ADDR || addr == BME_ADDR_ALTERNATE) {
registerValue = getRegisterValue(addr, 0xD0, 1); // GET_ID
if (registerValue == 0x61) {
DEBUG_MSG("BME-680 sensor found at address 0x%x\n", (uint8_t)addr);
nodeTelemetrySensorsMap[TelemetrySensorType_BME680] = addr;
} else if (registerValue == 0x60) {
DEBUG_MSG("BME-280 sensor found at address 0x%x\n", (uint8_t)addr);
nodeTelemetrySensorsMap[TelemetrySensorType_BME280] = addr;
} else {
DEBUG_MSG("BMP-280 sensor found at address 0x%x\n", (uint8_t)addr);
nodeTelemetrySensorsMap[TelemetrySensorType_BMP280] = addr;
}
}
if (addr == INA_ADDR || addr == INA_ADDR_ALTERNATE) {
registerValue = getRegisterValue(addr, 0xFE, 2);
DEBUG_MSG("Register MFG_UID: 0x%x\n", registerValue);
if (registerValue == 0x5449) {
DEBUG_MSG("INA260 sensor found at address 0x%x\n", (uint8_t)addr);
nodeTelemetrySensorsMap[TelemetrySensorType_INA260] = addr;
} else { // Assume INA219 if INA260 ID is not found
DEBUG_MSG("INA219 sensor found at address 0x%x\n", (uint8_t)addr);
nodeTelemetrySensorsMap[TelemetrySensorType_INA219] = addr;
}
}
if (addr == MCP9808_ADDR) {
nodeTelemetrySensorsMap[TelemetrySensorType_MCP9808] = addr;
DEBUG_MSG("MCP9808 sensor found\n");
}
if (addr == SHT31_ADDR) {
DEBUG_MSG("SHT31 sensor found\n");
nodeTelemetrySensorsMap[TelemetrySensorType_SHT31] = addr;
}
if (addr == SHTC3_ADDR) {
DEBUG_MSG("SHTC3 sensor found\n");
nodeTelemetrySensorsMap[TelemetrySensorType_SHTC3] = addr;
}
if (addr == LPS22HB_ADDR || addr == LPS22HB_ADDR_ALT) {
DEBUG_MSG("LPS22HB sensor found\n");
nodeTelemetrySensorsMap[TelemetrySensorType_LPS22] = addr;
}
// High rate sensors, will be processed internally
if (addr == QMC6310_ADDR) {
DEBUG_MSG("QMC6310 Highrate 3-Axis magnetic sensor found\n");
nodeTelemetrySensorsMap[TelemetrySensorType_QMC6310] = addr;
}
if (addr == QMI8658_ADDR) {
DEBUG_MSG("QMI8658 Highrate 6-Axis inertial measurement sensor found\n");
nodeTelemetrySensorsMap[TelemetrySensorType_QMI8658] = addr;
}
if (addr == QMC5883L_ADDR) {
DEBUG_MSG("QMC5883L Highrate 3-Axis magnetic sensor found\n");
nodeTelemetrySensorsMap[TelemetrySensorType_QMC5883L] = addr;
}
} else if (err == 4) {
DEBUG_MSG("Unknow error at address 0x%x\n", addr);
}
}
if (nDevices == 0)
DEBUG_MSG("No I2C devices found\n");
else
DEBUG_MSG("%i I2C devices found\n",nDevices);
}
#else
void scanI2Cdevice() {}
#endif

View File

@@ -8,4 +8,4 @@
#define RECORD_CRITICALERROR(code) recordCriticalError(code, __LINE__, __FILE__)
/// Record an error that should be reported via analytics
void recordCriticalError(CriticalErrorCode code = CriticalErrorCode_Unspecified, uint32_t address = 0, const char *filename = NULL);
void recordCriticalError(CriticalErrorCode code = CriticalErrorCode_UNSPECIFIED, uint32_t address = 0, const char *filename = NULL);

View File

@@ -1,160 +0,0 @@
#ifndef USE_NEW_ESP32_BLUETOOTH
#include <Arduino.h>
#include "../concurrency/LockGuard.h"
#include "../graphics/Screen.h"
#include "../main.h"
#include "BluetoothSoftwareUpdate.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RadioLibInterface.h"
#include "configuration.h"
#include "nimble/BluetoothUtil.h"
#include <CRC32.h>
#include <Update.h>
int16_t updateResultHandle = -1;
static CRC32 crc;
static uint32_t updateExpectedSize, updateActualSize;
static uint8_t update_result;
static uint8_t update_region;
static concurrency::Lock *updateLock;
/// Handle writes & reads to total size
int update_size_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg)
{
concurrency::LockGuard g(updateLock);
// Check if there is enough to OTA Update
chr_readwrite32le(&updateExpectedSize, ctxt);
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR && updateExpectedSize != 0) {
updateActualSize = 0;
crc.reset();
if (Update.isRunning())
Update.abort();
bool canBegin = Update.begin(updateExpectedSize, update_region);
DEBUG_MSG("Setting region %d update size %u, result %d\n", update_region, updateExpectedSize, canBegin);
if (!canBegin) {
// Indicate failure by forcing the size to 0 (client will read it back)
updateExpectedSize = 0;
} else {
// This totally breaks abstraction to up up into the app layer for this, but quick hack to make sure we only
// talk to one service during the sw update.
// DEBUG_MSG("FIXME, crufty shutdown of mesh bluetooth for sw update.");
// void stopMeshBluetoothService();
// stopMeshBluetoothService();
screen->startFirmwareUpdateScreen();
if (RadioLibInterface::instance)
RadioLibInterface::instance->disable(); // FIXME, nasty hack - the RF95 ISR/SPI code on ESP32 can fail while we
// are writing flash - shut the radio off during updates
}
}
return 0;
}
#define MAX_BLOCKSIZE_FOR_BT 512
/// Handle writes to data
int update_data_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg)
{
concurrency::LockGuard g(updateLock);
static uint8_t
data[MAX_BLOCKSIZE_FOR_BT]; // we temporarily copy here because I'm worried that a fast sender might be able overwrite srcbuf
uint16_t len = 0;
auto rc = ble_hs_mbuf_to_flat(ctxt->om, data, sizeof(data), &len);
assert(rc == 0);
// DEBUG_MSG("Writing %u\n", len);
crc.update(data, len);
Update.write(data, len);
updateActualSize += len;
powerFSM.trigger(EVENT_FIRMWARE_UPDATE);
return 0;
}
/// Handle writes to crc32
int update_crc32_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg)
{
concurrency::LockGuard g(updateLock);
uint32_t expectedCRC = 0;
chr_readwrite32le(&expectedCRC, ctxt);
uint32_t actualCRC = crc.finalize();
DEBUG_MSG("expected CRC %u\n", expectedCRC);
uint8_t result = 0xff;
if (updateActualSize != updateExpectedSize) {
DEBUG_MSG("Expected %u bytes, but received %u bytes!\n", updateExpectedSize, updateActualSize);
result = 0xe1; // FIXME, use real error codes
} else if (actualCRC != expectedCRC) // Check the CRC before asking the update to happen.
{
DEBUG_MSG("Invalid CRC! expected=%u, actual=%u\n", expectedCRC, actualCRC);
result = 0xe0; // FIXME, use real error codes
} else {
if (Update.end()) {
if (update_region == U_SPIFFS) {
DEBUG_MSG("Filesystem updated!\n");
nodeDB.saveToDisk(); // Since we just wiped the filesystem, we need to save our current state
} else {
DEBUG_MSG("Appload updated, rebooting in 5 seconds!\n");
rebootAtMsec = millis() + 5000;
}
} else {
DEBUG_MSG("Error Occurred. Error #: %d\n", Update.getError());
}
result = Update.getError();
}
if (RadioLibInterface::instance)
RadioLibInterface::instance->startReceive(); // Resume radio
assert(updateResultHandle >= 0);
update_result = result;
DEBUG_MSG("BLE notify update result\n");
auto res = ble_gattc_notify(curConnectionHandle, updateResultHandle);
assert(res == 0);
return 0;
}
int update_result_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg)
{
return chr_readwrite8(&update_result, sizeof(update_result), ctxt);
}
int update_region_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg)
{
return chr_readwrite8(&update_region, sizeof(update_region), ctxt);
}
/*
See bluetooth-api.md
*/
void reinitUpdateService()
{
if (!updateLock)
updateLock = new concurrency::Lock();
auto res = ble_gatts_count_cfg(gatt_update_svcs); // assigns handles? see docstring for note about clearing the handle list
// before calling SLEEP SUPPORT
assert(res == 0);
res = ble_gatts_add_svcs(gatt_update_svcs);
assert(res == 0);
}
#endif //#ifndef USE_NEW_ESP32_BLUETOOTH

View File

@@ -1,29 +0,0 @@
#ifndef USE_NEW_ESP32_BLUETOOTH
#pragma once
#include "nimble/NimbleDefs.h"
void reinitUpdateService();
#ifdef __cplusplus
extern "C" {
#endif
int update_size_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg);
int update_data_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg);
int update_result_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg);
int update_crc32_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg);
int update_region_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg);
extern const struct ble_gatt_svc_def gatt_update_svcs[];
extern const ble_uuid128_t update_result_uuid, update_region_uuid;
extern int16_t updateResultHandle;
#ifdef __cplusplus
};
#endif
#endif //#ifndef USE_NEW_ESP32_BLUETOOTH

View File

@@ -1,259 +0,0 @@
#ifdef USE_NEW_ESP32_BLUETOOTH
#include "configuration.h"
#include "ESP32Bluetooth.h"
#include "BluetoothCommon.h"
#include "PowerFSM.h"
#include "sleep.h"
#include "main.h"
#include "mesh/PhoneAPI.h"
#include "mesh/mesh-pb-constants.h"
#include <NimBLEDevice.h>
//static BLEService meshBleService = BLEService(BLEUuid(MESH_SERVICE_UUID_16));
//static BLECharacteristic fromNum = BLECharacteristic(BLEUuid(FROMNUM_UUID_16));
//static BLECharacteristic fromRadio = BLECharacteristic(BLEUuid(FROMRADIO_UUID_16));
//static BLECharacteristic toRadio = BLECharacteristic(BLEUuid(TORADIO_UUID_16));
//static BLEDis bledis; // DIS (Device Information Service) helper class instance
//static BLEBas blebas; // BAS (Battery Service) helper class instance
//static BLEDfu bledfu; // DFU software update helper service
// This scratch buffer is used for various bluetooth reads/writes - but it is safe because only one bt operation can be in
// proccess at once
// static uint8_t trBytes[_max(_max(_max(_max(ToRadio_size, RadioConfig_size), User_size), MyNodeInfo_size), FromRadio_size)];
static uint8_t fromRadioBytes[FromRadio_size];
NimBLECharacteristic *FromNumCharacteristic;
NimBLEServer *bleServer;
static bool passkeyShowing;
static uint32_t doublepressed;
/**
* Subclasses can use this as a hook to provide custom notifications for their transport (i.e. bluetooth notifies)
*/
void BluetoothPhoneAPI::onNowHasData(uint32_t fromRadioNum)
{
PhoneAPI::onNowHasData(fromRadioNum);
DEBUG_MSG("BLE notify fromNum\n");
//fromNum.notify32(fromRadioNum);
uint8_t val[4];
put_le32(val, fromRadioNum);
std::string fromNumByteString(&val[0], &val[0] + sizeof(val));
FromNumCharacteristic->setValue(fromNumByteString);
FromNumCharacteristic->notify();
}
/// Check the current underlying physical link to see if the client is currently connected
bool BluetoothPhoneAPI::checkIsConnected() {
if (bleServer && bleServer->getConnectedCount() > 0) {
return true;
}
return false;
}
PhoneAPI *bluetoothPhoneAPI;
class ESP32BluetoothToRadioCallback : public NimBLECharacteristicCallbacks {
virtual void onWrite(NimBLECharacteristic *pCharacteristic) {
DEBUG_MSG("To Radio onwrite\n");
auto val = pCharacteristic->getValue();
bluetoothPhoneAPI->handleToRadio(val.data(), val.length());
}
};
class ESP32BluetoothFromRadioCallback : public NimBLECharacteristicCallbacks {
virtual void onRead(NimBLECharacteristic *pCharacteristic) {
DEBUG_MSG("From Radio onread\n");
size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes);
std::string fromRadioByteString(fromRadioBytes, fromRadioBytes + numBytes);
pCharacteristic->setValue(fromRadioByteString);
}
};
class ESP32BluetoothServerCallback : public NimBLEServerCallbacks {
virtual uint32_t onPassKeyRequest() {
uint32_t passkey = 0;
if (doublepressed > 0 && (doublepressed + (30 * 1000)) > millis()) {
DEBUG_MSG("User has overridden passkey\n");
passkey = defaultBLEPin;
} else {
DEBUG_MSG("Using random passkey\n");
passkey = random(
100000, 999999); // This is the passkey to be entered on peer - we pick a number >100,000 to ensure 6 digits
}
DEBUG_MSG("*** Enter passkey %d on the peer side ***\n", passkey);
powerFSM.trigger(EVENT_BLUETOOTH_PAIR);
screen->startBluetoothPinScreen(passkey);
passkeyShowing = true;
return passkey;
}
virtual void onAuthenticationComplete(ble_gap_conn_desc *desc) {
DEBUG_MSG("BLE authentication complete\n");
if (passkeyShowing) {
passkeyShowing = false;
screen->stopBluetoothPinScreen();
}
}
};
static ESP32BluetoothToRadioCallback *toRadioCallbacks;
static ESP32BluetoothFromRadioCallback *fromRadioCallbacks;
void ESP32Bluetooth::shutdown()
{
// Shutdown bluetooth for minimum power draw
DEBUG_MSG("Disable bluetooth\n");
//Bluefruit.Advertising.stop();
}
void ESP32Bluetooth::setup()
{
// Initialise the Bluefruit module
DEBUG_MSG("Initialise the ESP32 bluetooth module\n");
//Bluefruit.autoConnLed(false);
//Bluefruit.begin();
// Set the advertised device name (keep it short!)
//Bluefruit.setName(getDeviceName());
// Set the connect/disconnect callback handlers
//Bluefruit.Periph.setConnectCallback(connect_callback);
//Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
// Configure and Start the Device Information Service
DEBUG_MSG("Configuring the Device Information Service\n");
// FIXME, we should set a mfg string based on our HW_VENDOR enum
// bledis.setManufacturer(HW_VENDOR);
//bledis.setModel(optstr(HW_VERSION));
//bledis.setFirmwareRev(optstr(APP_VERSION));
//bledis.begin();
// Start the BLE Battery Service and set it to 100%
//DEBUG_MSG("Configuring the Battery Service\n");
//blebas.begin();
//blebas.write(0); // Unknown battery level for now
//bledfu.begin(); // Install the DFU helper
// Setup the Heart Rate Monitor service using
// BLEService and BLECharacteristic classes
DEBUG_MSG("Configuring the Mesh bluetooth service\n");
//setupMeshService();
// Supposedly debugging works with soft device if you disable advertising
//if (isSoftDeviceAllowed) {
// Setup the advertising packet(s)
// DEBUG_MSG("Setting up the advertising payload(s)\n");
// startAdv();
// DEBUG_MSG("Advertising\n");
//}
//NimBLEDevice::deleteAllBonds();
NimBLEDevice::init(getDeviceName());
NimBLEDevice::setPower(ESP_PWR_LVL_P9);
NimBLEDevice::setSecurityAuth(true, true, true);
NimBLEDevice::setSecurityIOCap(BLE_HS_IO_DISPLAY_ONLY);
bleServer = NimBLEDevice::createServer();
ESP32BluetoothServerCallback *serverCallbacks = new ESP32BluetoothServerCallback();
bleServer->setCallbacks(serverCallbacks);
NimBLEService *bleService = bleServer->createService(MESH_SERVICE_UUID);
//NimBLECharacteristic *pNonSecureCharacteristic = bleService->createCharacteristic("1234", NIMBLE_PROPERTY::READ );
//NimBLECharacteristic *pSecureCharacteristic = bleService->createCharacteristic("1235", NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::READ_ENC | NIMBLE_PROPERTY::READ_AUTHEN);
//define the characteristics that the app is looking for
NimBLECharacteristic *ToRadioCharacteristic = bleService->createCharacteristic(TORADIO_UUID, NIMBLE_PROPERTY::WRITE | NIMBLE_PROPERTY::WRITE_AUTHEN | NIMBLE_PROPERTY::WRITE_ENC);
NimBLECharacteristic *FromRadioCharacteristic = bleService->createCharacteristic(FROMRADIO_UUID, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::READ_AUTHEN | NIMBLE_PROPERTY::READ_ENC);
FromNumCharacteristic = bleService->createCharacteristic(FROMNUM_UUID, NIMBLE_PROPERTY::NOTIFY | NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::READ_AUTHEN | NIMBLE_PROPERTY::READ_ENC);
bluetoothPhoneAPI = new BluetoothPhoneAPI();
toRadioCallbacks = new ESP32BluetoothToRadioCallback();
ToRadioCharacteristic->setCallbacks(toRadioCallbacks);
fromRadioCallbacks = new ESP32BluetoothFromRadioCallback();
FromRadioCharacteristic->setCallbacks(fromRadioCallbacks);
//uint8_t val[4];
//uint32_t zero = 0;
//put_le32(val, zero);
//std::string fromNumByteString(&val[0], &val[0] + sizeof(val));
//FromNumCharacteristic->setValue(fromNumByteString);
bleService->start();
//pNonSecureCharacteristic->setValue("Hello Non Secure BLE");
//pSecureCharacteristic->setValue("Hello Secure BLE");
//FromRadioCharacteristic->setValue("FromRadioString");
//ToRadioCharacteristic->setCallbacks()
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
pAdvertising->addServiceUUID(MESH_SERVICE_UUID);
pAdvertising->start();
}
/// Given a level between 0-100, update the BLE attribute
void updateBatteryLevel(uint8_t level)
{
//blebas.write(level);
}
void ESP32Bluetooth::clearBonds()
{
DEBUG_MSG("Clearing bluetooth bonds!\n");
//bond_print_list(BLE_GAP_ROLE_PERIPH);
//bond_print_list(BLE_GAP_ROLE_CENTRAL);
//Bluefruit.Periph.clearBonds();
//Bluefruit.Central.clearBonds();
}
void clearNVS() {
NimBLEDevice::deleteAllBonds();
ESP.restart();
}
void disablePin() {
DEBUG_MSG("User Override, disabling bluetooth pin requirement\n");
// keep track of when it was pressed, so we know it was within X seconds
// Flash the LED
setLed(true);
delay(100);
setLed(false);
delay(100);
setLed(true);
delay(100);
setLed(false);
delay(100);
setLed(true);
delay(100);
setLed(false);
doublepressed = millis();
}
#endif

View File

@@ -1,33 +0,0 @@
#ifdef USE_NEW_ESP32_BLUETOOTH
#pragma once
extern uint16_t fromNumValHandle;
class BluetoothPhoneAPI : public PhoneAPI
{
protected:
/**
* Subclasses can use this as a hook to provide custom notifications for their transport (i.e. bluetooth notifies)
*/
virtual void onNowHasData(uint32_t fromRadioNum) override;
/// Check the current underlying physical link to see if the client is currently connected
virtual bool checkIsConnected() override;
};
extern PhoneAPI *bluetoothPhoneAPI;
class ESP32Bluetooth
{
public:
void setup();
void shutdown();
void clearBonds();
};
void setBluetoothEnable(bool on);
void clearNVS();
void disablePin();
#endif

View File

@@ -1,73 +0,0 @@
#ifndef USE_NEW_ESP32_BLUETOOTH
#include "BluetoothSoftwareUpdate.h"
// NRF52 wants these constants as byte arrays
// Generated here https://yupana-engineering.com/online-uuid-to-c-array-converter - but in REVERSE BYTE ORDER
// "cb0b9a0b-a84c-4c0d-bdbb-442e3144ee30"
const ble_uuid128_t update_service_uuid =
BLE_UUID128_INIT(0x30, 0xee, 0x44, 0x31, 0x2e, 0x44, 0xbb, 0xbd, 0x0d, 0x4c, 0x4c, 0xa8, 0x0b, 0x9a, 0x0b, 0xcb);
// "e74dd9c0-a301-4a6f-95a1-f0e1dbea8e1e" write|read
const ble_uuid128_t update_size_uuid =
BLE_UUID128_INIT(0x1e, 0x8e, 0xea, 0xdb, 0xe1, 0xf0, 0xa1, 0x95, 0x6f, 0x4a, 0x01, 0xa3, 0xc0, 0xd9, 0x4d, 0xe7);
// "e272ebac-d463-4b98-bc84-5cc1a39ee517" write
const ble_uuid128_t update_data_uuid =
BLE_UUID128_INIT(0x17, 0xe5, 0x9e, 0xa3, 0xc1, 0x5c, 0x84, 0xbc, 0x98, 0x4b, 0x63, 0xd4, 0xac, 0xeb, 0x72, 0xe2);
// "4826129c-c22a-43a3-b066-ce8f0d5bacc6" write
const ble_uuid128_t update_crc32_uuid =
BLE_UUID128_INIT(0xc6, 0xac, 0x5b, 0x0d, 0x8f, 0xce, 0x66, 0xb0, 0xa3, 0x43, 0x2a, 0xc2, 0x9c, 0x12, 0x26, 0x48);
// "5e134862-7411-4424-ac4a-210937432c77" read|notify
const ble_uuid128_t update_result_uuid =
BLE_UUID128_INIT(0x77, 0x2c, 0x43, 0x37, 0x09, 0x21, 0x4a, 0xac, 0x24, 0x44, 0x11, 0x74, 0x62, 0x48, 0x13, 0x5e);
// "5e134862-7411-4424-ac4a-210937432c67" write
const ble_uuid128_t update_region_uuid =
BLE_UUID128_INIT(0x67, 0x2c, 0x43, 0x37, 0x09, 0x21, 0x4a, 0xac, 0x24, 0x44, 0x11, 0x74, 0x62, 0x48, 0x13, 0x5e);
const struct ble_gatt_svc_def gatt_update_svcs[] = {
{
/*** Service: Security test. */
.type = BLE_GATT_SVC_TYPE_PRIMARY,
.uuid = &update_service_uuid.u,
.characteristics =
(struct ble_gatt_chr_def[]){{
.uuid = &update_size_uuid.u,
.access_cb = update_size_callback,
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_WRITE_AUTHEN | BLE_GATT_CHR_F_READ |
BLE_GATT_CHR_F_READ_AUTHEN,
},
{
.uuid = &update_data_uuid.u,
.access_cb = update_data_callback,
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_WRITE_AUTHEN,
},
{
.uuid = &update_crc32_uuid.u,
.access_cb = update_crc32_callback,
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_WRITE_AUTHEN,
},
{
.uuid = &update_result_uuid.u,
.access_cb = update_result_callback,
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_READ_AUTHEN | BLE_GATT_CHR_F_NOTIFY,
},
{
.uuid = &update_region_uuid.u,
.access_cb = update_region_callback,
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_WRITE_AUTHEN,
},
{
0, /* No more characteristics in this service. */
}},
},
{
0, /* No more services. */
},
};
#endif //#ifndef USE_NEW_ESP32_BLUETOOTH

View File

@@ -59,32 +59,129 @@ bool GPS::getACK(uint8_t c, uint8_t i) {
}
}
/**
* @brief
* @note New method, this method can wait for the specified class and message ID, and return the payload
* @param *buffer: The message buffer, if there is a response payload message, it will be returned through the buffer parameter
* @param size: size of buffer
* @param requestedClass: request class constant
* @param requestedID: request message ID constant
* @retval length of payload message
*/
int GPS::getAck(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t requestedID)
{
uint16_t ubxFrameCounter = 0;
uint32_t startTime = millis();
uint16_t needRead;
while (millis() - startTime < 800) {
while (_serial_gps->available()) {
int c = _serial_gps->read();
switch (ubxFrameCounter) {
case 0:
//ubxFrame 'μ'
if (c == 0xB5) {
ubxFrameCounter++;
}
break;
case 1:
//ubxFrame 'b'
if (c == 0x62) {
ubxFrameCounter++;
} else {
ubxFrameCounter = 0;
}
break;
case 2:
//Class
if (c == requestedClass) {
ubxFrameCounter++;
} else {
ubxFrameCounter = 0;
}
break;
case 3:
//Message ID
if (c == requestedID) {
ubxFrameCounter++;
} else {
ubxFrameCounter = 0;
}
break;
case 4:
//Payload lenght lsb
needRead = c;
ubxFrameCounter++;
break;
case 5:
//Payload lenght msb
needRead |= (c << 8);
ubxFrameCounter++;
break;
case 6:
// Check for buffer overflow
if (needRead >= size) {
ubxFrameCounter = 0;
break;
}
if (_serial_gps->readBytes(buffer, needRead) != needRead) {
ubxFrameCounter = 0;
} else {
// return payload lenght
return needRead;
}
break;
default:
break;
}
}
}
return 0;
}
bool GPS::setupGPS()
{
if (_serial_gps && !didSerialInit) {
didSerialInit = true;
#ifdef ARCH_ESP32
// In esp32 framework, setRxBufferSize needs to be initialized before Serial
_serial_gps->setRxBufferSize(2048); // the default is 256
#endif
// if the overrides are not dialled in, set them from the board definitions, if they exist
#if defined(GPS_RX_PIN)
if (!config.position.rx_gpio)
config.position.rx_gpio = GPS_RX_PIN;
#endif
#if defined(GPS_TX_PIN)
if (!config.position.tx_gpio)
config.position.tx_gpio = GPS_TX_PIN;
#endif
// ESP32 has a special set of parameters vs other arduino ports
#if defined(GPS_RX_PIN) && defined(ARCH_ESP32)
_serial_gps->begin(GPS_BAUDRATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
#if defined(ARCH_ESP32)
if(config.position.rx_gpio)
_serial_gps->begin(GPS_BAUDRATE, SERIAL_8N1, config.position.rx_gpio, config.position.tx_gpio);
#else
_serial_gps->begin(GPS_BAUDRATE);
#endif
#ifdef ARCH_ESP32
_serial_gps->setRxBufferSize(2048); // the default is 256
#endif
#ifdef TTGO_T_ECHO
// Switch to 9600 baud, then close and reopen port
_serial_gps->end();
delay(250);
_serial_gps->begin(4800);
delay(250);
_serial_gps->write("$PCAS01,1*1D\r\n");
delay(250);
_serial_gps->end();
delay(250);
_serial_gps->begin(9600);
delay(250);
/*
* T-Beam-S3-Core will be preset to use gps Probe here, and other boards will not be changed first
*/
gnssModel = probe();
if(gnssModel == GNSS_MODEL_MTK){
/*
* t-beam-s3-core uses the same L76K GNSS module as t-echo.
* Unlike t-echo, L76K uses 9600 baud rate for communication by default.
* */
// _serial_gps->begin(9600); //The baud rate of 9600 has been initialized at the beginning of setupGPS, this line is the redundant part
// delay(250);
// Initialize the L76K Chip, use GPS + GLONASS
_serial_gps->write("$PCAS04,5*1C\r\n");
delay(250);
@@ -94,9 +191,13 @@ bool GPS::setupGPS()
// Switch to Vehicle Mode, since SoftRF enables Aviation < 2g
_serial_gps->write("$PCAS11,3*1E\r\n");
delay(250);
#endif
#ifdef GPS_UBLOX
delay(250);
}else if(gnssModel == GNSS_MODEL_UBLOX){
/*
tips: NMEA Only should not be set here, otherwise initializing Ublox gnss module again after
setting will not output command messages in UART1, resulting in unrecognized module information
// Set the UART port to output NMEA only
byte _message_nmea[] = {0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC0, 0x08, 0x00, 0x00,
0x80, 0x25, 0x00, 0x00, 0x07, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0xAF};
@@ -105,6 +206,9 @@ bool GPS::setupGPS()
DEBUG_MSG("WARNING: Unable to enable NMEA Mode.\n");
return true;
}
*/
// ublox-M10S can be compatible with UBLOX traditional protocol, so the following sentence settings are also valid
// disable GGL
byte _message_GGL[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0xF0, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x05, 0x3A};
@@ -149,8 +253,10 @@ bool GPS::setupGPS()
// enable GGA
byte _message_GGA[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0xF0, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x38};
_serial_gps->write(_message_GGA, sizeof(_message_GGA));
if (!getACK(0x06, 0x01)) DEBUG_MSG("WARNING: Unable to enable NMEA GGA.\n");
#endif
if (!getACK(0x06, 0x01)) {
DEBUG_MSG("WARNING: Unable to enable NMEA GGA.\n");
}
}
}
return true;
@@ -164,21 +270,30 @@ bool GPS::setup()
pinMode(PIN_GPS_EN, OUTPUT);
#endif
#ifdef HAS_PMU
if(config.position.gps_enabled){
setGPSPower(true);
}
#endif
#ifdef PIN_GPS_RESET
digitalWrite(PIN_GPS_RESET, 1); // assert for 10ms
pinMode(PIN_GPS_RESET, OUTPUT);
delay(10);
digitalWrite(PIN_GPS_RESET, 0);
#endif
setAwake(true); // Wake GPS power before doing any init
bool ok = setupGPS();
if (ok) {
notifySleepObserver.observe(&notifySleep);
notifyDeepSleepObserver.observe(&notifyDeepSleep);
notifyGPSSleepObserver.observe(&notifyGPSSleep);
}
if (config.position.gps_enabled==false) {
setAwake(false);
doGPSpowersave(false);
}
return ok;
}
@@ -187,6 +302,7 @@ GPS::~GPS()
// we really should unregister our sleep observer
notifySleepObserver.unobserve(&notifySleep);
notifyDeepSleepObserver.unobserve(&notifyDeepSleep);
notifyGPSSleepObserver.observe(&notifyGPSSleep);
}
bool GPS::hasLock()
@@ -271,16 +387,7 @@ uint32_t GPS::getWakeTime() const
if (t == UINT32_MAX)
return t; // already maxint
if (t == 0)
t = (config.device.role == Config_DeviceConfig_Role_Router)
? 5 * 60
: 15 * 60; // Allow up to 15 mins for each attempt (probably will be much
// less if we can find sats) or less if a router
t *= 1000; // msecs
return t;
return t * 1000;
}
/** Get how long we should sleep between aqusition attempts in msecs
@@ -288,21 +395,15 @@ uint32_t GPS::getWakeTime() const
uint32_t GPS::getSleepTime() const
{
uint32_t t = config.position.gps_update_interval;
bool gps_disabled = config.position.gps_disabled;
bool gps_enabled = config.position.gps_enabled;
if (gps_disabled)
if (!gps_enabled)
t = UINT32_MAX; // Sleep forever now
if (t == UINT32_MAX)
return t; // already maxint
if (t == 0) // default - unset in preferences
t = (config.device.role == Config_DeviceConfig_Role_Router) ? 24 * 60 * 60
: 2 * 60; // 2 mins or once per day for routers
t *= 1000;
return t;
return t * 1000;
}
void GPS::publishUpdate()
@@ -311,10 +412,10 @@ void GPS::publishUpdate()
shouldPublish = false;
// In debug logs, identify position by @timestamp:stage (stage 2 = publish)
DEBUG_MSG("publishing pos@%x:2, hasVal=%d, GPSlock=%d\n", p.pos_timestamp, hasValidLocation, hasLock());
DEBUG_MSG("publishing pos@%x:2, hasVal=%d, GPSlock=%d\n", p.timestamp, hasValidLocation, hasLock());
// Notify any status instances that are observing us
const meshtastic::GPSStatus status = meshtastic::GPSStatus(hasValidLocation, isConnected(), p);
const meshtastic::GPSStatus status = meshtastic::GPSStatus(hasValidLocation, isConnected(), isPowerSaving(), p);
newStatus.notifyObservers(&status);
}
}
@@ -325,14 +426,14 @@ int32_t GPS::runOnce()
// if we have received valid NMEA claim we are connected
setConnected();
} else {
#ifdef GPS_UBLOX
if((config.position.gps_enabled == 1) && (gnssModel == GNSS_MODEL_UBLOX)){
// reset the GPS on next bootup
if(devicestate.did_gps_reset && (millis() > 60000) && !hasFlow()) {
DEBUG_MSG("GPS is not communicating, trying factory reset on next bootup.\n");
devicestate.did_gps_reset = false;
nodeDB.saveDeviceStateToDisk();
}
#endif
}
}
// If we are overdue for an update, turn on the GPS and at least publish the current status
@@ -427,11 +528,118 @@ int GPS::prepareDeepSleep(void *unused)
DEBUG_MSG("GPS deep sleep!\n");
// For deep sleep we also want abandon any lock attempts (because we want minimum power)
getSleepTime();
setAwake(false);
return 0;
}
GnssModel_t GPS::probe()
{
// return immediately if the model is set by the variant.h file
#ifdef GPS_UBLOX
return GNSS_MODEL_UBLOX;
#elif defined(GPS_L76K)
return GNSS_MODEL_MTK;
#else
// we use autodetect, only T-BEAM S3 for now...
uint8_t buffer[256];
/*
* The GNSS module information variable is temporarily placed inside the function body,
* if it needs to be used elsewhere, it can be moved to the outside
* */
struct uBloxGnssModelInfo info ;
memset(&info, 0, sizeof(struct uBloxGnssModelInfo));
// Close all NMEA sentences , Only valid for MTK platform
_serial_gps->write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(20);
// Get version information
_serial_gps->write("$PCAS06,0*1B\r\n");
uint32_t startTimeout = millis() + 500;
while (millis() < startTimeout) {
if (_serial_gps->available()) {
String ver = _serial_gps->readStringUntil('\r');
// Get module info , If the correct header is returned,
// it can be determined that it is the MTK chip
int index = ver.indexOf("$");
if(index != -1){
ver = ver.substring(index);
if (ver.startsWith("$GPTXT,01,01,02")) {
DEBUG_MSG("L76K GNSS init succeeded, using L76K GNSS Module\n");
return GNSS_MODEL_MTK;
}
}
}
}
uint8_t cfg_rate[] = {0xB5, 0x62, 0x06, 0x08, 0x00, 0x00, 0x0E, 0x30};
_serial_gps->write(cfg_rate, sizeof(cfg_rate));
// Check that the returned response class and message ID are correct
if (!getAck(buffer, 256, 0x06, 0x08)) {
DEBUG_MSG("Warning: Failed to find UBlox & MTK GNSS Module\n");
return GNSS_MODEL_UNKONW;
}
// Get Ublox gnss module hardware and software info
uint8_t cfg_get_hw[] = {0xB5, 0x62, 0x0A, 0x04, 0x00, 0x00, 0x0E, 0x34};
_serial_gps->write(cfg_get_hw, sizeof(cfg_get_hw));
uint16_t len = getAck(buffer, 256, 0x0A, 0x04);
if (len) {
uint16_t position = 0;
for (int i = 0; i < 30; i++) {
info.swVersion[i] = buffer[position];
position++;
}
for (int i = 0; i < 10; i++) {
info.hwVersion[i] = buffer[position];
position++;
}
while (len >= position + 30) {
for (int i = 0; i < 30; i++) {
info.extension[info.extensionNo][i] = buffer[position];
position++;
}
info.extensionNo++;
if (info.extensionNo > 9)
break;
}
DEBUG_MSG("Module Info : \n");
DEBUG_MSG("Soft version: %s\n",info.swVersion);
DEBUG_MSG("Hard version: %s\n",info.hwVersion);
DEBUG_MSG("Extensions:%d\n",info.extensionNo);
for (int i = 0; i < info.extensionNo; i++) {
DEBUG_MSG(" %s\n",info.extension[i]);
}
memset(buffer,0,sizeof(buffer));
//tips: extensionNo field is 0 on some 6M GNSS modules
for (int i = 0; i < info.extensionNo; ++i) {
if (!strncmp(info.extension[i], "OD=", 3)) {
strcpy((char *)buffer, &(info.extension[i][3]));
DEBUG_MSG("GetModel:%s\n",(char *)buffer);
}
}
}
if (strlen((char*)buffer)) {
DEBUG_MSG("UBlox GNSS init succeeded, using UBlox %s GNSS Module\n" , buffer);
}else{
DEBUG_MSG("UBlox GNSS init succeeded, using UBlox GNSS Module\n");
}
return GNSS_MODEL_UBLOX;
#endif
}
#if HAS_GPS
#include "NMEAGPS.h"
#endif
@@ -442,7 +650,7 @@ GPS *createGps()
#if !HAS_GPS
return nullptr;
#else
if (!config.position.gps_disabled) {
if (config.position.gps_enabled) {
#ifdef GPS_ALTITUDE_HAE
DEBUG_MSG("Using HAE altitude model\n");
#else
@@ -456,6 +664,11 @@ GPS *createGps()
return new_gps;
}
}
else{
GPS *new_gps = new NMEAGPS();
new_gps->setup();
return new_gps;
}
return nullptr;
#endif
}

View File

@@ -4,6 +4,20 @@
#include "Observer.h"
#include "concurrency/OSThread.h"
struct uBloxGnssModelInfo {
char swVersion[30];
char hwVersion[10];
uint8_t extensionNo;
char extension[10][30];
} ;
typedef enum{
GNSS_MODEL_MTK,
GNSS_MODEL_UBLOX,
GNSS_MODEL_UNKONW,
}GnssModel_t;
// Generate a string representation of DOP
const char *getDOPString(uint32_t dop);
@@ -35,6 +49,7 @@ class GPS : private concurrency::OSThread
CallbackObserver<GPS, void *> notifySleepObserver = CallbackObserver<GPS, void *>(this, &GPS::prepareSleep);
CallbackObserver<GPS, void *> notifyDeepSleepObserver = CallbackObserver<GPS, void *>(this, &GPS::prepareDeepSleep);
CallbackObserver<GPS, void *> notifyGPSSleepObserver = CallbackObserver<GPS, void *>(this, &GPS::prepareDeepSleep);
public:
/** If !NULL we will use this serial port to construct our GPS */
@@ -63,6 +78,8 @@ class GPS : private concurrency::OSThread
/// Return true if we are connected to a GPS
bool isConnected() const { return hasGPS; }
bool isPowerSaving() const { return !config.position.gps_enabled;}
/**
* Restart our lock attempt - try to get and broadcast a GPS reading ASAP
* called after the CPU wakes from light-sleep state
@@ -146,6 +163,14 @@ class GPS : private concurrency::OSThread
void publishUpdate();
virtual int32_t runOnce() override;
// Get GNSS model
GnssModel_t probe();
int getAck(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t requestedID);
protected:
GnssModel_t gnssModel = GNSS_MODEL_UNKONW;
};
// Creates an instance of the GPS class.

View File

@@ -19,14 +19,21 @@ static int32_t toDegInt(RawDegrees d)
bool NMEAGPS::factoryReset()
{
#ifdef GPS_UBLOX
#ifdef PIN_GPS_REINIT
//The L76K GNSS on the T-Echo requires the RESET pin to be pulled LOW
digitalWrite(PIN_GPS_REINIT, 0);
pinMode(PIN_GPS_REINIT, OUTPUT);
delay(150); //The L76K datasheet calls for at least 100MS delay
digitalWrite(PIN_GPS_REINIT, 1);
#endif
// send the UBLOX Factory Reset Command regardless of detect state, something is very wrong, just assume it's UBLOX.
// Factory Reset
byte _message_reset[] = {0xB5, 0x62, 0x06, 0x09, 0x0D, 0x00, 0xFF,
0xFB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0x00, 0x00, 0x17, 0x2B, 0x7E};
_serial_gps->write(_message_reset,sizeof(_message_reset));
delay(1000);
#endif
return true;
}
@@ -102,7 +109,7 @@ bool NMEAGPS::lookForLocation()
#ifndef TINYGPS_OPTION_NO_CUSTOM_FIELDS
fixType = atoi(gsafixtype.value()); // will set to zero if no data
DEBUG_MSG("FIX QUAL=%d, TYPE=%d\n", fixQual, fixType);
// DEBUG_MSG("FIX QUAL=%d, TYPE=%d\n", fixQual, fixType);
#endif
// check if GPS has an acceptable lock
@@ -155,13 +162,13 @@ bool NMEAGPS::lookForLocation()
return false;
}
p.location_source = Position_LocSource_LOCSRC_GPS_INTERNAL;
p.location_source = Position_LocSource_LOC_INTERNAL;
// Dilution of precision (an accuracy metric) is reported in 10^2 units, so we need to scale down when we use it
#ifndef TINYGPS_OPTION_NO_CUSTOM_FIELDS
p.HDOP = reader.hdop.value();
p.PDOP = TinyGPSPlus::parseDecimal(gsapdop.value());
DEBUG_MSG("PDOP=%d, HDOP=%d\n", dop, reader.hdop.value());
// DEBUG_MSG("PDOP=%d, HDOP=%d\n", p.PDOP, p.HDOP);
#else
// FIXME! naive PDOP emulation (assumes VDOP==HDOP)
// correct formula is PDOP = SQRT(HDOP^2 + VDOP^2)
@@ -176,8 +183,8 @@ bool NMEAGPS::lookForLocation()
p.latitude_i = toDegInt(loc.lat);
p.longitude_i = toDegInt(loc.lng);
p.alt_geoid_sep = reader.geoidHeight.meters();
p.altitude_hae = reader.altitude.meters() + p.alt_geoid_sep;
p.altitude_geoidal_separation = reader.geoidHeight.meters();
p.altitude_hae = reader.altitude.meters() + p.altitude_geoidal_separation;
p.altitude = reader.altitude.meters();
p.fix_quality = fixQual;
@@ -194,7 +201,7 @@ bool NMEAGPS::lookForLocation()
t.tm_mon = reader.date.month() - 1;
t.tm_year = reader.date.year() - 1900;
t.tm_isdst = false;
p.pos_timestamp = mktime(&t);
p.timestamp = mktime(&t);
// Nice to have, if available
if (reader.satellites.isUpdated()) {
@@ -210,13 +217,10 @@ bool NMEAGPS::lookForLocation()
}
}
/*
// REDUNDANT?
// expect gps pos lat=37.520825, lon=-122.309162, alt=158
DEBUG_MSG("new NMEA GPS pos lat=%f, lon=%f, alt=%d, dop=%g, heading=%f\n",
latitude * 1e-7, longitude * 1e-7, altitude, dop * 1e-2,
heading * 1e-5);
*/
if (reader.speed.isUpdated() && reader.speed.isValid()) {
p.ground_speed = reader.speed.kmph();
}
return true;
}

90
src/gps/NMEAWPL.cpp Normal file
View File

@@ -0,0 +1,90 @@
#include "NMEAWPL.h"
#include "GeoCoord.h"
/* -------------------------------------------
* 1 2 3 4 5 6
* | | | | | |
* $--WPL,llll.ll,a,yyyyy.yy,a,c--c*hh<CR><LF>
*
* Field Number:
* 1 Latitude
* 2 N or S (North or South)
* 3 Longitude
* 4 E or W (East or West)
* 5 Waypoint name
* 6 Checksum
* -------------------------------------------
*/
uint32_t printWPL(char *buf, const Position &pos, const char *name)
{
GeoCoord geoCoord(pos.latitude_i,pos.longitude_i,pos.altitude);
uint32_t len = sprintf(buf, "$GNWPL,%02d%07.4f,%c,%03d%07.4f,%c,%s",
geoCoord.getDMSLatDeg(),
(abs(geoCoord.getLatitude()) - geoCoord.getDMSLatDeg() * 1e+7) * 6e-6,
geoCoord.getDMSLatCP(),
geoCoord.getDMSLonDeg(),
(abs(geoCoord.getLongitude()) - geoCoord.getDMSLonDeg() * 1e+7) * 6e-6,
geoCoord.getDMSLonCP(),
name);
uint32_t chk = 0;
for (uint32_t i = 1; i < len; i++) {
chk ^= buf[i];
}
len += sprintf(buf + len, "*%02X\r\n", chk);
return len;
}
/* -------------------------------------------
* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* | | | | | | | | | | | | | | |
* $--GGA,hhmmss.ss,ddmm.mm,a,ddmm.mm,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh<CR><LF>
*
* Field Number:
* 1 UTC of this position report, hh is hours, mm is minutes, ss.ss is seconds.
* 2 Latitude
* 3 N or S (North or South)
* 4 Longitude
* 5 E or W (East or West)
* 6 GPS Quality Indicator (non null)
* 7 Number of satellites in use, 00 - 12
* 8 Horizontal Dilution of precision (meters)
* 9 Antenna Altitude above/below mean-sea-level (geoid) (in meters)
* 10 Units of antenna altitude, meters
* 11 Geoidal separation, the difference between the WGS-84 earth ellipsoid and mean-sea-level (geoid), "-" means mean-sea-level below ellipsoid
* 12 Units of geoidal separation, meters
* 13 Age of differential GPS data, time in seconds since last SC104 type 1 or 9 update, null field when DGPS is not used
* 14 Differential reference station ID, 0000-1023
* 15 Checksum
* -------------------------------------------
*/
uint32_t printGGA(char *buf, const Position &pos)
{
GeoCoord geoCoord(pos.latitude_i,pos.longitude_i,pos.altitude);
uint32_t len = sprintf(buf, "$GNGGA,%06u.%03u,%02d%07.4f,%c,%03d%07.4f,%c,%u,%02u,%04u,%04d,%c,%04d,%c,%d,%04d",
pos.time / 1000,
pos.time % 1000,
geoCoord.getDMSLatDeg(),
(abs(geoCoord.getLatitude()) - geoCoord.getDMSLatDeg() * 1e+7) * 6e-6,
geoCoord.getDMSLatCP(),
geoCoord.getDMSLonDeg(),
(abs(geoCoord.getLongitude()) - geoCoord.getDMSLonDeg() * 1e+7) * 6e-6,
geoCoord.getDMSLonCP(),
pos.fix_type,
pos.sats_in_view,
pos.HDOP,
geoCoord.getAltitude(),
'M',
pos.altitude_geoidal_separation,
'M',
0,
0);
uint32_t chk = 0;
for (uint32_t i = 1; i < len; i++) {
chk ^= buf[i];
}
len += sprintf(buf + len, "*%02X\r\n", chk);
return len;
}

7
src/gps/NMEAWPL.h Normal file
View File

@@ -0,0 +1,7 @@
#pragma once
#include <Arduino.h>
#include "main.h"
uint32_t printWPL(char *buf, const Position &pos, const char *name);
uint32_t printGGA(char *buf, const Position &pos);

View File

@@ -44,11 +44,15 @@ void readFromRTC()
if(rtc_found == PCF8563_RTC) {
uint32_t now = millis();
PCF8563_Class rtc;
#ifdef RTC_USE_WIRE1
rtc.begin(Wire1);
#else
rtc.begin();
#endif
auto tc = rtc.getDateTime();
tm t;
t.tm_year = tc.year;
t.tm_mon = tc.month;
t.tm_year = tc.year - 1900;
t.tm_mon = tc.month - 1;
t.tm_mday = tc.day;
t.tm_hour = tc.hour;
t.tm_min = tc.minute;
@@ -110,9 +114,13 @@ bool perhapsSetRTC(RTCQuality q, const struct timeval *tv)
#elif defined(PCF8563_RTC)
if(rtc_found == PCF8563_RTC) {
PCF8563_Class rtc;
#ifdef RTC_USE_WIRE1
rtc.begin(Wire1);
#else
rtc.begin();
#endif
tm *t = localtime(&tv->tv_sec);
rtc.setDateTime(t->tm_year + 1900, t->tm_mon + 1, t->tm_wday, t->tm_hour, t->tm_min, t->tm_sec);
rtc.setDateTime(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
DEBUG_MSG("PCF8563_RTC setDateTime %02d-%02d-%02d %02d:%02d:%02d %ld\n", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, tv->tv_sec);
}
#elif defined(ARCH_ESP32)

View File

@@ -16,7 +16,7 @@ enum RTCQuality {
RTCQualityFromNet = 2,
/// Our time is based on NTP
RTCQualityNTP= 3,
RTCQualityNTP = 3,
/// Our time is based on our own GPS
RTCQualityGPS = 4

View File

@@ -14,8 +14,8 @@
#define TECHO_DISPLAY_MODEL GxEPD2_154_D67
#elif defined(RAK4630)
//GxEPD2_213_B74 - RAK14000 2.13 inch b/w 250x128
#define TECHO_DISPLAY_MODEL GxEPD2_213_B74
//GxEPD2_213_BN - RAK14000 2.13 inch b/w 250x122 - changed from GxEPD2_213_B74 - which was not going to give partial update support
#define TECHO_DISPLAY_MODEL GxEPD2_213_BN
//4.2 inch 300x400 - GxEPD2_420_M01
//#define TECHO_DISPLAY_MODEL GxEPD2_420_M01
@@ -46,7 +46,7 @@ EInkDisplay::EInkDisplay(uint8_t address, int sda, int scl)
setGeometry(GEOMETRY_RAWMODE, TECHO_DISPLAY_MODEL::WIDTH, TECHO_DISPLAY_MODEL::HEIGHT);
#elif defined(RAK4630)
//GxEPD2_213_B74 - RAK14000 2.13 inch b/w 250x128
//GxEPD2_213_BN - RAK14000 2.13 inch b/w 250x122
setGeometry(GEOMETRY_RAWMODE, 250, 122);
//GxEPD2_420_M01
@@ -110,14 +110,17 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit)
adafruitDisplay->display(false); // FIXME, use partial update mode
#elif defined(RAK4630)
//RAK14000 2.13 inch b/w 250x122 does not support partial updates
adafruitDisplay->display(false); // FIXME, use partial update mode
//RAK14000 2.13 inch b/w 250x122 actually now does support partial updates
//Full update mode (slow)
//adafruitDisplay->display(false); // FIXME, use partial update mode
//Only enable for e-Paper with support for partial updates and comment out above adafruitDisplay->display(false);
// 1.54 inch 200x200 - GxEPD2_154_M09
// 2.13 inch 250x122 - GxEPD2_213_BN
// 2.9 inch 296x128 - GxEPD2_290_T5D
// 4.2 inch 300x400 - GxEPD2_420_M01
//adafruitDisplay->nextPage();
adafruitDisplay->nextPage();
#elif defined(PCA10059) || defined(M5_COREINK)
adafruitDisplay->nextPage();
@@ -190,11 +193,11 @@ bool EInkDisplay::connect()
adafruitDisplay->init(115200, true, 10, false, SPI1, SPISettings(4000000, MSBFIRST, SPI_MODE0));
//RAK14000 2.13 inch b/w 250x122 does not support partial updates
//RAK14000 2.13 inch b/w 250x122 does actually now support partial updates
adafruitDisplay->setRotation(3);
//For 1.54, 2.9 and 4.2
//Partial update support for 1.54, 2.13 RAK14000 b/w , 2.9 and 4.2
//adafruitDisplay->setRotation(1);
//adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight);
adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight);
} else {
(void)adafruitDisplay;
}

View File

@@ -35,6 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "mesh/Channels.h"
#include "mesh/generated/deviceonly.pb.h"
#include "modules/TextMessageModule.h"
#include "modules/ExternalNotificationModule.h"
#include "sleep.h"
#include "target_specific.h"
#include "utils.h"
@@ -42,18 +43,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef ARCH_ESP32
#include "esp_task_wdt.h"
#include "mesh/http/WiFiAPClient.h"
#include "modules/esp32/StoreForwardModule.h"
#endif
#ifdef OLED_RU
#include "fonts/OLEDDisplayFontsRU.h"
#endif
using namespace meshtastic; /** @todo remove */
extern bool loadProto(const char *filename, size_t protoSize, size_t objSize, const pb_msgdesc_t *fields, void *dest_struct);
namespace graphics
{
// This means the *visible* area (sh1106 can address 132, but shows 128 for example)
#define IDLE_FRAMERATE 1 // in fps
#define COMPASS_DIAM 44
// DEBUG
#define NUM_EXTRA_FRAMES 3 // text message and debug frame
@@ -65,10 +68,7 @@ static FrameCallback normalFrames[MAX_NUM_NODES + NUM_EXTRA_FRAMES];
static uint32_t targetFramerate = IDLE_FRAMERATE;
static char btPIN[16] = "888888";
// This defines the layout of the compass.
// If true, North with remain static at the top of the compass.
// If false, your current heading is static at the top of the compass.
bool compassNorthTop = false;
uint32_t logo_timeout = 5000; // 4 seconds for EACH logo
// This image definition is here instead of images.h because it's modified dynamically by the drawBattery function
uint8_t imgBattery[16] = {0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xE7, 0x3C};
@@ -86,10 +86,6 @@ static char ourId[5];
// GeoCoord object for the screen
GeoCoord geoCoord;
// OEM Config File
static const char *oemConfigFile = "/prefs/oem.proto";
OEMStore oemStore;
#ifdef SHOW_REDRAWS
static bool heartbeat = false;
#endif
@@ -99,27 +95,29 @@ static uint16_t displayWidth, displayHeight;
#define SCREEN_WIDTH displayWidth
#define SCREEN_HEIGHT displayHeight
#if defined(USE_EINK) || defined(ILI9341_DRIVER)
#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS)
// The screen is bigger so use bigger fonts
#define FONT_SMALL ArialMT_Plain_16
#define FONT_MEDIUM ArialMT_Plain_24
#define FONT_LARGE ArialMT_Plain_24
#define FONT_SMALL ArialMT_Plain_16 // Height: 19
#define FONT_MEDIUM ArialMT_Plain_24 // Height: 28
#define FONT_LARGE ArialMT_Plain_24 // Height: 28
#else
#define FONT_SMALL ArialMT_Plain_10
#define FONT_MEDIUM ArialMT_Plain_16
#define FONT_LARGE ArialMT_Plain_24
#ifdef OLED_RU
#define FONT_SMALL ArialMT_Plain_10_RU
#else
#define FONT_SMALL ArialMT_Plain_10 // Height: 13
#endif
#define FONT_MEDIUM ArialMT_Plain_16 // Height: 19
#define FONT_LARGE ArialMT_Plain_24 // Height: 28
#endif
#define fontHeight(font) ((font)[1] + 1) // height is position 1
#define FONT_HEIGHT_SMALL fontHeight(FONT_SMALL)
#define FONT_HEIGHT_MEDIUM fontHeight(FONT_MEDIUM)
#define FONT_HEIGHT_LARGE fontHeight(FONT_LARGE)
#define getStringCenteredX(s) ((SCREEN_WIDTH - display->getStringWidth(s)) / 2)
#ifndef SCREEN_TRANSITION_MSECS
#define SCREEN_TRANSITION_MSECS 300
#endif
/**
* Draw the icon with extra info printed around the corners
@@ -233,26 +231,17 @@ static void drawSSLScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16
// Used when booting without a region set
static void drawWelcomeScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
if ((millis() / 10000) % 2) {
display->setFont(FONT_SMALL);
display->setTextAlignment(TEXT_ALIGN_CENTER);
display->drawString(64 + x, y, "//\\ E S H T /\\ S T / C");
display->drawString(64 + x, y + FONT_HEIGHT_SMALL, getDeviceName());
display->setTextAlignment(TEXT_ALIGN_LEFT);
if ((millis() / 10000) % 2) {
display->drawString(x, y + FONT_HEIGHT_SMALL * 2 - 3, "Set the region using the");
display->drawString(x, y + FONT_HEIGHT_SMALL * 3 - 3, "Meshtastic Android, iOS,");
display->drawString(x, y + FONT_HEIGHT_SMALL * 4 - 3, "Flasher or CLI client.");
} else {
display->setFont(FONT_SMALL);
display->setTextAlignment(TEXT_ALIGN_CENTER);
display->drawString(64 + x, y, "//\\ E S H T /\\ S T / C");
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->drawString(x, y + FONT_HEIGHT_SMALL * 2 - 3, "Visit meshtastic.org");
display->drawString(x, y + FONT_HEIGHT_SMALL * 3 - 3, "for more information.");
display->drawString(x, y + FONT_HEIGHT_SMALL * 4 - 3, "");
@@ -296,22 +285,27 @@ static void drawModuleFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int
static void drawFrameBluetooth(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
int x_offset = display->width() / 2;
int y_offset = display->height() == 64 ? 0 : 32;
display->setTextAlignment(TEXT_ALIGN_CENTER);
display->setFont(FONT_MEDIUM);
display->drawString(64 + x, y, "Bluetooth");
display->drawString(x_offset + x, y_offset + y, "Bluetooth");
display->setFont(FONT_SMALL);
display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Enter this code");
y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_MEDIUM -4 : y_offset + FONT_HEIGHT_MEDIUM + 5;
display->drawString(x_offset + x, y_offset + y, "Enter this code");
display->setFont(FONT_LARGE);
display->drawString(64 + x, 26 + y, btPIN);
String displayPin(btPIN);
String pin = displayPin.substring(0, 3) + " " + displayPin.substring(3, 6);
y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_SMALL - 5 : y_offset + FONT_HEIGHT_SMALL + 5;
display->drawString(x_offset + x, y_offset + y, pin);
display->setFont(FONT_SMALL);
char buf[30];
const char *name = "Name: ";
strcpy(buf, name);
strcat(buf, getDeviceName());
display->drawString(64 + x, 48 + y, buf);
String deviceName = "Name: ";
deviceName.concat(getDeviceName());
y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_LARGE - 6 : y_offset + FONT_HEIGHT_LARGE + 5;
display->drawString(x_offset + x, y_offset + y, deviceName);
}
static void drawFrameShutdown(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
@@ -322,6 +316,14 @@ static void drawFrameShutdown(OLEDDisplay *display, OLEDDisplayUiState *state, i
display->drawString(64 + x, 26 + y, "Shutting down...");
}
static void drawFrameReboot(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
display->setTextAlignment(TEXT_ALIGN_CENTER);
display->setFont(FONT_MEDIUM);
display->drawString(64 + x, 26 + y, "Rebooting...");
}
static void drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
display->setTextAlignment(TEXT_ALIGN_CENTER);
@@ -329,14 +331,8 @@ static void drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUiState *state, i
display->drawString(64 + x, y, "Updating");
display->setFont(FONT_SMALL);
if ((millis() / 1000) % 2) {
display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait . . .");
} else {
display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait . . ");
}
// display->setFont(FONT_LARGE);
// display->drawString(64 + x, 26 + y, btPIN);
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->drawStringMaxWidth(0 + x, 2 + y + FONT_HEIGHT_SMALL *2, x + display->getWidth(), "Please be patient and do not power off.");
}
/// Draw the last text message we received
@@ -367,6 +363,9 @@ static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state
{
displayedNodeNum = 0; // Not currently showing a node pane
// the max length of this buffer is much longer than we can possibly print
static char tempBuf[237];
MeshPacket &mp = devicestate.rx_text_message;
NodeInfo *node = nodeDB.getNode(getFrom(&mp));
// DEBUG_MSG("drawing text message from 0x%x: %s\n", mp.from,
@@ -376,16 +375,14 @@ static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state
// with the third parameter you can define the width after which words will
// be wrapped. Currently only spaces and "-" are allowed for wrapping
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->setFont(FONT_MEDIUM);
String sender = (node && node->has_user) ? node->user.short_name : "???";
display->drawString(0 + x, 0 + y, sender);
display->setFont(FONT_SMALL);
// the max length of this buffer is much longer than we can possibly print
static char tempBuf[96];
snprintf(tempBuf, sizeof(tempBuf), " %s", mp.decoded.payload.bytes);
display->drawStringMaxWidth(4 + x, 10 + y, SCREEN_WIDTH - (6 + x), tempBuf);
display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL);
display->setColor(BLACK);
display->drawStringf(0 + x, 0 + y, tempBuf, "From: %s", (node && node->has_user) ? node->user.short_name : "???");
display->drawStringf(1 + x, 0 + y, tempBuf, "From: %s", (node && node->has_user) ? node->user.short_name : "???");
display->setColor(WHITE);
snprintf(tempBuf, sizeof(tempBuf), "%s", mp.decoded.payload.bytes);
display->drawStringMaxWidth(0 + x, 0 + y + FONT_HEIGHT_SMALL, x + display->getWidth(), tempBuf);
}
/// Draw a series of fields in a column, wrapping to multiple colums if needed
@@ -398,6 +395,10 @@ static void drawColumns(OLEDDisplay *display, int16_t x, int16_t y, const char *
int xo = x, yo = y;
while (*f) {
display->drawString(xo, yo, *f);
if (display->getColor() == BLACK)
display->drawString(xo + 1, yo, *f);
display->setColor(WHITE);
yo += FONT_HEIGHT_SMALL;
if (yo > SCREEN_HEIGHT - FONT_HEIGHT_SMALL) {
xo += SCREEN_WIDTH / 2;
@@ -466,8 +467,13 @@ static void drawNodes(OLEDDisplay *display, int16_t x, int16_t y, NodeStatus *no
{
char usersString[20];
sprintf(usersString, "%d/%d", nodeStatus->getNumOnline(), nodeStatus->getNumTotal());
#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS)
display->drawFastImage(x, y + 3, 8, 8, imgUser);
#else
display->drawFastImage(x, y, 8, 8, imgUser);
#endif
display->drawString(x + 10, y - 2, usersString);
display->drawString(x + 11, y - 2, usersString);
}
// Draw GPS status summary
@@ -476,15 +482,18 @@ static void drawGPS(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus
if (config.position.fixed_position) {
// GPS coordinates are currently fixed
display->drawString(x - 1, y - 2, "Fixed GPS");
display->drawString(x, y - 2, "Fixed GPS");
return;
}
if (!gps->getIsConnected()) {
display->drawString(x, y - 2, "No GPS");
display->drawString(x + 1, y - 2, "No GPS");
return;
}
display->drawFastImage(x, y, 6, 8, gps->getHasLock() ? imgPositionSolid : imgPositionEmpty);
if (!gps->getHasLock()) {
display->drawString(x + 8, y - 2, "No sats");
display->drawString(x + 9, y - 2, "No sats");
return;
} else {
char satsString[3];
@@ -509,6 +518,23 @@ static void drawGPS(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus
}
}
//Draw status when gps is disabled by PMU
static void drawGPSpowerstat(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus *gps)
{
#ifdef HAS_PMU
String displayLine = "GPS disabled";
int16_t xPos = display->getStringWidth(displayLine);
if (!config.position.gps_enabled){
display->drawString(x + xPos, y, displayLine);
#ifdef GPS_POWER_TOGGLE
display->drawString(x + xPos, y - 2 + FONT_HEIGHT_SMALL, " by button");
#endif
//display->drawString(x + xPos, y + 2, displayLine);
}
#endif
}
static void drawGPSAltitude(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus *gps)
{
String displayLine = "";
@@ -521,6 +547,8 @@ static void drawGPSAltitude(OLEDDisplay *display, int16_t x, int16_t y, const GP
} else {
geoCoord.updateCoords(int32_t(gps->getLatitude()), int32_t(gps->getLongitude()), int32_t(gps->getAltitude()));
displayLine = "Altitude: " + String(geoCoord.getAltitude()) + "m";
if (config.display.units == Config_DisplayConfig_DisplayUnits_IMPERIAL)
displayLine = "Altitude: " + String(geoCoord.getAltitude() * METERS_TO_FEET) + "ft";
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine);
}
}
@@ -539,21 +567,22 @@ static void drawGPScoordinates(OLEDDisplay *display, int16_t x, int16_t y, const
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine);
} else {
if (gpsFormat != Config_DisplayConfig_GpsCoordinateFormat_GpsFormatDMS) {
char coordinateLine[22];
geoCoord.updateCoords(int32_t(gps->getLatitude()), int32_t(gps->getLongitude()), int32_t(gps->getAltitude()));
if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_GpsFormatDec) { // Decimal Degrees
if (gpsFormat != Config_DisplayConfig_GpsCoordinateFormat_DMS) {
char coordinateLine[22];
if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_DEC) { // Decimal Degrees
sprintf(coordinateLine, "%f %f", geoCoord.getLatitude() * 1e-7, geoCoord.getLongitude() * 1e-7);
} else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_GpsFormatUTM) { // Universal Transverse Mercator
} else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_UTM) { // Universal Transverse Mercator
sprintf(coordinateLine, "%2i%1c %06u %07u", geoCoord.getUTMZone(), geoCoord.getUTMBand(),
geoCoord.getUTMEasting(), geoCoord.getUTMNorthing());
} else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_GpsFormatMGRS) { // Military Grid Reference System
} else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_MGRS) { // Military Grid Reference System
sprintf(coordinateLine, "%2i%1c %1c%1c %05u %05u", geoCoord.getMGRSZone(), geoCoord.getMGRSBand(),
geoCoord.getMGRSEast100k(), geoCoord.getMGRSNorth100k(), geoCoord.getMGRSEasting(),
geoCoord.getMGRSNorthing());
} else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_GpsFormatOLC) { // Open Location Code
} else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_OLC) { // Open Location Code
geoCoord.getOLCCode(coordinateLine);
} else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_GpsFormatOSGR) { // Ordnance Survey Grid Reference
} else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_OSGR) { // Ordnance Survey Grid Reference
if (geoCoord.getOSGRE100k() == 'I' || geoCoord.getOSGRN100k() == 'I') // OSGR is only valid around the UK region
sprintf(coordinateLine, "%s", "Out of Boundary");
else
@@ -665,6 +694,26 @@ static bool hasPosition(NodeInfo *n)
return n->has_position && (n->position.latitude_i != 0 || n->position.longitude_i != 0);
}
static uint16_t getCompassDiam(OLEDDisplay *display)
{
uint16_t diam = 0;
// get the smaller of the 2 dimensions and subtract 20
if(display->getWidth() > (display->getHeight() - FONT_HEIGHT_SMALL)) {
diam = display->getHeight() - FONT_HEIGHT_SMALL;
// if 2/3 of the other size would be smaller, use that
if (diam > (display->getWidth() * 2 / 3)) {
diam = display->getWidth() * 2 / 3;
}
} else {
diam = display->getWidth();
if (diam > ((display->getHeight() - FONT_HEIGHT_SMALL) * 2 / 3)) {
diam = (display->getHeight() - FONT_HEIGHT_SMALL) * 2 / 3;
}
}
return diam - 20;
};
/// We will skip one node - the one for us, so we just blindly loop over all
/// nodes
static size_t nodeIndex;
@@ -681,7 +730,7 @@ static void drawNodeHeading(OLEDDisplay *display, int16_t compassX, int16_t comp
for (int i = 0; i < 4; i++) {
arrowPoints[i]->rotate(headingRadian);
arrowPoints[i]->scale(COMPASS_DIAM * 0.6);
arrowPoints[i]->scale(getCompassDiam(display) * 0.6);
arrowPoints[i]->translate(compassX, compassY);
}
drawLine(display, tip, tail);
@@ -693,7 +742,7 @@ static void drawNodeHeading(OLEDDisplay *display, int16_t compassX, int16_t comp
static void drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t compassY, float myHeading)
{
//If north is supposed to be at the top of the compass we want rotation to be +0
if(compassNorthTop)
if(config.display.compass_north_top)
myHeading = -0;
Point N1(-0.04f, 0.65f), N2(0.04f, 0.65f);
@@ -703,7 +752,7 @@ static void drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t com
for (int i = 0; i < 4; i++) {
// North on compass will be negative of heading
rosePoints[i]->rotate(-myHeading);
rosePoints[i]->scale(COMPASS_DIAM);
rosePoints[i]->scale(getCompassDiam(display));
rosePoints[i]->translate(compassX, compassY);
}
drawLine(display, N1, N3);
@@ -738,6 +787,8 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
// The coordinates define the left starting point of the text
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL);
const char *username = node->has_user ? node->user.long_name : "Unknown Name";
static char signalStr[20];
@@ -768,7 +819,7 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
const char *fields[] = {username, distStr, signalStr, lastStr, NULL};
// coordinates for the center of the compass/circle
int16_t compassX = x + SCREEN_WIDTH - COMPASS_DIAM / 2 - 5, compassY = y + SCREEN_HEIGHT / 2;
int16_t compassX = x + SCREEN_WIDTH - getCompassDiam(display) / 2 - 5, compassY = y + FONT_HEIGHT_SMALL + (SCREEN_HEIGHT - FONT_HEIGHT_SMALL) / 2;
bool hasNodeHeading = false;
if (ourNode && hasPosition(ourNode)) {
@@ -782,16 +833,24 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
Position &p = node->position;
float d =
GeoCoord::latLongToMeter(DegD(p.latitude_i), DegD(p.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i));
if (config.display.units == Config_DisplayConfig_DisplayUnits_IMPERIAL) {
if (d < (2 * MILES_TO_FEET))
snprintf(distStr, sizeof(distStr), "%.0f ft", d * METERS_TO_FEET);
else
snprintf(distStr, sizeof(distStr), "%.1f mi", d * METERS_TO_FEET / MILES_TO_FEET);
} else {
if (d < 2000)
snprintf(distStr, sizeof(distStr), "%.0f m", d);
else
snprintf(distStr, sizeof(distStr), "%.1f km", d / 1000);
}
float bearingToOther =
GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(p.latitude_i), DegD(p.longitude_i));
// If the top of the compass is a static north then bearingToOther can be drawn on the compass directly
// If the top of the compass is not a static north we need adjust bearingToOther based on heading
if(!compassNorthTop)
if(!config.display.compass_north_top)
bearingToOther -= myHeading;
drawNodeHeading(display, compassX, compassY, bearingToOther);
}
@@ -801,35 +860,13 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
// Debug info for gps lock errors
// DEBUG_MSG("ourNode %d, ourPos %d, theirPos %d\n", !!ourNode, ourNode && hasPosition(ourNode), hasPosition(node));
display->drawString(compassX - FONT_HEIGHT_SMALL / 4, compassY - FONT_HEIGHT_SMALL / 2, "?");
display->drawCircle(compassX, compassY, COMPASS_DIAM / 2);
display->drawCircle(compassX, compassY, getCompassDiam(display) / 2);
display->setColor(BLACK);
// Must be after distStr is populated
drawColumns(display, x, y, fields);
}
#if 0
void _screen_header()
{
if (!disp)
return;
// Message count
//snprintf(buffer, sizeof(buffer), "#%03d", ttn_get_count() % 1000);
//display->setTextAlignment(TEXT_ALIGN_LEFT);
//display->drawString(0, 2, buffer);
// Datetime
display->setTextAlignment(TEXT_ALIGN_CENTER);
display->drawString(display->getWidth()/2, 2, gps.getTimeStr());
// Satellite count
display->setTextAlignment(TEXT_ALIGN_RIGHT);
char buffer[10];
display->drawString(display->getWidth() - SATELLITE_IMAGE_WIDTH - 4, 2, itoa(gps.satellites.value(), buffer, 10));
display->drawXbm(display->getWidth() - SATELLITE_IMAGE_WIDTH, 0, SATELLITE_IMAGE_WIDTH, SATELLITE_IMAGE_HEIGHT, SATELLITE_IMAGE);
}
#endif
// #ifdef RAK4630
// Screen::Screen(uint8_t address, int sda, int scl) : OSThread("Screen"), cmdQueue(32), dispdev(address, sda, scl),
// dispdev_oled(address, sda, scl), ui(&dispdev)
@@ -897,16 +934,13 @@ void Screen::setup()
dispdev.setDetected(screen_model);
#endif
// Load OEM config from Proto file if existent
loadProto(oemConfigFile, OEMStore_size, sizeof(oemConfigFile), OEMStore_fields, &oemStore);
// Initialising the UI will init the display too.
ui.init();
displayWidth = dispdev.width();
displayHeight = dispdev.height();
ui.setTimePerTransition(SCREEN_TRANSITION_MSECS);
ui.setTimePerTransition(0);
ui.setIndicatorPosition(BOTTOM);
// Defines where the first frame is located in the bar.
@@ -920,6 +954,9 @@ void Screen::setup()
// Set the utf8 conversion function
dispdev.setFontTableLookupFunction(customFontTableLookup);
if (strlen(oemStore.oem_text) > 0)
logo_timeout *= 2;
// Add frames.
static FrameCallback bootFrames[] = {drawBootScreen};
static const int bootFrameCount = sizeof(bootFrames) / sizeof(bootFrames[0]);
@@ -935,8 +972,12 @@ void Screen::setup()
#ifdef SCREEN_MIRROR
dispdev.mirrorScreen();
#elif defined(SCREEN_FLIP_VERTICALLY)
#else
// Standard behaviour is to FLIP the screen (needed on T-Beam). If this config item is set, unflip it, and thereby logically flip it.
// If you have a headache now, you're welcome.
if (!config.display.flip_screen) {
dispdev.flipScreenVertically();
}
#endif
// Get our hardware ID
@@ -984,32 +1025,34 @@ int32_t Screen::runOnce()
return RUN_SAME;
}
// Show boot screen for first 5 seconds, then switch to normal operation.
// Show boot screen for first logo_timeout seconds, then switch to normal operation.
// serialSinceMsec adjusts for additional serial wait time during nRF52 bootup
static bool showingBootScreen = true;
if (showingBootScreen && (millis() > (5000 + serialSinceMsec))) {
if (showingBootScreen && (millis() > (logo_timeout + serialSinceMsec))) {
DEBUG_MSG("Done with boot screen...\n");
stopBootScreen();
showingBootScreen = false;
}
// If we have an OEM Boot screen, toggle after 2,5 seconds
// If we have an OEM Boot screen, toggle after logo_timeout seconds
if (strlen(oemStore.oem_text) > 0) {
static bool showingOEMBootScreen = true;
if (showingOEMBootScreen && (millis() > (2500 + serialSinceMsec))) {
if (showingOEMBootScreen && (millis() > ((logo_timeout / 2) + serialSinceMsec))) {
DEBUG_MSG("Switch to OEM screen...\n");
// Change frames.
static FrameCallback bootOEMFrames[] = {drawOEMBootScreen};
static const int bootOEMFrameCount = sizeof(bootOEMFrames) / sizeof(bootOEMFrames[0]);
ui.setFrames(bootOEMFrames, bootOEMFrameCount);
ui.update();
#ifndef USE_EINK
ui.update();
#endif
showingOEMBootScreen = false;
}
}
#ifndef DISABLE_WELCOME_UNSET
if (showingNormalScreen && config.lora.region == Config_LoRaConfig_RegionCode_Unset) {
if (showingNormalScreen && config.lora.region == Config_LoRaConfig_RegionCode_UNSET) {
setWelcomeFrames();
}
#endif
@@ -1028,7 +1071,13 @@ int32_t Screen::runOnce()
handleSetOn(false);
break;
case Cmd::ON_PRESS:
// If a nag notification is running, stop it
if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) {
externalNotificationModule->stopNow();
} else {
// Don't advance the screen if we just wanted to switch off the nag notification
handleOnPress();
}
break;
case Cmd::START_BLUETOOTH_PIN_SCREEN:
handleStartBluetoothPinScreen(cmd.bluetooth_pin);
@@ -1047,6 +1096,9 @@ int32_t Screen::runOnce()
case Cmd::START_SHUTDOWN_SCREEN:
handleShutdownScreen();
break;
case Cmd::START_REBOOT_SCREEN:
handleRebootScreen();
break;
default:
DEBUG_MSG("BUG: invalid cmd\n");
}
@@ -1067,13 +1119,8 @@ int32_t Screen::runOnce()
// otherwise that breaks animations.
if (targetFramerate != IDLE_FRAMERATE && ui.getUiState()->frameState == FIXED) {
// oldFrameState = ui.getUiState()->frameState;
DEBUG_MSG("Setting idle framerate\n");
targetFramerate = IDLE_FRAMERATE;
#ifdef ARCH_ESP32
setCPUFast(false); // Turn up the CPU to improve screen animations
#endif
ui.setTargetFPS(targetFramerate);
forceDisplay();
}
@@ -1239,6 +1286,18 @@ void Screen::handleShutdownScreen()
setFastFramerate();
}
void Screen::handleRebootScreen()
{
DEBUG_MSG("showing reboot screen\n");
showingNormalScreen = false;
static FrameCallback rebootFrames[] = {drawFrameReboot};
ui.disableAllIndicators();
ui.setFrames(rebootFrames, 1);
setFastFramerate();
}
void Screen::handleStartFirmwareUpdateScreen()
{
DEBUG_MSG("showing firmware screen\n");
@@ -1285,7 +1344,6 @@ void Screen::handleOnPress()
// If we are in a transition, the press must have bounced, drop it.
if (ui.getUiState()->frameState == FIXED) {
ui.nextFrame();
DEBUG_MSG("Setting LastScreenTransition\n");
lastScreenTransition = millis();
setFastFramerate();
}
@@ -1297,15 +1355,9 @@ void Screen::handleOnPress()
void Screen::setFastFramerate()
{
DEBUG_MSG("Setting fast framerate\n");
// We are about to start a transition so speed up fps
targetFramerate = SCREEN_TRANSITION_FRAMERATE;
#ifdef ARCH_ESP32
setCPUFast(true); // Turn up the CPU to improve screen animations
#endif
ui.setTargetFPS(targetFramerate);
setInterval(0); // redraw ASAP
runASAP = true;
@@ -1320,6 +1372,9 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
// The coordinates define the left starting point of the text
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL);
display->setColor(BLACK);
char channelStr[20];
{
concurrency::LockGuard guard(&lock);
@@ -1329,18 +1384,54 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
// Display power status
if (powerStatus->getHasBattery())
drawBattery(display, x, y + 2, imgBattery, powerStatus);
drawBattery(display, x + 1, y + 3, imgBattery, powerStatus);
else if (powerStatus->knowsUSB())
display->drawFastImage(x, y + 2, 16, 8, powerStatus->getHasUSB() ? imgUSB : imgPower);
display->drawFastImage(x + 1, y + 3, 16, 8, powerStatus->getHasUSB() ? imgUSB : imgPower);
// Display nodes status
drawNodes(display, x + (SCREEN_WIDTH * 0.25), y + 2, nodeStatus);
drawNodes(display, x + (SCREEN_WIDTH * 0.25), y + 3, nodeStatus);
// Display GPS status
if (!config.position.gps_enabled){
int16_t yPos = y + 2;
#ifdef GPS_POWER_TOGGLE
yPos = (y + 10 + FONT_HEIGHT_SMALL);
#endif
drawGPSpowerstat(display, x, yPos, gpsStatus);
} else {
drawGPS(display, x + (SCREEN_WIDTH * 0.63), y + 2, gpsStatus);
drawGPS(display, x + (SCREEN_WIDTH * 0.63), y + 3, gpsStatus);
}
display->setColor(WHITE);
// Draw the channel name
display->drawString(x, y + FONT_HEIGHT_SMALL, channelStr);
// Draw our hardware ID to assist with bluetooth pairing
display->drawFastImage(x + SCREEN_WIDTH - (10) - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 8, 8, imgInfo);
// Draw our hardware ID to assist with bluetooth pairing. Either prefix with Info or S&F Logo
if (moduleConfig.store_forward.enabled) {
#ifdef ARCH_ESP32
if (millis() - storeForwardModule->lastHeartbeat > (storeForwardModule->heartbeatInterval * 1200)) { //no heartbeat, overlap a bit
#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS)
display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, imgQuestionL1);
display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, imgQuestionL2);
#else
display->drawFastImage(x + SCREEN_WIDTH - 10 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 8, 8, imgQuestion);
#endif
} else {
#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS)
display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 16, 8, imgSFL1);
display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 16, 8, imgSFL2);
#else
display->drawFastImage(x + SCREEN_WIDTH - 13 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 11, 8, imgSF);
#endif
}
#endif
} else {
#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS)
display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, imgInfoL1);
display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, imgInfoL2);
#else
display->drawFastImage(x + SCREEN_WIDTH - 10 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 8, 8, imgInfo);
#endif
}
display->drawString(x + SCREEN_WIDTH - display->getStringWidth(ourId), y + FONT_HEIGHT_SMALL, ourId);
// Draw any log messages
@@ -1358,8 +1449,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
#if HAS_WIFI
const char *wifiName = config.wifi.ssid;
const char *wifiPsw = config.wifi.psk;
const char *wifiName = config.network.wifi_ssid;
displayedNodeNum = 0; // Not currently showing a node pane
@@ -1368,19 +1458,24 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i
// The coordinates define the left starting point of the text
display->setTextAlignment(TEXT_ALIGN_LEFT);
if (isSoftAPForced()) {
display->drawString(x, y, String("WiFi: Software AP (Admin)"));
} else if (config.wifi.mode == Config_WiFiConfig_WiFiMode_AccessPoint || config.wifi.mode == Config_WiFiConfig_WiFiMode_AccessPointHidden) {
display->drawString(x, y, String("WiFi: Software AP"));
} else if (WiFi.status() != WL_CONNECTED) {
display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL);
display->setColor(BLACK);
if (WiFi.status() != WL_CONNECTED) {
display->drawString(x, y, String("WiFi: Not Connected"));
display->drawString(x + 1, y, String("WiFi: Not Connected"));
} else {
display->drawString(x, y, String("WiFi: Connected"));
display->drawString(x + 1, y, String("WiFi: Connected"));
display->drawString(x + SCREEN_WIDTH - display->getStringWidth("RSSI " + String(WiFi.RSSI())), y,
"RSSI " + String(WiFi.RSSI()));
display->drawString(x + SCREEN_WIDTH - display->getStringWidth("RSSI " + String(WiFi.RSSI())) - 1, y,
"RSSI " + String(WiFi.RSSI()));
}
display->setColor(WHITE);
/*
- WL_CONNECTED: assigned when connected to a WiFi network;
- WL_NO_SSID_AVAIL: assigned when no SSID are available;
@@ -1393,25 +1488,14 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i
- WL_NO_SHIELD: assigned when no WiFi shield is present;
*/
if (WiFi.status() == WL_CONNECTED || isSoftAPForced() || config.wifi.mode == Config_WiFiConfig_WiFiMode_AccessPoint || config.wifi.mode == Config_WiFiConfig_WiFiMode_AccessPointHidden) {
if (config.wifi.mode == Config_WiFiConfig_WiFiMode_AccessPoint || config.wifi.mode == Config_WiFiConfig_WiFiMode_AccessPointHidden || isSoftAPForced()) {
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "IP: " + String(WiFi.softAPIP().toString().c_str()));
// Number of connections to the AP. Default max for the esp32 is 4
display->drawString(x + SCREEN_WIDTH - display->getStringWidth("(" + String(WiFi.softAPgetStationNum()) + "/4)"),
y + FONT_HEIGHT_SMALL * 1, "(" + String(WiFi.softAPgetStationNum()) + "/4)");
} else {
if (WiFi.status() == WL_CONNECTED) {
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "IP: " + String(WiFi.localIP().toString().c_str()));
}
} else if (WiFi.status() == WL_NO_SSID_AVAIL) {
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "SSID Not Found");
} else if (WiFi.status() == WL_CONNECTION_LOST) {
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Connection Lost");
} else if (WiFi.status() == WL_CONNECT_FAILED) {
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Connection Failed");
//} else if (WiFi.status() == WL_DISCONNECTED) {
// display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Disconnected");
} else if (WiFi.status() == WL_IDLE_STATUS) {
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Idle ... Reconnecting");
} else {
@@ -1478,24 +1562,8 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i
}
}
if (isSoftAPForced()) {
if ((millis() / 10000) % 2) {
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "SSID: meshtasticAdmin");
} else {
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "PWD: 12345678");
}
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "SSID: " + String(wifiName));
} else {
if (config.wifi.mode == Config_WiFiConfig_WiFiMode_AccessPoint || config.wifi.mode == Config_WiFiConfig_WiFiMode_AccessPointHidden) {
if ((millis() / 10000) % 2) {
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "SSID: " + String(wifiName));
} else {
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "PWD: " + String(wifiPsw));
}
} else {
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "SSID: " + String(wifiName));
}
}
display->drawString(x, y + FONT_HEIGHT_SMALL * 3, "http://meshtastic.local");
/* Display a heartbeat pixel that blinks every time the frame is redrawn */
@@ -1516,6 +1584,9 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat
// The coordinates define the left starting point of the text
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL);
display->setColor(BLACK);
char batStr[20];
if (powerStatus->getHasBattery()) {
int batV = powerStatus->getBatteryVoltageMv() / 1000;
@@ -1526,33 +1597,35 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat
// Line 1
display->drawString(x, y, batStr);
display->drawString(x + 1, y, batStr);
} else {
// Line 1
display->drawString(x, y, String("USB"));
display->drawString(x + 1, y, String("USB"));
}
auto mode = "";
switch (config.lora.modem_preset) {
case Config_LoRaConfig_ModemPreset_ShortSlow:
case Config_LoRaConfig_ModemPreset_SHORT_SLOW:
mode = "ShortS";
break;
case Config_LoRaConfig_ModemPreset_ShortFast:
case Config_LoRaConfig_ModemPreset_SHORT_FAST:
mode = "ShortF";
break;
case Config_LoRaConfig_ModemPreset_MedSlow:
case Config_LoRaConfig_ModemPreset_MEDIUM_SLOW:
mode = "MedS";
break;
case Config_LoRaConfig_ModemPreset_MedFast:
case Config_LoRaConfig_ModemPreset_MEDIUM_FAST:
mode = "MedF";
break;
case Config_LoRaConfig_ModemPreset_LongSlow:
case Config_LoRaConfig_ModemPreset_LONG_SLOW:
mode = "LongS";
break;
case Config_LoRaConfig_ModemPreset_LongFast:
case Config_LoRaConfig_ModemPreset_LONG_FAST:
mode = "LongF";
break;
case Config_LoRaConfig_ModemPreset_VLongSlow:
case Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW:
mode = "VeryL";
break;
default:
@@ -1561,6 +1634,7 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat
}
display->drawString(x + SCREEN_WIDTH - display->getStringWidth(mode), y, mode);
display->drawString(x + SCREEN_WIDTH - display->getStringWidth(mode) - 1, y, mode);
// Line 2
uint32_t currentMillis = millis();
@@ -1573,6 +1647,8 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat
// minutes %= 60;
// hours %= 24;
display->setColor(WHITE);
// Show uptime as days, hours, minutes OR seconds
String uptime;
if (days >= 2)
@@ -1608,15 +1684,17 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat
char chUtil[13];
sprintf(chUtil, "ChUtil %2.0f%%", airTime->channelUtilizationPercent());
display->drawString(x + SCREEN_WIDTH - display->getStringWidth(chUtil), y + FONT_HEIGHT_SMALL * 1, chUtil);
if (config.position.gps_enabled) {
// Line 3
if (config.display.gps_format !=
Config_DisplayConfig_GpsCoordinateFormat_GpsFormatDMS) // if DMS then don't draw altitude
Config_DisplayConfig_GpsCoordinateFormat_DMS) // if DMS then don't draw altitude
drawGPSAltitude(display, x, y + FONT_HEIGHT_SMALL * 2, gpsStatus);
// Line 4
drawGPScoordinates(display, x, y + FONT_HEIGHT_SMALL * 3, gpsStatus);
} else {
drawGPSpowerstat(display, x - (SCREEN_WIDTH / 4), y + FONT_HEIGHT_SMALL * 2, gpsStatus);
}
/* Display a heartbeat pixel that blinks every time the frame is redrawn */
#ifdef SHOW_REDRAWS
if (heartbeat)
@@ -1627,6 +1705,9 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat
// adjust Brightness cycle trough 1 to 254 as long as attachDuringLongPress is true
void Screen::adjustBrightness()
{
if (!useDisplay)
return;
if (brightness == 254) {
brightness = 0;
} else {

View File

@@ -10,7 +10,7 @@ namespace graphics
class Screen
{
public:
Screen(char){}
explicit Screen(char){}
void onPress() {}
void setup() {}
void setOn(bool) {}
@@ -20,6 +20,8 @@ class Screen
void forceDisplay() {}
void startBluetoothPinScreen(uint32_t pin) {}
void stopBluetoothPinScreen() {}
void startRebootScreen() {}
void startFirmwareUpdateScreen() {}
};
}
@@ -56,6 +58,16 @@ class Screen
#define BRIGHTNESS_DEFAULT 150
#endif
// Meters to feet conversion
#ifndef METERS_TO_FEET
#define METERS_TO_FEET 3.28
#endif
// Feet to miles conversion
#ifndef MILES_TO_FEET
#define MILES_TO_FEET 5280
#endif
namespace graphics
{
@@ -120,8 +132,7 @@ class Screen : public concurrency::OSThread
void setOn(bool on)
{
if (!on)
handleSetOn(
false); // We handle off commands immediately, because they might be called because the CPU is shutting down
handleSetOn(false); // We handle off commands immediately, because they might be called because the CPU is shutting down
else
enqueueCmd(ScreenCmd{.cmd = on ? Cmd::SET_ON : Cmd::SET_OFF});
}
@@ -167,6 +178,13 @@ class Screen : public concurrency::OSThread
enqueueCmd(cmd);
}
void startRebootScreen()
{
ScreenCmd cmd;
cmd.cmd = Cmd::START_REBOOT_SCREEN;
enqueueCmd(cmd);
}
/// Stops showing the bluetooth PIN screen.
void stopBluetoothPinScreen() { enqueueCmd(ScreenCmd{.cmd = Cmd::STOP_BLUETOOTH_PIN_SCREEN}); }
@@ -204,7 +222,7 @@ class Screen : public concurrency::OSThread
uint8_t last = LASTCHAR; // get last char
LASTCHAR = ch;
switch (last) { // conversion depnding on first UTF8-character
switch (last) { // conversion depending on first UTF8-character
case 0xC2: {
SKIPREST = false;
return (uint8_t)ch;
@@ -213,10 +231,25 @@ class Screen : public concurrency::OSThread
SKIPREST = false;
return (uint8_t)(ch | 0xC0);
}
// map UTF-8 cyrillic chars to it Windows-1251 (CP-1251) ASCII codes
// note: in this case we must use compatible font - provided ArialMT_Plain_10/16/24 by 'ThingPulse/esp8266-oled-ssd1306' library
// have empty chars for non-latin ASCII symbols
case 0xD0: {
SKIPREST = false;
if (ch == 129) return (uint8_t)(168); // Ё
if (ch > 143 && ch < 192) return (uint8_t)(ch + 48);
break;
}
case 0xD1: {
SKIPREST = false;
if (ch == 145) return (uint8_t)(184); // ё
if (ch > 127 && ch < 144) return (uint8_t)(ch + 112);
break;
}
}
// We want to strip out prefix chars for two-byte char formats
if (ch == 0xC2 || ch == 0xC3 || ch == 0x82)
if (ch == 0xC2 || ch == 0xC3 || ch == 0x82 || ch == 0xD0 || ch == 0xD1)
return (uint8_t)0;
// If we already returned an unconvertable-character symbol for this unconvertable-character sequence, return NULs for the
@@ -280,6 +313,7 @@ class Screen : public concurrency::OSThread
void handlePrint(const char *text);
void handleStartFirmwareUpdateScreen();
void handleShutdownScreen();
void handleRebootScreen();
/// Rebuilds our list of frames (screens) to default ones.
void setFrames();

View File

@@ -22,15 +22,25 @@ void TFTDisplay::display(void)
{
concurrency::LockGuard g(spiLock);
// FIXME - only draw bits have changed (use backbuf similar to the other displays)
// tft.drawBitmap(0, 0, buffer, 128, 64, TFT_YELLOW, TFT_BLACK);
for (uint16_t y = 0; y < displayHeight; y++) {
for (uint16_t x = 0; x < displayWidth; x++) {
uint16_t x,y;
for (y = 0; y < displayHeight; y++) {
for (x = 0; x < displayWidth; x++) {
// get src pixel in the page based ordering the OLED lib uses FIXME, super inefficent
auto isset = buffer[x + (y / 8) * displayWidth] & (1 << (y & 7));
auto dblbuf_isset = buffer_back[x + (y / 8) * displayWidth] & (1 << (y & 7));
if (isset != dblbuf_isset) {
tft.drawPixel(x, y, isset ? TFT_WHITE : TFT_BLACK);
}
}
}
// Copy the Buffer to the Back Buffer
for (y = 0; y < (displayHeight / 8); y++) {
for (x = 0; x < displayWidth; x++) {
uint16_t pos = x + y * displayWidth;
buffer_back[pos] = buffer[pos];
}
}
}
// Send a command to the display (low level function)

View File

@@ -0,0 +1,426 @@
#include "OLEDDisplayFontsRU.h"
// Font generated or edited with the glyphEditor
const uint8_t ArialMT_Plain_10_RU[] PROGMEM = {
0x0A, // Width: 10
0x0D, // Height: 13
0x20, // First char: 32
0xE0, // Number of chars: 224
// Jump Table:
0xFF, 0xFF, 0x00, 0x0A, // 32
0x00, 0x00, 0x04, 0x03, // 33
0x00, 0x04, 0x05, 0x04, // 34
0x00, 0x09, 0x09, 0x06, // 35
0x00, 0x12, 0x0A, 0x06, // 36
0x00, 0x1C, 0x10, 0x09, // 37
0x00, 0x2C, 0x0E, 0x08, // 38
0x00, 0x3A, 0x01, 0x02, // 39
0x00, 0x3B, 0x06, 0x04, // 40
0x00, 0x41, 0x06, 0x04, // 41
0x00, 0x47, 0x05, 0x04, // 42
0x00, 0x4C, 0x09, 0x06, // 43
0x00, 0x55, 0x04, 0x03, // 44
0x00, 0x59, 0x03, 0x03, // 45
0x00, 0x5C, 0x04, 0x03, // 46
0x00, 0x60, 0x05, 0x04, // 47
0x00, 0x65, 0x0A, 0x06, // 48
0x00, 0x6F, 0x08, 0x05, // 49
0x00, 0x77, 0x0A, 0x06, // 50
0x00, 0x81, 0x0A, 0x06, // 51
0x00, 0x8B, 0x0B, 0x07, // 52
0x00, 0x96, 0x0A, 0x06, // 53
0x00, 0xA0, 0x0A, 0x06, // 54
0x00, 0xAA, 0x09, 0x06, // 55
0x00, 0xB3, 0x0A, 0x06, // 56
0x00, 0xBD, 0x0A, 0x06, // 57
0x00, 0xC7, 0x04, 0x03, // 58
0x00, 0xCB, 0x04, 0x03, // 59
0x00, 0xCF, 0x0A, 0x06, // 60
0x00, 0xD9, 0x09, 0x06, // 61
0x00, 0xE2, 0x09, 0x06, // 62
0x00, 0xEB, 0x0B, 0x07, // 63
0x00, 0xF6, 0x14, 0x0B, // 64
0x01, 0x0A, 0x0E, 0x08, // 65
0x01, 0x18, 0x0C, 0x07, // 66
0x01, 0x24, 0x0C, 0x07, // 67
0x01, 0x30, 0x0B, 0x07, // 68
0x01, 0x3B, 0x0C, 0x07, // 69
0x01, 0x47, 0x09, 0x06, // 70
0x01, 0x50, 0x0D, 0x08, // 71
0x01, 0x5D, 0x0C, 0x07, // 72
0x01, 0x69, 0x04, 0x03, // 73
0x01, 0x6D, 0x08, 0x05, // 74
0x01, 0x75, 0x0E, 0x08, // 75
0x01, 0x83, 0x0C, 0x07, // 76
0x01, 0x8F, 0x10, 0x09, // 77
0x01, 0x9F, 0x0C, 0x07, // 78
0x01, 0xAB, 0x0E, 0x08, // 79
0x01, 0xB9, 0x0B, 0x07, // 80
0x01, 0xC4, 0x0E, 0x08, // 81
0x01, 0xD2, 0x0C, 0x07, // 82
0x01, 0xDE, 0x0C, 0x07, // 83
0x01, 0xEA, 0x0B, 0x07, // 84
0x01, 0xF5, 0x0C, 0x07, // 85
0x02, 0x01, 0x0D, 0x08, // 86
0x02, 0x0E, 0x11, 0x0A, // 87
0x02, 0x1F, 0x0E, 0x08, // 88
0x02, 0x2D, 0x0D, 0x08, // 89
0x02, 0x3A, 0x0C, 0x07, // 90
0x02, 0x46, 0x06, 0x04, // 91
0x02, 0x4C, 0x06, 0x04, // 92
0x02, 0x52, 0x04, 0x03, // 93
0x02, 0x56, 0x09, 0x06, // 94
0x02, 0x5F, 0x0C, 0x07, // 95
0x02, 0x6B, 0x03, 0x03, // 96
0x02, 0x6E, 0x0A, 0x06, // 97
0x02, 0x78, 0x0A, 0x06, // 98
0x02, 0x82, 0x0A, 0x06, // 99
0x02, 0x8C, 0x0A, 0x06, // 100
0x02, 0x96, 0x0A, 0x06, // 101
0x02, 0xA0, 0x05, 0x04, // 102
0x02, 0xA5, 0x0A, 0x06, // 103
0x02, 0xAF, 0x0A, 0x06, // 104
0x02, 0xB9, 0x04, 0x03, // 105
0x02, 0xBD, 0x04, 0x03, // 106
0x02, 0xC1, 0x08, 0x05, // 107
0x02, 0xC9, 0x04, 0x03, // 108
0x02, 0xCD, 0x10, 0x09, // 109
0x02, 0xDD, 0x0A, 0x06, // 110
0x02, 0xE7, 0x0A, 0x06, // 111
0x02, 0xF1, 0x0A, 0x06, // 112
0x02, 0xFB, 0x0A, 0x06, // 113
0x03, 0x05, 0x05, 0x04, // 114
0x03, 0x0A, 0x08, 0x05, // 115
0x03, 0x12, 0x06, 0x04, // 116
0x03, 0x18, 0x0A, 0x06, // 117
0x03, 0x22, 0x09, 0x06, // 118
0x03, 0x2B, 0x0E, 0x08, // 119
0x03, 0x39, 0x0A, 0x06, // 120
0x03, 0x43, 0x09, 0x06, // 121
0x03, 0x4C, 0x0A, 0x06, // 122
0x03, 0x56, 0x06, 0x04, // 123
0x03, 0x5C, 0x04, 0x03, // 124
0x03, 0x60, 0x05, 0x04, // 125
0x03, 0x65, 0x09, 0x06, // 126
0xFF, 0xFF, 0x00, 0x0A, // 127
0xFF, 0xFF, 0x00, 0x0A, // 128
0xFF, 0xFF, 0x00, 0x0A, // 129
0xFF, 0xFF, 0x00, 0x0A, // 130
0xFF, 0xFF, 0x00, 0x0A, // 131
0xFF, 0xFF, 0x00, 0x0A, // 132
0xFF, 0xFF, 0x00, 0x0A, // 133
0xFF, 0xFF, 0x00, 0x0A, // 134
0xFF, 0xFF, 0x00, 0x0A, // 135
0xFF, 0xFF, 0x00, 0x0A, // 136
0xFF, 0xFF, 0x00, 0x0A, // 137
0xFF, 0xFF, 0x00, 0x0A, // 138
0xFF, 0xFF, 0x00, 0x0A, // 139
0xFF, 0xFF, 0x00, 0x0A, // 140
0xFF, 0xFF, 0x00, 0x0A, // 141
0xFF, 0xFF, 0x00, 0x0A, // 142
0xFF, 0xFF, 0x00, 0x0A, // 143
0xFF, 0xFF, 0x00, 0x0A, // 144
0xFF, 0xFF, 0x00, 0x0A, // 145
0xFF, 0xFF, 0x00, 0x0A, // 146
0xFF, 0xFF, 0x00, 0x0A, // 147
0xFF, 0xFF, 0x00, 0x0A, // 148
0xFF, 0xFF, 0x00, 0x0A, // 149
0xFF, 0xFF, 0x00, 0x0A, // 150
0xFF, 0xFF, 0x00, 0x0A, // 151
0xFF, 0xFF, 0x00, 0x0A, // 152
0xFF, 0xFF, 0x00, 0x0A, // 153
0xFF, 0xFF, 0x00, 0x0A, // 154
0xFF, 0xFF, 0x00, 0x0A, // 155
0xFF, 0xFF, 0x00, 0x0A, // 156
0xFF, 0xFF, 0x00, 0x0A, // 157
0xFF, 0xFF, 0x00, 0x0A, // 158
0xFF, 0xFF, 0x00, 0x0A, // 159
0xFF, 0xFF, 0x00, 0x0A, // 160
0x03, 0x6E, 0x04, 0x03, // 161
0x03, 0x72, 0x0A, 0x06, // 162
0x03, 0x7C, 0x0C, 0x07, // 163
0x03, 0x88, 0x0A, 0x06, // 164
0x03, 0x92, 0x0A, 0x06, // 165
0x03, 0x9C, 0x04, 0x03, // 166
0x03, 0xA0, 0x0A, 0x06, // 167
0x03, 0xAA, 0x0C, 0x07, // 168
0x03, 0xB6, 0x0D, 0x08, // 169
0x03, 0xC3, 0x07, 0x05, // 170
0x03, 0xCA, 0x0A, 0x06, // 171
0x03, 0xD4, 0x09, 0x06, // 172
0x03, 0xDD, 0x03, 0x03, // 173
0x03, 0xE0, 0x0D, 0x08, // 174
0x03, 0xED, 0x0B, 0x07, // 175
0x03, 0xF8, 0x07, 0x05, // 176
0x03, 0xFF, 0x0A, 0x06, // 177
0x04, 0x09, 0x05, 0x04, // 178
0x04, 0x0E, 0x05, 0x04, // 179
0x04, 0x13, 0x05, 0x04, // 180
0x04, 0x18, 0x0A, 0x06, // 181
0x04, 0x22, 0x09, 0x06, // 182
0x04, 0x2B, 0x03, 0x03, // 183
0x04, 0x2E, 0x0B, 0x07, // 184
0x04, 0x39, 0x0B, 0x07, // 185
0x04, 0x44, 0x07, 0x05, // 186
0x04, 0x4B, 0x0A, 0x06, // 187
0x04, 0x55, 0x10, 0x09, // 188
0x04, 0x65, 0x10, 0x09, // 189
0x04, 0x75, 0x10, 0x09, // 190
0x04, 0x85, 0x0A, 0x06, // 191
0x04, 0x8F, 0x0C, 0x07, // 192
0x04, 0x9B, 0x0C, 0x07, // 193
0x04, 0xA7, 0x0C, 0x07, // 194
0x04, 0xB3, 0x0B, 0x07, // 195
0x04, 0xBE, 0x0C, 0x07, // 196
0x04, 0xCA, 0x0C, 0x07, // 197
0x04, 0xD6, 0x0C, 0x07, // 198
0x04, 0xE2, 0x0C, 0x07, // 199
0x04, 0xEE, 0x0C, 0x07, // 200
0x04, 0xFA, 0x0C, 0x07, // 201
0x05, 0x06, 0x0C, 0x07, // 202
0x05, 0x12, 0x0C, 0x07, // 203
0x05, 0x1E, 0x0C, 0x07, // 204
0x05, 0x2A, 0x0C, 0x07, // 205
0x05, 0x36, 0x0C, 0x07, // 206
0x05, 0x42, 0x0C, 0x07, // 207
0x05, 0x4E, 0x0B, 0x07, // 208
0x05, 0x59, 0x0C, 0x07, // 209
0x05, 0x65, 0x0B, 0x07, // 210
0x05, 0x70, 0x0C, 0x07, // 211
0x05, 0x7C, 0x0B, 0x07, // 212
0x05, 0x87, 0x0C, 0x07, // 213
0x05, 0x93, 0x0C, 0x07, // 214
0x05, 0x9F, 0x0C, 0x07, // 215
0x05, 0xAB, 0x0C, 0x07, // 216
0x05, 0xB7, 0x0E, 0x08, // 217
0x05, 0xC5, 0x0C, 0x07, // 218
0x05, 0xD1, 0x0C, 0x07, // 219
0x05, 0xDD, 0x0C, 0x07, // 220
0x05, 0xE9, 0x0C, 0x07, // 221
0x05, 0xF5, 0x0C, 0x07, // 222
0x06, 0x01, 0x0C, 0x07, // 223
0x06, 0x0D, 0x0C, 0x07, // 224
0x06, 0x19, 0x0C, 0x07, // 225
0x06, 0x25, 0x0C, 0x07, // 226
0x06, 0x31, 0x0B, 0x07, // 227
0x06, 0x3C, 0x0C, 0x07, // 228
0x06, 0x48, 0x0B, 0x07, // 229
0x06, 0x53, 0x0C, 0x07, // 230
0x06, 0x5F, 0x0C, 0x07, // 231
0x06, 0x6B, 0x0C, 0x07, // 232
0x06, 0x77, 0x0C, 0x07, // 233
0x06, 0x83, 0x0C, 0x07, // 234
0x06, 0x8F, 0x0C, 0x07, // 235
0x06, 0x9B, 0x0C, 0x07, // 236
0x06, 0xA7, 0x0C, 0x07, // 237
0x06, 0xB3, 0x0C, 0x07, // 238
0x06, 0xBF, 0x0C, 0x07, // 239
0x06, 0xCB, 0x0B, 0x07, // 240
0x06, 0xD6, 0x0C, 0x07, // 241
0x06, 0xE2, 0x0B, 0x07, // 242
0x06, 0xED, 0x0C, 0x07, // 243
0x06, 0xF9, 0x0B, 0x07, // 244
0x07, 0x04, 0x0C, 0x07, // 245
0x07, 0x10, 0x0C, 0x07, // 246
0x07, 0x1C, 0x0C, 0x07, // 247
0x07, 0x28, 0x0C, 0x07, // 248
0x07, 0x34, 0x0E, 0x08, // 249
0x07, 0x42, 0x0C, 0x07, // 250
0x07, 0x4E, 0x0C, 0x07, // 251
0x07, 0x5A, 0x0C, 0x07, // 252
0x07, 0x66, 0x0C, 0x07, // 253
0x07, 0x72, 0x0C, 0x07, // 254
0x07, 0x7E, 0x0C, 0x07, // 255
// Font Data:
0x00, 0x00, 0xF8, 0x02, // 33
0x38, 0x00, 0x00, 0x00, 0x38, // 34
0xA0, 0x03, 0xE0, 0x00, 0xB8, 0x03, 0xE0, 0x00, 0xB8, // 35
0x30, 0x01, 0x28, 0x02, 0xF8, 0x07, 0x48, 0x02, 0x90, 0x01, // 36
0x00, 0x00, 0x30, 0x00, 0x48, 0x00, 0x30, 0x03, 0xC0, 0x00, 0xB0, 0x01, 0x48, 0x02, 0x80, 0x01, // 37
0x80, 0x01, 0x50, 0x02, 0x68, 0x02, 0xA8, 0x02, 0x18, 0x01, 0x80, 0x03, 0x80, 0x02, // 38
0x38, // 39
0xE0, 0x03, 0x10, 0x04, 0x08, 0x08, // 40
0x08, 0x08, 0x10, 0x04, 0xE0, 0x03, // 41
0x28, 0x00, 0x18, 0x00, 0x28, // 42
0x40, 0x00, 0x40, 0x00, 0xF0, 0x01, 0x40, 0x00, 0x40, // 43
0x00, 0x00, 0x00, 0x06, // 44
0x80, 0x00, 0x80, // 45
0x00, 0x00, 0x00, 0x02, // 46
0x00, 0x03, 0xE0, 0x00, 0x18, // 47
0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 48
0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0xF8, 0x03, // 49
0x10, 0x02, 0x08, 0x03, 0x88, 0x02, 0x48, 0x02, 0x30, 0x02, // 50
0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 51
0xC0, 0x00, 0xA0, 0x00, 0x90, 0x00, 0x88, 0x00, 0xF8, 0x03, 0x80, // 52
0x60, 0x01, 0x38, 0x02, 0x28, 0x02, 0x28, 0x02, 0xC8, 0x01, // 53
0xF0, 0x01, 0x28, 0x02, 0x28, 0x02, 0x28, 0x02, 0xD0, 0x01, // 54
0x08, 0x00, 0x08, 0x03, 0xC8, 0x00, 0x38, 0x00, 0x08, // 55
0xB0, 0x01, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 56
0x70, 0x01, 0x88, 0x02, 0x88, 0x02, 0x88, 0x02, 0xF0, 0x01, // 57
0x00, 0x00, 0x20, 0x02, // 58
0x00, 0x00, 0x20, 0x06, // 59
0x00, 0x00, 0x40, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0x10, 0x01, // 60
0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, // 61
0x00, 0x00, 0x10, 0x01, 0xA0, 0x00, 0xA0, 0x00, 0x40, // 62
0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0xC8, 0x02, 0x48, 0x00, 0x30, // 63
0x00, 0x00, 0xC0, 0x03, 0x30, 0x04, 0xD0, 0x09, 0x28, 0x0A, 0x28, 0x0A, 0xC8, 0x0B, 0x68, 0x0A, 0x10, 0x05, 0xE0, 0x04, // 64
0x00, 0x02, 0xC0, 0x01, 0xB0, 0x00, 0x88, 0x00, 0xB0, 0x00, 0xC0, 0x01, 0x00, 0x02, // 65
0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xF0, 0x01, // 66
0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, // 67
0x00, 0x00, 0xF8, 0x03, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, 0xE0, // 68
0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, // 69
0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x08, // 70
0x00, 0x00, 0xE0, 0x00, 0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x50, 0x01, 0xC0, // 71
0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 72
0x00, 0x00, 0xF8, 0x03, // 73
0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x01, // 74
0x00, 0x00, 0xF8, 0x03, 0x80, 0x00, 0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x02, // 75
0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, // 76
0x00, 0x00, 0xF8, 0x03, 0x30, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x30, 0x00, 0xF8, 0x03, // 77
0x00, 0x00, 0xF8, 0x03, 0x30, 0x00, 0x40, 0x00, 0x80, 0x01, 0xF8, 0x03, // 78
0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 79
0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 80
0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x03, 0x08, 0x03, 0xF0, 0x02, // 81
0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0xC8, 0x00, 0x30, 0x03, // 82
0x00, 0x00, 0x30, 0x01, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x90, 0x01, // 83
0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, // 84
0x00, 0x00, 0xF8, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x01, // 85
0x08, 0x00, 0x70, 0x00, 0x80, 0x01, 0x00, 0x02, 0x80, 0x01, 0x70, 0x00, 0x08, // 86
0x18, 0x00, 0xE0, 0x01, 0x00, 0x02, 0xF0, 0x01, 0x08, 0x00, 0xF0, 0x01, 0x00, 0x02, 0xE0, 0x01, 0x18, // 87
0x00, 0x02, 0x08, 0x01, 0x90, 0x00, 0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x02, // 88
0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0xC0, 0x03, 0x20, 0x00, 0x10, 0x00, 0x08, // 89
0x08, 0x03, 0x88, 0x02, 0xC8, 0x02, 0x68, 0x02, 0x38, 0x02, 0x18, 0x02, // 90
0x00, 0x00, 0xF8, 0x0F, 0x08, 0x08, // 91
0x18, 0x00, 0xE0, 0x00, 0x00, 0x03, // 92
0x08, 0x08, 0xF8, 0x0F, // 93
0x40, 0x00, 0x30, 0x00, 0x08, 0x00, 0x30, 0x00, 0x40, // 94
0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, // 95
0x08, 0x00, 0x10, // 96
0x00, 0x00, 0x00, 0x03, 0xA0, 0x02, 0xA0, 0x02, 0xE0, 0x03, // 97
0x00, 0x00, 0xF8, 0x03, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 98
0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x40, 0x01, // 99
0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xF8, 0x03, // 100
0x00, 0x00, 0xC0, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x02, // 101
0x20, 0x00, 0xF0, 0x03, 0x28, // 102
0x00, 0x00, 0xC0, 0x05, 0x20, 0x0A, 0x20, 0x0A, 0xE0, 0x07, // 103
0x00, 0x00, 0xF8, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 104
0x00, 0x00, 0xE8, 0x03, // 105
0x00, 0x08, 0xE8, 0x07, // 106
0xF8, 0x03, 0x80, 0x00, 0xC0, 0x01, 0x20, 0x02, // 107
0x00, 0x00, 0xF8, 0x03, // 108
0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 109
0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 110
0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 111
0x00, 0x00, 0xE0, 0x0F, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 112
0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xE0, 0x0F, // 113
0x00, 0x00, 0xE0, 0x03, 0x20, // 114
0x40, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x20, 0x01, // 115
0x20, 0x00, 0xF8, 0x03, 0x20, 0x02, // 116
0x00, 0x00, 0xE0, 0x01, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, // 117
0x20, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x20, // 118
0xE0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x20, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xE0, 0x01, // 119
0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 120
0x20, 0x00, 0xC0, 0x09, 0x00, 0x06, 0xC0, 0x01, 0x20, // 121
0x20, 0x02, 0x20, 0x03, 0xA0, 0x02, 0x60, 0x02, 0x20, 0x02, // 122
0x80, 0x00, 0x78, 0x0F, 0x08, 0x08, // 123
0x00, 0x00, 0xF8, 0x0F, // 124
0x08, 0x08, 0x78, 0x0F, 0x80, // 125
0xC0, 0x00, 0x40, 0x00, 0xC0, 0x00, 0x80, 0x00, 0xC0, // 126
0x00, 0x00, 0xA0, 0x0F, // 161
0x00, 0x00, 0xC0, 0x01, 0xA0, 0x0F, 0x78, 0x02, 0x40, 0x01, // 162
0x40, 0x02, 0x70, 0x03, 0xC8, 0x02, 0x48, 0x02, 0x08, 0x02, 0x10, 0x02, // 163
0x00, 0x00, 0xE0, 0x01, 0x20, 0x01, 0x20, 0x01, 0xE0, 0x01, // 164
0x48, 0x01, 0x70, 0x01, 0xC0, 0x03, 0x70, 0x01, 0x48, 0x01, // 165
0x00, 0x00, 0x38, 0x0F, // 166
0xD0, 0x04, 0x28, 0x09, 0x48, 0x09, 0x48, 0x0A, 0x90, 0x05, // 167
0x00, 0x00, 0xE0, 0x03, 0xA8, 0x02, 0xA0, 0x02, 0xA8, 0x02, 0x20, 0x02, // 168
0xE0, 0x00, 0x10, 0x01, 0x48, 0x02, 0xA8, 0x02, 0xA8, 0x02, 0x10, 0x01, 0xE0, // 169
0x68, 0x00, 0x68, 0x00, 0x68, 0x00, 0x78, // 170
0x00, 0x00, 0x80, 0x01, 0x40, 0x02, 0x80, 0x01, 0x40, 0x02, // 171
0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, // 172
0x80, 0x00, 0x80, // 173
0xE0, 0x00, 0x10, 0x01, 0xE8, 0x02, 0x68, 0x02, 0xC8, 0x02, 0x10, 0x01, 0xE0, // 174
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, // 175
0x00, 0x00, 0x38, 0x00, 0x28, 0x00, 0x38, // 176
0x40, 0x02, 0x40, 0x02, 0xF0, 0x03, 0x40, 0x02, 0x40, 0x02, // 177
0x48, 0x00, 0x68, 0x00, 0x58, // 178
0x48, 0x00, 0x58, 0x00, 0x68, // 179
0x00, 0x00, 0x10, 0x00, 0x08, // 180
0x00, 0x00, 0xE0, 0x0F, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, // 181
0x70, 0x00, 0xF8, 0x0F, 0x08, 0x00, 0xF8, 0x0F, 0x08, // 182
0x00, 0x00, 0x40, // 183
0x00, 0x00, 0xC0, 0x01, 0xA8, 0x02, 0xA0, 0x02, 0xA8, 0x02, 0xC0, // 184
0x00, 0x00, 0xF0, 0x03, 0x40, 0x00, 0x80, 0x00, 0xF8, 0x03, 0x08, // 185
0x30, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 186
0x00, 0x00, 0x40, 0x02, 0x80, 0x01, 0x40, 0x02, 0x80, 0x01, // 187
0x00, 0x00, 0x10, 0x02, 0x78, 0x01, 0xC0, 0x00, 0x20, 0x01, 0x90, 0x01, 0xC8, 0x03, 0x00, 0x01, // 188
0x00, 0x00, 0x10, 0x02, 0x78, 0x01, 0x80, 0x00, 0x60, 0x00, 0x50, 0x02, 0x48, 0x03, 0xC0, 0x02, // 189
0x48, 0x00, 0x58, 0x00, 0x68, 0x03, 0x80, 0x00, 0x60, 0x01, 0x90, 0x01, 0xC8, 0x03, 0x00, 0x01, // 190
0x00, 0x00, 0x00, 0x06, 0x00, 0x09, 0xA0, 0x09, 0x00, 0x04, // 191
0x00, 0x00, 0xF0, 0x03, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0xF0, 0x03, // 192
0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x88, 0x01, // 193
0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 194
0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x18, // 195
0x00, 0x00, 0x00, 0x02, 0xFC, 0x03, 0x04, 0x02, 0xFC, 0x03, 0x00, 0x02, // 196
0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x08, 0x02, // 197
0x00, 0x00, 0xB8, 0x03, 0x40, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xB8, 0x03, // 198
0x00, 0x00, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 199
0x00, 0x00, 0xF8, 0x03, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0xF8, 0x03, // 200
0x00, 0x00, 0xE0, 0x03, 0x08, 0x01, 0x90, 0x00, 0x48, 0x00, 0xE0, 0x03, // 201
0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xA0, 0x00, 0x10, 0x01, 0x08, 0x02, // 202
0x00, 0x00, 0x00, 0x02, 0xF0, 0x01, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, // 203
0x00, 0x00, 0xF8, 0x03, 0x10, 0x00, 0x60, 0x00, 0x10, 0x00, 0xF8, 0x03, // 204
0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 205
0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 206
0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, // 207
0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 208
0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, // 209
0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, // 210
0x00, 0x00, 0x38, 0x00, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0xF8, 0x01, // 211
0x00, 0x00, 0x70, 0x00, 0x88, 0x00, 0xF8, 0x03, 0x88, 0x00, 0x70, // 212
0x00, 0x00, 0x18, 0x03, 0xA0, 0x00, 0x40, 0x00, 0xA0, 0x00, 0x18, 0x03, // 213
0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, // 214
0x00, 0x00, 0x38, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 215
0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, // 216
0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x06, // 217
0x00, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, // 218
0x00, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, 0xF8, 0x03, // 219
0x00, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, // 220
0x00, 0x00, 0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0xF0, 0x01, // 221
0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xF0, 0x01, 0x08, 0x02, 0xF0, 0x01, // 222
0x00, 0x00, 0x30, 0x02, 0x48, 0x01, 0xC8, 0x00, 0x48, 0x00, 0xF8, 0x03, // 223
0x00, 0x00, 0x00, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x03, // 224
0x00, 0x00, 0xE0, 0x01, 0x50, 0x02, 0x50, 0x02, 0x48, 0x02, 0x88, 0x01, // 225
0x00, 0x00, 0xE0, 0x03, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x40, 0x01, // 226
0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x60, // 227
0x00, 0x00, 0x00, 0x02, 0xC0, 0x03, 0x20, 0x02, 0xE0, 0x03, 0x00, 0x02, // 228
0x00, 0x00, 0xC0, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, // 229
0x00, 0x00, 0x60, 0x03, 0x80, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x60, 0x03, // 230
0x00, 0x00, 0x20, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x40, 0x01, // 231
0x00, 0x00, 0xE0, 0x03, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0xE0, 0x03, // 232
0x00, 0x00, 0xE0, 0x03, 0x00, 0x01, 0x98, 0x00, 0x40, 0x00, 0xE0, 0x03, // 233
0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 234
0x00, 0x00, 0x00, 0x02, 0xC0, 0x01, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, // 235
0x00, 0x00, 0xE0, 0x03, 0x40, 0x00, 0x80, 0x00, 0x40, 0x00, 0xE0, 0x03, // 236
0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xE0, 0x03, // 237
0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 238
0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, // 239
0x00, 0x00, 0xE0, 0x03, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0x40, // 240
0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0x40, 0x02, // 241
0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, // 242
0x00, 0x00, 0x60, 0x00, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0xE0, 0x01, // 243
0x00, 0x00, 0xC0, 0x00, 0x20, 0x01, 0xE0, 0x03, 0x20, 0x01, 0xC0, // 244
0x00, 0x00, 0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 245
0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, // 246
0x00, 0x00, 0x60, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xE0, 0x03, // 247
0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, // 248
0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x06, // 249
0x00, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, // 250
0x00, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, 0xE0, 0x03, // 251
0x00, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, // 252
0x00, 0x00, 0x40, 0x01, 0x20, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x01, // 253
0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0xC0, 0x01, 0x20, 0x02, 0xC0, 0x01, // 254
0x00, 0x00, 0x40, 0x02, 0xA0, 0x01, 0xA0, 0x00, 0xA0, 0x00, 0xE0, 0x03, // 255
};

View File

@@ -0,0 +1,11 @@
#ifndef OLEDDISPLAYFONTSRU_h
#define OLEDDISPLAYFONTSRU_h
#ifdef ARDUINO
#include <Arduino.h>
#elif __MBED__
#define PROGMEM
#endif
extern const uint8_t ArialMT_Plain_10_RU[] PROGMEM;
#endif

View File

@@ -12,36 +12,18 @@ const uint8_t imgPower[] PROGMEM = { 0x40, 0x40, 0x40, 0x58, 0x48, 0x08,
const uint8_t imgUser[] PROGMEM = { 0x3C, 0x42, 0x99, 0xA5, 0xA5, 0x99, 0x42, 0x3C };
const uint8_t imgPositionEmpty[] PROGMEM = { 0x20, 0x30, 0x28, 0x24, 0x42, 0xFF };
const uint8_t imgPositionSolid[] PROGMEM = { 0x20, 0x30, 0x38, 0x3C, 0x7E, 0xFF };
const uint8_t imgInfo[] PROGMEM = { 0xFF, 0x81, 0x81, 0xB5, 0xB5, 0x81, 0x81, 0xFF };
#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS)
const uint8_t imgQuestionL1[] PROGMEM = { 0xff, 0x01, 0x01, 0x32, 0x7b, 0x49, 0x49, 0x6f, 0x26, 0x01, 0x01, 0xff };
const uint8_t imgQuestionL2[] PROGMEM = { 0x0f, 0x08, 0x08, 0x08, 0x06, 0x0f, 0x0f, 0x06, 0x08, 0x08, 0x08, 0x0f };
const uint8_t imgInfoL1[] PROGMEM = { 0xff, 0x01, 0x01, 0x01, 0x1e, 0x7f, 0x1e, 0x01, 0x01, 0x01, 0x01, 0xff };
const uint8_t imgInfoL2[] PROGMEM = { 0x0f, 0x08, 0x08, 0x08, 0x06, 0x0f, 0x0f, 0x06, 0x08, 0x08, 0x08, 0x0f };
const uint8_t imgSFL1[] PROGMEM = { 0xb6, 0x8f, 0x19, 0x11, 0x31, 0xe3, 0xc2, 0x01, 0x01, 0xf9, 0xf9, 0x89, 0x89, 0x89, 0x09, 0xeb};
const uint8_t imgSFL2[] PROGMEM = { 0x0e, 0x09, 0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x00, 0x0f, 0x0f, 0x00, 0x08, 0x08, 0x08, 0x0f};
#else
const uint8_t imgInfo[] PROGMEM = { 0xff, 0x81, 0x00, 0xfb, 0xfb, 0x00, 0x81, 0xff };
const uint8_t imgQuestion[] PROGMEM = { 0xbf, 0x41, 0xc0, 0x8b, 0xdb, 0x70, 0xa1, 0xdf };
const uint8_t imgSF[] PROGMEM = { 0xd2, 0xb7, 0xad, 0xbb, 0x92, 0x01, 0xfd, 0xfd, 0x15, 0x85, 0xf5};
#endif
#include "img/icon.xbm"
// We now programmatically draw our compass
#if 0
const
#include "img/compass.xbm"
#endif
#if 0
const uint8_t activeSymbol[] PROGMEM = {
B00000000,
B00000000,
B00011000,
B00100100,
B01000010,
B01000010,
B00100100,
B00011000
};
const uint8_t inactiveSymbol[] PROGMEM = {
B00000000,
B00000000,
B00000000,
B00000000,
B00011000,
B00011000,
B00000000,
B00000000
};
#endif

View File

@@ -1,28 +0,0 @@
#define compass_width 48
#define compass_height 48
static char compass_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00,
0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00,
0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0x01, 0x00,
0x00, 0xC0, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00,
0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0xFC, 0x07, 0xE0, 0x3F, 0x00,
0x00, 0xFE, 0x01, 0x80, 0x7F, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x7F, 0x00,
0x00, 0x7F, 0x00, 0x00, 0xFE, 0x00, 0x80, 0x3F, 0x00, 0x00, 0xFC, 0x01,
0x80, 0x1F, 0x00, 0x00, 0xF8, 0x01, 0x80, 0x0F, 0x00, 0x00, 0xF0, 0x01,
0xC0, 0x0F, 0x00, 0x00, 0xF0, 0x03, 0xC0, 0x07, 0x00, 0x00, 0xE0, 0x03,
0xC0, 0x07, 0x00, 0x00, 0xE0, 0x03, 0xC0, 0x07, 0x00, 0x00, 0xE0, 0x03,
0xFC, 0x07, 0x00, 0x00, 0xE0, 0x3F, 0xFC, 0x07, 0x00, 0x00, 0xE0, 0x3F,
0xFC, 0x07, 0x00, 0x00, 0xE0, 0x3F, 0xFC, 0x07, 0x00, 0x00, 0xE0, 0x3F,
0xC0, 0x07, 0x00, 0x00, 0xE0, 0x03, 0xC0, 0x07, 0x00, 0x00, 0xE0, 0x03,
0xC0, 0x07, 0x00, 0x00, 0xE0, 0x03, 0xC0, 0x0F, 0x00, 0x00, 0xF0, 0x03,
0x80, 0x0F, 0x00, 0x00, 0xF0, 0x01, 0x80, 0x1F, 0x00, 0x00, 0xF8, 0x01,
0x80, 0x3F, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x7F, 0x00, 0x00, 0xFE, 0x00,
0x00, 0xFE, 0x00, 0x00, 0x7F, 0x00, 0x00, 0xFE, 0x01, 0x80, 0x7F, 0x00,
0x00, 0xFC, 0x07, 0xE0, 0x3F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00,
0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0x03, 0x00,
0x00, 0x80, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00,
0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00,
0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

View File

@@ -1,6 +0,0 @@
#define pin_width 13
#define pin_height 13
static char pin_bits[] = {
0x00, 0x00, 0xF0, 0x01, 0xF8, 0x03, 0xFC, 0x07, 0xBC, 0x07, 0xBC, 0x07,
0xFC, 0x07, 0xF8, 0x03, 0xF8, 0x03, 0xF0, 0x01, 0xE0, 0x00, 0xE0, 0x00,
0x00, 0x00, };

View File

@@ -1,9 +1,13 @@
#pragma once
#include "Observer.h"
#define ANYKEY 0xFF
#define MATRIXKEY 0xFE
typedef struct _InputEvent {
const char* source;
char inputEvent;
char kbchar;
} InputEvent;
class InputBroker :
public Observable<const InputEvent *>

View File

@@ -34,7 +34,7 @@ void RotaryEncoderInterruptBase::init(
int32_t RotaryEncoderInterruptBase::runOnce()
{
InputEvent e;
e.inputEvent = ModuleConfig_CannedMessageConfig_InputEventChar_KEY_NONE;
e.inputEvent = ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
e.source = this->_originName;
if (this->action == ROTARY_ACTION_PRESSED) {
@@ -48,7 +48,7 @@ int32_t RotaryEncoderInterruptBase::runOnce()
e.inputEvent = this->_eventCcw;
}
if (e.inputEvent != ModuleConfig_CannedMessageConfig_InputEventChar_KEY_NONE) {
if (e.inputEvent != ModuleConfig_CannedMessageConfig_InputEventChar_NONE) {
this->notifyObservers(&e);
}

View File

@@ -33,8 +33,8 @@ class RotaryEncoderInterruptBase : public Observable<const InputEvent *>, privat
private:
uint8_t _pinA = 0;
uint8_t _pinB = 0;
char _eventCw = ModuleConfig_CannedMessageConfig_InputEventChar_KEY_NONE;
char _eventCcw = ModuleConfig_CannedMessageConfig_InputEventChar_KEY_NONE;
char _eventPressed = ModuleConfig_CannedMessageConfig_InputEventChar_KEY_NONE;
char _eventCw = ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
char _eventCcw = ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
char _eventPressed = ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
const char *_originName;
};

View File

@@ -16,8 +16,8 @@ class UpDownInterruptBase : public Observable<const InputEvent *>
private:
uint8_t _pinDown = 0;
uint8_t _pinUp = 0;
char _eventDown = ModuleConfig_CannedMessageConfig_InputEventChar_KEY_NONE;
char _eventUp = ModuleConfig_CannedMessageConfig_InputEventChar_KEY_NONE;
char _eventPressed = ModuleConfig_CannedMessageConfig_InputEventChar_KEY_NONE;
char _eventDown = ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
char _eventUp = ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
char _eventPressed = ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
const char *_originName;
};

View File

@@ -17,9 +17,9 @@ void UpDownInterruptImpl1::init()
uint8_t pinDown = moduleConfig.canned_message.inputbroker_pin_b;
uint8_t pinPress = moduleConfig.canned_message.inputbroker_pin_press;
char eventDown = static_cast<char>(ModuleConfig_CannedMessageConfig_InputEventChar_KEY_DOWN);
char eventUp = static_cast<char>(ModuleConfig_CannedMessageConfig_InputEventChar_KEY_UP);
char eventPressed = static_cast<char>(ModuleConfig_CannedMessageConfig_InputEventChar_KEY_SELECT);
char eventDown = static_cast<char>(ModuleConfig_CannedMessageConfig_InputEventChar_DOWN);
char eventUp = static_cast<char>(ModuleConfig_CannedMessageConfig_InputEventChar_UP);
char eventPressed = static_cast<char>(ModuleConfig_CannedMessageConfig_InputEventChar_SELECT);
UpDownInterruptBase::init(pinDown, pinUp, pinPress, eventDown, eventUp, eventPressed, UpDownInterruptImpl1::handleIntDown,
UpDownInterruptImpl1::handleIntUp, UpDownInterruptImpl1::handleIntPressed);

Some files were not shown because too many files have changed in this diff Show More