jcuroboclub / Arduino-ZigBee-Pi-ThingSpeak

An interface to attempt to simplify IoT ThingSpeak networks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arduino-ZigBee-Pi-ThingSpeak

An interface to attempt to simplify IoT ThingSpeak networks.

Network

The intended network topology for this code is:

Arduino - XBee (AT Router/End Point) \

Arduino - XBee (AT Router/End Point) -- XBee (API Coordinator) - Raspberry Pi - ThingSpeak

Arduino - XBee (AT Router/End Point) /

Arduino

The Arduino endpoints are set up as data loggers. See GenericDataLogger for info. The code is tested using Arduino Uno, but should be applicable to other boards.

For testing, the Sparkfun Weather Shield was used.

XBee Configuration

The LAN is a ZigBee mesh, based on the recommendations of Gadgeteer@HCI-Lab. Data points are set up in AT mode for simple transmission, whereas the coordinator is set up in API mode to enable message tracking. The abridged setup process is as follows:

  1. Set up coordinator with API firmware.
  2. Reset coordinator settings to default.
  3. Set the following settings:

Set PAN (ID) to desired network ID (common to all) Set API Enable (AP) to 2 Set name (NI) to desired name (unique)

  1. Set up other modules as routers or end points.
  2. Reset these module's setting to default.
  3. Set the following settings:

Set PAN (ID) to desired network ID (same as coordinator) Set Dest. high (DH) to 0 Set Dest. low (DL) to 0 Set Chan. ver. (JV) to 1 Set name (NI) to desired name (unique)

XBee Pro S2B modules were used for testing, but the code and process should be applicable to other ZigBee enabled XBee modules.

Raspberry Pi

Under Development

ThingSpeak

Under Development

Software Dependencies

There are a number of dependencies for each part of the software.

Arduino

There are no direct dependencies for the library, however the example file uses the following:

  • MemoryFree: For debugging purposes.
  • HTU21D: Sparkfun weather shield humidity sensor.
  • MPL3115A2: Sparufun weather shield pressure sensor.

Python

If you don't already have Python 3:

sudo apt-get install python3 pip3

This may require you to use sudo, the command is likely pip3 but may be pip.

pip3 install numpy, pyserial, xbee

Useful References

http://blog.hcilab.org/gadgeteer/2012/12/xbee-zigbee-howto/
http://serdmanczyk.github.io/XBeeAPI-PythonArduino-Tutorial/

About

An interface to attempt to simplify IoT ThingSpeak networks.


Languages

Language:Arduino 49.2%Language:Python 37.2%Language:C++ 13.6%