Replies: 3 comments 1 reply
-
|
To be honest I'm a bit surprised this works at all - changing the PA configuration while transmitting does not seem entirely safe. While it could be used to add OOK/ASK support to modules that don't have it, it won't be able to implement AFSK, since there we need to shift the audio frequency. I don't know what is the required bit rate here, if it is slow enough, you might be able to get away with switching between Tx and standby, that is how Morse code transmission is implemented here. |
Beta Was this translation helpful? Give feedback.
-
|
Originally i tried transmitDirect() + standby() since I took the idea from the MorseCode class:
I then tested different ways to achieve the same result but faster, I found out the call to set the power is quite quick (<50us) and also very consistent. The frequency changes also worked ok (without calibration) and achieved the same result, but are a little bit slower, and I do not like the idea of transmitting power when not needed on another frequency band or distorting the oscillator freq. I ended converging to this solution which works for my case (2.85kb, or 350us). I estimate you can squeeze up to 20kb speed maximum using this technique before you run into bit pacing and stability problems. If you are happy adding code like this to the lib I can draft a PR for OOK/ASK cases, otherwise, this post can remain as testimony that this hack is doable and someone can take the code if needed for their use case :) |
Beta Was this translation helpful? Give feedback.
-
|
I have found a hack in order to enable OOK: set bit0 at 0x0680 (RADIOLIB_SX126X_REG_TX_BITBANG_ENABLE_1 = 0x01) Tx as usual (with payload len *4) Here a capture: on the top the one sent with STM32WLE5 (sx1262) and the original remote controller on the bottom: (I have still an issue in my case. Even if the signal looks the same it doesn't work, but it's a good lead. If you play with 0xF value, for example use 0x1, it seems to change the phase.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First let me paste the code I have for OOK (but it can be adapted for ASK or AFSK):
This comes from me wanting to open/close my garage door, after using a SDK-RTL I capture the OOK sequence, bit time on/off, and the frequency. Then implemented this piece of code and it works great!.
The door opens/closes every time I send the sequence. :)
Looking at the spectrum, it looks like a 100% match:
Original


SX1262
Yes I know, there is a small bit of modulation there, but I think most decoder's would see a 31dB drop the same as "OFF".
Do you think this is safe? Some feature that could be implemented for modules without tone() input support?
Beta Was this translation helpful? Give feedback.
All reactions