I changed from my R5-USB 434MHz (DIO2 connected to Moteino Pin3) to the same modules with 868MHz and can read the transmitted bits (at least the 950*1000L delay is easy to identify). The bits preceding the long pause seem to be the bits I send, but are inverted? The timing is also a bit out of the programmed delay.
For example if I program the following 6 bits:
//snip
radio.send(1);
delayMicros(100L);
radio.send(0);
delayMicros(500L);
radio.send(1);
delayMicros(100L);
radio.send(0);
delayMicros(500L);
radio.send(1);
delayMicros(100L);
radio.send(0);
delayMicros(950 * 1000L);
//snap
I get values like:
19 0 68
0 1 392
1 0 184
2 1 476
3 0 168
4 1 944972
19 0 384
0 1 384
1 0 228
2 1 476
3 0 132
4 1 945460
19 0 116
0 1 400
1 0 184
2 1 476
3 0 160
4 1 944868
19 0 52
0 1 420
1 0 184
2 1 472
3 0 156
4 1 944948
5 0 412
6 1 156
7 0 484
8 1 144
9 0 945524
and so on.
I'm not sure if I the bits are one after another but I would absolutely call this a succes for your code.
One of my first wishes would be to fine tune the threshold like having a "squelch" at least for debugging to see how good the timings are. I didn't test the interrupt sending/ receiving - do you have any code for that?
Cheers
markbee
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?