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

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #45 on: September 15, 2015, 09:11:15 AM »
Average is -0,67%. Pretty good.

Could you find the compile error?

@WhiteHare: an SDR stick is not at all bad for this with proper settings for the band. In fact, you have a lot more detailed image. And the better ones can even see Wi-Fi signals.

markbee

  • NewMember
  • *
  • Posts: 18
Re: New OOK library for Moteino
« Reply #46 on: September 16, 2015, 03:51:12 AM »
I downloaded the github files again, cleaned some stuff in my libraries ;) and now everything compiles fine. Did you get any further with the RSSI values?

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #47 on: September 16, 2015, 05:37:27 AM »
No. From what I was able to gather, it's not possible to query RSSI values in OOK mode, sadly.

markbee

  • NewMember
  • *
  • Posts: 18
Re: New OOK library for Moteino
« Reply #48 on: September 16, 2015, 08:05:14 AM »
Regarding the small changes I made in your code (e.g. OOKdumper) check for the datatypes to be correct. E.g. if you set TSIZE to 400 you need an integer for the variable pos & i in the for next loop and so on...

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #49 on: September 16, 2015, 08:21:27 AM »
Loop variable i: thanks, fixed. Originally tt was shorter so byte was fine. Honestly, I didn't pay much attention to the dumper code. I'd expect anyone trying to use it tailor it to their specific needs.

EDIT: removed first paragraph; it was a product of misreading a part of your post.
« Last Edit: September 16, 2015, 09:44:10 AM by kobuki »

markbee

  • NewMember
  • *
  • Posts: 18
Re: New OOK library for Moteino
« Reply #50 on: September 25, 2015, 04:20:34 AM »
Did you ever succeed controlling a power socket with the transmitted code?

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #51 on: September 25, 2015, 07:26:11 AM »
No, sorry, I don't have such a thing at the moment. Did you not succeed with it? I'm willing to help if I can, it would be great if I could include a working transmitter of any kind in the sources as an example.

markbee

  • NewMember
  • *
  • Posts: 18
Re: New OOK library for Moteino
« Reply #52 on: September 25, 2015, 10:11:07 AM »
No I'm working at it at the moment. I thought it would be as easy as setting the RFM69 into TX mode with the appropiate register settings and then send the recorded bitbursts back. But that apparently doesn't work. I will have a more detailed look into it.

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #53 on: September 25, 2015, 10:16:57 AM »
It should be as simple as calling transmitBegin(), do your send() series and then transmitEnd(). With dummy data, I've been successful with it (see the OOKTransmitTest example). You might need to use setPowerLevel() to lower the RF output power if your receiver is very close (during testing). You posted nice scope shots about the process, it should work with the original receiver, too. However the receiver might use rolling code, some changing bits as flags you need to mimic in your transmitter, etc. What kind of receiver do you have?
« Last Edit: September 25, 2015, 11:01:45 AM by kobuki »

markbee

  • NewMember
  • *
  • Posts: 18
Re: New OOK library for Moteino
« Reply #54 on: September 25, 2015, 10:40:06 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.
« Last Edit: September 25, 2015, 11:03:56 AM by markbee »

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #55 on: September 25, 2015, 11:05:50 AM »
I'm using RFM69W-433-S2 for 433 HMz stuff (tested with 868 MHz versions earlier, but they are not a good fit, obviously). Post your code so we can check it out.

EDIT: Remote device is a simple power socket that should work receiving a simple bit burst.

Brand, model...?
« Last Edit: September 25, 2015, 11:12:52 AM by kobuki »

markbee

  • NewMember
  • *
  • Posts: 18
Re: New OOK library for Moteino
« Reply #56 on: September 28, 2015, 05:33:43 AM »
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

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #57 on: September 28, 2015, 07:35:49 AM »
Thanks for the report. It would greatly help if you showed us the changed settings. I didn't need to change a lot of them besides the most important 3-4 ones to receive a sensible pulse train of any device I could find. So I'm wondering what needed to be changed so much on your side. Is it possible you upload/send your code? BTW, did you interpret all your devices for yourself or you were able to use a 3rd party lib to decode the lot of devices you have? I don't need a lenghty blog entry, just the basics so I can refine the public repo for others to gain from it (well, of course, if you'd allow that, too).

pzingg

  • NewMember
  • *
  • Posts: 2
Re: New OOK library for Moteino
« Reply #58 on: September 28, 2015, 07:39:12 PM »
Newbie (to electronics as well as Arduino, not to mention 433 Mhz radios and OOK), so probably doing something drastically wrong. I'm using a MoteinoMEGA and the project is to receive and decode data a rain gauge that I am told uses OOK. (Basing things on this post: http://rayshobby.net/reverse-engineer-wireless-temperature-humidity-rain-sensors-part-3/ )

First hurdle (after soldering all the headers on my Moteino) is that when I use this sample code in setup:

Code: [Select]
  radio.initialize();
  radio.setFixedThreshold(30);
  radio.setFrequencyMHz(433.9);
  radio.receiveBegin();

and then poll radio.readAllRegs() in my loop, the only register that has any non-zero values in it is the first one (REG_OPMODE). So I'm thinking that the SPI/register stuff is not really working right.  Shouldn't the radio.initialize() call set up a lot of other values, and I should get them back if I call readAllRegs()?

The SS pin is 4 on the MEGA. Does it need a pulldown to keep it low?  Any other suggestions?

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: New OOK library for Moteino
« Reply #59 on: September 28, 2015, 07:46:12 PM »
Sorry, I don't have a Mega, but I'll try to help. Did you hook the DIO2 pin to an interrupt pin on the mote? It's needed for RX and TX, whether using interrupts or not. It should be connected to PIN10. The register dump had an error, as it was from an old version of the original LPL code. It should be fixed in at least the latest GitHub revision of the OOK lib. What revision do you use?