Gettting Started
Arduino IDE installed.
Libraries installed - read more here for instaling the SAMD boards and required libraries https://www.arduino.cc/en/Guide/MKRWAN1300
Antennas for the win. - suprisingly the MKR1300 doesnt come with an antenna in the box and you are going to want one. I specifically went with a Dipole Pentaband Waterproof Antenna, $4 each and they have arrived in time (hurrah), there is lots of guidance out there on rolling your own if you are so inclined.
Next suprise was the Grove Shield, this is well suited for the larger form factor Uno et.al type boards and one the MKR feather sized ones. Curently working out if the sensor shield can be plumbed to the MKR1300, will post an update once this is finished later today.
Sensors have arrived and the enclosure bucket test is to commence shortly.
Sensors so far
So this is my selection of sensors so far, running left to right we have:
- DHT22 temp and humidity sensor. A better choice that the DHT11 which is limited at 0C, it gets cold than that here. I managed to get hold of some Grove breakout boards so can make up my own sensors to use with the sensor shield.
- pH probe, waiting on a bit level shifter to arrive to take this down to 3.3 from its current 5v which the MKR 1300 will not like
- Turbidity sensor - very much aligned at being installed in something, say a dishwasher or washing machine and not exposed to the outside world. Will need to make up a waterproof back cover for this, some 3D printing now required :)
- Total disolved solids meter
- Ambient light sensor, high precision but inexpensive, so why not
- High temp waterproof probe, this is the Adafruit one, ideally I am going to measure water temp and 2 depths.
No luck with am ORP sensor at the moment, having checked my reef tank kit, so one for salt water, alas this would be no good for me in fresh water, a shame.
LoRa Sender Starting LoRa failed!
If this helps someone else, great.
The LoRa Sender Starting LoRa failed! messages on the serial monitor has had me stuck for a while. Advice seems to be upgrade the board firmware using the MKRWANFWUpdate_standalone.ino as included in the MKRWAN examples.
Having updated, run the example sender / reciever code I was still getting stuck on the LoRa Sender Starting LoRa failed! message.
A single comment in github sandeepmistry / arduino-LoRa repo advised trying to downgrade the MKRWAN library and firmware from the latest 1.1.0 to the previous version 1.0.15.
Having done so, and then running the previous release of MKRWANFWUpdate_standalone.ino ... I now have a working sender / receiver set up.
MKRWAN library version.
Sending Lora
Receiving Lora and not a LoRa Sender Starting LoRa failed! in sight :)
Sender Code:
#include <SPI.h> #include <LoRa.h> int counter = 0; void setup() { Serial.begin(9600); while (!Serial); Serial.println("LoRa Sender"); if (!LoRa.begin(868E6)) { 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); }
Reciever Code:
#include <SPI.h> #include <LoRa.h> void setup() { Serial.begin(9600); while (!Serial); Serial.println("LoRa Receiver"); if (!LoRa.begin(868E6)) { Serial.println("Starting LoRa failed!"); while (1); } } void loop() { // try to parse packet int packetSize = LoRa.parsePacket(); if (packetSize) { // received a packet Serial.print("Received packet '"); // read packet while (LoRa.available()) { Serial.print((char)LoRa.read()); } // print RSSI of packet Serial.print("' with RSSI "); Serial.println(LoRa.packetRssi()); } }
Top Comments