Grüße,
ich versuche eine Kommunikation zwischen 2 Arduino Unos mithilfe des 8-Pin E07-M1101D Sender/Empfänger Moduls aufzubauen. Beide Arduinos sind mit jeweils einem dieser Module verbunden, einer soll NUR senden und einer soll NUR empfangen.
Beide Module sind gleich an ihren jeweiligen Arduino angeschlossen (Siehe Ende). Problem ist das der Empfänger kein gültiges Signal erkennt.
Ich bin ziemlich neu auf dem Gebiet und etwas ratlos was genau hier das Problem sein kann und würde mich über Tipps und Lösungsansätze sehr freuen.
Code Sender:
#include <ELECHOUSE_CC1101_SRC_DRV.h>
#include <SPI.h>
void setup() {
Serial.begin(9600);
if (ELECHOUSE_cc1101.getCC1101()) {
Serial.println("Connection OK");
} else {
Serial.println("Connection Error");
}
ELECHOUSE_cc1101.Init(); // must be set to initialize the cc1101!
ELECHOUSE_cc1101.setCCMode(1); // set config for internal transmission mode.
ELECHOUSE_cc1101.setModulation(0); // set modulation mode. 0 = 2-FSK, 1 = GFSK, 2 = ASK/OOK, 3 = 4-FSK, 4 = MSK.
ELECHOUSE_cc1101.setMHZ(433.92); // Here you can set your basic frequency. The lib calculates the frequency automatically (default = 433.92).The cc1101 can: 300-348 MHZ, 387-464MHZ and 779-928MHZ. Read More info from datasheet.
ELECHOUSE_cc1101.setSyncMode(2); // Combined sync-word qualifier mode. 0 = No preamble/sync. 1 = 16 sync word bits detected. 2 = 16/16 sync word bits detected. 3 = 30/32 sync word bits detected. 4 = No preamble/sync, carrier-sense above threshold. 5 = 15/16 + carrier-sense above threshold. 6 = 16/16 + carrier-sense above threshold. 7 = 30/32 + carrier-sense above threshold.
// ELECHOUSE_cc1101.setPA(10); // set TxPower. The following settings are possible depending on the frequency band. (-30 -20 -15 -10 -6 0 5 7 10 11 12) Default is max!
ELECHOUSE_cc1101.setCrc(1); // 1 = CRC calculation in TX and CRC check in RX enabled. 0 = CRC disabled for TX and RX.
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("Sending");
ELECHOUSE_cc1101.SendData("Hello World", 100);
delay(2000);
}
Code Empfänger:
//New receiving method. This method checks the Rx Fifo for any data it contains.
//It allows you to do several things in a loop.
//In addition, the gdo0 and gdo2 pin are not required.
//https://github.com/LSatan/SmartRC-CC1101-Driver-Lib
//by Little_S@tan
#include <ELECHOUSE_CC1101_SRC_DRV.h>
void setup() {
Serial.begin(9600);
if (ELECHOUSE_cc1101.getCC1101()) { // Check the CC1101 Spi connection.
Serial.println("Connection OK");
} else {
Serial.println("Connection Error");
}
ELECHOUSE_cc1101.Init(); // must be set to initialize the cc1101!
ELECHOUSE_cc1101.setCCMode(1); // set config for internal transmission mode.
ELECHOUSE_cc1101.setModulation(0); // set modulation mode. 0 = 2-FSK, 1 = GFSK, 2 = ASK/OOK, 3 = 4-FSK, 4 = MSK.
ELECHOUSE_cc1101.setMHZ(433.92); // Here you can set your basic frequency. The lib calculates the frequency automatically (default = 433.92).The cc1101 can: 300-348 MHZ, 387-464MHZ and 779-928MHZ. Read More info from datasheet.
ELECHOUSE_cc1101.setSyncMode(2); // Combined sync-word qualifier mode. 0 = No preamble/sync. 1 = 16 sync word bits detected. 2 = 16/16 sync word bits detected. 3 = 30/32 sync word bits detected. 4 = No preamble/sync, carrier-sense above threshold. 5 = 15/16 + carrier-sense above threshold. 6 = 16/16 + carrier-sense above threshold. 7 = 30/32 + carrier-sense above threshold.
ELECHOUSE_cc1101.setCrc(1); // 1 = CRC calculation in TX and CRC check in RX enabled. 0 = CRC disabled for TX and RX.
Serial.println("Rx Mode");
}
byte buffer[61] = { 0 };
void loop() {
//Checks whether something has been received.
//When something is received we give some time to receive the message in full.(time in millis)
if (ELECHOUSE_cc1101.CheckRxFifo(100)) {
if (ELECHOUSE_cc1101.CheckCRC()) { //CRC Check. If "setCrc(false)" crc returns always OK!
Serial.print("Rssi: ");
Serial.println(ELECHOUSE_cc1101.getRssi());
Serial.print("LQI: ");
Serial.println(ELECHOUSE_cc1101.getLqi());
int len = ELECHOUSE_cc1101.ReceiveData(buffer);
buffer[len] = '\0';
Serial.println((char *)buffer);
for (int i = 0; i < len; i++) {
Serial.print(buffer[i]);
Serial.print(",");
}
Serial.println();
}
}
}
Der Sender scheint erfolgreich zu senden, jedoch bekomme ich beim Empfänger nur folgende Werte im Serial Monitor angezeigt:
19:07:08.351 -> Rssi: -138
19:07:08.397 -> LQI: 0
19:07:08.397 ->
19:07:08.397 ->
19:07:08.491 -> Rssi: -138
19:07:08.491 -> LQI: 0
E07-M1101D Datenblatt PDF: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwi72Yfg3dOPAxXyBdsEHd-OFCIQFnoECBgQAQ&url=https%3A%2F%2Fwww.cdebyte.com%2Fpdf-down.aspx%3Fid%3D1341&usg=AOvVaw2fXuqRUqlhyNuE9ourpiJo&opi=89978449
Anschlüsse:

