Pi Pico with RA-01SH hangs when saving config

Hi

I’m trying to build a DIY node using a Pi Pico and an AiThinker RA-01SH lora module.

To try to keep things simple and just use the official firmware, I’ve mimicked the connections of the Waveshare Pico LoRa hat so the pin connections are as follows:

BUSY - GP2
NSS - GP3
CLK - GP10
MOSI - GP11
MISO - GP12
RESET - GP15
DIO1 - GP20
3v3 3v3
GND GND

The problem is that on the default Pi Pico firmware, whenever trying to save config to the device through either the web client or CLI the device completely hangs and only comes back after a power cycle.

The only part of the Waveshare hat I haven’t recreated is the voltage divider for power measurement but I don’t believe this is the problem.

Can anyone suggest where I’ve gone wrong? There isn’t much on forums about the AiThinker SX1262 modules, I’m not convinced anyone has actually got one working yet.

Quick update. Configured the device with region and channel settings while the LoRa module was disconnected so it does at least attempt to send packets now and gives some console output to work with:

DEBUG | ??:??:?? 3 Filesystem files:
DEBUG | ??:??:?? 3 channels.proto (53 Bytes)
lfs_file_close: fd=0x20013784
DEBUG | ??:??:?? 3 config.proto (91 Bytes)
lfs_file_close: fd=0x20013784
DEBUG | ??:??:?? 3 db.proto (116 Bytes)
lfs_file_close: fd=0x20013784
DEBUG | ??:??:?? 3 module.proto (97 Bytes)
lfs_file_close: fd=0x20013784
DEBUG | ??:??:?? 3 Using analog input 26 for battery level
INFO | ??:??:?? 3 Scanning for i2c devices…
DEBUG | ??:??:?? 3 Scanning for i2c devices on port 1
INFO | ??:??:?? 3 No I2C devices found
DEBUG | ??:??:?? 3 acc_info = 0
INFO | ??:??:?? 3 Meshtastic hwvendor=47, swver=2.2.18.e9bde80
INFO | ??:??:?? 3 Initializing NodeDB
INFO | ??:??:?? 3 Loading /prefs/db.proto
lfs_file_close: fd=0x20013524
INFO | ??:??:?? 3 Loaded saved devicestate version 22
INFO | ??:??:?? 3 Loading /prefs/config.proto
lfs_file_close: fd=0x20013524
INFO | ??:??:?? 3 Loaded saved config version 22
INFO | ??:??:?? 3 Loading /prefs/module.proto
lfs_file_close: fd=0x20013524
INFO | ??:??:?? 3 Loaded saved moduleConfig version 22
INFO | ??:??:?? 3 Loading /prefs/channels.proto
lfs_file_close: fd=0x20013524
INFO | ??:??:?? 3 Loaded saved channelFile version 22
LittleFSDirImpl::openFile: rc=-2 fd=0x20013524 path=/oem/oem.proto openMode=0 accessMode=1 err=-2
INFO | ??:??:?? 3 No /oem/oem.proto preferences found
DEBUG | ??:??:?? 3 cleanupMeshDB purged 0 entries
WARN | ??:??:?? 3 Using nodenum 0x8399882f
DEBUG | ??:??:?? 3 Expanding short PSK #1
INFO | ??:??:?? 3 Wanted region 3, using EU_868
DEBUG | ??:??:?? 3 region=3, NODENUM=0x8399882f, dbsize=1
DEBUG | ??:??:?? 3 Read RTC time as 2444
DEBUG | ??:??:?? 3 Running without GPS.
DEBUG | ??:??:?? 3 NeighborInfoModule is disabled
INFO | ??:??:?? 3 External Notification Module Disabled
WARN | ??:??:?? 3 SX126xInterface(cs=3, irq=20, rst=15, busy=2)
DEBUG | ??:??:?? 3 SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at 1.800000 V
INFO | ??:??:?? 3 Starting meshradio init…
DEBUG | ??:??:?? 3 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=0, time 231 ms
DEBUG | ??:??:?? 3 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=253, time 2115 ms
INFO | ??:??:?? 3 Radio freq=869.525, config.lora.frequency_offset=0.000
INFO | ??:??:?? 3 Set radio: region=EU_868, name=LongFast, config=0, ch=0, power=27
INFO | ??:??:?? 3 Radio myRegion->freqStart → myRegion->freqEnd: 869.400024 → 869.650024 (0.250000 mhz)
INFO | ??:??:?? 3 Radio myRegion->numChannels: 1 x 250.000kHz
INFO | ??:??:?? 3 Radio channel_num: 1
INFO | ??:??:?? 3 Radio frequency: 869.525024
INFO | ??:??:?? 3 Slot time: 42 msec
INFO | ??:??:?? 3 Set radio: final power level=22
INFO | ??:??:?? 3 SX126x init result -707
INFO | ??:??:?? 3 Frequency set to 869.525024
INFO | ??:??:?? 3 Bandwidth set to 250.000000
INFO | ??:??:?? 3 Power output set to 22
DEBUG | ??:??:?? 3 Current limit set to 140.000000
DEBUG | ??:??:?? 3 Current limit set result 0
DEBUG | ??:??:?? 3 Setting DIO2 as RF switch
DEBUG | ??:??:?? 3 SX126X_RXEN not defined, defaulting to RADIOLIB_NC
DEBUG | ??:??:?? 3 SX126X_TXEN not defined, defaulting to RADIOLIB_NC
DEBUG | ??:??:?? 3 Using MCU pin -1 as RXEN and pin -1 as TXEN to control RF switching
INFO | ??:??:?? 3 Set RX gain to boosted mode; result: 0
INFO | ??:??:?? 3 SX1262 Radio init succeeded, using SX1262 radio
DEBUG | ??:??:?? 3 (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=237, time 2000 ms
DEBUG | ??:??:?? 3 LoRA bitrate = 118.500000 bytes / sec
INFO | ??:??:?? 3 PowerFSM init, USB power=1
DEBUG | ??:??:?? 3 Enter state: BOOT
DEBUG | ??:??:?? 3 [Power] Battery: usbPower=0, isCharging=0, batMv=0, batPct=0
DEBUG | ??:??:?? 23 [Power] Battery: usbPower=0, isCharging=0, batMv=2247, batPct=0
DEBUG | ??:??:?? 23 [Power] Low voltage counter: 1/10
INFO | ??:??:?? 23 [PowerFSM] Loss of power in Powered
DEBUG | ??:??:?? 23 [PowerFSM] Enter state: ON
INFO | ??:??:?? 33 [NodeInfoModule] Sending our nodeinfo to mesh (wantReplies=1)
INFO | ??:??:?? 33 [NodeInfoModule] sending owner !8399882f/Meshtastic 882f/882f
DEBUG | ??:??:?? 33 [NodeInfoModule] Initial packet id 316718457, numPacketId 4294967295
DEBUG | ??:??:?? 33 [NodeInfoModule] Update DB node 0x8399882f, rx_time=0, channel=0
DEBUG | ??:??:?? 33 [NodeInfoModule] handleReceived(LOCAL) (id=0x12e0bd7b fr=0x2f to=0xff, WantAck=0, HopLim=3 Ch=0x0 Portnum=4 WANTRESP priority=10)
DEBUG | ??:??:?? 33 [NodeInfoModule] No modules interested in portnum=4, src=LOCAL
DEBUG | ??:??:?? 33 [NodeInfoModule] localSend to channel 0
DEBUG | ??:??:?? 33 [NodeInfoModule] Add packet record (id=0x12e0bd7b fr=0x2f to=0xff, WantAck=0, HopLim=3 Ch=0x0 Portnum=4 WANTRESP priority=10)
DEBUG | ??:??:?? 33 [NodeInfoModule] Expanding short PSK #1
DEBUG | ??:??:?? 33 [NodeInfoModule] Using AES128 key!
DEBUG | ??:??:?? 33 [NodeInfoModule] Installing AES128 key!
DEBUG | ??:??:?? 33 [NodeInfoModule] enqueuing for send (id=0x12e0bd7b fr=0x2f to=0xff, WantAck=0, HopLim=3 Ch=0x8 encrypted priority=10)
DEBUG | ??:??:?? 33 [NodeInfoModule] txGood=0,rxGood=0,rxBad=0
DEBUG | ??:??:?? 33 [RadioIf] SX126x standby failed with error -707

The device now hangs after 30 seconds or so when sending the first node info broadcast.

Possibly worth noting that the only other instance I can find of the error “SX126x standby failed with error -707” on this or any other forum is from someone using the same RA-01SH module.

I don’t have any experience with this module, but the error code comes from RadioLib: RadioLib: Status Codes
It seems it might be an issue with the TCXO setting. It looks like this module doesn’t have one. Did you remove #define SX126X_DIO3_TCXO_VOLTAGE from the variant file?

Edit: from the logs it seems not:
DEBUG | ??:??:?? 3 SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at 1.800000 V.
You’ll need to remove this line.

That’s done it, working fine now.

Thanks so much.

Just out of curiosity, what is the function of this line?

Great!

It sets the voltage for the TCXO, but your module doesn’t have one (it uses a normal XTAL), so it should be set to 0.

1 Like

Hi guys,
i am facing the same problem with a Rpi pico with a waveshare SX1262 XXXM LoRaWAN HAT module meant for Rpi 4 or zero.The waveshare pico-lora hat was out of stock.The Pico-LoRa-SX1262 has a TCXO but the lorawan hat doesn’t.
How can i modify the settings?..being a noob

Thanks