Day: September 10, 2022

Testing SX127x on NuttX

I’m testing the TTGO_LORA32 board (sch here: https://raw.githubusercontent.com/LilyGO/TTGO-LORA32/master/schematic1in6.pdf) with NuttX RTOS and noticed the `sx127x` app is not working with default LoRa Modulation, but at least I got it working with FSK modulation:

$ ./tools/configure.sh ttgo_lora_esp32:sx127x

$ make -j flash ESPTOOL_PORT=/dev/ttyUSB0

Board 1:

NuttShell (NSH) NuttX-10.4.0                                                    
nsh> sx127x -m 1 -t                                                             
Start sx127x_demo                                                               
FSK modulation                                                                  
Set frequency to 868000000                                                      
Set power to 14

Board 2:

nsh> sx127x -m 1
Start sx127x_demo
FSK modulation
Set frequency to 868000000
Set power to 14
Waiting for data

Received:
SNR  = 0
RSSI = -66
len  = 5
0x00 0x01 0x02 0x03 0x04 

wait 5 sec ...

Update:

I discovered an interesting fact (that at least happens for TTGO_LORA32 board) :
If CONFIG_LPWAN_SX127X_MODULATION_DEFAULT=3 the sx127x app doesn’t work on LoRa mode (-m 0), but works on FSK mode (-m 1). If CONFIG_LPWAN_SX127X_MODULATION_DEFAULT=2 the app will work fine for LoRa and FSK mode, but not for OOK. If CONFIG_LPWAN_SX127X_MODULATION_DEFAULT=1 none mode will work.

NuttX Binary to Test Particle Photon board

A NuttX user reported an issue when using Particle Photon board: https://github.com/apache/incubator-nuttx/issues/6938

Then I decided to test it and discovered that some recent modification damaged that board configuration and decided to test an older version that I knew was working.

I converted my nuttx.bin to text (using base64) and created a gist with it. Then you can test yourself:

Download “nuttx_base64.txt”: https://gist.github.com/acassis/4479c13e029415cd05a4b52493f1da52

$ cat nuttx_base64.txt | base64 --decode > nuttx.bin

Confirm the file was created correctly:

$ md5sum nuttx.bin
56f9b321ca946f092e89f42723a0cea3 nuttx.bin

Press the RESET and SETUP buttons of your board, release the RESET and keep SETUP pressed until the LED start blinking on yellow color, then release it as well.

Now that your board is in DFU mode you can flash it using DFU command:

$ sudo dfu-util -d 2b04:d006 -a 0 -s 0x08020000 -D nuttx.bin

We will need a router configured with SSID: DLINK and password: dlinkphoto to test this firmware. It will connected on your board and will assume the fixed IP 192.168.0.16. You can telnet to this IP and get the NSH terminal working over telnet.