From 366a02850279aa1ee25d1988415badbe6baa6264 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Sun, 26 Dec 2021 09:05:35 -0800 Subject: [PATCH 01/11] Remove unused comments. --- src/mesh/http/WebServer.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/mesh/http/WebServer.cpp b/src/mesh/http/WebServer.cpp index 500af5107..e450c566b 100644 --- a/src/mesh/http/WebServer.cpp +++ b/src/mesh/http/WebServer.cpp @@ -114,22 +114,12 @@ static void taskCreateCert(void *parameter) if (createCertResult != 0) { DEBUG_MSG("Creating the certificate failed\n"); - // Serial.printf("Creating the certificate failed. Error Code = 0x%02X, check SSLCert.hpp for details", - // createCertResult); - // while (true) - // delay(500); } else { DEBUG_MSG("Creating the certificate was successful\n"); DEBUG_MSG("Created Private Key: %d Bytes\n", cert->getPKLength()); - // for (int i = 0; i < cert->getPKLength(); i++) - // Serial.print(cert->getPKData()[i], HEX); - // Serial.println(); DEBUG_MSG("Created Certificate: %d Bytes\n", cert->getCertLength()); - // for (int i = 0; i < cert->getCertLength(); i++) - // Serial.print(cert->getCertData()[i], HEX); - // Serial.println(); prefs.putBytes("PK", (uint8_t *)cert->getPKData(), cert->getPKLength()); prefs.putBytes("cert", (uint8_t *)cert->getCertData(), cert->getCertLength()); From 072707c77e996f92e9f362caceddd30598fa95e2 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Sun, 26 Dec 2021 09:08:49 -0800 Subject: [PATCH 02/11] Update esp8266-oled-ssd1306 --- platformio.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index 8d4f3a883..a3ab41283 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -;default_envs = tbeam +default_envs = tbeam ;default_envs = tbeam0.7 ;default_envs = heltec-v2.0 ;default_envs = tlora-v1 @@ -21,7 +21,7 @@ ;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 = rak4631 ;default_envs = rak4630 -default_envs = meshtastic-diy-v1 +;default_envs = meshtastic-diy-v1 [common] ; common is not currently used @@ -68,7 +68,7 @@ debug_tool = jlink ; monitor adapter_khz 10000 lib_deps = - https://github.com/meshtastic/esp8266-oled-ssd1306.git#35d796226b853b0c0ff818b2f1aa3d35e7296a96 ; ESP8266_SSD1306 + https://github.com/meshtastic/esp8266-oled-ssd1306.git#03c0015fc4621f7a76390fa6846de41380f1f9f9 ; ESP8266_SSD1306 https://github.com/meshtastic/OneButton.git#3bcba9492d01e2a8a86f46700ab16f96dd2cf1f5 ; OneButton library for non-blocking button debounce 1202 ; CRC32, explicitly needed because dependency is missing in the ble ota update lib https://github.com/meshtastic/arduino-fsm.git @@ -124,7 +124,7 @@ platform_packages = framework-arduinoespressif32@https://github.com/meshtastic/arduino-esp32.git#4cde0f5d412d2695184f32e8a47e9bea57b45276 ; leave this commented out to avoid breaking Windows -upload_port = /dev/ttyUSB0 +;upload_port = /dev/ttyUSB0 ;monitor_port = /dev/ttyUSB0 ;upload_port = /dev/cu.SLAB_USBtoUART From bea9dfff38a51091f9709cedfc9080cab7ab56a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 27 Dec 2021 21:25:08 +0100 Subject: [PATCH 03/11] CI/CD for building on GitLab instance (#1028) This yml is basically a wrapper for build-all.sh that makes sure the submodules are checked out and pushes a release package to the gitlab registry. Not needed for building on github! Co-authored-by: Ben Meadors --- .gitlab-ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..ae9c20b82 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,50 @@ +image: python:latest + +variables: + # make sure GitLab check out submodules + GIT_SUBMODULE_STRATEGY: recursive + +stages: + - buildall + - upload + +build: + stage: buildall + + before_script: + # we need zip later for packaging + - "apt update;apt -y install zip" + - "pip install -U platformio" + + script: + # clean up residues from previous run + - rm -rf release + - bin/build-all.sh + + # This is for my local environment, if your runners are tagged differently, modify or remove + tags: + - dockerized + + # The files which are to be made available in GitLab + artifacts: + paths: + - release/archive/firmware*.zip + + +upload: + image: curlimages/curl:latest + + stage: upload + + script: + - | + PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/master" + cd release/archive + for f in *.zip; do + curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ${f} ${PACKAGE_REGISTRY_URL}/${f} + done + echo 'Package uploaded!' + + # This is for my local environment, if your runners are tagged differently, modify or remove + tags: + - dockerized From 06a6f75f00c01e012d582f24f6456ac164692210 Mon Sep 17 00:00:00 2001 From: riddick <93053584+PlumRugOfDoom@users.noreply.github.com> Date: Tue, 28 Dec 2021 01:01:21 +0100 Subject: [PATCH 04/11] Update device-install.sh (#1029) fix for #911 Co-authored-by: Ben Meadors --- bin/device-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/device-install.sh b/bin/device-install.sh index 85e39892e..b0ba6ef37 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -46,10 +46,10 @@ shift "$((OPTIND-1))" if [ -f "${FILENAME}" ]; then echo "Trying to flash ${FILENAME}, but first erasing and writing system information" - $PYTHON -m esptool --baud 921600 erase_flash - $PYTHON -m esptool --baud 921600 write_flash 0x1000 system-info.bin - $PYTHON -m esptool --baud 921600 write_flash 0x00390000 spiffs-*.bin - $PYTHON -m esptool --baud 921600 write_flash 0x10000 ${FILENAME} + $PYTHON -m esptool erase_flash + $PYTHON -m esptool write_flash 0x1000 system-info.bin + $PYTHON -m esptool write_flash 0x00390000 spiffs-*.bin + $PYTHON -m esptool write_flash 0x10000 ${FILENAME} else echo "Invalid file: ${FILENAME}" show_help From 5a22b49a24c44ceae97ce0dfaa1018929f2c9259 Mon Sep 17 00:00:00 2001 From: linagee Date: Mon, 27 Dec 2021 21:18:10 -0700 Subject: [PATCH 05/11] Ham, not HAM Originally discovered in https://github.com/meshtastic/Meshtastic/pull/160/commits/1ffa55d39a8270686c8ba087634d31826c0f4a33 https://www.kb6nu.com/ham-ham-radio-ham-radio-amateur-radio/#:~:text=Of%20course%20either%20term%20may,be%20avoided%20at%20all%20costs. --- geeksville-private/TODO.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geeksville-private/TODO.md b/geeksville-private/TODO.md index 732627108..00950e8ad 100644 --- a/geeksville-private/TODO.md +++ b/geeksville-private/TODO.md @@ -325,7 +325,7 @@ Items after the first final candidate release. - add "store and forward" support for messages, or move to the DB sync model. This would allow messages to be eventually delivered even if nodes are out of contact at the moment. - use variable length Strings in protobufs (instead of current fixed buffers). This would save lots of RAM - use BLEDevice::setPower to lower our BLE transmit power - extra range doesn't help us, it costs amps and it increases snoopability -- make a HAM build: just a new frequency list, a bool to say 'never do encryption' and use hte callsign as that node's unique id. -from Girts +- make a Ham build: just a new frequency list, a bool to say 'never do encryption' and use hte callsign as that node's unique id. -from Girts - don't forward redundant pings or ping responses to the phone, it just wastes phone battery - don't send location packets if we haven't moved significantly - scrub default radio config settings for bandwidth/range/speed From a534eae43cdfd90a819ddd0d1d41c3034ad05c19 Mon Sep 17 00:00:00 2001 From: linagee Date: Mon, 27 Dec 2021 21:21:56 -0700 Subject: [PATCH 06/11] Grammar. --- geeksville-private/TODO.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geeksville-private/TODO.md b/geeksville-private/TODO.md index 00950e8ad..7059ddbe2 100644 --- a/geeksville-private/TODO.md +++ b/geeksville-private/TODO.md @@ -325,7 +325,7 @@ Items after the first final candidate release. - add "store and forward" support for messages, or move to the DB sync model. This would allow messages to be eventually delivered even if nodes are out of contact at the moment. - use variable length Strings in protobufs (instead of current fixed buffers). This would save lots of RAM - use BLEDevice::setPower to lower our BLE transmit power - extra range doesn't help us, it costs amps and it increases snoopability -- make a Ham build: just a new frequency list, a bool to say 'never do encryption' and use hte callsign as that node's unique id. -from Girts +- make a Ham build: just a new frequency list, a bool to say 'never do encryption' and use the callsign as that node's unique id. -from Girts - don't forward redundant pings or ping responses to the phone, it just wastes phone battery - don't send location packets if we haven't moved significantly - scrub default radio config settings for bandwidth/range/speed From a70b849039ad2049efd2a304a269b7f854509c77 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 28 Dec 2021 11:20:45 -0600 Subject: [PATCH 07/11] Changed getMacAddr behavior (#1017) --- src/nrf52/main-nrf52.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/nrf52/main-nrf52.cpp b/src/nrf52/main-nrf52.cpp index ab109205b..88166e4fa 100644 --- a/src/nrf52/main-nrf52.cpp +++ b/src/nrf52/main-nrf52.cpp @@ -38,18 +38,13 @@ void __attribute__((noreturn)) __assert_func(const char *file, int line, const c void getMacAddr(uint8_t *dmac) { - ble_gap_addr_t addr; - if (sd_ble_gap_addr_get(&addr) == NRF_SUCCESS) { - memcpy(dmac, addr.addr, 6); - } else { - const uint8_t *src = (const uint8_t *)NRF_FICR->DEVICEADDR; - dmac[5] = src[0]; - dmac[4] = src[1]; - dmac[3] = src[2]; - dmac[2] = src[3]; - dmac[1] = src[4]; - dmac[0] = src[5] | 0xc0; // MSB high two bits get set elsewhere in the bluetooth stack - } + const uint8_t *src = (const uint8_t *)NRF_FICR->DEVICEADDR; + dmac[5] = src[0]; + dmac[4] = src[1]; + dmac[3] = src[2]; + dmac[2] = src[3]; + dmac[1] = src[4]; + dmac[0] = src[5] | 0xc0; // MSB high two bits get set elsewhere in the bluetooth stack } static void initBrownout() From 106341529285e00364456cd1982258a612c36e11 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 28 Dec 2021 14:17:56 -0600 Subject: [PATCH 08/11] Remove networking operations from presentation layer (#1033) * Remove networking operations from presentation layer --- src/graphics/Screen.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 246fcea5f..502c60b02 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -619,11 +619,6 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_ n = nodeDB.getNodeByIndex(nodeIndex); } displayedNodeNum = n->num; - - // We just changed to a new node screen, ask that node for updated state if it's older than 2 minutes - if (sinceLastSeen(n) > 120) { - service.sendNetworkPing(displayedNodeNum, true); - } } NodeInfo *node = nodeDB.getNodeByIndex(nodeIndex); From 638d43a34121a351f58c1c4818b962d502eface9 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 28 Dec 2021 16:40:53 -0800 Subject: [PATCH 09/11] Roll back oled update --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index a3ab41283..1d35ddeb9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -68,7 +68,7 @@ debug_tool = jlink ; monitor adapter_khz 10000 lib_deps = - https://github.com/meshtastic/esp8266-oled-ssd1306.git#03c0015fc4621f7a76390fa6846de41380f1f9f9 ; ESP8266_SSD1306 + https://github.com/meshtastic/esp8266-oled-ssd1306.git#35d796226b853b0c0ff818b2f1aa3d35e7296a96 ; ESP8266_SSD1306 https://github.com/meshtastic/OneButton.git#3bcba9492d01e2a8a86f46700ab16f96dd2cf1f5 ; OneButton library for non-blocking button debounce 1202 ; CRC32, explicitly needed because dependency is missing in the ble ota update lib https://github.com/meshtastic/arduino-fsm.git From a2883789d1489343e720eb17d104501aa982d691 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 28 Dec 2021 23:29:30 -0800 Subject: [PATCH 10/11] updating proto submodule to latest --- proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto b/proto index c52c8ef99..638783bad 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit c52c8ef99ead88a5edb73891b33247c54d37cb28 +Subproject commit 638783bad47d683a5bd67f8f53091c8905e4402d From f1c029d6dad9183584adc9791df8ed0650a361b7 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 28 Dec 2021 23:33:12 -0800 Subject: [PATCH 11/11] updating proto submodule to latest --- proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto b/proto index 638783bad..ec35525ae 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 638783bad47d683a5bd67f8f53091c8905e4402d +Subproject commit ec35525ae6042999b2b3de368aff0ebc3fdcf308