So you want to forward Serial data over the LoRa radio?
If so, you'd set up the USART, and then use the SX1272 code from here: http://www.espruino.com/SX127x
A bit like:
// LoRa ----------------- SPI1.setup({ sck:B3, miso:B4, mosi:B5 }); var sx = require("SX127x").connect({spi: SPI1, cs: B6, rst : B7 }); var config = { rxContinuous : true }; // Until DIO0 line irqs are implemented we need this: setInterval(function() { sx.onIRQ(); }, 100); // Serial --------------------- Serial1.setup(9600); // send data when we receive it Serial1.on('data', function(d) { sx.setTxConfig(config); sx.send(d, function() { console.log("TX done"); }); });
But the code above is just an example - to do this properly you want to make sure you didn't call sx.send again until its callback had got called.
sx.send
Also, I should warn you, the SX127x module hasn't been used a great deal - it's possible that you might hit problems when using it.
@Gordon started
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.
So you want to forward Serial data over the LoRa radio?
If so, you'd set up the USART, and then use the SX1272 code from here: http://www.espruino.com/SX127x
A bit like:
But the code above is just an example - to do this properly you want to make sure you didn't call
sx.send
again until its callback had got called.Also, I should warn you, the SX127x module hasn't been used a great deal - it's possible that you might hit problems when using it.