arduino-libraries / mkrwan_v2 Goto Github PK
View Code? Open in Web Editor NEW[Beta] Library for Arduino MKRWAN 1300 / 1310 suitable for firmwares derived from ST sources
License: GNU Lesser General Public License v3.0
[Beta] Library for Arduino MKRWAN 1300 / 1310 suitable for firmwares derived from ST sources
License: GNU Lesser General Public License v3.0
When running (MKRWANFWUpdate_standalone.ino), I am getting this error:
WARNING: library MKRWAN_v2 claims to run on samd, mbed architecture(s) and may be incompatible with your current board which runs on mbed_portenta architecture(s).
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino: In function 'void setup()':
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:39:18: error: 'SerialLoRa' was not declared in this scope
port.dev = &SerialLoRa;
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:39:18: note: suggested alternative: 'SerialFifo'
port.dev = &SerialLoRa;
^~~~~~~~~~
SerialFifo
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:45:11: error: 'LORA_BOOT0' was not declared in this scope
pinMode(LORA_BOOT0, OUTPUT);
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:45:11: note: suggested alternative: 'LORA_OK'
pinMode(LORA_BOOT0, OUTPUT);
^~~~~~~~~~
LORA_OK
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:47:11: error: 'LORA_RESET' was not declared in this scope
pinMode(LORA_RESET, OUTPUT);
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:47:11: note: suggested alternative: 'LORA_ERROR'
pinMode(LORA_RESET, OUTPUT);
^~~~~~~~~~
LORA_ERROR
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino: In function 'void resetModuleRunning()':
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:270:16: error: 'LORA_BOOT0' was not declared in this scope
digitalWrite(LORA_BOOT0, LOW);
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:270:16: note: suggested alternative: 'LORA_OK'
digitalWrite(LORA_BOOT0, LOW);
^~~~~~~~~~
LORA_OK
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:271:3: error: 'SerialLoRa' was not declared in this scope
SerialLoRa.end();
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:271:3: note: suggested alternative: 'SerialFifo'
SerialLoRa.end();
^~~~~~~~~~
SerialFifo
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:274:16: error: 'LORA_RESET' was not declared in this scope
digitalWrite(LORA_RESET, HIGH);
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:274:16: note: suggested alternative: 'LORA_ERROR'
digitalWrite(LORA_RESET, HIGH);
^~~~~~~~~~
LORA_ERROR
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino: In function 'void loop()':
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:286:5: error: 'SerialLoRa' was not declared in this scope
SerialLoRa.end();
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:286:5: note: suggested alternative: 'SerialFifo'
SerialLoRa.end();
^~~~~~~~~~
SerialFifo
exit status 1
Compilation error: 'SerialLoRa' was not declared in this scope
Hi,
I was wondering if the issues with SPI contention are still a problem for this library with the MKR WAN 1310, both for the external flash storage and other SPI devices.
I'd like to use the external flash and an SPI RFID reader, but would like to avoid resetting the lora module where possible.
Sorry if this topic isn't appropriate for this repo, but I believe you guys will give me the best answers.
Thanks
I would really like the ability to do point-to-point LoRa with the Arduino boards. If the sendAt() function was made public then users not wishing to be forced to join any of the very public LoRaWan networks, would not have to. Also then it would be up to the user to figure out how to use the AT commands for the Arduino boards.
I'm a bit confused about this repo and how it relates to the MKRWAN repository. Is this an alternatively line of development for newer firwmare versions? Or is it intended for different hardware? Is the user-facing API different, or just the internals?
Maybe this could be clarified in the README as well?
When running (MKRWANFWUpdate_standalone.ino), I am getting this error:
WARNING: library MKRWAN_v2 claims to run on samd, mbed architecture(s) and may be incompatible with your current board which runs on mbed_portenta architecture(s).
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino: In function 'void setup()':
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:39:18: error: 'SerialLoRa' was not declared in this scope
port.dev = &SerialLoRa;
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:39:18: note: suggested alternative: 'SerialFifo'
port.dev = &SerialLoRa;
^~~~~~~~~~
SerialFifo
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:45:11: error: 'LORA_BOOT0' was not declared in this scope
pinMode(LORA_BOOT0, OUTPUT);
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:45:11: note: suggested alternative: 'LORA_OK'
pinMode(LORA_BOOT0, OUTPUT);
^~~~~~~~~~
LORA_OK
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:47:11: error: 'LORA_RESET' was not declared in this scope
pinMode(LORA_RESET, OUTPUT);
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:47:11: note: suggested alternative: 'LORA_ERROR'
pinMode(LORA_RESET, OUTPUT);
^~~~~~~~~~
LORA_ERROR
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino: In function 'void resetModuleRunning()':
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:270:16: error: 'LORA_BOOT0' was not declared in this scope
digitalWrite(LORA_BOOT0, LOW);
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:270:16: note: suggested alternative: 'LORA_OK'
digitalWrite(LORA_BOOT0, LOW);
^~~~~~~~~~
LORA_OK
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:271:3: error: 'SerialLoRa' was not declared in this scope
SerialLoRa.end();
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:271:3: note: suggested alternative: 'SerialFifo'
SerialLoRa.end();
^~~~~~~~~~
SerialFifo
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:274:16: error: 'LORA_RESET' was not declared in this scope
digitalWrite(LORA_RESET, HIGH);
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:274:16: note: suggested alternative: 'LORA_ERROR'
digitalWrite(LORA_RESET, HIGH);
^~~~~~~~~~
LORA_ERROR
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino: In function 'void loop()':
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:286:5: error: 'SerialLoRa' was not declared in this scope
SerialLoRa.end();
^~~~~~~~~~
C:\Users\M\AppData\Local\Temp\.arduinoIDE-unsaved2023818-7392-ond0ck.taup\MKRWANFWUpdate_standalone\MKRWANFWUpdate_standalone.ino:286:5: note: suggested alternative: 'SerialFifo'
SerialLoRa.end();
^~~~~~~~~~
SerialFifo
exit status 1
Compilation error: 'SerialLoRa' was not declared in this scope
Hi,
I updated my MKRWAN 1310 with the exemple code from the MKRWAN_v2 library: MKRANFWUpdate_standalone and it gets updated to the Firmware version 1.3.0.
Could you pls update the fw.h file to the one corresponding to the version 1.3.1? It has no sence that this library says it is for version 1.3.1 but updates it to 1.3.0.
If it is not updated in the repository, could anyone send me the fw.h for the 1.3.1?
Thank you
With the example LoRa Send and Receive the module MKR 1310 show the message "Failed to start module" (line 25 on the source example code). The module works fine on version first version of MKRWAN released on version 1.0.12.
This issue was also covered in depth here arduino-libraries/MKRWAN#36 and this problem still persists using the MKRWAN_v2 Library and 1.3.1 fw.
I want to bring this up again. Because of this issue it is currently not possible to use the e.g. Arduino MKRWAN 1310 device in a more realistic, battery powered scenario. The documentation also claims
and also the use of the ArduinoLowPower library.
Are there plans to update this to the latest i-cube LRWAN STM stack which is now v2.0.0?
Hello,
I am using Arduino Zero with LoRa module builtin, everything is working fine with the previous library and firmware 1.2.0.
The problem is that with the new version of this library and the lastest firmware, 1.3.0.0 my program does not receve anything. The function "modem.available" is constantly returning false value.
Fw version compiled is 1.3.0 and not 1.3.1
In the modemSend method there is a timeout of 5000. I had to increas this to 10000 to avoid getting the message send error.
My MKR WAN 1310 arrived with the original 1.2 firmware on the Murata module which gave me the Arduino registered EUI (first three bytes A8:61:0A + sort-of-random based on MCU ID).
Updating using the v2 results in a totally random EUI starting 35:35:31, a prefix that isn’t registered.
The GitHub source shows that the original code to create the original EUI is still in place:
So I suspect that the MKRWANFWUpdate_standalone
file in v2 has a generic firmware embedded in it.
Does anyone have a release level with the correct HW_GetUniqueId
function embedded?
After updating the library and the FW accordingly, the receiving side (TTN) only gets empty messages. This is true for confirmed and for unconfirmed messages. OTAA join works, though.
I was using the old FW and MKRWAN1 before and the same code did work. I even have a serial debug output which clearly shows that the message is not actually empty:
Sending: d=8190,v=1.31,w=B - 64 3D 38 31 39 30 2C 76 3D 31 2E 33 31 2C 77 3D 42
This is the relevant code:
{
Serial.println();
Serial.print("Sending: " + messageStr + " - ");
for (unsigned int i = 0; i < messageStr.length(); i++)
{
Serial.print(messageStr[i] >> 4, HEX);
Serial.print(messageStr[i] & 0xF, HEX);
Serial.print(" ");
}
Serial.println();
int err;
modem.beginPacket();
modem.print(messageStr);
err = modem.endPacket(false); // do not request packet confirmation
if (err > 0)
{
Serial.println("Message sent!");
}
else
{
Serial.println("Error sending message :(");
Serial.println("(you may send a limited amount of messages per minute, depending on the signal strength");
Serial.println("it may vary from 1 message every couple of seconds to 1 message every minute)");
}
}```
In the previous version, there was a sleep method:
bool sleep(bool on = true) {
sendAT(GF("+SLEEP="), on);
if (waitResponse() != 1) {
return false;
}
return true;
}
which I could use to power down the modem. The method is missing now. How do I achieve the same?
Hi,
MKRWANFWUpdate_standalone from MKRWAN_v2.h does nothing, just print "Press a key to start FW update".
Modified the baud rate to 57600 as seen on this post in the Arduino forum but it didn't works, always the same message on the serial terminal.
Firmware update and First configuration works ok with MKRWAN.h library.
Any ideas?
Does anyone know where can I get AT commands for the firmware that uses MKRWANv2?
Using MKRWAN 1310.
I'm trying to setup an OTAA connection (modem.joinOTAA
method) with US915 band, obviously doesn't work...
But the question is why if I call the modem.getConf()
method it tells me that Freq= 868000000 Hz? I don't think that's correct.
// CODE
#include <MKRWAN_v2.h>
LoRaModem modem;
String appEui = "xxxxxxx";
String appKey = "xxxxxxxxxx";
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("beginning....");
if (!modem.begin(US915)) {
Serial.println("Failed to start module");
while (1) {}
};
delay(5000);
int connected = modem.joinOTAA(appEui, appKey);
Serial.println(modem.getTConf());
if (!connected) {
Serial.println("Something went wrong; are you indoor? Move near a window and retry");
while (1) {}
}
Serial.println("Connected");
}
Serial OUTPUT:
GetTConf FailFreq= 868000000 Hz
Power= 14 dBm
Bandwidth= 125 kHz
SF= 12
CR= 4/8
LNA State =0
PA Boost State =0
868000000:14:125:12:4/8:0:0
Something went wrong; are you indoor? Move near a window and retry
(and replace Travis based CI). @per1234
I'm not sure about this AppEui. Should we provide a function where the AppEUI can be read from the device:
String appEUI() { return getValue("APPEUI"); }
or is this not necessary?
I don't understand the appEUI is this a number I can invent? Perhaps there is some Documentation needed.
Is using the one Programmed into device not sufficient?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.