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
Yep our #PineDio USB Driver returns some Register Values for #LoRa SX1262! 🎉
https://github.com/lupyuen/pinedio_usb_sx126x_driver#output-log
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
Our #PineDio USB Driver returns the exact same Register Values ... As BL602 with LoRa #SX1262! 🎉
https://lupyuen.github.io/articles/lorawan#troubleshoot-lorawan