Skip to content

Commit

Permalink
Merge pull request #193 from geeksville/dev
Browse files Browse the repository at this point in the history
misc fixes
  • Loading branch information
geeksville authored Jun 18, 2020
2 parents f4d476d + 3005373 commit 5843c6f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 16 deletions.
20 changes: 8 additions & 12 deletions docs/software/TODO.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
16 changes: 16 additions & 0 deletions docs/software/esp32-arduino-build-notes.md
Original file line number Diff line number Diff line change
@@ -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/
```
2 changes: 2 additions & 0 deletions docs/software/ramusage-nrf52.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions src/mesh/PhoneAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RadioInterface.h"
#include "GPS.h"
#include <assert.h>

PhoneAPI::PhoneAPI()
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions src/mesh/Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ Allocator<MeshPacket> &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)); */
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down

0 comments on commit 5843c6f

Please sign in to comment.