ulno / ulnoiot-upy

retired version of ulnoiot based on micropython
MIT License
17 stars 15 forks source link
education esp8266 framework iot micropython orange-pi raspberry-pi teaching

=================== ulnoiot micropython

Attention, this is the retired version of ulnoiot which was based on micropython. For new features head to http://github.com/ulno/ulnoiot

All infomration here might be slightly outdated and not work. If you want to adopt thi sproject and continue it, feel free to adopt the original author ulno.

Introduction

ulnoiot (pronounced: "You'll know IoT") is a framework and environment for making it easy for everyone to explore and develop for the Internet of Things (IoT) -- easy for tinkerers, makers, programmers, hobbyists, students, and professionals alike. It has a special focus on education and is intended to support classes to teach Internet of Things (IoT) and home automation.

However, it also supports existing IoT deployments and brings mechanisms for over the air (OTA) updates and automatic multi-device deployment.

If you are impatient and want to dive into it right now, fast forward to Installation or First IoT Nodes.

ulnoiot is based on a multi-layered network architecture. This means for this project that each IoT-system (small network of connected sensors and actors) has its own gateway - usually running an MQTT-broker. These gateways can be connected to cloud resources, other cloud or Internet based MQTT brokers or interconnected among themselves. Security and privacy can be selectively controlled at each layer border (everywhere, where a gateway connects two layers). In a teaching context these gateways are usally based on a modified Raspbian running on a Raspberry Pi of a newer generation (wifi on board - both the Raspberry Pi 3 and the Raspberry Pi Zero W can be easily used as an ulnoiot gateway at this point) to allow them to work as wifi routers.

Table of Contents

Architecture

.. figure:: /doc/images/system-architecture.png :width: 50% :figwidth: 100% :align: center :alt: ulnoiot System Architecture

ulnoiot System Architecture

In an ulnoiot system you find one or several ulnoiot gateways and wirelessly connected nodes with physically connected devices (sensors or actors).

An ulnoiot gateway contains and runs all the software needed to configure an IoT system. It also provides facilities to run and manage a wifi router as well as an MQTT-broker. It therefore provides configuration management software as well as dataflow management services.

Such a gateway can for example easily be installed on a Raspberry Pi 3. Nodes are wireless components which interact with physical obejcts. Usually a node has several devices attached to it. devices can be sensors (like a button or temperature, light, movement, or humidity sensor) or actors (like relais, solenoids, motors, or leds).

Supported Hardware

ulnoiot is targeted to run on a variety of (mainly Linux-based) hardware and on wireless microcontrollers (initially mainly esp8266-based microcontrollers and single-board Linux computers like the Raspberry Pi 3 or Raspberry Pi Zero W).

If you are interested in shopping for related hardware, check http://iot.ulno.net/hardware or go directly to AliExpress, Amazon, AdaFruit or Sparkfun and search for Wemos D1 Mini, ESP8266, NodeMCU, 37-in-1 Arduino sensor kit.

The gateway services have been tested to run on:

We are trying to provide virtualbox images as soon as we find time and/or volunteers.

We are also working on verifying that ulniot works well on Orange-Pi Zero and the C.H.I.P. from NextThing to allow more cost-effective solutions to use ulnoiot.

Currently the following esp8266-based devices are supported:

The part of ulnoiot running on the esp8266 is an extension of micropython <http://www.micropython.org/>__ enabling IoT classes and easily getting started using micropython.

There has been some initial effort in creating a starter development kit for the Wemos D1 Mini - you can see more information here </doc/shields/wemosd1mini/devkit1/README.rst>__.

Tool support

ulnoiot includes a lot of small scripts to simplify a plethora of tasks supporting the deployment of a small IoT system or MQTT <http://mqtt.org/>__-based IoT environment. Among them are the following (most of these scripts are available after starting the ulnoiot command or executing run in the main ulnoiot directory):

Installation

There are two ways to get the ulnoiot configuration management software up and running:

  1. Downloading and flashing a pre-prepared raspberry pi image to an sd card and running the gateway and configuration management software from there.

  2. Setting up ulnoiot in your own Linux environment: Installation on Linux_

Please also check out the tutorial videos for this setup on ulno's youtube channel: https://www.youtube.com/results?search_query=ulno.net+ulnoiot

Installation on Raspberry Pi from Pre-Prepared Image ++++++++++++++++++++++++++++++++++++++++++++++++++++

Tutorial videos for setup:

Installation step by step:

If you have trouble following this, make sure to checkout the tutorials on youtube.

you can now continue with First IoT Nodes_

Installation on Linux +++++++++++++++++++++

First IoT Nodes

For this section, we assume that you have successfully set-up the ulnoiot configuration management environment.

If something gets stuck, try to power cycle the esp8266.

initialize sets up your wifi based on the settings in system.conf and also encrypts the network connecting, but if you want to set it up manually, call wifi on the esp8266 node from the serial console.

Try typing help and check the small manual. You can setup the wifi with wifi( "network-name", "password" ). You can scan the existing wifi networks with wscan and when the wifi is configured, you can see the current ip with typing wip.

If you create an autostart.py file or modify the existing one in your nodes/files directory and then call deploy noupdate, you can add your own devices to this newly configured node. Don't forget to add run() add the end of your autostart file. However, try first to add some devices manually at the console command prompt, check and browse the help for available devices. Type run() to activate these devices and then use the mqtt_all and mqtt_send tools to watch and interact. Try also help("autostart.py") at the console prompt.

External Resources

This project would not have been possible without a thriving open source community around the Internet of Things. We make a lot of use of the following tools:

As ulnoiot relies heavily on MQTT, it also integrates very easily with community home automation software like home-assistant <http://home-assistant.io> and openhab <https://openhab.org>.

Support

You can find the developers and people using ulnoiot on #ulnoiot:matrix.org <https://riot.im/app/#/room/#ulnoiot:matrix.org>__ or respectively riot in the group ulnoiot and might get answers there in real time. Feel also free to file and discuss issues, problems, and potential new features at http://github.com/ulno/ulnoiot. Please feel also free to contact ulno directly via http://contact.ulno.net, especially if you want to use ulnoiot in teaching yourself, or have somebody teach the use and opportunities of ulnoiot to you or your organization in person.

Further Documentation