Compare commits

..

5 Commits

Author SHA1 Message Date
thebentern
61d64bdc47 [create-pull-request] automated change 2024-12-21 20:56:39 +00:00
Eric Severance
2fd5a4848a
Separate host:port before checking for private IP (x2) (#5643) 2024-12-21 14:07:20 -06:00
GUVWAF
f4cff33450
Portduino: specify C++ version and add link pthread (#5642)
Some checks are pending
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / package-raspbian (push) Waiting to run
CI / package-raspbian-armv7l (push) Waiting to run
CI / package-native (push) Waiting to run
CI / build-docker (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
Flawfinder Scan / Flawfinder (push) Waiting to run
2024-12-21 11:13:03 -06:00
Ben Meadors
1c8b165408
Add libusb to dockerfile for ch341 (#5641) 2024-12-21 11:03:17 -06:00
Thomas Göttgens
8e6ef4ea04
add nugget and nibble boards for 38c3 (#5609)
* add nugget and nibble boards for 38c3

* mark those boards extra for now
2024-12-21 14:57:01 +01:00
14 changed files with 189 additions and 15 deletions

View File

@ -14,7 +14,7 @@ USER root
# trunk-ignore(hadolint/DL3008): Use latest version of packages for buildchain
RUN apt-get update && apt-get install --no-install-recommends -y wget python3 python3-pip python3-wheel python3-venv g++ zip git \
ca-certificates libgpiod-dev libyaml-cpp-dev libbluetooth-dev \
libulfius-dev liborcania-dev libssl-dev pkg-config && \
libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev pkg-config && \
apt-get clean && rm -rf /var/lib/apt/lists/* && mkdir /tmp/firmware
RUN groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh && chown mesh:mesh /tmp/firmware
@ -37,7 +37,7 @@ ENV TZ=Etc/UTC
# trunk-ignore(terrascan/AC_DOCKER_0002): Known terrascan issue
# trunk-ignore(hadolint/DL3008): Use latest version of packages for buildchain
RUN apt-get update && apt-get --no-install-recommends -y install libc-bin libc6 libgpiod2 libyaml-cpp0.7 libulfius2.7 liborcania2.3 libssl3 && \
RUN apt-get update && apt-get --no-install-recommends -y install libc-bin libc6 libgpiod2 libyaml-cpp0.7 libulfius2.7 libusb-1.0-0-dev liborcania2.3 libssl3 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh
@ -51,4 +51,4 @@ VOLUME /home/mesh/data
CMD [ "sh", "-cx", "./meshtasticd -d /home/mesh/data --hwid=${HWID:-$RANDOM}" ]
HEALTHCHECK NONE
HEALTHCHECK NONE

View File

@ -34,7 +34,9 @@ build_flags =
-Isrc/platform/portduino
-DRADIOLIB_EEPROM_UNSUPPORTED
-DPORTDUINO_LINUX_HARDWARE
-lpthread
-lstdc++fs
-lbluetooth
-lgpiod
-lyaml-cpp
-lyaml-cpp
-std=c++17

41
boards/esp32-s3-zero.json Normal file
View File

@ -0,0 +1,41 @@
{
"build": {
"arduino": {
"partitions": "default.csv",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_ESP32S3_DEV",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DBOARD_HAS_PSRAM"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"psram_type": "qio",
"hwids": [["0x303A", "0x1001"]],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": ["wifi", "bluetooth"],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": ["esp-builtin"],
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"platforms": ["espressif32"],
"name": "Espressif ESP32-S3-FH4R2 (4 MB QD, 2MB PSRAM)",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
"vendor": "Espressif"
}

View File

@ -231,6 +231,23 @@ bool isPrivateIpAddress(const IPAddress &ip)
}
return false;
}
// Separate a <host>[:<port>] string. Returns a pair containing the parsed host and port. If the port is
// not present in the input string, or is invalid, the value of the `port` argument will be returned.
std::pair<String, uint16_t> parseHostAndPort(String server, uint16_t port = 0)
{
const int delimIndex = server.indexOf(':');
if (delimIndex > 0) {
const long parsedPort = server.substring(delimIndex + 1, server.length()).toInt();
if (parsedPort < 1 || parsedPort > UINT16_MAX) {
LOG_WARN("Invalid MQTT port %d: %s", parsedPort, server.c_str());
} else {
port = parsedPort;
}
server[delimIndex] = 0;
}
return std::make_pair(std::move(server), port);
}
} // namespace
void MQTT::mqttCallback(char *topic, byte *payload, unsigned int length)
@ -308,7 +325,8 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), mqttQueue(MAX_MQTT_QUEUE)
}
IPAddress ip;
isMqttServerAddressPrivate = ip.fromString(moduleConfig.mqtt.address) && isPrivateIpAddress(ip);
isMqttServerAddressPrivate =
ip.fromString(parseHostAndPort(moduleConfig.mqtt.address).first.c_str()) && isPrivateIpAddress(ip);
#if HAS_NETWORKING
if (!moduleConfig.mqtt.proxy_to_client_enabled)
@ -424,14 +442,9 @@ void MQTT::reconnect()
pubSub.setClient(mqttClient);
#endif
String server = String(serverAddr);
int delimIndex = server.indexOf(':');
if (delimIndex > 0) {
String port = server.substring(delimIndex + 1, server.length());
server[delimIndex] = 0;
serverPort = port.toInt();
serverAddr = server.c_str();
}
std::pair<String, uint16_t> hostAndPort = parseHostAndPort(serverAddr, serverPort);
serverAddr = hostAndPort.first.c_str();
serverPort = hostAndPort.second;
pubSub.setServer(serverAddr, serverPort);
pubSub.setBufferSize(512);

View File

@ -33,4 +33,6 @@
#define HW_VENDOR meshtastic_HardwareModel_RP2040_LORA
#elif defined(RP2040_FEATHER_RFM95)
#define HW_VENDOR meshtastic_HardwareModel_RP2040_FEATHER_RFM95
#elif defined(PRIVATE_HW)
#define HW_VENDOR meshtastic_HardwareModel_PRIVATE_HW
#endif

View File

@ -0,0 +1,6 @@
[env:nibble-esp32]
extends = esp32s3_base
board = esp32-s3-zero
board_level = extra
build_flags =
${esp32_base.build_flags} -D PRIVATE_HW -I variants/nibble_esp32

View File

@ -0,0 +1,18 @@
#define I2C_SDA 11 // I2C pins for this board
#define I2C_SCL 10
#define LED_PIN 1 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define BUTTON_NEED_PULLUP
#define USE_RF95
#define LORA_SCK 6
#define LORA_MISO 7
#define LORA_MOSI 8
#define LORA_CS 9
#define LORA_DIO0 5 // a No connect on the SX1262 module
#define LORA_RESET 4
#define LORA_DIO1 RADIOLIB_NC
#define LORA_DIO2 RADIOLIB_NC

View File

@ -0,0 +1,17 @@
[env:nibble-rp2040]
extends = rp2040_base
board = rpipico
board_level = extra
upload_protocol = picotool
# add our variants files to the include and src paths
build_flags = ${rp2040_base.build_flags}
-DPRIVATE_HW
-Ivariants/nibble_rp2040
-DDEBUG_RP2040_PORT=Serial
-DHW_SPI1_DEVICE
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
lib_deps =
${rp2040_base.lib_deps}
debug_build_flags = ${rp2040_base.build_flags}, -g
debug_tool = cmsis-dap ; for e.g. Picotool

View File

@ -0,0 +1,18 @@
#define ARDUINO_ARCH_AVR
#define BUTTON_PIN -1 // Pin 17 used for antenna switching via DIO4
#define LED_PIN 1
#define HAS_CPU_SHUTDOWN 1
#define USE_RFM95
#define LORA_SCK 10
#define LORA_MISO 12
#define LORA_MOSI 11
#define LORA_CS 13
#define LORA_DIO0 14
#define LORA_RESET 15
#define LORA_DIO1 RADIOLIB_NC
#define LORA_DIO2 RADIOLIB_NC

View File

@ -0,0 +1,6 @@
[env:nugget-s2-lora]
extends = esp32s2_base
board = lolin_s2_mini
board_level = extra
build_flags =
${esp32s2_base.build_flags} -D PRIVATE_HW -I variants/nugget_s2_lora

View File

@ -0,0 +1,23 @@
#define I2C_SDA 34 // I2C pins for this board
#define I2C_SCL 36
#define LED_PIN 15 // If defined we will blink this LED
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 3 // How many neopixels are connected
#define NEOPIXEL_DATA 12 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define BUTTON_NEED_PULLUP
#define USE_RF95
#define LORA_SCK 6
#define LORA_MISO 8
#define LORA_MOSI 10
#define LORA_CS 13
#define LORA_DIO0 16
#define LORA_RESET 5
#define LORA_DIO1 RADIOLIB_NC
#define LORA_DIO2 RADIOLIB_NC

View File

@ -0,0 +1,6 @@
[env:nugget-s3-lora]
extends = esp32s3_base
board = lolin_s3_mini
board_level = extra
build_flags =
${esp32s3_base.build_flags} -D PRIVATE_HW -I variants/nugget_s3_lora

View File

@ -0,0 +1,23 @@
#define I2C_SDA 34 // I2C pins for this board
#define I2C_SCL 38
#define LED_PIN 15 // If defined we will blink this LED
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 3 // How many neopixels are connected
#define NEOPIXEL_DATA 10 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define BUTTON_NEED_PULLUP
#define USE_RF95
#define LORA_SCK 6
#define LORA_MISO 7
#define LORA_MOSI 8
#define LORA_CS 9
#define LORA_DIO0 16 // a No connect on the SX1262 module
#define LORA_RESET 4
#define LORA_DIO1 RADIOLIB_NC
#define LORA_DIO2 RADIOLIB_NC

View File

@ -3,7 +3,6 @@ extends = portduino_base
; Optional libraries should be appended to `PLATFORMIO_BUILD_FLAGS`
; environment variable in the buildroot environment.
build_flags = ${portduino_base.build_flags} -O0 -I variants/portduino-buildroot
-std=c++17
board = buildroot
lib_deps = ${portduino_base.lib_deps}
build_src_filter = ${portduino_base.build_src_filter}
build_src_filter = ${portduino_base.build_src_filter}