Skip to content

Add support for Arduino MKR WAN 1300 boards #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 7, 2018
Merged

Conversation

sandeepmistry
Copy link
Owner

An alternative to #103 to support the Arduino MKR WAN 1300 board in this library. I don't have a board to test with at this time, so let's hold off merging until it is tested.

It build's off @facchinm's work from https://github.com/arduino-libraries/MKRWAN/blob/master/examples/DumbModemLoraSender/DumbModemLoraSender.ino and simplifies the effort to use the board with this library.

I've also added a new LoRa.setSPI(...) API to select a different SPI interface at run time.

@sandeepmistry
Copy link
Owner Author

Got some boards to test win, the Sender part is fine.

However, when running the Receiver example on a MKR WAN 1300 with an Uno Sender, packets are received twice:

LoRa Receiver
Received packet 'hello 95' with RSSI -32
Received packet 'hello 95' with RSSI -32
Received packet 'hello 96' with RSSI -32
Received packet 'hello 96' with RSSI -32
Received packet 'hello 97' with RSSI -43
Received packet 'hello 97' with RSSI -43
Received packet 'hello 98' with RSSI -32
Received packet 'hello 98' with RSSI -32
Received packet 'hello 99' with RSSI -27
Received packet 'hello 99' with RSSI -27
Received packet 'hello 100' with RSSI -32
Received packet 'hello 100' with RSSI -32
Received packet 'hello 101' with RSSI -32
Received packet 'hello 101' with RSSI -32
Received packet 'hello 102' with RSSI -31
Received packet 'hello 102' with RSSI -31
Received packet 'hello 103' with RSSI -31
Received packet 'hello 103' with RSSI -31
Received packet 'hello 104' with RSSI -42
Received packet 'hello 104' with RSSI -42
Received packet 'hello 105' with RSSI -31
Received packet 'hello 105' with RSSI -31
Received packet 'hello 106' with RSSI -42
Received packet 'hello 106' with RSSI -42
Received packet 'hello 107' with RSSI -31
Received packet 'hello 107' with RSSI -31
Received packet 'hello 108' with RSSI -31
Received packet 'hello 108' with RSSI -31
Received packet 'hello 109' with RSSI -31
Received packet 'hello 109' with RSSI -31
Received packet 'hello 110' with RSSI -31
Received packet 'hello 110' with RSSI -31
Received packet 'hello 111' with RSSI -32
Received packet 'hello 111' with RSSI -32
Received packet 'hello 112' with RSSI -32
Received packet 'hello 112' with RSSI -32
Received packet 'hello 113' with RSSI -32
Received packet 'hello 113' with RSSI -32
Received packet 'hello 114' with RSSI -42
Received packet 'hello 114' with RSSI -42

@fpistm
Copy link

fpistm commented Mar 5, 2018

Hi @sandeepmistry and thanks for this library.
Just a quick comment to tell that I've tested the setSPI () with the stm32duino/Arduino_Core_STM32 and the B-L072Z-LRWAN1 and that's ok.
It should be fine to have this new API.

@sandeepmistry sandeepmistry changed the title [DO NOT MERGE] Add support for Arduino MKR WAN 1300 boards Add support for Arduino MKR WAN 1300 boards Mar 14, 2018
@sandeepmistry
Copy link
Owner Author

@facchinm This is good to go now, with the updated firmware from arduino/mkrwan1300-fw#1

Let's wait until @facchinm has tested the firmware changes and merged that PR.

@sandeepmistry
Copy link
Owner Author

@fpistm awesome, thanks for trying, I think this will be merged soon once @facchinm gets a chance to try it.

@Deltoz
Copy link

Deltoz commented Mar 17, 2018

Hi sandeepmistry.
Many thanks for your works, are very interesting !!!
I'm making a project with the Arduino MKR WAN1300 and have 3 pz of it.
I want to use your library but for I know that for now is impossible.
Can I test this modification, there is a version that I can try?
I can make some tests on this boards for you.
Let me know.
Many Thanks

@Deltoz
Copy link

Deltoz commented Mar 19, 2018

Hi.
I'm making some test with MKR WAN1300...
In standard library version it's same do not function...but i have changed some little things and now all sames to work properly.
This is the modification I made:
#define LORA_DEFAULT_SPI_FREQUENCY 100000
#define LORA_DEFAULT_SS_PIN LORA_IRQ_DUMB
#define LORA_DEFAULT_RESET_PIN -1
#define LORA_DEFAULT_DIO0_PIN -1
and the SPI_MODE must be set to 0 (SPI_MODE0)
In this way all function....but ther is only 1 problem, I'm receiving 2 time the same message.
I do not understand yet if is a double "trasmission" or is a double "receiving"...
I'm testing...
Excuse me for my not perfect english ;)

@sandeepmistry
Copy link
Owner Author

@Deltoz these changes require the firmware changes from pull request arduino/mkrwan1300-fw#1 - without these you will see double receive messages. We are still trying to track down the root cause for this.

@Deltoz
Copy link

Deltoz commented Mar 23, 2018

OK. I follow on with attention, I would like to use it as possible.
If there is anything I can do to give you a hand, some tests, well known, are at your disposal.
Thank you

@Deltoz
Copy link

Deltoz commented May 2, 2018

@sandeepmistry @facchinm
How I can test the new firmware?
can you share a compiled modified firmware that allows me to make some tests?
I'm working on this board and I can give to you some feedback if all works with the modified firmware.
Many thanks
Let me know as fast as you can.

@Rocketct
Copy link

Rocketct commented May 4, 2018

HI all, i have tested the firmware with arduino/mkrwan1300-fw#1, in a setup composed by a st evaluation board (a nucleo), a dragino lora shield with the semtech and a arduino zero, i had records the SPI signals that come from the ZERO to the stm32 and from the stm32 to the semtech, in order to investigate how improve the communication speed between all the module of the MKR1300.
The results(reported in the attached zip) show that in the MISO from draghino to stm32 occurs some spikes between a turn ON and a turn OFF of the chip select, as showed in the following screenshot:

spikes

recordingRec.zip

@Deltoz
Copy link

Deltoz commented May 5, 2018

@Rocketct
Can you explayn how I can download this firmware and use it?
I do not know how I can do it.
I want to make some test to the MKRWAN1300
thanks

@Deltoz
Copy link

Deltoz commented May 6, 2018

Other tests....
If I put a LoRa.sleep() command next a cicle of a message reading... then I see only 1 message and not 2 !
THIS:
if (LoRa.parsePacket(MexLength)){
if (LoRa.available()) {
for (byte i = 0; i < MexLength; i++) {
Mex[i] = LoRa.read();
}
LoRa.sleep();
}
}

@sandeepmistry
Copy link
Owner Author

This is good to merge now, and requires firmware v1.1.6 on the Murata module. Which is bundled in the current master version of the MKRWAN library. @facchinm will release the MKRWAN lib later this week.

@sandeepmistry sandeepmistry merged commit 039b138 into master May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants