diff --git a/docs/software/TODO.md b/docs/software/TODO.md index a47d73e6..0b52c70b 100644 --- a/docs/software/TODO.md +++ b/docs/software/TODO.md @@ -1,22 +1,18 @@ -# High priority +# Geeksville's current work queue -- nrf52 free memory https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/hathach-memory-map +You probably don't care about this section - skip to the next one. + +- fix hasGPS bug +- make new android release +- check in our modified arduino binaries +- post bug on esp32-arduino - encryption review findings writeup - NRF52 BLE -- cubecell - DSR - turn on modem-sleep mode - https://github.com/espressif/arduino-esp32/issues/1142#issuecomment-512428852 -``` - last EDF release in arduino is: https://github.com/espressif/arduino-esp32/commit/1977370e6fc069e93ffd8818798fbfda27ae7d99 - IDF release/v3.3 46b12a560 - IDF release/v3.3 367c3c09c - https://docs.espressif.com/projects/esp-idf/en/release-v3.3/get-started/linux-setup.html - kevinh@kevin-server:~/development/meshtastic/esp32-arduino-lib-builder\$ python /home/kevinh/development/meshtastic/esp32-arduino-lib-builder/esp-idf/components/esptool*py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 /home/kevinh/development/meshtastic/esp32-arduino-lib-builder/build/bootloader/bootloader.bin - cp -a out/tools/sdk/* components/arduino/tools/sdk - cp -ar components/arduino/ ~/.platformio/packages/framework-arduinoespressif32@src-fba9d33740f719f712e9f8b07da6ea13/ -``` + # Medium priority diff --git a/docs/software/esp32-arduino-build-notes.md b/docs/software/esp32-arduino-build-notes.md new file mode 100644 index 00000000..45fb7a54 --- /dev/null +++ b/docs/software/esp32-arduino-build-notes.md @@ -0,0 +1,16 @@ +# esp32-arduino build instructions + +We build our own custom version of esp32-arduino, in order to get some fixes we've made but haven't yet been merged in master. + +These are a set of currently unformatted notes on how to build and install them. Most developers should not care about this, because +you'll automatically get our fixed libraries. + +``` + last EDF release in arduino is: https://github.com/espressif/arduino-esp32/commit/1977370e6fc069e93ffd8818798fbfda27ae7d99 + IDF release/v3.3 46b12a560 + IDF release/v3.3 367c3c09c + https://docs.espressif.com/projects/esp-idf/en/release-v3.3/get-started/linux-setup.html + kevinh@kevin-server:~/development/meshtastic/esp32-arduino-lib-builder\$ python /home/kevinh/development/meshtastic/esp32-arduino-lib-builder/esp-idf/components/esptool*py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 /home/kevinh/development/meshtastic/esp32-arduino-lib-builder/build/bootloader/bootloader.bin + cp -a out/tools/sdk/* components/arduino/tools/sdk + cp -ar components/arduino/ ~/.platformio/packages/framework-arduinoespressif32@src-fba9d33740f719f712e9f8b07da6ea13/ +``` diff --git a/docs/software/ramusage-nrf52.txt b/docs/software/ramusage-nrf52.txt index 9969806e..380b1bbb 100644 --- a/docs/software/ramusage-nrf52.txt +++ b/docs/software/ramusage-nrf52.txt @@ -18,6 +18,8 @@ b) shrink packet pool size because none of that storage will be used for ToPhone c) don't allocate any storage in RAM for the tophone messages we save inside device state, instead just use nanopb callbacks to save/load those d) a smarter MeshPacket in memory representation would save about 7KB of RAM. call pb_release before freeing each freshly malloced MeshPacket +- nrf52 free memory https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/hathach-memory-map + 2000790c 00003558 B devicestate // 16KB 2000b53c 00001000 b _cache_buffer // 4KB flash filesystem support 20003b1c 000006b0 B console diff --git a/src/main.cpp b/src/main.cpp index 16aa2099..cfbd7e48 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -335,7 +335,7 @@ void loop() screen.debug()->setChannelNameStatus(channelSettings.name); screen.debug()->setPowerStatus(powerStatus); // TODO(#4): use something based on hdop to show GPS "signal" strength. - screen.debug()->setGPSStatus(gps->hasLock() ? "good" : "bad"); + screen.debug()->setGPSStatus(gps->isConnected ? (gps->hasLock() ? "GPS ok" : "No Sats") : "No GPS"); // No GPS lock yet, let the OS put the main CPU in low power mode for 100ms (or until another interrupt comes in) // i.e. don't just keep spinning in loop as fast as we can. diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 59750d46..8d705327 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -3,6 +3,7 @@ #include "NodeDB.h" #include "PowerFSM.h" #include "RadioInterface.h" +#include "GPS.h" #include PhoneAPI::PhoneAPI() @@ -78,6 +79,7 @@ void PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength) } } + /** * Get the next packet we want to send to the phone, or NULL if no such packet is available. * @@ -108,6 +110,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) break; case STATE_SEND_MY_INFO: + myNodeInfo.has_gps = gps && gps->isConnected; // Update with latest GPS connect info fromRadioScratch.which_variant = FromRadio_my_info_tag; fromRadioScratch.variant.my_info = myNodeInfo; state = STATE_SEND_RADIO; diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index fa425ddb..9c9bedd6 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -36,9 +36,11 @@ Allocator &packetPool = staticPool; */ Router::Router() : fromRadioQueue(MAX_RX_FROMRADIO) { - DEBUG_MSG("Size of NodeInfo %d\n", sizeof(NodeInfo)); +// This is called pre main(), don't touch anything here, the following code is not safe + + /* DEBUG_MSG("Size of NodeInfo %d\n", sizeof(NodeInfo)); DEBUG_MSG("Size of SubPacket %d\n", sizeof(SubPacket)); - DEBUG_MSG("Size of MeshPacket %d\n", sizeof(MeshPacket)); + DEBUG_MSG("Size of MeshPacket %d\n", sizeof(MeshPacket)); */ } /** diff --git a/src/screen.cpp b/src/screen.cpp index 9198bc20..1837ef79 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -667,7 +667,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 } if (!gpsStatus.empty()) { - snprintf(gpsStr, sizeof(gpsStr), "GPS %s", gpsStatus.c_str()); + snprintf(gpsStr, sizeof(gpsStr), "%s", gpsStatus.c_str()); } else { gpsStr[0] = '\0'; // Just show empty string. }