-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-default Spreading Factor not working #70
Comments
The CircuitPython RFM9X library will only work with RadioHead compliant packet headers. I don't know offhand if the Arduino-LoRa packets comply. I may be misunderstanding this and will look at it in more detail tomorrow. Can you post your full code, or enough to provide an sample of the issue so I can try to reproduce this. |
Looking at your example, FFFF0000345733E11203B22B47187E, I would have expected the Pi to be able to receive this using the FFFF0000 as the header. I'm trying to set this up on my system to test. |
As a quick test, I am running the Arduino-LoRa LoRaSender example on a feather M0 Rfm9x -- it's packets are ceded OK by my RaspberryPi 400 with an RFM9x Bonnet. I was incorrect about the header. The pi does receive the packets ok. It just treats the first 4 bytes as the packet header but that is a different issue. Note, In this case, I am not setting anything other than the pins. |
However, If I set use your configuration
and
The Pi stops receiving the packets. So, the default configuration on both sides works, but the specific configuration you are creating does not. |
This is the Adruino-Lora Code I am usiong
and the Pi code
and here is the received data on the PI
As you see, the first 4 bytes are interpreted a header (0x68 0x65 0x6c 0x6c) = "hell" then the final "o" and the counter are reported as the payload |
It appears that it is the setting of the Spreading Factor that is causing the problem. I have not experimented with the spreading factors so this may well be a bug. I'l try some more tests. I tried some other spreading factors: 8 and 10 work, but 11 and 12 do not... |
I "think" the issue has something to do with the setting of the "low data rate optimize flag" which if I am understanding correctly would only occur for SF 11 and 12 at the 125000 bandwidth. @psycik Can you try using a Spreading Factor 7 just to see if it works for you? |
The more I look at how the CircuitPython code handles the setting of the Spreading Factor, the more confused I get. This is going to take some time to investigate and sort out. At this point, all I can suggest is try setting the SF to 7 if you want to be able to communicate with the Raspberry Pi using the CircuitPython Library. |
@jerryneedell Thank you so much for looking into this. You are indeed correct, I set the SF to 7 on all devices and communication is working great now. I was aiming for longest distance with the high SF and low bandwidth, I'll have to run some tests at range. Thanks again. |
That is good news! Glad you have something that works. I plan to keep looking into this, but I have no idea how long it may take to make any progress with the other Settings for SF. |
I was able to get SF 12 to work with the following code.
|
@logic-switch Thank you for this example. It saves a lot of head-scratching! |
I am curious why you set the preamble length to 16? |
FYI, using the above, I can receive fine with SF12, but I am still having problems transmitting... |
I was testing various settings. I thought that a longer preamble may allow it to lock on to the signal with a higher spreading factor. I don't think the preamble length matters in this case, but I haven't tested that. |
Any update on this ? I was testing on two rpi pico devices, and spreading factor of 11 or 12 wont work. |
I did some investigation and found hopefully useful information regarding this. When using bigger spreading factors and lower bandwidth, the time it takes for the packet to be transmitted can easily take 10-15 seconds. After changing the |
I don't have too much to add here other than I've run into the same issue. I also had trouble lowering the signal_bandwidth. Only 62500 and 125000 seem to work. Fortunately the coding_rate does work and using a signal_bandwidth of 62500 and coding_rate of 8 seems to be working so far though it's too soon to tell if that combination is reliable enough. I'm pulling telemetry from my solar monitoring box which is in a marginal location and am hoping LORA can have a better time compared to Wifi. This is using 2 of the RFM9x Pi Bonnets though I plan on modifying my AirGradients to also use LORA instead of WIFI. |
@ImTheBadWolf Sorry for the much delayed response. Thank you for that suggestion and it makes sense. I will be looking into this issue as part of my work on #92. |
Any news on this ticket? I see that the new combined library (https://github.com/adafruit/Adafruit_CircuitPython_RFM) is up and running but I wonder if this has been looked at? In my application, I seem to be at the range limit given the configuration which this library supports, and changing to other radio settings would probably really help. |
Sorry for the slow response -- for some reason I did not get a notification of your new post... |
No worries! I'm very grateful for the work you've already done on the library. I wish I could help, but currently my hardware is being used for its intended purpose. Perhaps come spring when temperatures rise (and my use case disappears with the winter cold) I can experiment a bit (or possibly change to a new library version and new radio settings 🤞). |
Some progress on SF 7-12 -- see adafruit/Adafruit_CircuitPython_RFM#8 (comment) |
I have two other devices in the same room that are able to communicate while my LoRa Radio Bonnet on my Pi Zero cannot. The other devices can receive (FFFF0000345733E11203B22B47187E) what is sent but my Pi doesn't get anything that is sent.
One device is a Wio Terminal using the LoRa-E5 with these setting:
The other is a Feather nRF52840 with the FeatherWing RFM95W, which I assumed would be the easiest to communicate with being the same LoRa module. I am using this library https://github.com/sandeepmistry/arduino-LoRa since the RadioHead lib doesn't compile for the nRF52. It's settings:
And finally the settings from the Pi:
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: