Trying to convert the APRS_Position_LoRa.ino example to STM32WL for Ebyte's E77 STM32WLE5CCU6 board #1323
-
Hello, I am trying to get the APRS_Position_LoRa.ino going on a STM32WLE board. Hardware is (red: fixed link formatting) As far as the serial responses, it acts like its transmitting. But I never get a reception from my iGates. I am currently compiling for:
But I have also tried compiling for a nucleo_wl55jc, with the same results. Can anyone tell what I am doing wrong? // include the library
#include <Arduino.h>
#include <RadioLib.h>
// no need to configure pins, signals are routed to the radio internally
STM32WLx radio = new STM32WLx_Module();
APRSClient aprs(&radio);
// set RF switch configuration for Nucleo WL55JC1
// NOTE: other boards may be different!
// Some boards may not have either LP or HP.
// For those, do not set the LP/HP entry in the table.
static const uint32_t rfswitch_pins[] =
{PC3, PC4, PC5, RADIOLIB_NC, RADIOLIB_NC};
static const Module::RfSwitchMode_t rfswitch_table[] = {
{STM32WLx::MODE_IDLE, {LOW, LOW, LOW}},
{STM32WLx::MODE_RX, {HIGH, HIGH, LOW}},
{STM32WLx::MODE_TX_LP, {HIGH, HIGH, HIGH}},
{STM32WLx::MODE_TX_HP, {HIGH, LOW, HIGH}},
END_OF_MODE_TABLE,
};
void setup() {
Serial.begin(9600);
pinMode(PB4, OUTPUT); // Set LED1 as output
pinMode(PB3, OUTPUT); // Set LED2 as output
digitalWrite(PB4, 0); // Turn off LED1
digitalWrite(PB3, 0); // Turn off LED2
radio.setRfSwitchTable(rfswitch_pins, rfswitch_table);
// set RF switch control configuration
// this has to be done prior to calling begin()
//radio.setRfSwitchTable(rfswitch_pins, rfswitch_table);
// initialize STM32WL with default settings, except frequency
Serial.print(F("[STM32WL] Initializing ... "));
//int state = radio.begin(433.775);
// frequency: 433.775 MHz
// bandwidth: 125 kHz
// spreading factor: 12
// coding rate: 4/5
int state = radio.begin(433.775, 125, 12, 5);
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true) { delay(10); }
}
// initialize APRS client
Serial.print(F("[APRS] Initializing ... "));
// symbol: '>' (car)
// callsign "K6ATV"
// SSID 1
char source[] = "K6ATV";
state = aprs.begin('>', source, 1);
if(state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true) { delay(10); }
}
// set appropriate TCXO voltage for Nucleo WL55JC1
state = radio.setTCXO(1.7);
Serial.print(F("Set TCXO voltage ... "));
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true) { delay(10); }
}
}
// counter to keep track of transmitted packets
int count = 0;
void loop() {
//**************************************************
Serial.print(F("[APRS] Sending position ... "));
// send a location with message and timestamp
// SSID is set to 1, as APRS over LoRa uses WIDE1-1 path by default
char destination[] = "GPS";
char latitude[] = "3011.67N";
char longitude[] = "12135.96W";
char message[] = "I'm here!";
char timestamp[] = "093045z";
digitalWrite(PB3, 1);
//int state = aprs.sendPosition(destination, 1, latitude, longitude, message, timestamp);
int state = aprs.sendPosition(destination, 1, latitude, longitude, message);
digitalWrite(PB3, 0);
delay(5000);
if(state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
}
Serial.print(F("[Mic-E] Sending position ... "));
// you can also send Mic-E encoded messages
digitalWrite(PB3, 1);
state |= state = aprs.sendMicE(30.1945, -121.6000, 120, 10, RADIOLIB_APRS_MIC_E_TYPE_EN_ROUTE);
digitalWrite(PB3, 0);
delay(5000);
if(state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
}
// wait for 30 seconds before transmitting again
delay(30000);
} |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
Hi @radiohound, a few comments:
|
Beta Was this translation helpful? Give feedback.
-
I am convinced you are right, that my problem is RF switch pins, or possibly some setting like TCXO or HSE. But I am confused about how the RF Switch pins function. These switch pins don't seem to be chip specific. They seem to be board specific. For instance, in stmduino: For generic node:
For RAK3172 Module:
I am trying to use a STM32WLE5CC module in a stand alone application, with no external control. Are these pins controlling the SX1261 (inside the STM32WLE5 chip)? Or are these pins meant for outside control of the module? If the second part is true, I can understand why it is board specific. But if these pins are connected internally to the SX1261, then I do not understand why these pins appear to be board specific. Thanks for any ideas you may have. |
Beta Was this translation helpful? Give feedback.
-
I am not skilled enough to know if my situation is applicable to the discussion here, but wanted to share my config that works perfectly for the STM32WL55JC1 & JC2:
|
Beta Was this translation helpful? Give feedback.
-
Thank you K4KDR,
I have a STM32WL55JC2 coming in the mail, so I can try it with some of the
existing code, using your RF configs. I gather there are different settings
on the WLE series. Apparently multiple different settings.... I may have to
ask EByte, the manufacturer of my module for the specific info for my E77
Ebyte module. You would think they would publish the info, like Seeed
Studio does for theirs, but I can't seem to find it anywhere (yet).
For instance, the WIO-E5 (a STM32WLE5JC) uses only 2 switches:
Wio-E5 module ONLY transmits through RFO_HP:
Receive: PA4=1, PA5=0
Transmit(high output power, SMPS mode): PA4=0, PA5=1
Walter
…On Thu, Nov 21, 2024 at 8:21 AM K4KDR ***@***.***> wrote:
I am not skilled enough to know if my situation is applicable to the
discussion here, but wanted to share my config that works perfectly for the
*STM32WL55JC1* & *JC2*:
//-----------------------------------------------------------------------------
// set up radio module
// no need to configure pins, signals are routed to the radio internally
STM32WLx radio = new STM32WLx_Module();
// set RF switch configuration for Nucleo WL55JC2
// NOTE: other boards may be different!
// Some boards may not have either LP or HP.
// For those, do not set the LP/HP entry in the table.
static const uint32_t rfswitch_pins[] =
{PC3, PC4, PC5, RADIOLIB_NC, RADIOLIB_NC};
static const Module::RfSwitchMode_t rfswitch_table[] = {
{STM32WLx::MODE_IDLE, {LOW, LOW, LOW}},
{STM32WLx::MODE_RX, {HIGH, HIGH, LOW}},
{STM32WLx::MODE_TX_LP, {HIGH, HIGH, HIGH}},
{STM32WLx::MODE_TX_HP, {HIGH, LOW, HIGH}},
END_OF_MODE_TABLE,
};
//-----------------------------------------------------------------------------
—
Reply to this email directly, view it on GitHub
<#1323 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOA5OK4UJVH26AED3UXSJD2BYCA3AVCNFSM6AAAAABR66OA72VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMZTHA4DAMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ok, I was able to get the modules to transmit and receive using the example code. For this module, there are only 2 outputs for the switch, but I use the third one to turn on an LED for transmitting. Thanks for everyones help.
|
Beta Was this translation helpful? Give feedback.
Ok, I was able to get the modules to transmit and receive using the example code. For this module, there are only 2 outputs for the switch, but I use the third one to turn on an LED for transmitting. Thanks for everyones help.