diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 66bf7539c..aacdc72af 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -2,14 +2,14 @@ name: CI on: # # Triggers the workflow on push but only for the master branch push: - branches: [master] + branches: [master, develop] paths-ignore: - "**.md" - "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" @@ -170,7 +170,7 @@ jobs: path: | release/*.bin release/*.elf - retention-days: 90 + retention-days: 30 build-nrf52: strategy: @@ -229,7 +229,7 @@ jobs: release/*.uf2 release/*.elf release/*.zip - retention-days: 90 + retention-days: 30 build-rpi2040: strategy: @@ -283,7 +283,7 @@ jobs: path: | release/*.uf2 release/*.elf - retention-days: 90 + retention-days: 30 build-native: runs-on: ubuntu-latest @@ -342,7 +342,7 @@ jobs: release/meshtasticd_linux_amd64 release/device-*.sh release/device-*.bat - retention-days: 90 + retention-days: 30 after-checks: runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..01d262ce3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM debian:bullseye-slim AS builder +RUN apt-get update +RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install wget python3 g++ zip python3-venv git vim +RUN wget https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -O get-platformio.py; chmod +x get-platformio.py +RUN python3 get-platformio.py +RUN git clone https://github.com/meshtastic/firmware --recurse-submodules +RUN cd firmware +RUN chmod +x ./firmware/bin/build-native.sh +RUN . ~/.platformio/penv/bin/activate; cd firmware; sh ./bin/build-native.sh + +FROM frolvlad/alpine-glibc +WORKDIR /root/ +COPY --from=builder /firmware/release/meshtasticd_linux_amd64 ./ +RUN apk --update add --no-cache g++ +CMD ["./meshtasticd_linux_amd64"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..28b8c2ebd --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,5 @@ +version: "3.7" + +services: + meshtastic-device: + build: . diff --git a/protobufs b/protobufs index a0fe9ec86..6b46e42a6 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit a0fe9ec8614cd27af7691869ccbd20c39e48a086 +Subproject commit 6b46e42a656dd3aab74c373e79b70e699eeac834 diff --git a/src/gps/NMEAWPL.cpp b/src/gps/NMEAWPL.cpp index 95e69343b..222a2d04c 100644 --- a/src/gps/NMEAWPL.cpp +++ b/src/gps/NMEAWPL.cpp @@ -15,11 +15,11 @@ * ------------------------------------------- */ -uint printWPL(char *buf, const Position &pos, const char *name) +uint32_t printWPL(char *buf, const Position &pos, const char *name) { - uint len = sprintf(buf, "$GNWPL,%07.2f,%c,%08.2f,%c,%s", pos.latitude_i * 1e-5, pos.latitude_i < 0 ? 'S' : 'N', pos.longitude_i * 1e-5, pos.longitude_i < 0 ? 'W' : 'E', name); - uint chk = 0; - for (uint i = 1; i < len; i++) { + uint32_t len = sprintf(buf, "$GNWPL,%07.2f,%c,%08.2f,%c,%s", pos.latitude_i * 1e-5, pos.latitude_i < 0 ? 'S' : 'N', pos.longitude_i * 1e-5, pos.longitude_i < 0 ? 'W' : 'E', name); + uint32_t chk = 0; + for (uint32_t i = 1; i < len; i++) { chk ^= buf[i]; } len += sprintf(buf + len, "*%02X\r\n", chk); @@ -50,9 +50,9 @@ uint printWPL(char *buf, const Position &pos, const char *name) * ------------------------------------------- */ -uint printGGA(char *buf, const Position &pos) +uint32_t printGGA(char *buf, const Position &pos) { - uint len = sprintf(buf, "$GNGGA,%06u.%03u,%07.2f,%c,%08.2f,%c,%u,%02u,%04u,%04d,%c,%04d,%c,%d,%04d", + uint32_t len = sprintf(buf, "$GNGGA,%06u.%03u,%07.2f,%c,%08.2f,%c,%u,%02u,%04u,%04d,%c,%04d,%c,%d,%04d", pos.time / 1000, pos.time % 1000, pos.latitude_i * 1e-5, pos.latitude_i < 0 ? 'S' : 'N', @@ -67,10 +67,10 @@ uint printGGA(char *buf, const Position &pos) 0, 0); - uint chk = 0; - for (uint i = 1; i < len; i++) { + 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; -} \ No newline at end of file +} diff --git a/src/gps/NMEAWPL.h b/src/gps/NMEAWPL.h index 853c850eb..aaa18933c 100644 --- a/src/gps/NMEAWPL.h +++ b/src/gps/NMEAWPL.h @@ -3,5 +3,5 @@ #include #include "main.h" -uint printWPL(char *buf, const Position &pos, const char *name); -uint printGGA(char *buf, const Position &pos); +uint32_t printWPL(char *buf, const Position &pos, const char *name); +uint32_t printGGA(char *buf, const Position &pos); diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index 262a10c18..c08220555 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -317,7 +317,13 @@ ErrorCode RadioLibInterface::send(MeshPacket *p) void RadioLibInterface::handleReceiveInterrupt() { uint32_t xmitMsec; - assert(isReceiving); + + // when this is called, we should be in receive mode - if we are not, just jump out instead of bombing. Possible Race Condition? + if (!isReceiving) { + DEBUG_MSG("*** WAS_ASSERT *** handleReceiveInterrupt called when not in receive mode\n"); + return; + } + isReceiving = false; // read the number of actually received bytes diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 812099166..c1c2bdd7b 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -501,7 +501,7 @@ typedef PB_BYTES_ARRAY_T(256) MeshPacket_encrypted_t; typedef struct _MeshPacket { /* The sending node number. Note: Our crypto implementation uses this field as well. - See [crypto](/docs/developers/firmware/encryption) for details. + See [crypto](/docs/about/overview/encryption) for details. FIXME - really should be fixed32 instead, this encoding only hurts the ble link though. */ uint32_t from; /* The (immediatSee Priority description for more details.y should be fixed32 instead, this encoding only @@ -529,7 +529,7 @@ typedef struct _MeshPacket { needs to be unique for a few minutes (long enough to last for the length of any ACK or the completion of a mesh broadcast flood). Note: Our crypto implementation uses this id as well. - See [crypto](/docs/developers/firmware/encryption) for details. + See [crypto](/docs/about/overview/encryption) for details. FIXME - really should be fixed32 instead, this encoding only hurts the ble link though. */ uint32_t id; diff --git a/src/sleep.cpp b/src/sleep.cpp index 055cf770d..390ab7f65 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -263,8 +263,8 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r #ifdef BUTTON_PIN gpio_wakeup_enable((gpio_num_t)BUTTON_PIN, GPIO_INTR_LOW_LEVEL); // when user presses, this button goes low #endif -#ifdef RF95_IRQ_GPIO - gpio_wakeup_enable((gpio_num_t)RF95_IRQ_GPIO, GPIO_INTR_HIGH_LEVEL); // RF95 interrupt, active high +#ifdef RF95_IRQ + gpio_wakeup_enable((gpio_num_t)RF95_IRQ, GPIO_INTR_HIGH_LEVEL); // RF95 interrupt, active high #endif #ifdef PMU_IRQ // wake due to PMU can happen repeatedly if there is no battery installed or the battery fills