Never miss an important situation with this LoRaWAN Audio Notifier using WisBlock Audio. It would be helpful to get an audio notification to call our attention in particular situations, such as when a variable is approaching a risky limit, a procedure is complete, or even when a smart doorbell is installed at home.
Hardware
To carry out this test, you need the following hardware components:
- RAK5005-O WisBlock Base Board
- RAK11310 (RP2040) WisBlock Core Module
- RAK18060 WisBlock Audio Stereo Amplifier Module
- LoRa Antenna
- Speaker
- 3.7 V LiPo battery
đź“ť NOTE: This is also compatible with the ESP32 and Nordic cores. |
Software
- Helium Console
- Arduino IDE
Follow the installation guide of BSP to set up your Arduino IDE to program WisBlock boards.
WisBlock Assembly
To put together the different modules, you need to connect them to the respective slots in the base board. For further information, refer to the Assembling and Disassembling section in the Quick Start Guide.
Helium Console Setup
Log in to Helium Console or create an account if you don’t have one.
Go to Devices, then click Add New Device.
Define a name for your device. In this example, the device name is LoRa Notifier.
Change the Dev EUI with the one printed on your core sticker. Do not modify the APP EUI and APP Key!
Click Save device.
Wait for the device to be added. You will see a pending sign and this could last for several minutes.
Once done, you are now ready with the initial configuration.
Code
To open the code, first, you need to download it from the repository.
Unzip the downloaded file and open the code in the Arduino IDE.
Install the required libraries by clicking on the URLs next to them.
#include <Arduino.h>
#include "LoRaWan-Arduino.h" //http://librarymanager/All#SX126x
#include <SPI.h>
#include "audio.h" //http://librarymanager/All#RAKwireless-Audio-Library
#include "sound.h"
Define your country's LoRaWAN frequency. For example LORAMAC_REGION_AU915.
LoRaMacRegion_t g_CurrentRegion = LORAMAC_REGION_XX; /* Region: Which works in your Country*/
Edit the OTAA keys with the ones of your devices in the Helium Console.
//OTAA keys !!!! KEYS ARE MSB !!!
uint8_t nodeDeviceEUI[8] = {0xAC, 0x1F, 0x09, 0xFF, 0xFE, 0x05, 0x41, 0X95}; // The one printed on your core
uint8_t nodeAppEUI[8] = {0x60, 0x81, 0xF9, 0x7D, 0x71, 0x89, 0xC3, 0x47};
uint8_t nodeAppKey[16] = {0x03, 0xE6, 0xF0, 0xC1, 0x75, 0x2C, 0x91, 0x9F, 0x70, 0xED, 0x69, 0xBE, 0x54, 0x81, 0x22, 0xAC};
Select the board you are using (RAK11310), connect it through the USB cable, and select the respective COM port.
Click Upload and wait for the core to be flashed.
Testing
To test the project, you just need to power up our board with the LiPo battery. (It can also be powered in other ways).
It should start sending data to the console every 20 seconds. Verify if you are in the range of the Helium Network.
To send a message to the project so it can send notifications, go to the blue downlink icon on the right of your screen, as shown in Figure 12
Set the Payload type to Text. Enter one of the trigger commands (G1 or B1), and uncheck the confirmation of response box.
đź“ť NOTE: You will need to send the message B1 or G1 = Base64 (QjE= and RzE=, respectively) to trigger the notification. |
Click again the blue downlink icon. Right after the module has sent something, the notification will be executed.
đź“ť NOTE The Helium console only supports Class A devices, which means that a downlink is just received after an uplink from the device to the console.
Updated