-
Hello, trying to use APRS with a home made board (not made for radiolib but working with LMIC, so there could be bad GPIO choice) alternate SPI inspired by Wiki Basics and SPI multiples (ESP32 example) Thank you in advance for ideas-comments error log :
Program extract : #define SX1278_CS 5
#define SX1278_SCK 18
#define SX1278_MOSI 23
#define SX1278_MISO 19
#define SX1278_RESET 33
#define SX1278_DIO0 39
#define SX1278_DIO1 26
#define SX1278_DIO2 25
#define SX1278_DIO3 36
#define SX1278_DIO4 27
#define SX1278_DIO5 34
//-------------------------------------------------------------------------
// include the library
#include <RadioLib.h>
// wiki basics
SPIClass spi(VSPI);
SPISettings spiSettings(2000000, MSBFIRST, SPI_MODE0);
// SX1278 has the following connections:
// NSS pin: 10
// DIO0 pin: 2
// RESET pin: 9
// DIO1 pin: 3
// SX1278 radio = new Module(10, 2, 9, 3);
// SX1278 radio = new Module(SX1278_CS, SX1278_DIO0, SX1278_RESET, SX1278_DIO1);
SX1278 radio = new Module(SX1278_CS, SX1278_DIO0, SX1278_RESET, SX1278_DIO1, spi, spiSettings);
//ajout rc d'apres SPI multiple bus
// or using RadioShield
// https://github.com/jgromes/RadioShield
//SX1278 radio = RadioShield.ModuleA;
// create AFSK client instance using the FSK module
// this requires connection to the module direct
// input pin, here connected to Arduino pin 5
// SX127x/RFM9x: DIO2
// RF69: DIO2
// SX1231: DIO2
// CC1101: GDO2
// Si443x/RFM2x: GPIO
// SX126x/LLCC68: DIO2
// AFSKClient audio(&radio, 5);
AFSKClient audio(&radio, SX1278_DIO2);
// create AX.25 client instance using the AFSK instance
AX25Client ax25(&audio);
// create APRS client instance using the AX.25 client
APRSClient aprs(&ax25);
void setup() {
Serial.begin(115200);
// ajout rc d apres ESP SPI multiple bus
spi.begin(SX1278_SCK, SX1278_MISO, SX1278_MOSI, SX1278_CS); //SCLK, MISO, MOSI, SS
//set up slave select pins as outputs as the Arduino API
//doesn't handle automatically pulling SS low
pinMode(SX1278_CS, OUTPUT); //VSPI SS
//set up Pin pour RFM9x
//doesn't handle automatically pulling SS low
pinMode(SX1278_RESET, OUTPUT); //
pinMode(SX1278_DIO0, INPUT); //
pinMode(SX1278_DIO1, INPUT); //
pinMode(SX1278_DIO2, INPUT); //
pinMode(SX1278_DIO3, INPUT); //
pinMode(SX1278_DIO4, INPUT); //
pinMode(SX1278_DIO5, INPUT); //
// ajout rc d apres ESP SPI multiple bus
// initialize SX1278
// NOTE: moved to ISM band on purpose
// DO NOT transmit in APRS bands without ham radio license!
Serial.print(F("[SX1278] Initializing ... "));
int state = radio.beginFSK(434.0);
// when using one of the non-LoRa modules for AX.25
// (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);
}
// rc
//radio.setOutputPower(0);
//rc fin
// initialize AX.25 client
Serial.print(F("[AX.25] Initializing ... "));
// source station callsign: "N7LEM"
// source station SSID: 0
// preamble length: 8 bytes
// state = ax25.begin("N7LEM");
state = ax25.begin("FR4KP"); // rc
if(state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while(true);
}
// initialize APRS client
Serial.print(F("[APRS] Initializing ... "));
// symbol: '>' (car)
state = aprs.begin('>');
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("[APRS] Sending position ... ")); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Thank you for rporting this! I was able to replicate the issue on my Lilygo T-beam. There were two issues, one that was introduced when APRS over LoRa was added, and another with incorrectly sized buffer. I fixed both in d9eb90e, so you can either pull the latest master, or wait until the next update which should be coming in the next couple of weeks. |
Beta Was this translation helpful? Give feedback.
Thank you for rporting this! I was able to replicate the issue on my Lilygo T-beam. There were two issues, one that was introduced when APRS over LoRa was added, and another with incorrectly sized buffer. I fixed both in d9eb90e, so you can either pull the latest master, or wait until the next update which should be coming in the next couple of weeks.