Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: meshcore-dev
10 changes: 1 addition & 9 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ Anyone is able to build anything they like on top of MeshCore without paying any
- MeshCore Firmware on GitHub: [https://github.com/meshcore-dev/MeshCore](https://github.com/meshcore-dev/MeshCore)
- MeshCore Companion Web App: [https://app.meshcore.nz](https://app.meshcore.nz)
- MeshCore Map: [https://map.meshcore.io](https://map.meshcore.io)
- Andy Kirby's [MeshCore Intro Video](https://www.youtube.com/watch?v=t1qne8uJBAc)
- Liam Cottle's [MeshCore Technical Presentation](https://www.youtube.com/watch?v=OwmkVkZQTf4)

You need LoRa hardware devices to run MeshCore firmware as clients or server (repeater and room server).
Expand Down Expand Up @@ -402,10 +401,7 @@ Another way to download map tiles is to use this Python script to get the tiles
<https://github.com/fistulareffigy/MTD-Script>

There is also a modified script that adds additional error handling and parallel downloads:
<https://discord.com/channels/826570251612323860/1330643963501351004/1338775811548905572>

UK map tiles are available separately from Andy Kirby on his discord server:
<https://discord.com/channels/826570251612323860/1330643963501351004/1331346597367386224>
<https://github.com/TheBestJohn/MTD-Script>

### 4.8. Q: Where do the map tiles go?
Once you have the tiles downloaded, copy the `\tiles` folder to the root of your T-Deck's SD card.
Expand Down Expand Up @@ -563,10 +559,6 @@ pio run -e RAK_4631_Repeater
```
then you'll find `firmware.zip` in `.pio/build/RAK_4631_Repeater`

Andy also has a video on how to build using VS Code:
*How to build and flash Meshcore repeater firmware | Heltec V3*
<https://www.youtube.com/watch?v=WJvg6dt13hk> *(Link referenced in the Discord post)*

### 5.10. Q: Are there other MeshCore related open source projects?

**A:** [Liam Cottle](https://liamcottle.net)'s MeshCore web client and MeshCore Javascript library are open source under MIT license.
Expand Down
3 changes: 3 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ build_flags =
-D ENV_INCLUDE_BME280=1
-D ENV_INCLUDE_BMP280=1
-D ENV_INCLUDE_SHTC3=1
-D ENV_INCLUDE_SHT3X=1
-D ENV_INCLUDE_SHT3X=1
-D ENV_INCLUDE_SHT4X=1
-D ENV_INCLUDE_LPS22HB=1
-D ENV_INCLUDE_INA3221=1
Expand All @@ -144,6 +146,7 @@ lib_deps =
adafruit/Adafruit BME280 Library @ ^2.3.0
adafruit/Adafruit BMP280 Library @ ^2.6.8
adafruit/Adafruit SHTC3 Library @ ^1.0.1
adafruit/Adafruit SHT31 Library @ ^2.2.2
sensirion/Sensirion I2C SHT4x @ ^1.1.2
arduino-libraries/Arduino_LPS22HB @ ^1.0.2
adafruit/Adafruit MLX90614 Library @ ^2.1.5
Expand Down
29 changes: 29 additions & 0 deletions src/helpers/sensors/EnvironmentSensorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ static Adafruit_BME280 BME280;
static Adafruit_BMP280 BMP280(TELEM_WIRE);
#endif

#if ENV_INCLUDE_SHT3X
#ifndef TELEM_SHT3X_ADDRESS
#define TELEM_SHT3X_ADDRESS 0x44
#endif
#include <Adafruit_SHT31.h>
static Adafruit_SHT31 SHT3X;
#endif

#if ENV_INCLUDE_SHTC3
#include <Adafruit_SHTC3.h>
static Adafruit_SHTC3 SHTC3;
Expand Down Expand Up @@ -230,6 +238,16 @@ bool EnvironmentSensorManager::begin() {
}
#endif

#if ENV_INCLUDE_SHT3X
if (SHT3X.begin(TELEM_SHT3X_ADDRESS)) {
MESH_DEBUG_PRINTLN("Found SHT3x at address: %02X", TELEM_SHT3X_ADDRESS);
SHT3X_initialized = true;
} else {
SHT3X_initialized = false;
MESH_DEBUG_PRINTLN("SHT3x was not found at I2C address %02X", TELEM_SHT3X_ADDRESS);
}
#endif

#if ENV_INCLUDE_SHTC3
if (SHTC3.begin(TELEM_WIRE)) {
MESH_DEBUG_PRINTLN("Found sensor: SHTC3");
Expand Down Expand Up @@ -407,6 +425,17 @@ bool EnvironmentSensorManager::querySensors(uint8_t requester_permissions, Cayen
}
#endif

#if ENV_INCLUDE_SHT3X
if (SHT3X_initialized) {
float sht3x_temp = SHT3X.readTemperature();
float sht3x_humidity = SHT3X.readHumidity();
if (!isnan(sht3x_temp) && !isnan(sht3x_humidity)) {
telemetry.addTemperature(TELEM_CHANNEL_SELF, sht3x_temp);
telemetry.addRelativeHumidity(TELEM_CHANNEL_SELF, sht3x_humidity);
}
}
#endif

#if ENV_INCLUDE_SHTC3
if (SHTC3_initialized) {
sensors_event_t humidity, temp;
Expand Down
1 change: 1 addition & 0 deletions src/helpers/sensors/EnvironmentSensorManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class EnvironmentSensorManager : public SensorManager {
bool INA219_initialized = false;
bool INA260_initialized = false;
bool INA226_initialized = false;
bool SHT3X_initialized = false;
bool SHTC3_initialized = false;
bool LPS22HB_initialized = false;
bool MLX90614_initialized = false;
Expand Down
10 changes: 10 additions & 0 deletions variants/lilygo_teth_elite/TETHEliteBoard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once

#include <helpers/ESP32Board.h>

class TETHEliteBoard : public ESP32Board {
public:
const char* getManufacturerName() const override {
return "LilyGO T-ETH Elite";
}
};
99 changes: 99 additions & 0 deletions variants/lilygo_teth_elite/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[LilyGo_TETH_Elite_sx1262]
extends = esp32_base
board = esp32s3box
board_build.partitions = default_16MB.csv
board_upload.flash_size = 16MB
build_flags =
${esp32_base.build_flags}
-I variants/lilygo_teth_elite
-D BOARD_HAS_PSRAM
-D LILYGO_TETH_ELITE
-D LILYGO_T_ETH_ELITE_ESP32S3
-D ARDUINO_USB_CDC_ON_BOOT=1
-D P_LORA_DIO_1=8
-D P_LORA_NSS=40
-D P_LORA_RESET=46
-D P_LORA_BUSY=16
-D P_LORA_SCLK=10
-D P_LORA_MISO=9
-D P_LORA_MOSI=11
-D P_LORA_TX_LED=38
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140
-D USE_SX1262
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D LORA_TX_POWER=8
-D SX126X_RX_BOOSTED_GAIN=1
build_src_filter = ${esp32_base.build_src_filter}
+<../variants/lilygo_teth_elite>
lib_deps =
${esp32_base.lib_deps}

[env:LilyGo_TETH_Elite_sx1262_repeater]
extends = LilyGo_TETH_Elite_sx1262
build_flags =
${LilyGo_TETH_Elite_sx1262.build_flags}
-D ADVERT_NAME='"T-ETH Elite Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${LilyGo_TETH_Elite_sx1262.build_src_filter}
+<../examples/simple_repeater>
lib_deps =
${LilyGo_TETH_Elite_sx1262.lib_deps}
${esp32_ota.lib_deps}

[env:LilyGo_TETH_Elite_sx1262_room_server]
extends = LilyGo_TETH_Elite_sx1262
build_flags =
${LilyGo_TETH_Elite_sx1262.build_flags}
-D ADVERT_NAME='"T-ETH Elite Room"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${LilyGo_TETH_Elite_sx1262.build_src_filter}
+<../examples/simple_room_server>
lib_deps =
${LilyGo_TETH_Elite_sx1262.lib_deps}
${esp32_ota.lib_deps}

[env:LilyGo_TETH_Elite_sx1262_companion_radio_usb]
extends = LilyGo_TETH_Elite_sx1262
build_flags =
${LilyGo_TETH_Elite_sx1262.build_flags}
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D OFFLINE_QUEUE_SIZE=256
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${LilyGo_TETH_Elite_sx1262.build_src_filter}
+<../examples/companion_radio/*.cpp>
lib_deps =
${LilyGo_TETH_Elite_sx1262.lib_deps}
densaugeo/base64 @ ~1.4.0

[env:LilyGo_TETH_Elite_sx1262_companion_radio_ble]
extends = LilyGo_TETH_Elite_sx1262
build_flags =
${LilyGo_TETH_Elite_sx1262.build_flags}
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1
-D OFFLINE_QUEUE_SIZE=256
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${LilyGo_TETH_Elite_sx1262.build_src_filter}
+<helpers/esp32/*.cpp>
+<../examples/companion_radio/*.cpp>
lib_deps =
${LilyGo_TETH_Elite_sx1262.lib_deps}
densaugeo/base64 @ ~1.4.0
43 changes: 43 additions & 0 deletions variants/lilygo_teth_elite/target.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <Arduino.h>
#include "target.h"

TETHEliteBoard board;

static SPIClass spi(HSPI);
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi);
WRAPPER_CLASS radio_driver(radio, board);

ESP32RTCClock fallback_clock;
AutoDiscoverRTCClock rtc_clock(fallback_clock);
SensorManager sensors;

#ifndef LORA_CR
#define LORA_CR 5
#endif

bool radio_init() {
fallback_clock.begin();
rtc_clock.begin(Wire);

return radio.std_init(&spi);
}

uint32_t radio_get_rng_seed() {
return radio.random(0x7FFFFFFF);
}

void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) {
radio.setFrequency(freq);
radio.setSpreadingFactor(sf);
radio.setBandwidth(bw);
radio.setCodingRate(cr);
}

void radio_set_tx_power(int8_t dbm) {
radio.setOutputPower(dbm);
}

mesh::LocalIdentity radio_new_identity() {
RadioNoiseListener rng(radio);
return mesh::LocalIdentity(&rng);
}
20 changes: 20 additions & 0 deletions variants/lilygo_teth_elite/target.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once

#define RADIOLIB_STATIC_ONLY 1
#include <RadioLib.h>
#include <helpers/radiolib/RadioLibWrappers.h>
#include <helpers/radiolib/CustomSX1262Wrapper.h>
#include <helpers/AutoDiscoverRTCClock.h>
#include <helpers/SensorManager.h>
#include "TETHEliteBoard.h"

extern TETHEliteBoard board;
extern WRAPPER_CLASS radio_driver;
extern AutoDiscoverRTCClock rtc_clock;
extern SensorManager sensors;

bool radio_init();
uint32_t radio_get_rng_seed();
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
void radio_set_tx_power(int8_t dbm);
mesh::LocalIdentity radio_new_identity();