element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Pi IoT
  • Challenges & Projects
  • Design Challenges
  • Pi IoT
  • More
  • Cancel
Pi IoT
Blog [Pi IoT] Thuis #3: Software Architecture
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rhe123
  • Date Created: 2 Jun 2016 7:58 PM Date Created
  • Views 1483 views
  • Likes 3 likes
  • Comments 7 comments
  • piiot
  • software_architecture
  • thuis
Related
Recommended

[Pi IoT] Thuis #3: Software Architecture

rhe123
rhe123
2 Jun 2016

To make the Thuis app as flexible and efficient as possible a solid architecture is needed for the system. Different systems have different properties, which are most important, for Thuis it's important to provide the wanted functionality, be reliable, usable and adaptable.

Functionality and usability are the most obvious: without the wanted functionality the system doesn't do anything. And when it's not easier in use as the non-automated (old-fashioned) situation, it won't be used at all. Thuis should be reliable because it's influencing lots of functionality in the house: if for example the lights don't work, this can be problematic when it's dark. This includes recoverability as well: whenever something goes wrong it should not put the system in a non-working state, but should be able to at least do it's basic functionality. The last property is adaptability, which is important since all products on the market evolve rapidly. It should be possible to keep up with the latest products and easily add new hard- and software to the system.

 

Architecture overview

image

This blog provides a general overview of the architecture. In the upcoming blogs I will go in-depth into each module.

 

Core

At the heart of Thuis there is a Java EE application running in a WildFly container on a Raspberry Pi 3. On the same node Z-Way (a Z-Wave controller), Mosquitto (a MQTT broker) and a database (which one is to be decided later) are running. They are sharing the same node to save budget, but because of the modular set up they can be split on to multiple nodes.image

Initially the core application will be built around a MQTT observer: it subscribes to all available topics and knows what to do when certain messages arrive. All the rules live here, has knowledge of all devices, and keeps their status up-to-date. Different types of commands can be linked to each device and executed for them. Execution happens in prioritized JMS queue. This makes it possible to execute some commands in a predefined order and prioritize user initiated actions above background tasks.

 

Communication

Communication between the core modules takes place through MQTT. This is connectivity protocol designed for machine-to-machine communication, especially in IoT environments. It's extremely light weight and provides a publish/subscribe way of communication.image

MQTT in this case is used to provide a bus-structure, in a way comparable to the CAN bus used in cars. Each node can publish messages to any topic. These messages will be delivered to any nodes that are subscribed to that topic. For example when Z-Way detects a movement in the kitchen it publishes this to the topic Thuis/kitchen/movement. Another node is subscribed to this and can take action by turning on a light. This way the coupling between the different nodes is very loose and it's possible to exchange devices easily.

While MQTT is available for a lot of platforms, it's not possible to hook up anything directly to it. That's why some modules use a bridge. The most important examples are the Z-Wave devices. A Z-Wave node can only communicate through Z-Wave with each other and the controller. In this case the controller acts as a bridge to connect it to the other parts of the system. The same is the case for services that have an API, but no extensions, like Plex. For these the Core will act as a bridge.

 

User interaction

As mentioned in the proposal user interaction takes place in several ways. From the start these are physical buttons (Z-Wave), some iPhones and an iPad. A web and voice interface will be added later. Just like any other modules they communicate through MQTT. To make the interfaces easily adjustable and maintainable several UI components will be developed which will be connected to one or more MQTT topics. They automatically update based on a subscription and can publish messages to a topic when a user interacts with them.

 

This should give you some more insight in the building blocks of the Thuis system. Next up will be the setup of the MQTT broker and the first integration: Z-Way.

  • Sign in to reply

Top Comments

  • rhe123
    rhe123 over 9 years ago in reply to balearicdynamics +3
    Questions are always welcome The PI3 in your architecture scheme it is connected to a database and a NAS. These two units are part of the PI3 hardware or are external device that are controlled through…
  • fvan
    fvan over 9 years ago +2
    Looks like I'll be learning quite a lot from reading your posts, which is great!
  • fvan
    fvan over 9 years ago in reply to clem57 +1
    The attacker will always have the advantage. I don't think there is something like the ultimate security, we can only make it is hard as possible so it's not worth the effort to the attacker.
Parents
  • fvan
    fvan over 9 years ago

    Looks like I'll be learning quite a lot from reading your posts, which is great! image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • fvan
    fvan over 9 years ago

    Looks like I'll be learning quite a lot from reading your posts, which is great! image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • pettitda
    pettitda over 9 years ago in reply to fvan

    Me too.  I just learned what non-repudiation means.  Interesting!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube