diff --git a/README.md b/README.md index 011a8b246..8e01ed995 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ Hard resetting via RTS pin... # Meshtastic Android app -The companion (optional) Meshtastic Android app is [here](https://github.com/meshtastic/Meshtastic-Android). You can also download it on Google Play. +The companion (optional) Meshtastic Android app is [here](https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source%3Dgithub-dev-readme). You can also download it on Google Play. # Python API diff --git a/docs/README.md b/docs/README.md index 48e8d998e..bd5c2d2cd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -28,7 +28,7 @@ Not all of these features are fully implemented yet - see **important** disclaim - Shows direction and distance to all members of your channel - Directed or broadcast text messages for channel members - Open and extensible codebase supporting multiple hardware vendors - no lock in to one vendor -- Communication API for bluetooth devices (such as our Android app) to use the mesh. An iOS application is in the works. And [Meshtastic-python](https://pypi.org/project/meshtastic/) provides access from desktop computers. +- Communication API for bluetooth devices (such as our Android app) to use the mesh. An iOS application is in the works. And [Meshtastic-python](https://pypi.org/project/meshtastic/) provides access from desktop computers. - Very easy sharing of private secured channels. Just share a special link or QR code with friends and they can join your encrypted mesh This project is currently in beta testing but it is fairly stable and feature complete - if you have questions please [join our discussion forum](https://meshtastic.discourse.group/). @@ -51,7 +51,7 @@ Note: Updates are happening almost daily, only major updates are listed below. F Our Android application is available here: -[![Download at https://play.google.com/store/apps/details?id=com.geeksville.mesh](https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png)](https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source%3Dhomepage%26anid%3Dadmob) +[![Download at https://play.google.com/store/apps/details?id=com.geeksville.mesh](https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png)](https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source%3Dgithub-homepage) The link above will return older more stable releases. We would prefer if you join our alpha-test group, because the application is rapidly improving. Three steps to opt-in to the alpha- test: diff --git a/docs/software/TODO.md b/docs/software/TODO.md index 07bfad429..7bf428816 100644 --- a/docs/software/TODO.md +++ b/docs/software/TODO.md @@ -1,17 +1,22 @@ # High priority +- nrf52 free memory https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/hathach-memory-map - modem sleep should work if we lower serial rate to 115kb? -- device wakes, turns BLE on and phone doesn't notice (while phone was sitting in auto-connect) - encryption review findings writeup +- 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/ + 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/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index 8fb1ce781..f0451079e 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -304,6 +304,8 @@ void RadioLibInterface::startSend(MeshPacket *txp) printPacket("Starting low level send", txp); setStandby(); // Cancel any already in process receives + configHardwareForSend(); // must be after setStandby + size_t numbytes = beginSending(txp); int res = iface->startTransmit(radiobuf, numbytes); diff --git a/src/mesh/RadioLibInterface.h b/src/mesh/RadioLibInterface.h index 5f70d027d..706fcdf0d 100644 --- a/src/mesh/RadioLibInterface.h +++ b/src/mesh/RadioLibInterface.h @@ -105,16 +105,19 @@ class RadioLibInterface : public RadioInterface, private PeriodicTask virtual void doTask(); + /** start an immediate transmit + * This method is virtual so subclasses can hook as needed, subclasses should not call directly + */ + virtual void startSend(MeshPacket *txp); + protected: /// Initialise the Driver transport hardware and software. /// Make sure the Driver is properly configured before calling init(). /// \return true if initialisation succeeded. virtual bool init(); - /** start an immediate transmit - * This method is virtual so subclasses can hook as needed, subclasses should not call directly - */ - virtual void startSend(MeshPacket *txp); + /** Do any hardware setup needed on entry into send configuration for the radio. Subclasses can customize */ + virtual void configHardwareForSend() {} /** * Convert our modemConfig enum into wf, sf, etc... diff --git a/src/mesh/SX1262Interface.cpp b/src/mesh/SX1262Interface.cpp index 628ec995f..3fe4afa30 100644 --- a/src/mesh/SX1262Interface.cpp +++ b/src/mesh/SX1262Interface.cpp @@ -16,9 +16,9 @@ bool SX1262Interface::init() #ifdef SX1262_RXEN // set not rx or tx mode pinMode(SX1262_RXEN, OUTPUT); +#endif +#ifdef SX1262_TXEN pinMode(SX1262_TXEN, OUTPUT); - digitalWrite(SX1262_RXEN, LOW); - digitalWrite(SX1262_TXEN, LOW); #endif #ifndef SX1262_E22 @@ -36,7 +36,7 @@ bool SX1262Interface::init() DEBUG_MSG("LORA init result %d\n", res); #ifdef SX1262_RXEN - // lora.begin assumes Dio2 is RF switch control, which is not true if we are manually controlling RX and TX + // lora.begin sets Dio2 as RF switch control, which is not true if we are manually controlling RX and TX if (res == ERR_NONE) res = lora.setDio2AsRfSwitch(false); #endif @@ -101,6 +101,8 @@ void SX1262Interface::setStandby() #ifdef SX1262_RXEN // we have RXEN/TXEN control - turn off RX and TX power digitalWrite(SX1262_RXEN, LOW); +#endif +#ifdef SX1262_TXEN digitalWrite(SX1262_TXEN, LOW); #endif @@ -120,14 +122,13 @@ void SX1262Interface::addReceiveMetadata(MeshPacket *mp) /** start an immediate transmit * We override to turn on transmitter power as needed. */ -void SX1262Interface::startSend(MeshPacket *txp) +void SX1262Interface::configHardwareForSend() { -#ifdef SX1262_RXEN // we have RXEN/TXEN control - turn on TX power / off RX power - digitalWrite(SX1262_RXEN, LOW); +#ifdef SX1262_TXEN // we have RXEN/TXEN control - turn on TX power / off RX power digitalWrite(SX1262_TXEN, HIGH); #endif - RadioLibInterface::startSend(txp); + RadioLibInterface::configHardwareForSend(); } // For power draw measurements, helpful to force radio to stay sleeping @@ -139,12 +140,12 @@ void SX1262Interface::startReceive() sleep(); #else + setStandby(); + #ifdef SX1262_RXEN // we have RXEN/TXEN control - turn on RX power / off TX power digitalWrite(SX1262_RXEN, HIGH); - digitalWrite(SX1262_TXEN, LOW); #endif - setStandby(); // int err = lora.startReceive(); int err = lora.startReceiveDutyCycleAuto(); // We use a 32 bit preamble so this should save some power by letting radio sit in // standby mostly. diff --git a/src/mesh/SX1262Interface.h b/src/mesh/SX1262Interface.h index 1eee86a66..30167bc2d 100644 --- a/src/mesh/SX1262Interface.h +++ b/src/mesh/SX1262Interface.h @@ -44,10 +44,10 @@ class SX1262Interface : public RadioLibInterface */ virtual void startReceive(); - /** start an immediate transmit + /** * We override to turn on transmitter power as needed. */ - virtual void startSend(MeshPacket *txp); + virtual void configHardwareForSend(); /** * Add SNR data to received messages @@ -57,5 +57,4 @@ class SX1262Interface : public RadioLibInterface virtual void setStandby(); private: - }; \ No newline at end of file diff --git a/src/nrf52/UC1701Spi.cpp b/src/nrf52/UC1701Spi.cpp index d653b6454..dcb6435c3 100644 --- a/src/nrf52/UC1701Spi.cpp +++ b/src/nrf52/UC1701Spi.cpp @@ -36,15 +36,18 @@ class UC1701Spi : public OLEDDisplay }; #include "variant.h" + +#ifdef ERC12864_CS #include static UC1701 lcd(PIN_SPI_SCK, PIN_SPI_MOSI, ERC12864_CS, ERC12864_CD); +void testLCD() +{ + // PCD8544-compatible displays may have a different resolution... + lcd.begin(); -void testLCD() { - // PCD8544-compatible displays may have a different resolution... - lcd.begin(); - - // Write a piece of text on the first line... - lcd.setCursor(0, 0); - lcd.print("Hello, World!"); -} \ No newline at end of file + // Write a piece of text on the first line... + lcd.setCursor(0, 0); + lcd.print("Hello, World!"); +} +#endif \ No newline at end of file