Giter Club home page Giter Club logo

lorawan_32u4_ii's Introduction

LoRaWAN 32u4 II

This repo shows a quick, easy and cheap way to get the LoRa32u4 II board up and running using the LoRaWAN LMIC library. The board used in the example is http://www.diymalls.com/index.php?route=product/product&path=74&product_id=88 But there several more to choose from, such as the Moteino Mega https://lowpowerlab.com/shop/product/119 or RocketScream Mini Ultra Pro http://www.rocketscream.com/blog/product/mini-ultra-pro-with-radio/ which both offers more program memory if needed. All three have been tested and works great.

There is a free Wire(I2C) interface and Hardware serial for example GPS. 6 free analog inputs 5+ free IO/PWM etc. The Hardware SPI interface used by RFM95 can be shared.

NB! The code in this repo is geared toward use in EU, but the LMIC library supports US channels as well.

Required Hardware connections or changes

LoRa Radio RFM95 in WAN mode with arduino-lmic requires the use of DIO0, DIO1 and DIO2. DIO0 is already connected to ATMEGA32u4 on Arduino pin 7. DIO1 and DI2 are available as solder points and just needs a short dupont jumper or solder to an unused pin on ATMEGA32u4. This code uses Arduino pin 5 and 9, but it easy to change in the code (RFM95_DIO_1/RFM_DIO_2).

  • Connect Bottom Right Solderpad (RFM95 DIO2) to Arduino pin 9
  • Connect Pin DIO1 to Arduino pin 5

Example solder:

Suggested Hardware modifications

Battery monitoring, the code includes reading battery voltage using A0. A simple voltage divider from BAT pin.

BAT-----1MOhm-----3MOhm-----GND
               | 
               ---0.1µF-----GND
               |
               A0

Suggested Prerequisities

Install IDE

Install Arduino libraries

Into libraries folder ex. ~/code/arduino/libraries

Clone this repo to your prefered source folder ex. ~/code/arduino

Add path to your Platform.IO (~/.platformio/penv/bin) to your $PATH

Compile and Program board

  • In PlatformIO -> Open Project -> LoraWAN_32u4_II
  • Change your monitor_port/upload_port and lib_dir in platformio.ini
  • Select Build / Upload / Serial Monitor from the PlatformIO GUI or use a terminal
  • Make sure have access to the serial ports (need to logout/login to take effect)
$ sudo usermod -G dialout -a <username>
  • Make sure ModemManager is not interfering with the serial ports. Unless ModemManager is used for connectivity, remove it!
sudo apt-get purge modemmanager

Open a terminal and change into the project directory (.../LoRaWAN_32u4_II/) Compile, upload and monitor the serial debug output:

$ pio run
$ pio run -t upload
$ pio run -t monitor

If the upload fails. Enter the bootloader by pressing the reset button once (or twice). The board's white LED starts "breathing" when the bootloader is running.

Please see code for compile options. There are a few kilobytes left for sensor implementation :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.