Replies: 3 comments 1 reply
-
On CC1101, this is the GDO2 pin and yes, you have to connect it. Other than that it should be good to go. The POCSAG message format is obviously incompatible with the packets CC1101 (and all of the other modules) expects, so RadioLib uses two pins to output the demodulated data and clock, and then perform processing in software. Data is output on GDO2, that's why the connection is required. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the hint and code verification for CC1101 and ultimately would like to support 0.96 OLED display that would show the received message, and maybe the last 5 messages would be buffered in the code and with the help of the ESP GPIO button attached, you could scroll the received messages as in a typical PAGER POCSAG :-) Many thanks for adding POCSAG to RadioLib |
Beta Was this translation helpful? Give feedback.
-
Can you write more to me about the line const int pin = 4; The number 4 what is the number? I suppose that PIN CC1101 GD02 is connected to pin = 4 but the number is on Arduino Pro Mini etc? Regards |
Beta Was this translation helpful? Give feedback.
-
Hi,
I try to use example code to receive POCSAG message with SX1278 board
https://github.com/jgromes/RadioLib/blob/master/examples/Pager/Pager_Receive/Pager_Receive.ino
to my board CC1101
I have a question about part of code
// DIO2 pin: 5
const int pin = 4;
Is it necessary for CC101 ?
or other suggestions to optimize code for CC1101 to receive POCSAG messages?
Below example my modified code for CC1101 to receiving POCSAG message:
/*
RadioLib Pager (POCSAG) Receive Example
This example receives POCSAG messages using CC1101
FSK modem.
Other modules that can be used to receive POCSAG:
- SX127x/RFM9x
- RF69
- SX1231
- CC1101
- Si443x/RFM2x
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#sx127xrfm9x---lora-modem
For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/
*/
// include the library
#include <RadioLib.h>
// CC1101 has the following connections:
// CS pin: 10
// GDO0 pin: 2
// RST pin: unused
// GDO2 pin: 3 (optional)
CC1101 radio = new Module(10, 2, RADIOLIB_NC, 3);
// GDO2 PIN: 3
const int pin = 4;
// create Pager client instance using the FSK module
PagerClient pager(&radio);
void setup() {
Serial.begin(9600);
// initialize CC1101 with default settings
Serial.print(F("[CC1101] Initializing ... "));
// when using one of the non-LoRa modules
// (RF69, CC1101, Si4432 etc.), use the basic begin() method
int state = radio.begin();
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
}
// initalize Pager client
Serial.print(F("[Pager] Initializing ... "));
// base (center) frequency: 434.0 MHz
// speed: 1200 bps
state = pager.begin(434.0, 1200);
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
}
// start receiving POCSAG messages
Serial.print(F("[Pager] Starting to listen ... "));
// address of this "pager": 1234567
state = pager.startReceive(pin, 1234567);
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
}
}
void loop() {
// the number of batches to wait for
// 2 batches will usually be enough to fit short and medium messages
if (pager.available() >= 2) {
Serial.print(F("[Pager] Received pager data, decoding ... "));
// you can read the data as an Arduino String
String str;
int state = pager.readData(str);
// you can also receive data as byte array
/*
byte byteArr[8];
size_t numBytes = 0;
int state = radio.receive(byteArr, &numBytes);
*/
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
// print the received data
Serial.print(F("[Pager] Data:\t"));
Serial.println(str);
} else {
// some error occurred
Serial.print(F("failed, code "));
Serial.println(state);
}
}
}
Beta Was this translation helpful? Give feedback.
All reactions