This repository is a work-in progress under the Intelligent River v2.0 project at Clemson University,SC. The goal is to interface Catena 4551 OR Catena 4450/4470 with Adafruit Feather M0, developed by MCCI Corporation with different environmental sensors for water,air and soil quality monitoring. This project is based on LoRaWAN (Low Power Wide Area Network) designed to wirelessly connect battery operated ‘things’ to the internet in regional, national or global networks, and targets key Internet of Things (IoT) requirements such as bi-directional communication, end-to-end security, mobility and localization services. Thus, we have implemented a bunch of IoT nodes on different Clemson streams and channels to monitor rain water inflow and storm water wash-off. IoT nodes by definition are controllers coupled with environmental sensors, that act as radio nodes(or modules) connected to central gateway for IoT purposes.
For more details about the project : http://river.info/
For more details on the controller board(data logger) : https://github.com/mcci-catena
(Catena 4551 OR Catena 4450/4470)
For more details on network & data connectivity platform : https://www.thethingsnetwork.org/
These instructions will get you a copy of the project up and running for development and testing purposes. See deployment for notes on how to deploy the project on a live system. You will need the following hardware platforms/controller boards and softwares, libraries etc. before you dive straight into IoT communication.
It is advisable to have following controller platforms:
1. Adafruit Feather M0 and 2. Catena Wing 4450/4470 OR
1. Catena 4451
Other controller boards might work but aren't tested yet.
Install Arduino IDE. Follow steps here:
Follow steps here for installing and setting up Catena Boards. It is advisable to visit: https://github.com/mcci-catena/Catena-Sketches and https://github.com/mcci-catena/Catena-Sketches/blob/master/catena4450m101_sensor/README.md before you proceed any further with this document and code structure. The contents of this repository are based on top of the code developed by MCCI and this is only an extension/ modification of skeleton code. Different sensors have been interfaced on top of MCCI's code in this repo.
Follow the steps before to upload the code to the boards. The feather and catena stack has easy interface of code
Follow steps here to get started with 4450 and 4470 catena wings.
There are two methods to upload code,
1. DFU
2. ST-Link.
I have tested the DFU mode with the help of MCCI and below is the procedure I followed; note that based on your working environment you would have to follow different procedures.
- INSTALL ZADIG:
You would have to install Zadig from here: https://zadig.akeo.ie/. This software is used to set the driver address. Download and install the software. Launch the .exe icon.
-
Next, Short BOOT0 and VDD+ with a jumper wire on the 4551 board and press reset. This enables the bootloading mode to transfer code to the board.See the images below for deatiled understanding.
-
Select STM32 BOOTLOADER from the device dropdown
-
Select WinUSB (v6.1.7600.16385) as new driver
-
Click Replace Driver
- Now setup is ready. You can compile and upload your code using DFU. Before you upload your code make sure your arduino terminal has the following options selected.
TOOLS --> SERIAL INTERFACE - "NO SERIAL" && UPLOAD METHOD - DFU" && USB INTERFACE - "USB SERIAL" && PROGRAMMER - "STM 32 BOOTLOADER"
- Install the rules from drivers/linux/mccicatena4551.rules On a terminal you can simply do the following:
-
$wget https://raw.githubusercontent.com/mcci-catena/Arduino_Core_STM32/master/drivers/linux/mccicatena4551.rules
-
$mv /downloaded_filelocation/mccicatena4551.rules /etc/udev/rules.d
- Reload rules or Restart dbus deamon
-
$udevadm control --reload-rules
-
Give root permissions using 'sudo' whenever necessary. Make sure and ensure your user is in the plugdev group.
-
You can check by typing
$groups USERNAME
-
OR add your $USER to plugdev by typing:
sudo adduser USERNAME plugdev
Once your $USER has plugdev previliges, you are all set to go.
- Alternatively you could also restart the dbus deamon by typing
kill -HUP pid
-
Reboot the computing device to ensure all changes have taken place.
-
Before you upload the program using Arduino IDE, make sure you have selected the right options as outline [here] (https://github.com/vpowar/LoRaWAN_SensorNetworks-Catena/blob/master/README.md#important_upload_step)
The board will just plug in and work, without drivers!