New OOK library for Moteino

Started by kobuki, September 08, 2015, 06:21:44 PM

kobuki

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

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

No. From what I was able to gather, it's not possible to query RSSI values in OOK mode, sadly.

markbee

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

#49
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.

markbee

Did you ever succeed controlling a power socket with the transmitted code?

kobuki

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

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

#53
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?

markbee

#54
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.

kobuki

#55
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.

Quote from: markbee on September 25, 2015, 10:40:06 AM
EDIT: Remote device is a simple power socket that should work receiving a simple bit burst.

Brand, model...?

markbee

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

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

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:

  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

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?