Main Menu

Recent posts

#91
General topics / Re: Dropped Packets with High ...
Last post by Aerokeith - July 11, 2025, 06:50:18 PM
QuoteI applaud your perseverence, it pays off.
Thanks, it's really important that I get this working in within the next week.

Your message describes the normal operations of send() and receiveDone(), which I think I understand reasonably well. But I don't see any clues that would help me find or fix the problem. Maybe I should describe what I'm doing (in my test code) in more detail to see if it gives you any ideas of new things to try:

Transmit
The main loop calls send() every 100ms to send a 61 byte packet where the first byte contains a packet sequence number that is incremented every iteration. The bit rate is 100 Kbps.

Receive
The main loop repeatedly calls receiveDone() to check for a received packet, with no delays within the loop. If a packet is received, the packet sequence number is checked to see if there's a gap in the expected sequence. Errors are reported, but no other processing is performed (for this test).

It's pretty simple, but doesn't work correctly (no packet drops) until the transmit-side delay is reduced to less than the duration of a single packet (~6ms).
In this condition, send() is being called before the last bits of the previous packet have been transmitted. That's normal, I know. But when the delay is increased, send() is called when the previous transmission is completed (which I assume turns off the transmitter). So I'm guessing that there's some sort of delay in turning the transmitter back on such that the RFM module isn't fully ready to transmit the first bits of the packet, which get corrupted. I tried adding a setMode(RFM_MODE_TX) before the call to send() but that had no effect.

Any better ideas?

#92
General topics / Re: Dropped Packets with High ...
Last post by Felix - July 11, 2025, 05:08:44 PM
I applaud your perseverence, it pays off.
The send() will just modulate the packet then switch the radio in STANDBY mode, it cannot be left in TX mode or it would continuously modulate the carrier and not only eat up a lot of current, but also block the channel, it would be a terrible waste.
One call to receiveDone() will check if there is data received and if not it places the radio in RX mode, it eats around 15mA, but it stays there, it's needed if you expect an incoming packet at any undetermined time, once a packet is received it will read the packet and go into STANDBY mode.
A call to receiveBegin() just forces the RX mode regardless (this is called by receiveDone())

So i misunderstood initially - you definitely want comfortable separation if you transmit in parallel. I call for 300kbps if you have the room and don't need many channels tight together. Even 1mhz if there is no concern. Too much will start suffering if the antennas tuning frequency is very sharp, but 1mhz should be just fine with most antennas, and in your case at very short range a few db missed because of slight antenna mismatch is no concern.
#93
General topics / Re: Dropped Packets with High ...
Last post by Aerokeith - July 10, 2025, 06:18:16 PM
I think I'm getting closer to identifying the root cause of my "dropped packets" issue. The link is very reliable, with essentially no packet drops, if I continuously transmit packets by calling send() in a tight loop. But as soon as I add any delay between calls to send(), the packet loss rate jumps up. My guess is that during the delays the RFM module is switching to RX mode to listen for incoming packets. And then on the next call to send() maybe there's some kind of glitch when switching back to TX mode that corrupts the packet. Or maybe this is happening on the receiver side?

I've tested the difference between "continuous-transmit" and "periodic transmit" modes a couple of different ways, and get consistent results: continuous-good, periodic=bad. In periodic-transmit mode, the size of the delay between calls to send() doesn't seem to matter, although I haven't yet tried very small delays to see where the breakpoint is.

In my application i have dedicated transmit-only and receive-only nodes. Is there a way I can force the module to remain in either TX or RX mode?

Note that in my application, the delay between calls to send() are important. I use the elapsedMillis library to "pace" the calls to send(), allowing the CPU to perform other tasks during the delays.

Regarding the question I asked about center frequencies: I will have two transmitters in close proximity, and each transmitter will be sending data to two receivers located slightly further away. I plan to use different center frequencies for each transmitter [using setFrequency()] and I was asking about the necessary frequency separation.
#94
General topics / Re: Dropped Packets with High ...
Last post by Felix - July 09, 2025, 08:17:50 PM
They should work just as well at 2m apart.
You want the center frequency to match as much as possible. In reality it will vary from module to module by some amount, which is OK.
#95
General topics / Re: Dropped Packets with High ...
Last post by Aerokeith - July 09, 2025, 03:33:47 PM
A quick initial test indicates that it works well enough. More testing to come.

Any thoughts on the second question?
#96
General topics / Re: Dropped Packets with High ...
Last post by Felix - July 09, 2025, 02:59:24 PM
Looks like, try it!
#97
General topics / Re: Dropped Packets with High ...
Last post by Aerokeith - July 09, 2025, 11:41:10 AM
Can you please confirm that these are the correct settings for BitRate=100 Kbps?

void set100KBPS() {
  writeReg(0x03, 0x01);  //REG_BITRATEMSB: 100kbps (0x0140, see DS p20)
  writeReg(0x04, 0x40);  //REG_BITRATELSB: 100kbps (0x0140, see DS p20)
  writeReg(0x19, 0x49);  //REG_RXBW: 200kHz (DccFreq=010b, RxBwMant=01b/20, RxBwExp=001b)
  writeReg(0x1A, 0x89);  //REG_AFCBW: 200kHz (DccFreqAfc=100b, RxBwMantAfc=01b/20, RxBwExpAfc=001b)
  writeReg(0x05, 0x06);  //REG_FDEVMSB: 100khz (0x0668)
  writeReg(0x06, 0x68);  //REG_FDEVLSB: 100khz (0x0668)
  writeReg(0x29, 240);   //set REG_RSSITHRESH to -120dBm
  writeReg(0x37, 0b10010000); //DC=WHITENING, CRCAUTOOFF=0
  //                ^^->DC: 00=none, 01=manchester, 10=whitening
}

Also, if I want to use two transmitters operating in close proximity (~2m apart), do I need to offset the center frequencies by more than RxBw?
Thanks!
#98
Low Power Techniques / Re: Current Ranger LED current...
Last post by Felix - July 07, 2025, 04:04:20 PM
The max output is 3300mV.
In fact the battery is up to 4.2V and USB power is up to 5V.
It takes a divine miracle to get 6.7V at the output.
That your scope reads exactly 10x what the OLED reads tells me there's something going on with the scope.
And hence, I asked, if you could check the output with a DMM instead of the scope.
#99
Low Power Techniques / Re: Current Ranger LED current...
Last post by Sarfaraj - July 06, 2025, 09:40:44 AM
Hi Felix, Thanks for your reply. Could you explain what you mean by that? I didn't see an overload warning in the OLED display. It is showing me 674mA as mentioned. What value do you expect to see if an oscilloscope is connected at the analogue output?

Best Regards
#100
Low Power Techniques / Re: Current Ranger LED current...
Last post by Felix - July 05, 2025, 10:54:28 AM
There's no way to get more than 3.3V from the CR, ever, it would OVERLOAD.
Cross check with a DMM at the output.