Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CubeCell + POCSAG issues. #1041

Closed
ellisgl opened this issue Mar 29, 2024 · 1 comment
Closed

CubeCell + POCSAG issues. #1041

ellisgl opened this issue Mar 29, 2024 · 1 comment
Labels
hw workaround Fix for a (suspected) hardware bug

Comments

@ellisgl
Copy link

ellisgl commented Mar 29, 2024

Running POCSAG w/ the CubeCell (AB01 V2) at 1200 BPS, the ouput isn't able to be decoded in Multimon-ng. Running a test with RPITX, it works fine.

Here's the waterfall comparison (CubeCell on the left), looks like there's stuttering?:
CubeCell-RPITX-POCSAG-1200

platformio.ini

[env:cubecell_board_v2]
platform = heltec-cubecell
board = cubecell_board_v2
framework = arduino
monitor_speed = 115200
lib_deps = jgromes/RadioLib@^6.5.0

main.c

#include <Arduino.h>
#include <RadioLib.h>

// CubeCell has the SX1262 built-in.
SX1262 radio = new Module(RADIOLIB_BUILTIN_MODULE);

// Create the pager client instance using the FSK module.
PagerClient pager(&radio);

void setup() {
    Serial.begin(115200);
    while(!Serial);
    // Wait 5 seconds - so we can see the startup messages after upload.
    delay(5000);
    Serial.print(F("[CubeCell] Initializing ... "));
    int state = radio.beginFSK();
    state |= radio.setOutputPower(-9);
    if(state == RADIOLIB_ERR_NONE) {
        Serial.println(F("success!"));
    } else {
        Serial.print(F("failed, code "));
        Serial.println(state);
        while(true);
    }

    // Initialize the pager client.
    Serial.print(F("[Pager] Initializing ... "));
    // base (center) frequency:     914.1435 MHz testing!
    // speed:                       1200 bps
    state = pager.begin(915.142, 1200);
    if(state == RADIOLIB_ERR_NONE) {
      Serial.println(F("success!"));
    } else {
      Serial.print(F("failed, code "));
      Serial.println(state);
      while(true);
    }
}

void loop() {
    Serial.print(F("[Pager] Transmitting messages ... "));
    int state = pager.transmit("HELLOWRLD!\0", 0062551, RADIOLIB_PAGER_ASCII);
    delay(500);
    if(state == RADIOLIB_ERR_NONE) {
        Serial.println(F("success!"));
        // We are only to send once.
        while(true);
    } else {
        Serial.print(F("failed, code "));
        Serial.println(state);
    }

    // Wait for a couple seconds before next try.
    delay(3000);
}

Debug output: https://gist.github.com/ellisgl/f14dbda493654f984faf6bcb60180644

@jgromes
Copy link
Owner

jgromes commented Mar 31, 2024

To transmit POCSAG, RadioLib relies on Arduino API micros() function for timing, as can be seen here:

void PagerClient::write(uint32_t codeWord) {

However, it has been reported that on CubeCell, the micros() function is broken, as shown e.g. here: #1013 (comment)

There is a workaround you can try, which is described here: https://github.com/jgromes/RadioLib/wiki/Interrupt-Based-Timing Basically you don't use the micros() function and create an appropriate timer yourself, taking care to set it up so that it triggers every 1/1200 = 833 microseconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hw workaround Fix for a (suspected) hardware bug
Projects
None yet
Development

No branches or pull requests

2 participants