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 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 diff --git a/geeksville-private/TODO.md b/geeksville-private/TODO.md index 732627108..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 diff --git a/platformio.ini b/platformio.ini index 8d4f3a883..1d35ddeb9 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 @@ -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 diff --git a/proto b/proto index c52c8ef99..ec35525ae 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit c52c8ef99ead88a5edb73891b33247c54d37cb28 +Subproject commit ec35525ae6042999b2b3de368aff0ebc3fdcf308 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); diff --git a/src/mesh/http/WebServer.cpp b/src/mesh/http/WebServer.cpp index a900cfa9d..cbf25271d 100644 --- a/src/mesh/http/WebServer.cpp +++ b/src/mesh/http/WebServer.cpp @@ -110,22 +110,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()); 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()