• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Looking for 868mhz receiver
#21
Hi,

Sure the code is open, although it's not the prettiest code.
I'll post it tonight, the proof of concept is a standalone arduino code which connects to the rfm69, puts it in OOK mode and via an interrupt displays when digital pin 3 is high or low.
With a second arduino you can of course connect this pin 3 to an arduino with the pilight code on it and connect it easily with pilight.

Best would be to integrate part of my code with the current pilight arduino code so this would natively support the rfm69.

As said will post the code tonight
 
Reply
#22
(02-18-2016, 07:53 AM)rudig Wrote: Hi,

Sure the code is open, although it's not the prettiest code.
I'll post it tonight, the proof of concept is a standalone arduino code which connects to the rfm69, puts it in OOK mode and via an interrupt displays when digital pin 3 is high or low.
With a second arduino you can of course connect this pin 3 to an arduino with the pilight code on it and connect it easily with pilight.

Best would be to integrate part of my code with the current pilight arduino code so this would natively support the rfm69.

As said will post the code tonight

Thx, I need only the initilizing code for the rfm69. I bought some a while ago and I want to bring it in OOK mode. But I work with PIC controllers and I will have it to look at the code of a heating thermostat (ELV). Perhaps it can be integrated in pilight.
 
Reply
#23
Hi,

Below is the code I used for testing.
The library which is also used is found at :

http://www.airspayce.com/mikem/arduino/RadioHead/

Let me know if there any questions concerning below code.
Is not the nicest clean code, but it does work :-)

Code:
// Test OOK mode on RFM69 and Arduino nano
// RFM is connected to SPI pins from Arduino nano

#include <SPI.h>
#include <RH_RF69.h>

#define RH_RF69_DATAMODUL_MODULATIONTYPE_OOK                0x08
#define RH_RF69_REG_02_DATAMODUL                            0x02

const int slaveSelectPin = 10;

// Interrupt pin
const int pin = 3;


int i;
int times_found = 0;
long tijd, tijd_count = 0;
volatile int state = LOW;

int count = 0;
int duration = 0;
boolean found = false;
boolean pulse = false;

// Singleton instance of the radio driver
RH_RF69 rf69;

uint8_t spiWrite(uint8_t reg, uint8_t val)
{
  uint8_t status = 0;
  digitalWrite(slaveSelectPin, LOW);
  status = SPI.transfer(reg | RH_SPI_WRITE_MASK); // Send the address with the write mask on
  SPI.transfer(val); // New value follows
  digitalWrite(slaveSelectPin, HIGH);
  return status;
}

void setup()
{
  Serial.begin(9600);
  if (!rf69.init())
    Serial.println("init failed");
  // Defaults after init are 434.0MHz, modulation GFSK_Rb250Fd250, +13dbM
  // No encryption
  if (!rf69.setFrequency(868.0))
    Serial.println("setFrequency failed");

  // If you are using a high power RF69, you *must* set a Tx power in the
  // range 14 to 20 like this:
  rf69.setTxPower(14);

  // Set RFM69 into receive mode
  spiWrite(  0x01 ,  16);

  // Set RFM69 into OOK mode without bit synchronizer
  spiWrite(  RH_RF69_REG_02_DATAMODUL ,  RH_RF69_DATAMODUL_MODULATIONTYPE_OOK);

  // Attach interrupt to "data" pin from RFM69 (DIO2 pin from RFM69)
  attachInterrupt(digitalPinToInterrupt(pin), data, CHANGE);
}


// Interrupt procedure which sets the boolean "state" to the corresponding state of the pin
void data() {
  if (digitalRead(pin) == HIGH)
  {
    state = HIGH;
  }
  else {
    state = LOW;
  }
}

// Counter to count time between switch of signal from low->high and high->low
void count_time(int high_low) {
  tijd_count = millis();
  while (state == high_low) {
  }
  tijd = millis() - tijd_count;
}


void loop() {
  tijd = 0;

  if (state == HIGH) {
    count_time(HIGH);
    Serial.print(tijd);
    Serial.println("  HIGH Time counted");
    pulse = true;
  }
  if (state == LOW) {
    count_time(LOW);
    Serial.print(tijd);
    Serial.println(" LOW Time counted");
    pulse = true;
  }


}
 
Reply
#24
I wonder what the current status of 868 MHz devices within pilight is?
Here
https://www.kompf.de/tech/rxdec.html
I found a project where they use a 868 Mhz receiver together with an Raspberry Pi. I hope that you can understand the article (with google translate) but of course as a native speaker I can help if you have specific questions related to the language. The project is based on the WringP Library and the code can be found here https://github.com/skaringa/TempHygroRX868
I'm not an expert but the main code
https://github.com/skaringa/TempHygroRX8.../rxdec.cpp
does not look to long or to complicated? Maybe it helps to also include 868 MHz support in pilight?
 
Reply
#25
What about the cc1101 868 MHZ module, both sender and receiver. I've just received it from Ali aliexpress to control my Mechanical ventilation system that is working on a 868 Mhz signal. If I can do some testing to get it to work with pilight please let me know.

A link to the project:
https://gathering.tweakers.net/forum/lis...90945/last
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Approved Sender and Receiver Kit curlymo 73 99,021 03-01-2021, 04:11 AM
Last Post: jicTap
  ESP8266 with 433 MhZ Transceiver/Receiver as Remote for Raspberry Tueftler1983 2 3,092 05-12-2019, 06:31 PM
Last Post: bitboy
  Filter kit in 315 receiver? ceandre 1 2,052 04-14-2017, 10:10 PM
Last Post: wo_rasp
  Low Pass Filter and Receiver in Series? re-post Gustavo Woltmann 1 2,249 03-08-2017, 05:25 PM
Last Post: pilino1234
  Low Pass Filter and Receiver in Series? Hauke 3 4,054 08-30-2016, 08:25 AM
Last Post: wo_rasp
  433 Receiver shielding satsatt 2 4,593 07-13-2016, 07:12 PM
Last Post: HazelMiki
  433mhz receiver for window shutters stratege-0815 0 2,071 02-18-2016, 12:14 PM
Last Post: stratege-0815
  433mhz USB Sender/Receiver raws99 8 11,542 11-17-2015, 11:29 PM
Last Post: curlymo
  433 Mhz receiver mike 9 8,058 09-30-2015, 04:01 PM
Last Post: lxz
  sender and receiver 433,42 stefanzweig1979 6 7,119 09-14-2015, 10:05 PM
Last Post: wo_rasp

Forum Jump:


Browsing: 1 Guest(s)