Comments (5)
Since oyu have not posted your complete code (and ignored the issue template in the process), it's very hard to guess, but I will attempt to anyway: did you increase the overcurent protection limit? I'd guess not, it's set to 60 mA by default, not enough for +20 dBm output.
from radiolib.
Dear jgromes,
Sorry for deleting the template is the first time i post on GitHub and i did not really know how to proceed.
Thank you for your answer.
I have tried with this setting for the current limit:
if (radio.setOutputPower(20, false) == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
Serial.println(F("Selected output power is invalid for this module!"));
while (true);
}
if (radio.setCurrentLimit(240) == RADIOLIB_ERR_INVALID_CURRENT_LIMIT) {
Serial.println(F("Selected current limit is invalid for this module!"));
while (true);
}
But still only getting 10 dBm, the module is XL1278-SMT maybe is somethig to do with this?
Thank you for your answer highly appreciated
from radiolib.
I am still missing basic information, such as the code, which Arduino you are using etc.
the module is XL1278-SMT
No idea what that is. Quick google search several different Chinese modules. Do you know whether it uses the RFO or the PA_BOOST pin? Is the power source sufficient? How are you measuring the output?
from radiolib.
#include <RadioLib.h>
#include <WiFi.h>
#include <WebServer.h>
#include <SPIFFS.h>
// Configuración WiFi y servidor web
const char* ssid = "wifi";
const char* password = "123456789";
WebServer server(80);
//unsigned long wifiStartTime;
//const unsigned long wifiTimeout = 60000; // 60 segundos
bool isWifiActive = false;
unsigned long lastRequestTime = 0;
const unsigned long wifiTimeout = 60000; // 60 segundos
String lastConfigData = ""; //variable para leer los datos desde la pagina admin pulsando Leer
#define LED_PIN 1
#define SENSOR_PIN 10
unsigned long previousMillis = 0; // Variable para almacenar la última vez que se actualizó el LED
const long intervaloEncendido = 300; // Medio segundo
const long intervaloApagado = 2000; // 2 segundos
// Configuración del módulo LoRa SX1278
SX1278 radio = new Module(7, 2, 9, 3);
bool mensajeLoRaEnviado = false;
float frecuencia = 433.0; // Frecuencia inicial
float anchoBanda = 62.5; // Ancho de banda inicial
String SerialNumber = "433T0000101"; //Numero de serie ejemplo
String ID = "01"; //ID ejemplo maximo ID 99
void setup() {
if (!SPIFFS.begin(true)) {
Serial.println("Error al montar el sistema de archivos");
return;
}
server.on("/", HTTP_GET, handleRoot);
// Agregar un punto de acceso para servir el archivo de imagen
server.on("/pickpoint.png", HTTP_GET, []() {
File file = SPIFFS.open("/pickpoint.png", "r");
if (!file) {
server.send(404, "text/plain", "Archivo no encontrado");
return;
}
server.streamFile(file, "image/png");
file.close();
});
// Configurar el servidor web para procesar datos y ademas
// Configura el ESP32 como punto de acceso
WiFi.softAP(ssid, password);
isWifiActive = true;
IPAddress IP = WiFi.softAPIP();
Serial.print("IP del AP: ");
Serial.println(IP);
server.on("/", HTTP_GET, handleRoot);
server.on("/admin", HTTP_GET, handleAdminLoginForm);
server.on("/admin", HTTP_POST, handleAdmin);
server.on("/program", HTTP_POST, handleProgram);
server.on("/setFrequency", HTTP_GET, []() {
String frequency = server.arg("frequency");
procesarComando("F" + frequency);
server.send(200, "text/plain", "Frecuencia programada: " + frequency);
});
server.begin();
pinMode(A0, INPUT); // Configurar el pin A0 para la lectura de voltaje
pinMode(LED_PIN, OUTPUT); // Configura el pin del LED como salida
pinMode(SENSOR_PIN, INPUT); // Configura el pin del sensor como entrada
digitalWrite(LED_PIN, LOW); // Asegúrate de que el LED esté apagado al inicio
Serial.begin(9600);
Serial.print(F("[SX1278] Initializing ... "));
int state = radio.begin(frecuencia, anchoBanda);
// Configurar el Factor de Dispersión (Spreading Factor)
// state = radio.setSpreadingFactor(12);
// if (state != RADIOLIB_ERR_NONE) {
// Serial.println(F("Falló la configuración de SF!"));
// }
// Configurar el Código de Tasa (Coding Rate)
// state = radio.setCodingRate(7);
// if (state != RADIOLIB_ERR_NONE) {
// Serial.println(F("Falló la configuración de CR!"));
// }
if (radio.setOutputPower(20, false) == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
Serial.println(F("Selected output power is invalid for this module!"));
while (true);
}
if (radio.setCurrentLimit(240) == RADIOLIB_ERR_INVALID_CURRENT_LIMIT) {
Serial.println(F("Selected current limit is invalid for this module!"));
while (true);
}
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("Initialization successful!"));
digitalWrite(GPS, HIGH);
} else {
Serial.print(F("Initialization failed, code "));
Serial.println(state);
while (true);
}
}
I use an ESP32C3Mini module connected to the XL1278-SMT lora module, i can transmit, no problem, the only problem is that i connect the lora to my spectrum analyzer to check the power output and is alwas 10 db no matter what i set on the code. The current is not the problem the lora gets the power from a 18650 battery so this is not the problem. On the specifications for this module, says that can transmitt up to 20,5 dBm.
Thank you sir.
from radiolib.
spectrum analyzer to check the power output and is alwas 10 db
10 dB is just a relative measure, what is the reference level? And what is the measurement setup? Spectrum analyzers are typically quite sensitive to input power and will get damaged if you exceed its limit, do you have some attenuators in path?
The current is not the problem the lora gets the power from a 18650 battery
So you have the LoRa module connected directly to the battery? Seems unlikely, but if it really is the case it will most definitely destroy it, the absolute maximum the module can tolerate is 3.9V, while a fully charged Li-ion cell will be at 4.2V.
I have measured power output from SX1278 using RF power meter - not spectrum analyzer, an actual RF power meter with proper atteniuation. The output was as expected, so I am fairly confident it is not an issue in the library, but rather with your setup, or measurement, so I will convert this to a discussion.
from radiolib.
Related Issues (20)
- CubeCell + POCSAG issues. HOT 1
- RP2040-LoRa Development kit HOT 6
- SPIcheckStream in Module.cpp is ineffective (does nothing) HOT 1
- LoRaWAN ESP32 (Heltec WSL V3) reboot with stack error HOT 14
- TTGO LoRa32 (T3S3 v1.2) Error -16 HOT 10
- Sending more than one message in POCSAG HOT 1
- 'virtual float PhysicalLayer::getRSSI()' was hidden ESP-IDF HOT 10
- Feature request: AX.25 parser HOT 4
- Think I introduced a bug with Promiscuous (requireCarrierSense) when used with directMode HOT 2
- Move Raspberry Pi example to another GPIO library HOT 10
- Better error handling in the HAL HOT 3
- CC1101 Direct Mode getRSSI() only ever returns -74.0 HOT 2
- importing Radiolib into VSCODE + Platformio with NRF52840 board does not compile HOT 13
- SX1280 startTransmit after CAD not working HOT 4
- Move examples to a separate repository HOT 14
- Invalid calibrateImage parameters prevent initializing with 915MHz frequency on SX126x-based STM32WLx HOT 2
- #include <Radiolib/SX1262.h> is available to use less space than the hole library? HOT 1
- Minor issue in startReceiveDutyCycleAuto HOT 3
- GFSK support for SX1231/RFM69 and SX127x/RFM9x HOT 2
- Support for MSPM0 Microcontroller HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from radiolib.