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
We'll build our #PineDio USB #LoRa Driver based on Semtech's Reference Driver for SX1262
https://github.com/Lora-net/sx126x_driver