markqvist / RNode_Firmware

RNode is an open, free and flexible digital radio interface with many uses
https://unsigned.io/rnode
GNU General Public License v3.0
145 stars 52 forks source link

Add NRF52 BLE serial support #61

Closed jacobeva closed 5 months ago

jacobeva commented 5 months ago

Does what it says on the tin. I reworked the flash driver so it doesn't conflict as well, which also means no more flash_nrf5 whatever files in the source dir!

Can line 465 in RNodeInterface.py in the Reticulum repo also please be changed to sleep(1), that issue I DMed you about was caused by the timeout Mark, it wasn't waiting long enough for the full packet before trying to read it. Hence the bugs.

Hope this is all okay!

jacobeva commented 5 months ago

Oh yes, can this also please be tested on an ESP32 before merging to check I haven't broken anything? (It seems to compile fine)

markqvist commented 5 months ago

I'll check it on ESP32. Thanks for big effort here! Very cool you already got this running.

jacobeva commented 5 months ago

No worries. Just some caveats I forgot to add: I was testing this using the ble-serial tool for Linux, I created a virtual serial port with this tool (which was connected to the Nordic UART ) that I then tested using nomadnet. I have not added support for this in sideband. Android application development is rather beyond me currently, it seems you have written sideband in Python, so there may be a library you can use for BLE to this end? If not, you can probably use the Android API, which is documented here. In short, you'd need to:

TX allows you write permissions, RX allows you read permissions. From what I understand, you'd have to send the data in BLE packets, but here my knowledge is a bit hazy. You'll probably have to read up on the nitty gritty a bit.

u01-rn commented 5 months ago

As I only have one working RNode currently, I cannot test RX. Build Output:

user@laptop:~/RNTest/RNode_Firmware$ make firmware-heltec32_v2
arduino-cli compile --fqbn esp32:esp32:heltec_wifi_lora_32_V2 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\" \"-DMODEM=0x01\""
Sketch uses 1602573 bytes (76%) of program storage space. Maximum is 2097152 bytes.
Global variables use 80104 bytes (24%) of dynamic memory, leaving 247576 bytes for local variables. Maximum is 327680 bytes.

Used library         Version Path
SPI                  2.0.0   /home/user/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/SPI
EEPROM               2.0.0   /home/user/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM
Wire                 2.0.0   /home/user/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire
Adafruit GFX Library 1.11.9  /home/user/Arduino/libraries/Adafruit_GFX_Library
Adafruit BusIO       1.15.0  /home/user/Arduino/libraries/Adafruit_BusIO
Adafruit SSD1306     2.5.9   /home/user/Arduino/libraries/Adafruit_SSD1306
BluetoothSerial      2.0.0   /home/user/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/BluetoothSerial
Crypto               0.4.0   /home/user/Arduino/libraries/Crypto
FS                   2.0.0   /home/user/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/FS
SPIFFS               2.0.0   /home/user/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/SPIFFS
WiFi                 2.0.0   /home/user/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/WiFi
WebServer            2.0.0   /home/user/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/WebServer
SD                   2.0.0   /home/user/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/SD

Used platform Version Path
esp32:esp32   2.0.11  /home/user/.arduino15/packages/esp32/hardware/esp32/2.0.11

A new release of Arduino CLI is available: 0.35.1 → 0.35.2
https://arduino.github.io/arduino-cli/latest/installation/#latest-packages

TX PASS: TX_PASS_PULL61

Test results:

jacobeva commented 5 months ago

Thanks bud!