Giter VIP home page Giter VIP logo

Comments (3)

sh123 avatar sh123 commented on July 28, 2024

@SQ9MDD , unfortunately, nRF24 maximum payload size is 32 bytes only, so it might be truncated, also would be useful to enable CRC check, it is disabled by default, enabled it in the sketch. Additional protocol is needed to support full length APRS packets. Alternatively, sketch could be simplified, so it will be just sending raw KISS packets byte by byte.

from nrf24l01_arduino_kiss_modem.

SQ9MDD avatar SQ9MDD commented on July 28, 2024

"Sending raw KISS packets byte by byte" is an option.

How hard is it to do?
I will test anything you write :)

from nrf24l01_arduino_kiss_modem.

sh123 avatar sh123 commented on July 28, 2024

Try something like that, it will just send kiss packets over to another modem, it is not right, but just to test. Correct approach is to implement additional protocol, which will allow longer packets to be sent. I cannot test it much as do not even have second modem.

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

#define RADIO_PIN_CE 10
#define RADIO_PIN_CS 11
#define RADIO_ADDRESS "00001"
#define RADIO_CHANNEL 0
#define RADIO_SPEED RF24_250KBPS
#define RADIO_CRC RF24_CRC_DISABLED
#define RADIO_PA RF24_PA_MAX

#define LOOP_SLEEP_MS 10

RF24 radio_(RADIO_PIN_CE, RADIO_PIN_CS);
const byte address_[6] = "00001";

void setup() {
  Serial.begin(115200);
  while (!Serial);
  
  radio_.begin();
  radio_.openWritingPipe(address_);
  radio_.setPALevel(RADIO_PA);
  radio_.setDataRate(RADIO_SPEED);
  radio_.setCRCLength(RF24_CRC_8);
  radio_.setChannel(RADIO_CHANNEL);
  radio_.startListening();
  
  radio_.openWritingPipe(address_);
  radio_.openReadingPipe(1, address_);
}

void loop() { 
  while (radio_.available()) {
    uint8_t rxByte = 0;
    radio_.read((void*)&rxByte, sizeof(rxByte));
    Serial.write(rxByte);
  }
  while (Serial.available()) {
    int rxResult = Serial.read();
    if (rxResult == -1) break;
    
    byte rxByte = (byte)rxResult;

    radio_.stopListening();
    radio_.write((void*)&rxByte, sizeof(byte));
    radio_.startListening();
  }
  delay(LOOP_SLEEP_MS);
}

from nrf24l01_arduino_kiss_modem.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.