YourproductSmarter / KISSLoRa-demo

demo apps for KISSLoRa
MIT License
15 stars 26 forks source link

KISS LoRa

For common questions about the KISS gadget, see the FAQ.

Voor veelgestelde vragen over de KISS gadget, zie de FAQ.

This repository contains example firmware to customise the KISS LoRa gadget from the E&A fair. If you do not want to customise your KISS gadget, but just want to get it to work with the original firmware, please see the FAQ or the Commission at Home document.

kiss gadget

Prerequisites

You will need to install a few programs and libraries to be able to upload code to your KISS gadget. This is also neccesary when commissioning your KISS LoRa gadget at home.

Download this repository

Download the contents of this repository to your computer by clicking here or by clicking on the green button on top of this page: Clone or download->Download ZIP. On your computer unzip the downloaded file by following the correct procedure for your operating system.

Arduino IDE

If your Arduino IDE's interface language is not English, you can change it using the following steps:
Dutch: Bestand->Voorkeuren->Taal voor editor->Engels(Engels), hierna Arduino IDE opnieuw opstarten.

SparkFun AVR boards

The Things Network and SoftPWM libraries

If you already have these libraries installed, check if you have the latest versions. Otherwise update them.

The Things Network Console

Applications and devices can be managed via The Things Network Console. In the Console you can find your application which is registered via the Commissioning Terminal.

When uploading the new sketches, you need the appEui and appKey, you can find both in the Kiss-LoRa application which is registered under your personal account. Go to:

Uploading Firmware

The serial monitor must be closed before uploading code to the device.

  1. Switch the KISS LoRa gadget off.
  2. Plug it into your computer using a micro USB cable.
  3. In the Arduino IDE make sure the correct Tools->Board (SparkFun Pro Micro) and Tools->Processor (ATmega 32U4, 8MHz) are selected.
  4. Switch the device on and make sure the correct Tools->Port is selected.
  5. Switch the device off again.
  6. Press and hold the Push Button on the Kiss device.
  7. In the Arduino IDE, choose Sketch->Upload.
  8. As soon as you see PORTS {} / {} => {} printed in the output window turn the KISS LoRa on. If you do not see this text, make sure you enabled "Show verbose output during upload" in the Preferences of Arduino.
  9. When the upload process is done you can release the push button.

USB Troubleshooting

It is common to have problems while trying to program Arduino devices, including the KISS LoRa device. In case you experience some issues, a simple Google search will most likely help to find a solution. Some common problems and fixes are listed here:

If you are using Linux, read this.

If you are using MAC OS, read this.

Original firmware

In the directory KISSLoRa-demo_app you will find the original firmware that was on the KISS LoRa gadget when you received it. If you ever want to upload this firmware back onto the device, have a look at the README.md in this directory. You will also have to upload this firmware onto the gadget if you want to commission or re-commission it at home.

For the exact steps to commission your KISS LoRa gadget, or go back to the original firmware, see the Commission at Home document.

Examples

In the Examples directory you will find example firmware files to read the sensors on the board. Have a look at the README in each subdirectory to see an explanation of each example.

Bootloader

In the Bootloader directory you will find the hex file for the bootloader that runs on your KISS LoRa device. In the most cases you will never need this, but if you manage to brick your device, this will be useful to recover.

Schematics

The Schematics directory contains the electronic design of the board. It specifically shows how everything is connected. This is useful to have when writing firmware for the KISS LoRa device, to know on which pins the sensors are connected.

The schematic uses the pin names and numbers from the datasheet of the ATmega32u4. When programming this board from within Arduino IDE, we use the Arduino pin names and numbers. See the PIN_MAPPING document for the translation between these pin numbers and names.