Skip to content

Commit

Permalink
Merge branch 'master' into store-and-forward
Browse files Browse the repository at this point in the history
  • Loading branch information
caveman99 authored Dec 9, 2024
2 parents 37da78a + f3850ee commit 1f1d785
Show file tree
Hide file tree
Showing 86 changed files with 2,521 additions and 836 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
shell: bash
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_raspbian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
shell: bash
run: |
sudo apt-get update -y --fix-missing
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_raspbian_armv7l.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
shell: bash
run: |
sudo apt-get update -y --fix-missing
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev
- name: Checkout code
uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/package_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ jobs:
shopt -s dotglob nullglob
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
gunzip .debpkg/usr/share/doc/meshtasticd/web/ -r
cp release/meshtasticd_linux_x86_64 .debpkg/usr/sbin/meshtasticd
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
chmod +x .debpkg/usr/sbin/meshtasticd
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
Expand All @@ -82,4 +82,4 @@ jobs:
name: meshtasticd_${{ steps.version.outputs.version }}_amd64.deb
overwrite: true
path: |
./*.deb
./*.deb
8 changes: 4 additions & 4 deletions .github/workflows/package_raspbian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ jobs:
shopt -s dotglob nullglob
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
gunzip .debpkg/usr/share/doc/meshtasticd/web/ -r
cp release/meshtasticd_linux_aarch64 .debpkg/usr/sbin/meshtasticd
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
chmod +x .debpkg/usr/sbin/meshtasticd
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
Expand All @@ -82,4 +82,4 @@ jobs:
name: meshtasticd_${{ steps.version.outputs.version }}_arm64.deb
overwrite: true
path: |
./*.deb
./*.deb
8 changes: 4 additions & 4 deletions .github/workflows/package_raspbian_armv7l.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ jobs:
shopt -s dotglob nullglob
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
gunzip .debpkg/usr/share/doc/meshtasticd/web/ -r
cp release/meshtasticd_linux_armv7l .debpkg/usr/sbin/meshtasticd
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
chmod +x .debpkg/usr/sbin/meshtasticd
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
Expand All @@ -82,4 +82,4 @@ jobs:
name: meshtasticd_${{ steps.version.outputs.version }}_armhf.deb
overwrite: true
path: |
./*.deb
./*.deb
4 changes: 2 additions & 2 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ lint:
- git-diff-check
- [email protected]
- [email protected]
- [email protected]
#- [email protected]
ignore:
- linters: [ALL]
paths:
Expand All @@ -46,4 +46,4 @@ actions:
enabled:
- trunk-fmt-pre-commit
- trunk-check-pre-push
- trunk-upgrade-available
- trunk-upgrade-available
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributor Covenant Code of Conduct

The Meshtastic Firmware project is subject to the code of conduct for the parent project, which can be found here:
The Meshtastic Firmware project is subject to the code of conduct for the parent project, which can be found here:
https://meshtastic.org/docs/legal/conduct/
2 changes: 1 addition & 1 deletion arch/portduino/portduino.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; 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#bcd02436cfca91f7d28ad0f7dab977c6aaa781af
platform = https://github.com/meshtastic/platform-native.git#7fcee253a928535ff8b142704035b4b982f7e2d2
framework = arduino

build_src_filter =
Expand Down
4 changes: 2 additions & 2 deletions arch/rp2xx0/rp2040.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
; Common settings for rp2040 Processor based targets
[rp2040_base]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico 4.2.1
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico >=4.2.1
extends = arduino_base
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#996c3bfab9758f12c07aa20cc6d352e630c16987 ; 4.2.1 with fix for sporadic hangs
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#6024e9a7e82a72e38dd90f42029ba3748835eb2e ; 4.3.0 with fix MDNS

board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
Expand Down
4 changes: 2 additions & 2 deletions arch/rp2xx0/rp2350.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
; Common settings for rp2040 Processor based targets
[rp2350_base]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico 4.2.1
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico >=4.2.1
extends = arduino_base
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#96c3bfab9758f12c07aa20cc6d352e630c16987 ; 4.2.1 with fix for sporadic hangs
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#6024e9a7e82a72e38dd90f42029ba3748835eb2e ; 4.3.0 with fix MDNS

board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
Expand Down
2 changes: 1 addition & 1 deletion bin/build-userprefs-json.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def write_macros_to_json(macros, output_file):

def main():
header_file = 'userPrefs.h'
output_file = 'userPrefs.json'
output_file = 'userPrefs.jsonc'
# Uncomment all macros in the header file
with open(header_file, 'r') as file:
lines = file.readlines()
Expand Down
4 changes: 3 additions & 1 deletion bin/config-dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,6 @@ Webserver:
General:
MaxNodes: 200
MaxMessageQueue: 100
ConfigDirectory: /etc/meshtasticd/config.d/
ConfigDirectory: /etc/meshtasticd/config.d/
# MACAddress: AA:BB:CC:DD:EE:FF
# MACAddressSource: eth0
8 changes: 8 additions & 0 deletions bin/config.d/OpenWRT_One_mikroBUS_sx1262.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Lora:
Module: sx1262
IRQ: 10
Busy: 12
Reset: 2
spidev: spidev2.0
DIO2_AS_RF_SWITCH: true
DIO3_TCXO_VOLTAGE: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
Lora:
## Ebyte E22-900M30S, E22-900M22S with no external RF switching setup
## Will work with any module without RF switching, and with TCXO
Module: sx1262
gpiochip: 1 # subtract 32 from the gpio numbers
DIO2_AS_RF_SWITCH: true
DIO3_TCXO_VOLTAGE: true
CS: 16 #pin6 / GPIO48 1C0
IRQ: 23 #pin17 / GPIO55 1C7
Busy: 22 #pin16 / GPIO54 1C6
Reset: 25 #pin13 / GPIO57 1D1
RXen: 24 #pin12 / GPIO56 1D0
#TXen: bridge to DIO2 on E22 module
spidev: spidev0.0
spiSpeed: 2000000
16 changes: 16 additions & 0 deletions bin/config.d/femtofox/femtofox_EByte-E22-900MM22S.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
Lora:
## Ebyte E22-900MM22S with no external RF switching setup
## Will work with any module without RF switching and no TCXO
Module: sx1262
gpiochip: 1 # subtract 32 from the gpio numbers
DIO2_AS_RF_SWITCH: true
DIO3_TCXO_VOLTAGE: true
CS: 16 #pin6 / GPIO48 1C0
IRQ: 23 #pin17 / GPIO55 1C7
Busy: 22 #pin16 / GPIO54 1C6
Reset: 25 #pin13 / GPIO57 1D1
RXen: 24 #pin12 / GPIO56 1D0
#TXen: bridge to DIO2 on E22 module
spidev: spidev0.0
spiSpeed: 2000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
Lora:
## Heltec HT-RA62, Seeed WIO SX1262
## Will work with any module with automatic RF switching, and with TCXO
Module: sx1262
gpiochip: 1 # subtract 32 from the gpio numbers
DIO2_AS_RF_SWITCH: true
DIO3_TCXO_VOLTAGE: true
CS: 16 #pin6 (GPIO pin 48 1C0)
IRQ: 23 #pin17 (GPIO pin 55 1C7)
Reset: 25 #pin13 (GPIO pin 57 1D1)
Busy: 22 #pin16 (GPIO pin 54 1C6)
spidev: spidev0.0 #pins are (CS=6, CLK=7, MOSI=8, MISO=9)
spiSpeed: 2000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
Lora:
## Waveshare SX126X XXXM, AI Thinker RA-01SH
## Will work with any module with automatic RF switching, and with no TCXO
Module: sx1262
gpiochip: 1 # subtract 32 from the gpio numbers
DIO2_AS_RF_SWITCH: true
CS: 16 #pin6 (GPIO pin 48 1C0)
IRQ: 23 #pin17 (GPIO pin 55 1C7)
Reset: 25 #pin13 (GPIO pin 57 1D1)
Busy: 22 #pin16 (GPIO pin 54 1C6)
spidev: spidev0.0 #pins are (CS=6, CLK=7, MOSI=8, MISO=9)
spiSpeed: 2000000
36 changes: 32 additions & 4 deletions bin/platformio-custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# trunk-ignore-all(flake8/F821): For SConstruct imports
import sys
from os.path import join
import json
import re

from readprops import readProps

Expand Down Expand Up @@ -90,11 +92,37 @@ def esp32_create_combined_bin(source, target, env):
verObj = readProps(prefsLoc)
print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"] + " on " + env.get("PIOENV"))

jsonLoc = env["PROJECT_DIR"] + "/userPrefs.jsonc"
with open(jsonLoc) as f:
jsonStr = re.sub("//.*","", f.read(), flags=re.MULTILINE)
userPrefs = json.loads(jsonStr)

pref_flags = []
# Pre-process the userPrefs
for pref in userPrefs:
if userPrefs[pref].startswith("{"):
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
elif userPrefs[pref].replace(".", "").isdigit():
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
elif userPrefs[pref] == "true" or userPrefs[pref] == "false":
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
elif userPrefs[pref].startswith("meshtastic_"):
pref_flags.append("-D" + pref + "=" + userPrefs[pref])
# If the value is a string, we need to wrap it in quotes
else:
pref_flags.append("-D" + pref + "=" + env.StringifyMacro(userPrefs[pref]) + "")

# General options that are passed to the C and C++ compilers
projenv.Append(
CCFLAGS=[
flags = [
"-DAPP_VERSION=" + verObj["long"],
"-DAPP_VERSION_SHORT=" + verObj["short"],
"-DAPP_ENV=" + env.get("PIOENV"),
]
)
] + pref_flags

print ("Using flags:")
for flag in flags:
print(flag)

projenv.Append(
CCFLAGS=flags,
)
4 changes: 1 addition & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ default_envs = tbeam
;default_envs = radiomaster_900_bandit_nano
;default_envs = radiomaster_900_bandit_micro
;default_envs = radiomaster_900_bandit
;default_envs = heltec_capsule_sensor_v3
;default_envs = heltec_vision_master_t190
;default_envs = heltec_vision_master_e213
;default_envs = heltec_vision_master_e290
Expand Down Expand Up @@ -110,7 +109,6 @@ framework = arduino
lib_deps =
${env.lib_deps}
end2endzone/[email protected]
https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#5cf62b36c6f30bc72a07bdb2c11fc9a22d1e31da
build_flags = ${env.build_flags} -Os
build_src_filter = ${env.build_src_filter} -<platform/portduino/>

Expand Down Expand Up @@ -161,4 +159,4 @@ lib_deps =
https://github.com/KodinLanewave/[email protected]
mprograms/[email protected]
dfrobot/[email protected]
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d
2 changes: 1 addition & 1 deletion protobufs
2 changes: 1 addition & 1 deletion src/ButtonThread.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ButtonThread.h"
#include "../userPrefs.h"

#include "configuration.h"
#if !MESHTASTIC_EXCLUDE_GPS
#include "GPS.h"
Expand Down
10 changes: 7 additions & 3 deletions src/PowerFSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include "sleep.h"
#include "target_specific.h"

#if HAS_WIFI && !defined(ARCH_PORTDUINO)
#include "mesh/wifi/WiFiAPClient.h"
#endif

#ifndef SLEEP_TIME
#define SLEEP_TIME 30
#endif
Expand Down Expand Up @@ -377,9 +381,9 @@ void PowerFSM_setup()
// We never enter light-sleep or NB states on NRF52 (because the CPU uses so little power normally)
#ifdef ARCH_ESP32
// See: https://github.com/meshtastic/firmware/issues/1071
// Don't add power saving transitions if we are a power saving tracker or sensor. Sleep will be initiated through the
// modules
if ((isRouter || config.power.is_power_saving) && !isTrackerOrSensor) {
// Don't add power saving transitions if we are a power saving tracker or sensor or have Wifi enabled. Sleep will be initiated
// through the modules
if ((isRouter || config.power.is_power_saving) && !isWifiAvailable() && !isTrackerOrSensor) {
powerFSM.add_timed_transition(&stateNB, &stateLS,
Default::getConfiguredOrDefaultMs(config.power.min_wake_secs, default_min_wake_secs), NULL,
"Min wake timeout");
Expand Down
3 changes: 1 addition & 2 deletions src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// -----------------------------------------------------------------------------
// Security
// -----------------------------------------------------------------------------
#define ATECC608B_ADDR 0x35

// -----------------------------------------------------------------------------
// IO Expander
Expand Down Expand Up @@ -362,4 +361,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif

#include "DebugConfiguration.h"
#include "RF95Configuration.h"
#include "RF95Configuration.h"
1 change: 0 additions & 1 deletion src/detect/ScanI2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ScanI2C
SCREEN_SH1106,
SCREEN_UNKNOWN, // has the same address as the two above but does not respond to the same commands
SCREEN_ST7567,
ATECC608B,
RTC_RV3028,
RTC_PCF8563,
CARDKB,
Expand Down
Loading

0 comments on commit 1f1d785

Please sign in to comment.