The first firmware testing invoves setting up the LoRa environment by testing the communication between the two devices "Bouy and Onboard gateway", part of the programming parameters was to include SPI.h, and LoRa.h we shall use the includes details for the communciation and connection interface to the LoRa for both the onboard gateway and Bouy.
We also selected the frequency for the contry of deployment, for the testing we select 915Mhz during the testing purpose, but is eazyly adjustable from the code, or check out your country LoRaWAN frequency
For Bouy, it will print the details below if the connection was successful or failed.
// wait up to successfully LoRa initialization
if (!LoRa.begin(frequency))
{
Serial.println("LoRa init failed. Check your connections.");
// if failed, do nothing
while (true);
}
Serial.println("LoRa init succeeded.");
Serial.println();
Serial.println("LoRa Simple Node");
Serial.println("Only receive messages from Gateways");
Serial.println("Tx: invertIQ disable");
Serial.println("Rx: invertIQ enable");
Serial.println();
For Onboard Gateway, which is also similar with Bouy
// wait up to successfully LoRa initialization
if (!LoRa.begin(frequency))
{
Serial.println("LoRa init failed. Check your connections.");
// if failed, do nothing
while (true);
}
Serial.println("LoRa init succeeded.");
Serial.println();
Serial.println("LoRa Simple Gateway");
Serial.println("Only receive messages from Nodes");
Serial.println("Tx: invertIQ enable");
Serial.println("Rx: invertIQ disable");
Serial.println();
And they both loop back a message that says "node is working" and "gateway is working" respectively
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.