You also like #LoRa, right?
If so, you'll love this : LoRa on the Pinephone!
YES, thanks to the LoRa backplate, you can send and receive LoRa messages on the Pinephone!
Flashing the LoRa backplate for the PinePhone
hi @JF can you give me a quick explanation on the buffer sync in your c++ driver? I'm trying to write a python driver and so far cannot get anything to work, wondering if it's related to not performing this sync. https://codeberg.org/JF002/pinedio-lora-driver/src/branch/master/src/pinephone/PinephoneBackplate.cpp#L113
@captain_morgan I wrote the sync procedure to ensure that the read buffer is "empty", and that the next bytes I'll read are the ones coming from the request I'll send. For this, I send a command to the SX1262 for which I know exactly what it'll answer. Then I read the whole ring buffer until I read the data I expected to read. When finished, I know that the read cursor on the ring buffer is correctly positioned.
@captain_morgan This is needed because you don't know what happened on the I²C bus before you app is started : maybe a previous app crashed leaving the buffer in an inconsistent state, maybe a few glitches were generated while the phone was booting (and those glitches could have been interpreted as valid clock/data signal,...
You can have a look at this code to check how the bridge firmware is working : https://github.com/zschroeder6212/tiny-i2c-spi/blob/master/src/main.c#L67
@JF Awesome, this answers a bunch of questions, like how to handle reset states. Will give the python code another go this evening.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!