Took me a while to figure out how to build the CH341 SPI Driver with DKMS and Kernel Headers ... Yep it works on Pinebook Pro Manjaro! 🎉
Here's how we open the CH341 SPI Port ... And transfer SPI data to #LoRa SX1262
https://github.com/lupyuen/pinedio_usb_sx126x_driver/blob/master/src/main.c
Semtech's #LoRa SX1262 Driver requires an SPI HAL ... Here's how we do it with CH341 SPI
https://github.com/lupyuen/pinedio_usb_sx126x_driver/blob/master/src/main.c#L101-L138
Let's do a simple test of our #PineDio USB Driver ... Read some SX1262 Registers over SPI
https://github.com/lupyuen/pinedio_usb_sx126x_driver/blob/master/src/main.c#L31-L46
Yep our #PineDio USB Driver returns some Register Values for #LoRa SX1262! 🎉
https://github.com/lupyuen/pinedio_usb_sx126x_driver#output-log
Our #PineDio USB Driver returns the exact same Register Values ... As BL602 with LoRa #SX1262! 🎉
https://lupyuen.github.io/articles/lorawan#troubleshoot-lorawan
Oops just discovered that the new Semtech Reference Driver doesn't support LoRaWAN ... So we switched to the older #LoRa SX1262 Driver ... Exact same driver used by BL602!
Let's transmit a #LoRa Message on #PineDio USB Dongle with these settings ... Connected to Pinebook Pro
https://github.com/lupyuen/lora-sx1262/blob/master/src/main.c
#PineDio USB Dongle @PINE64 transmits a #LoRa Packet ... Which appears as a LoRa Chirp on Airspy SDR! 🎉
https://github.com/lupyuen/lora-sx1262/blob/master/src/main.c
I haven't figured how to control GPIO with CH341, so here are 2 Quick Hacks: 1️⃣ Need to reset #PineDio Dongle? Just unplug it ... 2️⃣ Checking for busy state? Just wait 10 millisecs between SX1262 requests
https://github.com/lupyuen/lora-sx1262/blob/master/src/sx126x-linux.c#L148-L179
#PineDio USB Dongle sends #LoRa Packet to RAKwireless WisBlock ... But received packet is consistently garbled ... As reported by @JF 🤔
https://github.com/lupyuen/lora-sx1262#wisblock-receiver-log
But #LoRa Messages sent by #PineDio Stack BL604 to RAKwireless WisBlock are not garbled ... Even though PineDio Stack and PineDio Dongle are running the same SX1262 Driver Code! 🤔
https://lupyuen.github.io/articles/lorawan#configure-lora-transceiver
#PineDio Dongle sends a 64-byte #LoRa Packet ... But the 64-byte Packet doesn't appear in the dmesg Log for CH341 SPI Driver 🤔
https://github.com/lupyuen/lora-sx1262#pinedio-usb-dmesg-log
Aha! When #PineDio Dongle sends a 29-byte #LoRa Packet to RAKwireless WisBlock ... It's received OK! Anything more will be garbled 🤔
https://github.com/lupyuen/lora-sx1262#wisblock-receiver-log
CH341 doesn't seem to support 32-byte SPI Transfers ... Hope this fixes @JF's #PineDio #LoRa USB Dongle! 👍
https://github.com/lupyuen/lora-sx1262/blob/master/src/sx126x-linux.c#L665-L687
#PineDio USB Dongle shall now receive a #LoRa Message ... From RAKwireless WisBlock
https://github.com/lupyuen/lora-sx1262/blob/master/src/main.c#L74-L119
What's inside #PineDio USB Dongle? CH341 connected to #LoRa SX1262 (over SPI)
https://lupyuen.github.io/articles/usb?2#pinedio-lora-usb-adapter
#PineDio USB Dongle runs the exact same #LoRa SX1262 Driver ... As #PineDio Stack BL604!
https://lupyuen.github.io/articles/usb?3#lora-sx1262-driver-for-pinedio-usb
What do #PineTime, #PineDio USB and PineDio Stack BL604 have in common? They run on NimBLE Porting Layer!
https://lupyuen.github.io/articles/usb?5#nimble-porting-layer
How do we make the same #LoRa SX1262 Driver run on #PineDio USB and PineDio Stack BL604? ... With Layers of Platform Dependent and Independent Code (Like Shrek)
https://lupyuen.github.io/articles/usb?8#source-files-for-linux
Our #PineDio USB Driver defines these Callback Functions ... For transmitting and receiving #LoRa Messages
https://lupyuen.github.io/articles/usb?10#initialise-lora-sx1262
How we transmit a #LoRa Message with #PineDio USB Dongle
https://lupyuen.github.io/articles/usb?11#transmit-lora-message
Our #PineDio USB Driver won't transmit #LoRa Messages longer than 29 bytes ... But there's a fix for this!
https://lupyuen.github.io/articles/usb?12#transmit-lora-message
Software Defined Radios are super helpful ... For troubleshooting #LoRa Devices!
https://lupyuen.github.io/articles/usb?16#spectrum-analysis-with-sdr
Here's how we receive a #LoRa Message on #PineDio USB Dongle
https://lupyuen.github.io/articles/usb?17#receive-lora-message
#PineDio USB Dongle uses a CH341 USB Interface Module ... To talk to #LoRa SX1262 (over SPI)
https://lupyuen.github.io/articles/usb?19#ch341-spi-interface
Long #LoRa Messages are garbled on #PineDio USB Dongle ... Let's solve the mystery
https://lupyuen.github.io/articles/usb?22#long-messages-are-garbled
Tracing the #PineDio USB Driver ... To uncover why it garbles Long #LoRa Messages
https://lupyuen.github.io/articles/usb?23#transmit-long-message
Aha! SPI Transfers of 32 bytes (or more) will fail on the CH341 SPI Driver!
https://lupyuen.github.io/articles/usb?24#spi-transfer-fails-with-32-bytes
Here's how we read the #LoRa SX1262 Registers on #PineDio USB Dongle
https://lupyuen.github.io/articles/usb?6#read-sx1262-registers