-
MQTT topic structure redesign
03/07/2016 at 13:50 • 0 commentsSince my IoT network slowly grows up, I have mode devices. And more devices means more data and also more errors in the network. Till now, every of my devices use following MQTT topics:
- <location>/<quantity> - For common data measurements, such as living-room/temperature.
- presence/<devname> - For presence topic with retain bit set.
Devices are connected to their local broker in designated area. Every local broker is bridged to central broker and outgoing messages are prefixed with the name of the area. For example living-room/temperature becomes my-house/living-room/temperature.
This works fine with few devices, but now I have many devices based on different kinds of processors, different versions of PCBs, different SW versions and much more. For that reason, I'm designing new topic scheme:
Data topics
- <location>/<quantity> - Main device sensor measurement.
- <location>/<quantity>/error - Error code indicating sensor read failure.
Where
- <location> - Location in designated area (example: `living-room`).
- <quantity> - Measurement physical quantity (example: `temperature`).
Service topics
All service topics should set retain flag.
- i/<devname>/hwversion - HW version.
- i/<devname>/fwversion - FW version.
- i/<devname>/presence - Presence message.
- online - Device is online.
- offline - Device is offline. This message is sent by the broker using last will message.
- i/<devname>/arch - Device architecture.
- avr - AVR based devices.
- esp - ESP based devices.
- i/<devname>/variant - Procesor model.
- atmega328p - ATMega 328p chip.
- esp8266 - ESP8266 chip.
- i/<devname>/link - Link information.
- ethernet - Ethernet LAN connection.
- wifi - Wi-Fi connection.
- nrf24 - NRF24 wireless connection.
- i/<devname>/voltage - Input voltage. For battery powered devices.
- i/<devname>/ip - Device IP address. Make network debugging easier.
Where
- <devname> - Device name.
-
New nodes
03/02/2016 at 10:55 • 0 commentsFor last months I worked on new devices, SW backend, infrastructure and network diagnostic tools. There is lot of updates coming.
First of all, I would like to introduce my ESP8266 base IoT sensor board design. It is primary designed for BMP180 baromertic pressure sensor and BH1750 ambient light sensor.
Size of the board is 1800 mils * 1800 mils, sot it can be easily panelized for mass production.
I will post repository of eagle files as soon as possible.
-
Ongoing project updates
11/30/2015 at 08:55 • 0 commentsFor last few weeks, I'm working on many other things which are also part of this project. I would like to introduce my work and some visions.
Currently, I'm developing endpoint device based on esp8266 chip. Every one knows what this chip is, so I thing that it doesn't need to be introduced. I have already done some prototype device with BMP180 barometer sensor. I have implemented code with MQTT client and sensor driver. It will be released on my GitHub very soon. I'm working on PCB design for it and 3D printed case.
Speaking on device source code, I added support for retain bit for messages and support for last will message. I needed to add this functionality for monitoring device presence on the network.
Also, I'm working on web application for health monitoring for entire network. It is divided into two parts: Python daemon for continuous monitoring of MQTT traffic and web app for user interface. The application should be capable of monitoring MQTT traffic and checking topic update rate, valid range of measured values, error codes and presence messages. It will help keep all devices up and running.
I'll keep you up to date :)
-
IoT sensor with case
11/28/2015 at 19:54 • 0 commentsI finally 3D printed case for my PCB.
Case can be mounted at wall with four screws. At the top is hole for AVR programmer and notification LED. It is designed to be mounted at wooden. Inventor source files can be found at my GitHub page.
Currently, I have already many of these sensors installed at many places. It works pretty well :)
-
IoT node PCB
11/09/2015 at 15:42 • 0 commentsI worked on many parts of this project for last few weeks. One of them is design of IoT node PCB. After some tinkering I created single side PCB design, which can be easily manufactured.
Manufactured and populated board looks like this
This is my first board design, so if you see some flaws on it, please let me know. You can find eagle files in my Git repository.
-
Central MQTT broker configuration - mosquitto
09/29/2015 at 15:11 • 0 commentsI just published second part of central MQTT broker configuration. You can find it on my blog: Central MQTT broker – mosquitto
-
mqspeak update
09/29/2015 at 07:18 • 0 commentsAfter few weeks of coding, I published new version of mqspeak to github. There are some major new features.
- Implemented buffered updater
- Implemented average updater
- Support for Phant (data.sparkfun.com) streams
- Changed configuration file syntax
- Added new bugs which needs to be fixed
I did not have much time for testing. In following days I will try to crash the app and commit bug fixes.
-
Another working prototype
09/23/2015 at 20:50 • 0 commentsRecently I deployed another prototype in our local hackerspace.
Node measure room humidity and temperature and send data to local MQTT broker.
Local broker is based on A5-V11 router with compiled OpenWRT system. Reason for why I had to build router image by myself is that I had to remove some packages to get fit necessary software into device flash storage.
Data are send to central broker where they are transformed into ThingSpeak channel updates. You can look at final graphs at hackerspace project page (czech).
Currently I'm working on PCB design of my node with PoE, reliable power source and RJ-11 connector for sensor. I'll post new project update shortly.
-
Central MQTT broker configuration
09/17/2015 at 11:44 • 0 commentsI just published a article on my blog: Central MQTT broker – configure OpenVPN server.
This is first part about configuration central MQTT broker for my IoT network infrastructure. If you have any questions about that, please leave a comment :)
-
Local MQTT broker
09/09/2015 at 09:44 • 0 commentsYesterday, I finally compiled operating system for my local MQTT broker which boots up with no errors. Broker is based on Raspberry Pi B and I had to build whole system by buildroot.
Reason for that is that I need more recent of software than Raspbian (Debian Wheezy) can offer. Rasbian don't use systemd and has quite old mosquitto version, which doesn't support bridging.
Building system by myself gives me lot of possibilities about used software versions and some other optimizations. Such as compiler setup.
System has features such as pure read-only filesystem, use of DTB and systemd init.
This is my rootfs overlay structure:
etc/ ├── dropbear │ └── dropbear_rsa_host_key ├── fstab ├── hosts ├── mosquitto │ └── mosquitto.conf ├── network │ └── interfaces ├── openvpn │ ├── ca_certificates │ │ ├── ca.crt │ │ └── dh.pem │ ├── certs │ │ ├── rpi-cr.crt │ │ └── rpi-cr.key │ └── client │ └── buben-vps.conf ├── resolv.conf ├── systemd │ ├── journald.conf │ └── system │ ├── dropbear.service │ ├── mosquitto.service │ ├── multi-user.target.wants │ │ ├── mosquitto.service -> ../mosquitto.service │ │ └── openvpn-client@buben-vps.service -> ../openvpn-client@buben-vps.service │ ├── openvpn-client@buben-vps.service -> openvpn-client@.service │ ├── openvpn-client@.service │ └── systemd-random-seed.service -> /dev/null └── tmpfiles.d ├── etc.conf ├── home.conf ├── network.conf ├── systemd.conf ├── systemd-nspawn.conf └── var.conf
I will post build instructions and git repository soon.