Code Monkey home page Code Monkey logo

zabbix-iot's Introduction

Example Zabbix IoT-Sensor from Zabbix Summit 2018

For details about the summit and the talk see Zabbix Summit 2018 and Better dress warm - IOT meets Zabbix.

About this repository

This repository shows how to build a simple IoT-Sensor based on Espressif Systems ESP32 that directly connects to a Zabbix Server or Zabbix Proxy and can measure temperature, air pressure, humidity and also the RSSI of the Wi-Fi connection. It is a very basic demo application that will not receive further updates.

It includes:

  • /docs - Schematic (Wiring).
  • /src - Demo Application (C++ to be used with Arduino IDE or Espressif's IDF).
  • /zabbix - Zabbix Template (requires Zabbix 3.0+)

The demo application contains a simple Zabbix Sender library, which is compatible with the "Zabbix Sender Protocol".

Required Hardware

To build this sensor the following components are needed:

  • Microcontroller Espressif ESP32. (either as a module or as a devKit). Note: There are many vendors on the market, that sell different types of boards based on the ESP32.
  • Sensor Bosch BME280. The BME280 modul itself is really tiny (2.5mm*2.5mm) and hard to solder. Better use a breakout board like the ADAfruit BME280
  • 2 LEDs with Resistors: These are optional and can be used to signal the user what the sensor is doing. See the schematic in /docs and the code for how they are used.
  • PCB or Breadboard: Either build your own PCB or use a breadboard to get started.
  • Micro USB cable: To flash the software, one needs to connect via a serial port to the ESP32. When using a devKit type board, then these boards have a micro USB connector that provides a serial port for the PC next to the power-supply for the ESP32 itself. Depending on the chipset used, a driver will be needed.

Required Development Software

To build a working firmware for the ESP32, the code must be cross-compiled. This can be done in a Windows or Linux environment. Basically there are 2 options.

Beginner friendly

For beginners, the easiest is to use the Arduino IDE. This IDE is simple to configure and contains a library manager, that installs required libraries (like sensor libs) with just some clicks from the GUI. However, this IDE is not a full featured C/C++ IDE.

Download and install Arduino. Then follow the instructions to add support for the ESP32 environment. See the arduino/esp32 respository and specificially the instructions for boards manager

Advanced user

If you are more experienced and prefer to use an IDE like Eclipse, then this requires a lot more work to setup the Espressif's IDF (IoT development Kit) and to configure the various settings in Eclipse. Also, there is no menu driven library manager, thus libraries must be installed manually.

Setup the Application

All sources (except the external library) are located in the /src directory. The main application file is called ZabbixIot.ino.

Arduino

Arduino uses a specific naming convention. The main file must have the same name as the project directory and must end with .ino. So in this case that would be the following structure: ZabbixIot/ZabbixIot.ino. To start, create a new directory ZabbixIot in the arduino sketch directory and copy the content of the repository /src directory into it.

Note: Arduino does not allow to place .cpp or .h in subdirectories. This is why all those files are located in the main source directory.

IDF (Eclipse)

Using Eclipse with IDF or only the IDF, a file like main.c or main.cpp is expected.

Create a new ESP32 example project using the IDF tools and copy the content of /src into it. Then rename ZabbixIot.ino to main.cpp.

Note: While the IDF is written in C, there are still a lot useful libraries out that are written in C++.

Configure Application Settings

All relevant application settings are defined in settings.h. This includes the Zabbix configuration, Wi-Fi and measuring interval.

Per default, measuring interval is set to 60 seconds. This means the sensor will make a measurement and then go to sleep for 60 seconds.

Required Software Libraries

Once the development environment is set, the application requires the following libraries:

Arduino

When using the Arduino IDE, simply install this libraries using the library manager.

IDF (Eclipse)

When using Eclipse or IDF only, the setup depends on your build settings.

Compile, Flash and Monitor

Arduino

Setup Com-Port in Arduino IDE.

Select Compile from the menu, select flash from the menu.

To view the output of the ESP32, select "Serial Monitor" from the menu.

IDF (Eclipse)

Setup Com-Port by issuing make menuconfig.

Then make flash and make monitor to see output.

Support

We do not provide support for this repository. However we provide custom development for hardware and software. Contact us if you need assistance in your sensor project.

zabbix-iot's People

Contributors

intellitrend-team avatar

Watchers

 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.