Author Topic: New OOK library for Moteino  (Read 30070 times)

markbee

  • NewMember
  • *
  • Posts: 18
Re: New OOK library for Moteino
« Reply #15 on: September 10, 2015, 11:28:45 AM »
Just a very impulse idea about RSSI - the bits are inverted and according to the data sheet "The RSSI sampling must occur during the reception of preamble in FSK, and
constant “1” reception in OOK." (datasheet page 27).
I still though had no time to look why the bits are inverted.

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #16 on: September 10, 2015, 11:52:20 AM »
Yes, I've tried when I verifiably had a '1' signal, it didn't work either. I'm using the readRSSI() function from the orginal lib and it has always worked reliably in FSK mode, so I'm somewhat surprised.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: New OOK library for Moteino
« Reply #17 on: September 10, 2015, 12:04:41 PM »
Is the idea to use knowledge of the preamble to time the taking of the RSSI measurement during a "HIGH" reception, and then use that RSSI to adjust the gain control?  This sounds far more involved than those $1 receivers, which, while inflexible, handled that aspect of it automatically.

Of course, they pretty much assumed machester encoding to continually set the AGC, so they wouldn't be as useful for these other types.
« Last Edit: September 10, 2015, 12:07:44 PM by WhiteHare »

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #18 on: September 10, 2015, 12:11:11 PM »
I don't think I completely understand the question, but I merely wanted to see what RSSI values I'm getting as a simple measure of the strengtht of the signal. The module handles everything automatically, using user-settable parameters. It even has multiple modes for OOK reception, and a lot of knobs and buttons for tuning most aspects of the reception process. But it's a $5 module ;) Not all modes are generally useful, though.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: New OOK library for Moteino
« Reply #19 on: September 10, 2015, 12:18:18 PM »
Just a very impulse idea about RSSI - the bits are inverted and according to the data sheet "The RSSI sampling must occur during the reception of preamble in FSK, and
constant “1” reception in OOK." (datasheet page 27).
I still though had no time to look why the bits are inverted.

As an aside, Felix's library for the RFM69 seems to have a parameter for "forcing" the RSSI sampling to happen on demand rather than only during the preamble.  Also, the datasheet says it takes a duration of two bits to do the sample for the RSSI, so I presume increasing the datarate must increase the sample rate also (?).
« Last Edit: September 10, 2015, 12:21:50 PM by WhiteHare »

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #20 on: September 10, 2015, 12:19:46 PM »

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: New OOK library for Moteino
« Reply #21 on: September 10, 2015, 12:42:54 PM »
Can you read the RSSI pin directly (mode 0 of the 4 pin modes), and it fluctuates in real-time, or do you actually have to explicitly command the chip to do a sample every time before it will update that pin?  Sorry for the bonehead question, but I found the datasheet a bit terse.

If it helps at all by way of contrast, the cheap OOK receivers give you an analog voltage in real-time to represent the signal strength.  In fact, that's the only output they typically give at all.  Then you can either read it using an ADC, or connect it to a digital input pin on the arduino and read it that way (which obviously assumes the AGC is working correctly).
« Last Edit: September 10, 2015, 12:49:13 PM by WhiteHare »

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #22 on: September 10, 2015, 12:50:17 PM »
The RSSI output is on a digital pin -- and yes, the DS is very coarse about it. My guess is that it's just a simple threshold indicator. But I'd rather not hook another pin to the moteino from the module just for that...

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: New OOK library for Moteino
« Reply #23 on: September 10, 2015, 01:31:43 PM »
I'm assuming you've seen sevenwatt's blog regarding RFM69 OOK, but if not, it may be worth a look:  http://www.sevenwatt.com/main/category/ook/

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #24 on: September 10, 2015, 01:42:25 PM »
Yeah, read his great site about his projects. He's purely using the RSSI value in FSK mode to capture OOK signals - he's obviously successful at it, but I'm positive that a correctly set up RFM69 module in OOK mode is much more capable for that purpose.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: New OOK library for Moteino
« Reply #25 on: September 10, 2015, 03:23:57 PM »
He's purely using the RSSI value in FSK mode to capture OOK signals....

I'm surprised to hear that, as one of his posts begins with "RFM69 OOK RSSI and optimal bitrate settings are key for proper reception and decoding of “foreign” OOK signals..." [bold emphasis added by me]  Well, he does seem to agree with you.

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #26 on: September 10, 2015, 03:26:31 PM »
I've looked into his decoding soure code and he only used the RSSI values, to my surprise. He's experimenting with a lot of OOK stuff, so it's not surprising he digged deep into this as well.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: New OOK library for Moteino
« Reply #27 on: September 10, 2015, 04:11:08 PM »
It does look as though you are both connecting to DIO2: "When the RFM69 is used in continuous OOK mode, the signal can be read from the RFM69 DATA (DIO2) pin."

What I'm still not clear on is: is DIO2 presenting you with an analog value, or purely a binary value HIGH-LOW based on a threshhold that you set?  I do realize it says DIO2, not AIO2, but what really happens isn't constrained by silkscreen alone.  In looking at his plot of the the Oregon Scientific V1, it does seem as though he's reading an analog strength value (what he calls "raw RSSI"):  "...it is easy to record the raw RSSI and OOK data from a RFM69..."

Maybe it's just me, but I find it a lot easier and faster to read code when there's a high level description as to what's going on, and then try match that against the code, than it is to read code purely bottoms-up.
« Last Edit: September 10, 2015, 04:14:47 PM by WhiteHare »

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #28 on: September 10, 2015, 04:16:31 PM »
I'd suggest some RTFM is due ;)

DIOx are all programmable digital IO pins. Their name also suggests that: Digital I/O. So they're purely digital, 1 or 0. He's using the RSSI register (see the DS!) in FSK mode to create those o'scope-like graphs, and to decode the signal.

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: New OOK library for Moteino
« Reply #29 on: September 11, 2015, 02:44:44 AM »
Hey guys, this is very cool! I also use Moteinos to control RF power sockets. I've used OOK in packet mode which allows for the radio to create the timings. Just switch off the preamble, select OOK, fixed packet length and select the baud rate to get the right timings. Works like a charm without HW mods. Only receive though.

https://lowpowerlab.com/forum/index.php/topic,1115.msg7221.html#msg7221
« Last Edit: September 11, 2015, 02:51:22 AM by joelucid »