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

pzingg

  • NewMember
  • *
  • Posts: 2
Re: New OOK library for Moteino
« Reply #60 on: September 28, 2015, 08:36:19 PM »
Thanks for the tips (should have RTFM about the DIO2 pin). Cloned your latest RFM69OOK repo and installed it.  Semi-soldered into DIO2 which is not wired on the MoteinoMEGA, and patched it to the MEGA pin 10 (i0).  So I didn't see much in OOKDumper until (duh) I plugged in the antenna wire.

dumpAllRegs() is working, and I'm getting signals.  Now to debug my code.  Not sure that the interrupt handler I'm using works. Perhaps I should start out by trying to handle all the state changes in loop() with radio.poll() calls?

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #61 on: September 28, 2015, 08:42:37 PM »
Yeah, the polling logic is definitely simpler. I'd started with that too, and then implemented the basic thermometer receiver based on that code. Anyway, it's good to see it works on the Mega too  8)

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #62 on: October 27, 2015, 06:07:43 PM »
A little update. It seems that reading out RSSI values is possible after all in OOK continuous mode. I haven't conducted thorough tests yet, but it seems that until the RSSI threshold is reached by an incoming signal, the RSSI reg. just returns some arbitrary constant. Then it starts changing according to the RSSI it currently senses and stays that way. If I set the threshold to the highest sensitivity value then values start changing right away. I've written a few lines of code that spouts RSSI values in continuous OOK mode and logged a session into a file with RealTerm, and loaded the file in GoldWawe (not the best app to look at waveforms of this kind, but it's OK). Attached image is a screenshot showing a capture of the old, cheap 433.92 MHz I use for testing sometimes. It's actually a floor higher, and several thick walls away.

This of course opens up new possibilities for the OOK receiver. It becomes possible to receive and decode OOK signals without HW modifications to the Moteino, or in general, less pins need to be connected and free to use on an ATMega. Natural consequence of the ability to measure RSSI is the possibility to adapt the receiver to the signal strenght to achieve more accurate pulse length detection, and so on. Of course, someone else has already done something similar, and actually his work gave me the inspiration to dig into this more. I however want a more generally applicable simple lib for basic OOK reception for custom codes and experimentation, and not another variation of a multi-device all-inclusive receiver solution.

janwolf

  • NewMember
  • *
  • Posts: 3
Re: New OOK library for Moteino
« Reply #63 on: January 24, 2016, 03:48:53 PM »
Hi

I'm very new to Aduino and RFM69. I'm starting a project to decode Visonic protocol with this RFM69 and Arduino. I've read your work. Very impressive. Now I have to choose the right library between RSSI approach and Intern OOK ! So have you made more test with RSSI approach. Which one will you choose ?

Many thanks
Jan
« Last Edit: January 25, 2016, 10:16:27 AM by janwolf »

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #64 on: January 24, 2016, 03:55:39 PM »
If you're new to Arduino then I recommend the original way that involves a small modification to the Moteino. It's a much simpler and more robust approach. BTW, are you sure that the Visonic RF protocol is OOK?

janwolf

  • NewMember
  • *
  • Posts: 3
Re: New OOK library for Moteino
« Reply #65 on: January 24, 2016, 04:35:19 PM »
It seems that it is OOK (for hardware like MCT-302) as jeelib handle it (https://github.com/jcw/jeelib/blob/master/examples/RF12/ookRelay2/decoders.h).
I've found a PDF from russia describing the MCT-302 where the protocol is described. It's composed of 32 bits but does not have a preamble !

Jan

janwolf

  • NewMember
  • *
  • Posts: 3
Re: New OOK library for Moteino
« Reply #66 on: January 25, 2016, 10:17:58 AM »
If you're new to Arduino then I recommend the original way that involves a small modification to the Moteino. It's a much simpler and more robust approach. BTW, are you sure that the Visonic RF protocol is OOK?

You mean to use your RFM69OOK code ? But, about the RSSI approach, have you continue to explore this way ?

Jan

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #67 on: January 25, 2016, 10:19:41 AM »
Why else would you post in the thread about my OOK lib? :)

Yes, I'm suggesting using it. No further code for exploring purely RSSI-based solutions yet to try, sorry.

MrSporty

  • NewMember
  • *
  • Posts: 2
  • Country: gb
Re: New OOK library for Moteino
« Reply #68 on: November 29, 2016, 06:41:34 AM »
The funny thing is, I tested transmitting with your code but only had a logic analyzer attached and never checked if it was really transmitting. I now looked at the spectrum analyzer and can't see any transmission on 433.9 MHz when I run the code...

EDIT: Which type of RFM69 do you use? H, HW, CW or HCW? I currently use a RFM69HCW for the tests.
EDIT: Remote device is a simple power socket that should work receiving a simple bit burst.

Works now with a lot of devices (receiving & sending), but had to change and adjust some (a lot) settings, library & code. I will go into detail later, maybe with a detailed blog entry.

Cheers
narkbee

Sorry for dredging up an old thread but I was wondering if you (markbee) had posted those changes anywhere as I'm having a devil of a time getting a basic RFM69 / Arduino setup to perform any form of OOK transmit.

The same setup will happily send and receive standard packet based data using the slew of example code available so I'm happy that the basics are in place. It will also receive KAKU-like data using the libs here :

https://github.com/SevenW/embapps/tree/master/ArduinoRFM69

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #69 on: November 29, 2016, 06:53:55 AM »
I asked him several times too, he never bothered. He needed some general cloning device IIRC, and that needs a lot of additional coding, though there are no changes needed to the library itself, so I don't really get what he meand by that statement. You can just modulate OOK in the sketch in any way you want. The transmitter worked just fine for me. Though I didn't spend a lot of time on it, I was able to receive OOK signals just fine using a pair of moteinos. You did the extra jumper wire soldering on the Moteino, right?

MrSporty

  • NewMember
  • *
  • Posts: 2
  • Country: gb
Re: New OOK library for Moteino
« Reply #70 on: November 29, 2016, 08:00:29 AM »
Thanks for the quick reply kobuki !

I have patched in the DIO2 pins to the int pins on a pair of setups that I have (fly wired Uno + RFM69). I initially purchased a batch of RFM69's from a china supplier and upon not being able to get them to transmit I decided to pick another up from a legit reseller. Unfortunately both seem to exhibit the same behavior.

I assumed that the DIO2 pin was just for an interrupt based reception but I can confirm they are wired correctly.

I know the SPI part is also working as I can use a "dumpreg" example and see that they are being loaded with the correct values. I know the setups will also transmit packet data fine because they are nice an noisy when checking them with an SDR dongle and a simple waterfall display.
« Last Edit: November 29, 2016, 09:56:02 AM by MrSporty »

DenisJ

  • NewMember
  • *
  • Posts: 18
  • Country: it
Re: New OOK library for Moteino
« Reply #71 on: January 26, 2017, 03:54:42 AM »
Hi there all
sorry Kobuki if I reopen this thread... I have a moteino mega usb with a RFM69HCW on it.

On the moteino mega usb board, I so a jumper near DIO2 pin of RFM69HCW ... it's like if you close this jumper
the DIO2 is mapping to the D21 pin of moteino.

I read on your lib that DIO2 must be connected to the pin 10 of moteino.

Can I change this pin someware in your lib please ? from 10 to 21... if yes where I must do it please ?

Thanks a lot
Denis

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #72 on: January 26, 2017, 05:15:38 AM »
If you don't use interrupts but only polling, you can map DIO2 to any free digital input pin by changing RF69OOK_IRQ_PIN in RFM69OOK.h and solder your jumper accordingly. If you use interupts, your options are limited, and depend on the actual ATMega chip. In that case you also need to change the associated RF69OOK_IRQ_NUM as well.

DenisJ

  • NewMember
  • *
  • Posts: 18
  • Country: it
Re: New OOK library for Moteino
« Reply #73 on: January 26, 2017, 05:26:20 AM »
Sorry,
I'm little confusing ... I know I use the INT0 but on the DIO0 pin of the RFM60HCW
In this case the RFM69 lib from LowPowerLab it's work.

You tell me that I must use the INT0 on the DIO2 pin in this case ?
Sorry but like you understand I'm newbe in this world :-)

Thanks again
Denis

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #74 on: January 26, 2017, 05:39:50 AM »
You can use INT0 or INT1 (pin 10 or 11), yes. Pin 10 is an example for one of the 2 available interrupts on the Mega.