Skip to content

Commit

Permalink
Merge branch 'meshtastic:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Mictronics authored Feb 11, 2024
2 parents f70eeec + ce8673b commit 95dd77e
Show file tree
Hide file tree
Showing 32 changed files with 449 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
- board: rak4631_eink
- board: monteops_hw1
- board: t-echo
- board: canaryone
- board: pca10059_diy_eink
- board: feather_diy
- board: nano-g2-ultra
Expand All @@ -128,6 +129,7 @@ jobs:
- board: picow
- board: rak11310
- board: senselora_rp2040
- board: rp2040-lora
uses: ./.github/workflows/build_rpi2040.yml
with:
board: ${{ matrix.board }}
Expand Down
2 changes: 1 addition & 1 deletion bin/check-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [[ $# -gt 0 ]]; then
# can override which environment by passing arg
BOARDS="$@"
else
BOARDS="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 rak4631 rak4631_eink rak11200 t-echo pca10059_diy_eink"
BOARDS="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 rak4631 rak4631_eink rak11200 t-echo canaryone pca10059_diy_eink"
fi

echo "BOARDS:${BOARDS}"
Expand Down
8 changes: 4 additions & 4 deletions bin/check-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
set -e

if [[ $# -gt 0 ]]; then
# can override which environment by passing arg
BOARDS="$@"
# 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"
BOARDS="rak4631 rak4631_eink t-echo canaryone 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}"
CHECK="${CHECK} -e ${BOARD}"
done

echo $CHECK
Expand Down
49 changes: 49 additions & 0 deletions boards/canaryone.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_CANARY -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [["0x239A", "0x4405"]],
"usb_product": "CanaryOne",
"mcu": "nrf52840",
"variant": "canaryone",
"variants_dir": "variants",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Canary (Adafruit BSP)",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://canaryradio.io/",
"vendor": "Canary Radio Company"
}
3 changes: 2 additions & 1 deletion boards/eink0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "TTGO eink (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/lora-relay-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Meshtastic Lora Relay V1 (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/lora-relay-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Meshtastic Lora Relay V1 (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/lora_isp4520.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
"svd_path": "nrf52.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "lora ISP4520",
Expand Down
3 changes: 2 additions & 1 deletion boards/nordic_pca10059.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "nRF52840 Dongle",
Expand Down
3 changes: 2 additions & 1 deletion boards/nrf52840_dk.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "A modified NRF52840-DK devboard (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/nrf52840_dk_modified.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "A modified NRF52840-DK devboard (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/ppr.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Meshtastic PPR (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/ppr1.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"debug": {
"jlink_device": "nRF52833_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52833.svd"
"svd_path": "nrf52833.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Meshtastic PPR1 (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/t-echo.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "TTGO eink (Adafruit BSP)",
Expand Down
3 changes: 2 additions & 1 deletion boards/wiscore_rak4600.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
"svd_path": "nrf52.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino", "zephyr"],
"name": "Adafruit Bluefruit nRF52832 Feather",
Expand Down
3 changes: 2 additions & 1 deletion boards/wiscore_rak4631.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "WisCore RAK4631 Board",
Expand Down
3 changes: 2 additions & 1 deletion boards/xiao_ble_sense.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Seeed Xiao BLE Sense",
Expand Down
2 changes: 2 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ default_envs = tbeam
;default_envs = tlora-t3s3-v1
;default_envs = lora-relay-v1 # nrf board
;default_envs = t-echo
;default_envs = canaryone
;default_envs = nrf52840dk-geeksville
;default_envs = native # lora-relay-v1 # nrf52840dk-geeksville # linux # or if you'd like to change the default to something like lora-relay-v1 put that here
;default_envs = nano-g1
Expand Down Expand Up @@ -57,6 +58,7 @@ build_flags = -Wno-missing-field-initializers
-DRADIOLIB_EXCLUDE_SI443X
-DRADIOLIB_EXCLUDE_RFM2X
-DRADIOLIB_EXCLUDE_AFSK
-DRADIOLIB_EXCLUDE_BELL
-DRADIOLIB_EXCLUDE_HELLSCHREIBER
-DRADIOLIB_EXCLUDE_MORSE
-DRADIOLIB_EXCLUDE_RTTY
Expand Down
2 changes: 1 addition & 1 deletion protobufs
2 changes: 1 addition & 1 deletion src/DebugConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define DEBUG_PORT (*console) // Serial debug port

#ifdef USE_SEGGER
#define DEBUG_PORT
// #undef DEBUG_PORT
#define LOG_DEBUG(...) SEGGER_RTT_printf(0, __VA_ARGS__)
#define LOG_INFO(...) SEGGER_RTT_printf(0, __VA_ARGS__)
#define LOG_WARN(...) SEGGER_RTT_printf(0, __VA_ARGS__)
Expand Down
14 changes: 13 additions & 1 deletion src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// -----------------------------------------------------------------------------
// GPS
// -----------------------------------------------------------------------------

#ifndef GPS_BAUDRATE
#define GPS_BAUDRATE 9600
#endif

#ifndef GPS_THREAD_INTERVAL
#define GPS_THREAD_INTERVAL 200
Expand All @@ -161,6 +162,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

/* Step #3: mop up with disabled values for HAS_ options not handled by the above two */

// -----------------------------------------------------------------------------
// GPS
// -----------------------------------------------------------------------------

#ifndef GPS_BAUDRATE
#define GPS_BAUDRATE 9600
#endif
#ifndef GPS_THREAD_INTERVAL
#define GPS_THREAD_INTERVAL 100
#endif

#ifndef HAS_WIFI
#define HAS_WIFI 0
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/mesh/generated/meshtastic/mesh.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ typedef enum _meshtastic_HardwareModel {
meshtastic_HardwareModel_SENSELORA_S3 = 28,
/* Canary Radio Company - CanaryOne: https://canaryradio.io/products/canaryone */
meshtastic_HardwareModel_CANARYONE = 29,
/* Waveshare RP2040 LoRa - https://www.waveshare.com/rp2040-lora.htm */
meshtastic_HardwareModel_RP2040_LORA = 30,
/* ---------------------------------------------------------------------------
Less common/prototype boards listed here (needs one more byte over the air)
--------------------------------------------------------------------------- */
Expand Down
20 changes: 11 additions & 9 deletions src/mesh/generated/meshtastic/storeforward.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ typedef struct _meshtastic_StoreAndForward_Statistics {
uint32_t requests_history;
/* Is the heartbeat enabled on the server? */
bool heartbeat;
/* Is the heartbeat enabled on the server? */
/* Maximum number of messages the server will return. */
uint32_t return_max;
/* Is the heartbeat enabled on the server? */
/* Maximum history window in minutes the server will return messages from. */
uint32_t return_window;
} meshtastic_StoreAndForward_Statistics;

Expand All @@ -74,18 +74,20 @@ typedef struct _meshtastic_StoreAndForward_History {
uint32_t history_messages;
/* The window of messages that was used to filter the history client requested */
uint32_t window;
/* The window of messages that was used to filter the history client requested */
/* Index in the packet history of the last message sent in a previous request to the server.
Will be sent to the client before sending the history and can be set in a subsequent request to avoid getting packets the server already sent to the client. */
uint32_t last_request;
} meshtastic_StoreAndForward_History;

/* TODO: REPLACE */
typedef struct _meshtastic_StoreAndForward_Heartbeat {
/* Number of that will be sent to the client */
/* Period in seconds that the heartbeat is sent out that will be sent to the client */
uint32_t period;
/* If set, this is not the primary Store & Forward router on the mesh */
uint32_t secondary;
} meshtastic_StoreAndForward_Heartbeat;

typedef PB_BYTES_ARRAY_T(237) meshtastic_StoreAndForward_text_t;
/* TODO: REPLACE */
typedef struct _meshtastic_StoreAndForward {
/* TODO: REPLACE */
Expand All @@ -98,8 +100,8 @@ typedef struct _meshtastic_StoreAndForward {
meshtastic_StoreAndForward_History history;
/* TODO: REPLACE */
meshtastic_StoreAndForward_Heartbeat heartbeat;
/* Empty Payload */
bool empty;
/* Text from history message. */
meshtastic_StoreAndForward_text_t text;
} variant;
} meshtastic_StoreAndForward;

Expand Down Expand Up @@ -148,15 +150,15 @@ extern "C" {
#define meshtastic_StoreAndForward_stats_tag 2
#define meshtastic_StoreAndForward_history_tag 3
#define meshtastic_StoreAndForward_heartbeat_tag 4
#define meshtastic_StoreAndForward_empty_tag 5
#define meshtastic_StoreAndForward_text_tag 5

/* Struct field encoding specification for nanopb */
#define meshtastic_StoreAndForward_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UENUM, rr, 1) \
X(a, STATIC, ONEOF, MESSAGE, (variant,stats,variant.stats), 2) \
X(a, STATIC, ONEOF, MESSAGE, (variant,history,variant.history), 3) \
X(a, STATIC, ONEOF, MESSAGE, (variant,heartbeat,variant.heartbeat), 4) \
X(a, STATIC, ONEOF, BOOL, (variant,empty,variant.empty), 5)
X(a, STATIC, ONEOF, BYTES, (variant,text,variant.text), 5)
#define meshtastic_StoreAndForward_CALLBACK NULL
#define meshtastic_StoreAndForward_DEFAULT NULL
#define meshtastic_StoreAndForward_variant_stats_MSGTYPE meshtastic_StoreAndForward_Statistics
Expand Down Expand Up @@ -204,7 +206,7 @@ extern const pb_msgdesc_t meshtastic_StoreAndForward_Heartbeat_msg;
#define meshtastic_StoreAndForward_Heartbeat_size 12
#define meshtastic_StoreAndForward_History_size 18
#define meshtastic_StoreAndForward_Statistics_size 50
#define meshtastic_StoreAndForward_size 54
#define meshtastic_StoreAndForward_size 242

#ifdef __cplusplus
} /* extern "C" */
Expand Down
6 changes: 3 additions & 3 deletions src/modules/SerialModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
SerialModule *serialModule;
SerialModuleRadio *serialModuleRadio;

#ifdef TTGO_T_ECHO
#if defined(TTGO_T_ECHO) || defined(CANARYONE)
SerialModule::SerialModule() : StreamAPI(&Serial), concurrency::OSThread("SerialModule") {}
static Print *serialPrint = &Serial;
#else
Expand Down Expand Up @@ -140,7 +140,7 @@ int32_t SerialModule::runOnce()
Serial.begin(baud);
Serial.setTimeout(moduleConfig.serial.timeout > 0 ? moduleConfig.serial.timeout : TIMEOUT);
}
#elif !defined(TTGO_T_ECHO)
#elif !defined(TTGO_T_ECHO) && !defined(CANARYONE)
if (moduleConfig.serial.rxd && moduleConfig.serial.txd) {
#ifdef ARCH_RP2040
Serial2.setFIFOSize(RX_BUFFER);
Expand Down Expand Up @@ -188,7 +188,7 @@ int32_t SerialModule::runOnce()
}
}
}
#if !defined(TTGO_T_ECHO)
#if !defined(TTGO_T_ECHO) && !defined(CANARYONE)
else {
while (Serial2.available()) {
serialPayloadSize = Serial2.readBytes(serialBytes, meshtastic_Constants_DATA_PAYLOAD_LEN);
Expand Down
Loading

0 comments on commit 95dd77e

Please sign in to comment.