diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml new file mode 100644 index 000000000..2b6ffce0a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -0,0 +1,27 @@ +name: Feature Request +description: Request a new feature +title: "[Feature Request]: " +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Thanks for your request this will not gurantee that we will implement it, but it will be reviewed. + - type: dropdown + id: soc + attributes: + label: Platform + description: What device platform will support your feature? + multiple: true + options: + - NRF52 + - ESP32 + validations: + required: true + - type: textarea + id: body + attributes: + label: Description + description: Please provide details about your enhancement. + validations: + required: true diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 2440b2ed3..e10369465 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -127,7 +127,6 @@ jobs: with: name: firmware-native-${{ steps.version.outputs.version }}.zip path: | - release/meshtasticd_linux_amd64 release/device-*.sh release/device-*.bat @@ -180,7 +179,7 @@ jobs: id: version - name: Move files up - run: mv -b -t ./ ./*tbeam-2*/littlefs*.bin ./*tbeam-2*/bleota.bin ./**/firmware*.bin ./*t-echo*/Meshtastic_nRF52_factory_erase.uf2 ./**/firmware-*.uf2 ./**/firmware-*-ota.zip ./**/*.elf ./**/meshtasticd_linux_amd64 ./*native*/*device-*.sh ./*native*/*device-*.bat + run: mv -b -t ./ ./*tbeam-2*/littlefs*.bin ./*tbeam-2*/bleota.bin ./**/firmware*.bin ./*t-echo*/Meshtastic_nRF52_factory_erase.uf2 ./**/firmware-*.uf2 ./**/firmware-*-ota.zip ./**/*.elf ./*native*/*device-*.sh ./*native*/*device-*.bat - name: Repackage in single firmware zip uses: actions/upload-artifact@v3 @@ -190,7 +189,6 @@ jobs: ./*.bin ./*.uf2 ./firmware-*-ota.zip - ./meshtasticd_linux_amd64 ./device-*.sh ./device-*.bat retention-days: 90 @@ -210,7 +208,7 @@ jobs: chmod +x ./output/device-update.sh - name: Zip firmware - run: zip -j -r ./firmware-${{ steps.version.outputs.version }}.zip ./output + run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output - name: Repackage in single elfs zip uses: actions/upload-artifact@v3 @@ -259,7 +257,7 @@ jobs: chmod +x ./output/device-update.sh - name: Zip firmware - run: zip -j -r ./firmware-${{ steps.version.outputs.version }}.zip ./output + run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output - uses: actions/download-artifact@v3 with: @@ -267,7 +265,7 @@ jobs: path: ./elfs - name: Zip Elfs - run: zip -j -r ./debug-elfs-${{ steps.version.outputs.version }}.zip ./elfs + run: zip -j -9 -r ./debug-elfs-${{ steps.version.outputs.version }}.zip ./elfs # For diagnostics - name: Show artifacts diff --git a/bin/build-esp32.sh b/bin/build-esp32.sh index 5a2044a35..6068eb256 100755 --- a/bin/build-esp32.sh +++ b/bin/build-esp32.sh @@ -29,6 +29,10 @@ echo "Copying ESP32 bin file" SRCBIN=.pio/build/$1/firmware.factory.bin cp $SRCBIN $OUTDIR/$basename.bin +echo "Copying ESP32 update bin file" +SRCBIN=.pio/build/$1/firmware.bin +cp $SRCBIN $OUTDIR/$basename-update.bin + echo "Building Filesystem for ESP32 targets" pio run --environment tbeam -t buildfs cp .pio/build/tbeam/littlefs.bin $OUTDIR/littlefs-$VERSION.bin diff --git a/bin/device-update.bat b/bin/device-update.bat index 40def6caf..103fbad6e 100755 --- a/bin/device-update.bat +++ b/bin/device-update.bat @@ -10,7 +10,7 @@ echo. echo -h Display this help and exit echo -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous). echo -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: %PYTHON%) -echo -f FILENAME The .bin file to flash. Custom to your device type and region. +echo -f FILENAME The *update.bin file to flash. Custom to your device type. goto EOF :GETOPTS @@ -28,7 +28,7 @@ IF "__%FILENAME%__" == "____" ( ) IF EXIST %FILENAME% ( echo Trying to flash update %FILENAME% - %PYTHON% -m esptool --baud 115200 write_flash 0x00 %FILENAME% + %PYTHON% -m esptool --baud 115200 write_flash 0x10000 %FILENAME% ) else ( echo "Invalid file: %FILENAME%" goto HELP diff --git a/bin/device-update.sh b/bin/device-update.sh index a6d80c200..bd06fb25a 100755 --- a/bin/device-update.sh +++ b/bin/device-update.sh @@ -11,7 +11,7 @@ Flash image file to device, leave existing system intact." -h Display this help and exit -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous). -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON") - -f FILENAME The .bin file to flash. Custom to your device type and region. + -f FILENAME The *update.bin file to flash. Custom to your device type. EOF } @@ -44,7 +44,7 @@ shift "$((OPTIND-1))" if [ -f "${FILENAME}" ]; then echo "Trying to flash update ${FILENAME}." - $PYTHON -m esptool --baud 115200 write_flash 0x00 ${FILENAME} + $PYTHON -m esptool --baud 115200 write_flash 0x10000 ${FILENAME} else echo "Invalid file: ${FILENAME}" show_help diff --git a/src/mesh/MeshModule.cpp b/src/mesh/MeshModule.cpp index e8f04aadb..ca1fb5b50 100644 --- a/src/mesh/MeshModule.cpp +++ b/src/mesh/MeshModule.cpp @@ -115,11 +115,11 @@ void MeshModule::callPlugins(const MeshPacket &mp, RxSource src) // no one should have already replied! assert(!currentReply); - if (mp.decoded.want_response || (isDecoded && mp.want_ack)) { - printPacket("Packet on wrong channel, returning error", &mp); - currentReply = pi.allocErrorResponse(Routing_Error_NOT_AUTHORIZED, &mp); + if (mp.decoded.want_response) { + printPacket("packet on wrong channel, returning error", &mp); + currentReply = pi.allocErrorResponse(Routing_Error_NOT_AUTHORIZED, &mp); } else - printPacket("Packet on wrong channel, but it didn't require a response or ACK", &mp); + printPacket("packet on wrong channel, but can't respond", &mp); } else { ProcessMessage handled = pi.handleReceived(mp); @@ -156,12 +156,12 @@ void MeshModule::callPlugins(const MeshPacket &mp, RxSource src) pi.currentRequest = NULL; } - if ((mp.decoded.want_response || mp.want_ack) && toUs) { + if (mp.decoded.want_response && toUs) { if (currentReply) { printPacket("Sending response", currentReply); service.sendToMesh(currentReply); currentReply = NULL; - } else if(mp.decoded.want_response && mp.from != ourNodeNum) { + } else if(mp.from != ourNodeNum) { // Note: if the message started with the local node we don't want to send a no response reply // No one wanted to reply to this requst, tell the requster that happened diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 698738866..7226abd0b 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -138,6 +138,11 @@ bool AdminModule::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r) nodeDB.factoryReset(); reboot(DEFAULT_REBOOT_SECONDS); break; + } case AdminMessage_nodedb_reset_tag: { + DEBUG_MSG("Initiating node-db reset\n"); + nodeDB.resetNodes(); + reboot(DEFAULT_REBOOT_SECONDS); + break; } case AdminMessage_begin_edit_settings_tag: { DEBUG_MSG("Beginning transaction for editing settings\n"); diff --git a/variants/m5stack_coreink/Speaker.cpp b/variants/m5stack_coreink/Speaker.cpp new file mode 100644 index 000000000..0aaff1238 --- /dev/null +++ b/variants/m5stack_coreink/Speaker.cpp @@ -0,0 +1,33 @@ +#include "Speaker.h" + +TONE::TONE(void) { + _volume = 5; + _begun = false; +} + +void TONE::begin() { + _begun = true; + ledcSetup(TONE_PIN_CHANNEL, 0, 13); + ledcAttachPin(PIN_BUZZER, TONE_PIN_CHANNEL); +} + +void TONE::end() { + mute(); + ledcDetachPin(PIN_BUZZER); + _begun = false; +} + +void TONE::tone(uint16_t frequency) { + if(!_begun) begin(); + ledcWriteTone(TONE_PIN_CHANNEL, frequency); + ledcWrite(TONE_PIN_CHANNEL, 0x400 >> _volume); +} + +void TONE::setVolume(uint8_t volume) { + _volume = 11 - volume; +} + +void TONE::mute() { + ledcWriteTone(TONE_PIN_CHANNEL, 0); + digitalWrite(PIN_BUZZER, 0); +} \ No newline at end of file diff --git a/variants/m5stack_coreink/Speaker.h b/variants/m5stack_coreink/Speaker.h new file mode 100644 index 000000000..2ab877d9b --- /dev/null +++ b/variants/m5stack_coreink/Speaker.h @@ -0,0 +1,30 @@ +#ifndef _SPEAKER_H_ + #define _SPEAKER_H_ + + #include "configuration.h" + + #ifdef __cplusplus + extern "C" + { + #endif /* __cplusplus */ + #include "esp32-hal-dac.h" + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + class TONE { + public: + TONE(void); + + void begin(); + void end(); + void mute(); + void tone(uint16_t frequency); + void setVolume(uint8_t volume); + + private: + uint8_t _volume; + bool _begun; + bool speaker_on; + }; +#endif diff --git a/variants/m5stack_coreink/platformio.ini b/variants/m5stack_coreink/platformio.ini index c33187da0..796b58e67 100644 --- a/variants/m5stack_coreink/platformio.ini +++ b/variants/m5stack_coreink/platformio.ini @@ -1,18 +1,26 @@ [env:m5stack-coreink] extends = esp32_base board = m5stack-coreink +build_src_filter = + ${esp32_base.build_src_filter} + +<../variants/m5stack_coreink> build_flags = - ${esp32_base.build_flags} -D M5_COREINK -I variants/m5stack_coreink + ${esp32_base.build_flags} -I variants/m5stack_coreink ;-D RADIOLIB_VERBOSE -Ofast -D__MCUXPRESSO -DEPD_HEIGHT=200 -DEPD_WIDTH=200 + -DUSER_SETUP_LOADED + -DM5_COREINK -DM5STACK lib_deps = ${esp32_base.lib_deps} zinggjm/GxEPD2@^1.4.9 lewisxhe/PCF8563_Library@^1.0.1 +lib_ignore = + m5stack-coreink +monitor_filters = esp32_exception_decoder board_build.f_cpu = 240000000L upload_protocol = esptool -upload_port = /dev/ttyACM* +upload_port = /dev/ttyACM0 diff --git a/variants/m5stack_coreink/variant.h b/variants/m5stack_coreink/variant.h index ef490415c..0676fda1c 100644 --- a/variants/m5stack_coreink/variant.h +++ b/variants/m5stack_coreink/variant.h @@ -1,34 +1,40 @@ -#define I2C_SDA 21 //-1 -#define I2C_SCL 22 //-1 +#define I2C_SDA 21 +#define I2C_SCL 22 -//#define LED_PIN 10 +// LED? +#define LED_INVERTED 0 +#define LED_PIN 10 #include "pcf8563.h" // PCF8563 RTC Module #define PCF8563_RTC 0x51 - -#define BUTTON_NEED_PULLUP -#define BUTTON_PIN 5 +#define HAS_RTC 1 //Wheel // Down 37 // Push 38 // Up 39 - // Top Physical Button 5 +#define BUTTON_NEED_PULLUP +#define BUTTON_PIN 5 + +//BUZZER +#define PIN_BUZZER 2 +#define TONE_PIN_CHANNEL 0 + #undef RF95_SCK #undef RF95_MISO #undef RF95_MOSI #undef RF95_NSS #define USE_RF95 -#define RF95_SCK 18 //13 -#define RF95_MISO 34 //26 -#define RF95_MOSI 23 //25 +#define RF95_SCK 18 +#define RF95_MISO 34 +#define RF95_MOSI 23 #define RF95_NSS 14 -#define LORA_DIO0 25 //32 now moved from ext port -#define LORA_RESET 26 //33 now moved from ext port +#define LORA_DIO0 25 +#define LORA_RESET 26 #define LORA_DIO1 RADIOLIB_NC #define LORA_DIO2 RADIOLIB_NC @@ -39,12 +45,10 @@ #define USE_EINK //https://docs.m5stack.com/en/core/coreink //https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/coreink/coreink_sch.pdf -#define PIN_EINK_EN -1 -#define PIN_EINK_CS 9 // EPD_CS -#define PIN_EINK_BUSY 4 // EPD_BUSY +#define PIN_EINK_EN -1 // N/C +#define PIN_EINK_CS 9 // EPD_CS +#define PIN_EINK_BUSY 4 // EPD_BUSY #define PIN_EINK_DC 15 // EPD_D/C -#define PIN_EINK_RES -1 // Connected to GPIO0 but no needed !!!! maybe causing issue ? -#define PIN_EINK_SCLK 18 // EPD_SCLK +#define PIN_EINK_RES -1 // Connected but not needed +#define PIN_EINK_SCLK 18 // EPD_SCLK #define PIN_EINK_MOSI 23 // EPD_MOSI - -#define HAS_RTC 1 diff --git a/version.properties b/version.properties index efff355e9..d560f5ba6 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 0 -build = 5 +build = 6