Let's connect #PineCone #BL602 @PINE64 to #LoRa RF96 ... Always connect Antenna before Power! ⚡... Bought from Tindie
https://www.tindie.com/products/m2m/lora-module-for-breadboard-with-antenna/
We'll port the #LoRa SX1276 Driver from #Mynewt OS to #BL602 IoT SDK ... Because the GPIO and SPI Hardware Abstraction Layers are quite similar
https://github.com/apache/mynewt-core/blob/master/hw/drivers/lora/sx1276/src/sx1276.c
Porting #LoRa SX1276 Driver from Mynewt to #BL602 IoT SDK
https://github.com/lupyuen/bl_iot_sdk/blob/lora/customer_app/sdk_app_lora/sdk_app_lora/sx1276-board.c#L64
#LoRa SX1276 Driver listens for GPIO Interrupts on 6 (!) GPIO Pins ... Maybe #BL602 can defer this ... If we're not receiving LoRa Packets 🤔
https://github.com/lupyuen/bl_iot_sdk/blob/lora/customer_app/sdk_app_lora/sdk_app_lora/sx1276-board.c#L137-L185
#BL602 IoT SDK builds #LoRa Driver successfully yay! Now filling in the SPI Functions to talk to SX1276
https://github.com/lupyuen/bl_iot_sdk/blob/lora/customer_app/sdk_app_lora/sdk_app_lora/sx1276.c#L213-L252
Transmit and Receive #SPI Data on #RISCV #BL602 ... Piece of kueh! 🍰
https://github.com/lupyuen/bl_iot_sdk/blob/lora/customer_app/sdk_app_lora/sdk_app_lora/sx1276.c#L245-L286
Let's test the #BL602 #LoRa Driver ... With the "LoRa Ping" app ported from #Mynewt OS
https://github.com/apache/mynewt-core/blob/master/apps/loraping/src/main.c
#PineCone #BL602 nearly out of pins (and colours) for #LoRa SX1276 ... Let's use these pins for now
https://github.com/lupyuen/bl_iot_sdk/blob/lora/customer_app/sdk_app_lora/sdk_app_lora/sx1276.h#L24-L54
Let's test whether #BL602 can talk to #LoRa SX1276 over SPI ... By dumping some SX1276 registers
https://github.com/lupyuen/bl_iot_sdk/blob/lora/customer_app/sdk_app_lora/sdk_app_lora/demo.c#L199-L213
Yep #BL602 talks OK to #LoRa SX1276 over SPI ... SX1276 register values look correct ... Now let's transmit a LoRa Message!
#BL602 #SPI Unsolved Mystery ... BL602 must be configured for SPI Phase 1 to talk to #LoRa SX1276 ... But SX1276 actually uses SPI Phase 0! 🤔
https://github.com/lupyuen/bl_iot_sdk/blob/lora/customer_app/sdk_app_lora/sdk_app_lora/sx1276-board.c#L112-L137
Our #LoRa SX1276 (actually RF96) is factory configured for 434 MHz, sez the Frequency Registers ... #BL602 will tune it to 923 MHz for Singapore
How will we know if our #BL602 + #LoRa SX1276 are misbehavin’ on the airwaves? We got a spy ... An AirSpy Software Defined Radio
https://airspy.com/airspy-r2
923 MHz on a quiet Singapore night ... Captured by #Gqrx and #Airspy R2 Software Defined Radio 📻
https://youtu.be/RJIRTz2zUok
#BL602 inits the #LoRa SX1276 Driver ... By writing a bunch of SX1276 Registers over SPI ... So far so good!
https://github.com/lupyuen/bl_iot_sdk/blob/lora/customer_app/sdk_app_lora/sdk_app_lora/demo.c#L220-L270
#BL602 sends a #LoRa message ... By copying the message to SX1276 Transmit FIFO over SPI ... Was the message actually transmitted? Airspy will tell!
https://github.com/lupyuen/bl_iot_sdk/blob/lora/customer_app/sdk_app_lora/sdk_app_lora/demo.c#L107-L124
Someday we shall pack #PineCone #BL602 @ThePine64 with #LoRa ... Into this cute clear Junction Box
But today we shall spy on #BL602 + #LoRa ... With an #Airspy R2 Software Defined Radio 📻
#BL602 + #LoRa SX1276 + Airspy SDR ... Inside an improvised Faraday Cage 🫕 ... It really works!
Nope Airspy SDR couldn't sniff our #BL602 #LoRa at 923 MHz ... Though it sniffed others thru the Faraday Cage (erm) Pot 🤔
@lupyuen I guess there's no sound in space.
@lupyuen It's a nice trick :þ
QOTO: Question Others to Teach Ourselves An inclusive, Academic Freedom, instance All cultures welcome. Hate speech and harassment strictly forbidden.
We'll port the #LoRa SX1276 Driver from #Mynewt OS to #BL602 IoT SDK ... Because the GPIO and SPI Hardware Abstraction Layers are quite similar
https://github.com/apache/mynewt-core/blob/master/hw/drivers/lora/sx1276/src/sx1276.c