I have a pair of TTGO Lora32 boards, and following the examples in SX127x, and comparing it with Arduino examples feels like TX power settings are way off. Or this board needs some special config.
My setup:
First LoRa board running OpenMQTTGateway pushing to messages with RSSI to influxdb. Visualization with Grafana. Did some testing with various antennas, and results been consistent. It does receive messages from both Arduino and Espruino, just messages from Espruino have a much lower RSSI. Same software, same position, same antenna in the following results.
Second LoRa board with Arduino OLED_LoRa_Sender example, it's transmitting at 17dB by default. RSSI is around -15db when both boards are on my desk, and -90db when the sender is at the other end of the house (50cm main walls...). Lowering TX power does lower RSSI as expected.
Second LoRa board with Espruino 2v04 and basically two liner from the sample (full code at the end):
RSSI with the two boards sitting ~50 cm apart: -100-110db. Almost 100db less than the Arduino sample. This actually doesn't make much sense, as the TX power range is -4dBm .. +20dBm, so you can't even set TX power that low. It's as low as when I was changing antennas on the receiver: no antenna on the receiving side, but still got the messages. Like something is not connected when transmitting from Espruino?
My first guess was frequency or coding or something is a bit off. But both run the same "default-ish" config. After checking it with my RTL-SDR, I think it's really transmission power: The arduino example's transmissions are clearly visible, but I see nothing when transmitting with Espruino. In this case all antennas are 20-50 cm distance.
Full Espruino code:
var g = null, sx = null, sxSpi = null;
var ix = 42;
var SSD = require("SSD1306");
var SX = require("SX127x");
var config = {
power: 17
};
function start() {
g.setFontVector(14)
.drawString("Hello Espruino!", 0, 0)
.flip();
}
function send() {
ix++;
var msg = `pwr: ${config.power}, ix: ${ix}`;
sx.send(msg, function () { print('TX Done: ', msg); });
g.clear()
.setFontVector(14)
.drawString(msg, 0, 0)
.flip();
}
function onInit() {
// gfx
I2C1.setup({ scl: D22, sda: D21 });
g = SSD.connect(I2C1, start);
start();
sxSpi = new SPI();
sxSpi.setup({ sck: D5, miso: D19, mosi: D27 });
sx = SX.connect({ spi: sxSpi, cs: D18 });
print("call setTxConfig", config);
sx.setTxConfig(config);
setTimeout(function () {
// Until DIO0 line irqs are implemented we need this:
setInterval(function () { sx.onIRQ(); }, 100);
}, 10);
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thread necro :)
("solved", see the next post)
I have a pair of TTGO Lora32 boards, and following the examples in SX127x, and comparing it with Arduino examples feels like TX power settings are way off. Or this board needs some special config.
My setup:
First LoRa board running OpenMQTTGateway pushing to messages with RSSI to influxdb. Visualization with Grafana. Did some testing with various antennas, and results been consistent. It does receive messages from both Arduino and Espruino, just messages from Espruino have a much lower RSSI. Same software, same position, same antenna in the following results.
Second LoRa board with Arduino OLED_LoRa_Sender example, it's transmitting at 17dB by default. RSSI is around -15db when both boards are on my desk, and -90db when the sender is at the other end of the house (50cm main walls...). Lowering TX power does lower RSSI as expected.
Second LoRa board with Espruino 2v04 and basically two liner from the sample (full code at the end):
RSSI with the two boards sitting ~50 cm apart: -100-110db. Almost 100db less than the Arduino sample. This actually doesn't make much sense, as the TX power range is -4dBm .. +20dBm, so you can't even set TX power that low. It's as low as when I was changing antennas on the receiver: no antenna on the receiving side, but still got the messages. Like something is not connected when transmitting from Espruino?
My first guess was frequency or coding or something is a bit off. But both run the same "default-ish" config. After checking it with my RTL-SDR, I think it's really transmission power: The arduino example's transmissions are clearly visible, but I see nothing when transmitting with Espruino. In this case all antennas are 20-50 cm distance.
Full Espruino code: