Decoding not working if target_freq < capture_freq
wphilips opened this issue · 3 comments
In channelizer_impl.cc d_freq_offset is declated as unsigned:
uint32_t d_freq_offset;
This means that in channelizer_impl.cc the following computation goes wrong:
d_freq_offset = channel_list[0] - center_freq;
This is because it stores a signed value into unsigned.
The variable should instead be declared as float.
With this change, the code finally works for me.
Unfortunately I spent many hours to reach this point because of two problems
- This bug
- It took a long time before I discovered that that implicit header mode is not working using gr-lora
and that my test device used implicit header mode (originally)
For further reference and in case it is helpful to someone:
As the sender I use a "lora nexus" module from ideetron. This is an arduino mini which
contains a HOPERF RFM98. Initially it ran some code which attempts to contact a base station, but with implicit header mode. I had only partial success decoding this using other software (https://github.com/BastilleResearch/gr-lora.git)
I have now reflashed it with code available on the internet (https://github.com/Ideetron/RFM95W_Nexus):
Bandwidth 125 kHz, Coding rate = 4/8, Explicit header mode
Spreading factor 8
Preamble length 0x0004 + 4 = 8
As this was not documented at ale: To flash the nexus, you can use the same procedure as for arduino
mini. This code is working with gr-lora.
As a receiver I use usrp B200. At a distance of 5 cm. :->
That seems like a bug indeed, thanks for reporting. I'll add a test case for target_freq < capture_freq in the QA suite. I'm sorry you lost some time to this. Did you try to run gr-lora inside the Docker environment? Implicit header mode should work if you enable reduced rate mode.
Anyway, feel free to submit a PR if you want.
I've been struggling to get this to work also but this fix seems to work.
Hi, it looks like we hit the same issue while trying gr-lora inside the docker environment, was there any fix issued for this or did i encountered another corner case ?
regards.