Code Monkey home page Code Monkey logo

azure-iot-python-samples-for-raspberry-pi-zero--2-and-3-on-raspbian-linux-4.4-1's Introduction

Rasperry Pi Rasbian Linux and Azure IoT Hub Secure Sensor Data Streaming

Rasperry Pi Rasbian Linux, Ubuntu and Windows 10 Python Azure IoT hub Sensor Streaming Samples

As at September 2016 samples are built on Azure IoT SDK 1.0.15.

Tested Configurations

  1. Raspberry Pi Zero, Raspbian Kernel 4.4 fully patched
    • Python 3.4
    • Enviro pHAT for temperature, barometric, and light sensing
  2. Raspberry Pi 2 and 3. Tested on Raspbian Kernel 4.4 fully patched
  3. Windows (10) Subsystem for Linux Python 3.4
    • Python 3.4
    • Open Weather Map Data
  4. Windows 10
    • Python 3.5
    • Open Weather Map Data

Azure IoT SDK Python Prequisites

Linux Azure SDK Python Prequisites

The samples include the compiled iothub_client.so library for ARM V6 (Pi Zero), V7 (Pi 2 and 3) and Ubuntu X64. But you still need to install the Azure SDK Python prerequisites.

Follow these steps to install the Azure SDK Python prerequisites :-

git clone --recursive https://github.com/Azure/azure-iot-sdks.git
cd azure-iot-sdks/python/build_all/linux/
./setup.sh --python-version 3.4

Windows

No additional software required.

Compiling the Azure IoT SDK

To compile your own iothub_client.so library follow these instructions.

Note you should allocate in the order or 5 to 6 hours to compile the Azure IoT SDK on the Raspberry Pi Zero.

  1. Increase Raspberry Pi Swap File size - see notes below
  2. Overview of preparing your Python Development Environment
  3. Compile Azure IoT Device SDK for C
  4. Compile Azure IoT Python Libraries

Recommended Software

  1. To find your Raspberry Pi on your network by name install Apple Print Bonjour Service on Windows for mDNS UNIX Name Resolution. .
  2. My favourite SSH and SFTP Windows Client is Bitvise
  3. Visual Studio Code for Windows, Mac and Linux

Recommended Raspbian Packages

  1. For Windows Remote Desktop Connection Support

    sudo apt-get install xrdp

Handy Tip for Raspberry Pi Zero

Raspberry Pi Zero โ€“ Programming over USB ONLY works with Raspberry Pi Zero and provides a quick easy way to connect your PC to your Raspberry Pi Zero.

Increase the Raspberry Pi Swap File Size

To compile Azure SDK on the Raspberry Pi you will almost certainly need to temporarily increase the size of the swap file. See How to change Raspberry Pi's Swapfile Size on Raspbian

Be sure to change the swapfile size back to the default after the SDK has been compiled.

Follow these steps

Edit Swap File Configuration

sudo nano /etc/dphys-swapfile

The default value in Raspbian is:

CONF_SWAPSIZE=100

Change this to:

CONF_SWAPSIZE=2048

Save changes

Restart Swap File Service

sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start

Verify Swap File Size

free -m

The output should look like:

total     used     free   shared  buffers   cached
Mem:           435       56      379        0        3       16
-/+ buffers/cache:       35      399
Swap:         1023        0     1023

Reset Swap File Size After compile

Be sure to change the swapfile size back to the default after the SDK has been compiled.

azure-iot-python-samples-for-raspberry-pi-zero--2-and-3-on-raspbian-linux-4.4-1's People

Contributors

gloveboxes avatar

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.