Closed sabas1080 closed 5 years ago
arduino-lmic is one of third party library I should investigate for LoRa to make it compatible with this core and vice versa.
stop here someone did I'm going to try
Right, forgot this while I've answered him :)
I have also noticed that with version 1.3 of the core arduino it is not possible to communicate through SPI to module, I went back to version 1.2 and I can do it
This issue should be referenced in the #254. This one i a request to support a third party library. Anyway how do you setup the core and the new variant?
SPI Core 1.2.0 work with library Lora https://github.com/sandeepmistry/arduino-LoRa, thus I discovered the error with this sketch
#include <SPI.h>
#include <LoRa.h>
int counter = 0;
void setup() {
Serial.begin(9600);
while (!Serial);
SPI.setMISO(RADIO_MISO_PORT);
SPI.setMOSI(RADIO_MOSI_PORT);
SPI.setSCLK(RADIO_SCLK_PORT);
SPI.setSSEL(RADIO_NSS_PORT);
LoRa.setPins(RADIO_NSS_PORT, RADIO_RESET_PORT, RADIO_DIO_0_PORT);
/*SPIClass LoRaSPI(RADIO_MOSI_PORT, RADIO_MISO, RADIO_SCLK, RADIO_NSS);
LoRa.setSPI(LoRaSPI);
LoRa.setPins(RADIO_NSS, RADIO_RESET, RADIO_DIO_0);
*/
Serial.println("LoRa Sender");
if (!LoRa.begin(915E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
}
void loop() {
Serial.print("Sending packet: ");
Serial.println(counter);
// send packet
LoRa.beginPacket();
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();
counter++;
delay(5000);
}
with core 1.3.0 not working
I've just tested with Core 1.3.0 / DISCO L072CZ LRWAN / arduino-LoRa. I have not issue, I can dump register and send packet. I think there is a mistake in your setup and when you switch from one version to the other there something wrong. So how do you use the core and the variant from #254 ? Using git? Using standard install and then copying the variant?...
One note about the previous code:
/*SPIClass LoRaSPI(RADIO_MOSI_PORT, RADIO_MISO, RADIO_SCLK, RADIO_NSS);
LoRa.setSPI(LoRaSPI);
LoRa.setPins(RADIO_NSS, RADIO_RESET, RADIO_DIO_0);
*/
LoRaSPI
instance have to be global not local to the setup:
I've tested both possibilities: Changing default SPI pins:
SPI.setMISO(RADIO_MISO_PORT);
SPI.setMOSI(RADIO_MOSI_PORT);
SPI.setSCLK(RADIO_SCLK_PORT);
SPI.setSSEL(RADIO_NSS_PORT);
LoRa.setPins(RADIO_NSS_PORT, RADIO_RESET_PORT, RADIO_DIO_0_PORT); // set CS, reset, IRQ pin
and creating new instance:
SPIClass LoraSPI(RADIO_MOSI_PORT, RADIO_MISO_PORT, RADIO_SCLK_PORT, RADIO_NSS_PORT);
void setup() {
....
LoRa.setSPI(LoraSPI);
LoRa.setPins(RADIO_NSS_PORT, RADIO_RESET_PORT, RADIO_DIO_0_PORT); // set CS, reset, IRQ pin
}
both work fine.
Hi @sabas1080 any update on this ?
I seem to have the same, or similar problem. I do have the DISCO L072CZ LRWAN, just as you do and it is working fine. However, on the RAK 811 Tracker, the code gets stuck in the LoRa.endPacket();
Any suggestions as to how to track down the issue?
I've just tested with Core 1.3.0 / DISCO L072CZ LRWAN / arduino-LoRa. I have not issue, I can dump register and send packet. I think there is a mistake in your setup and when you switch from one version to the other there something wrong. So how do you use the core and the variant from #254 ? Using git? Using standard install and then copying the variant?...
One note about the previous code:
/*SPIClass LoRaSPI(RADIO_MOSI_PORT, RADIO_MISO, RADIO_SCLK, RADIO_NSS); LoRa.setSPI(LoRaSPI); LoRa.setPins(RADIO_NSS, RADIO_RESET, RADIO_DIO_0); */
LoRaSPI
instance have to be global not local to the setup:I've tested both possibilities: Changing default SPI pins:
SPI.setMISO(RADIO_MISO_PORT); SPI.setMOSI(RADIO_MOSI_PORT); SPI.setSCLK(RADIO_SCLK_PORT); SPI.setSSEL(RADIO_NSS_PORT); LoRa.setPins(RADIO_NSS_PORT, RADIO_RESET_PORT, RADIO_DIO_0_PORT); // set CS, reset, IRQ pin
and creating new instance:
SPIClass LoraSPI(RADIO_MOSI_PORT, RADIO_MISO_PORT, RADIO_SCLK_PORT, RADIO_NSS_PORT); void setup() { .... LoRa.setSPI(LoraSPI); LoRa.setPins(RADIO_NSS_PORT, RADIO_RESET_PORT, RADIO_DIO_0_PORT); // set CS, reset, IRQ pin }
both work fine.
Hi @janbbeck You can try to debug using Eclipse + Sloeber: https://github.com/stm32duino/wiki/wiki/How-to-debug
Close this issue as no update since several month from OP.
Hi I'm trying to get the Lora module working inside the board RAK811,
With the LMIC library, which apparently works with STM32 Murata CMWX1ZZABZ-078 https://github.com/mcci-catena/arduino-lmic
I had to comment the line https://github.com/mcci-catena/arduino-lmic/blob/master/src/hal/hal.cpp#L247
But now I have an error in the line https://github.com/mcci-catena/arduino-lmic/blob/master/src/lmic/oslmic.c#L43
it seems not to start the radio
My sketch is