#303 Zigbee Meshes with IKEA, XIAOMI, Philips and zigbee2MQTT tested and explained

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
wireless mesh networks are fascinating because they adapt to changing situations and can bridge longer distances than point-to-point connections today we will have a look into the standard SiC P mesh technology learn its pros and cons and compare it with Wi-Fi and Lora van networks let's see youtubers here is the guy with the Swiss accent with a new episode and fresh ideas around sensors and microcontrollers remember if you subscribe you will always sit in the first row mesh networks are a little anarchic and maybe this is why they are fascinating for many free thinking makers but is this true to find this out we will compare mesh networks with star or hopping spoke networks look at the different roles in a mesh network look at the pros and cons of a mesh structure enable a Raspberry Pi and a cheap USB dongle to act as a network coordinator find a way to automatically chart the network for analysis try out various Network constellations and see if and how it adapts connect the network to node rate and glimpse into other mesh networks a mesh network is what its name suggests a network of devices that are connected in a non structured way at first glance each can connect with each like the hippies before aids this can be true for some mesh networks for sick bees this is not entirely true here you have three different roles in such a network why as always because of power restrictions as we will later see the coordinator who usually is also connected to the Internet one or more end nodes in between the two we can have as many routers as we want a network does not need routers but then we would not call it mesh network let's take an example our small house has three floors plus a basement the coordinator is my Raspberry Pi in the basement and we would like to have sensors and lamps on all other stories let's assume I want to switch off all lights before we go to bed on the second floor then I need a switch like this one from Shiomi unfortunately the range of the switch does not reach the basement because of all the concrete in between if I add routers on each floor a simple mesh is created the switch transmits the off message to the router on floor 1 and from there it goes to the router on the ground floor and then to the coordinator in the basement cool in this case the switch is called end node as well as all bulbs on all levels would be called end nodes but why do we have to distinguish between routers and end nodes the explanation is simple as a router you have to always listen for messages this is energy consuming and therefore only nodes connected to mains can act as routers end nodes on the other hand use only energy when they emit data this is in the case of this switch only a few milliseconds each day so they can be battery-operated Sigma devices are known for extended battery life fortunately end notes can also be routers like this ikea bulb for example or this power switch by the way it is not from sun off but it looks very similar all these mains connected end nodes have built-in routers very handy this temperature sensor this vibration sensor and this cube all are only end nodes because they are all battery-operated you can also build your own routers if you wish these are only routers no end nodes just buy one of those cc 2530 modules and flash the router software on the chip using such a programmer or an Arduino you find an excellent description on how to do it in the documentation of SiC p2 mqtt just a small tip connect external 3.3 volts to paint two of the programmer otherwise this bulb will never get green and you will never be able to flash the chip this insight costed me at least one hour of my life because all bulbs have a router included the chance you have multiple routers on each floor is high and the need for such self-made routers is quite small maybe if you have to bridge longer distances to another building or so a next trick when I changed my coordinator to another Raspberry Pi my CC 2530 routers did not connect any more until I reflash them so we know the basics of a mesh network and can go on with a comparison with other network structures like Wi-Fi or Laura van these are so-called star or hutton spoke networks where you have an access point or a gateway and all devices connect directly to those there are no routers in between endnotes and access points or gateways the range of such a network is limited by the technology the range of Laura is quite broad but so far it is not often used for home automation as we all know Wi-Fi has only a short range because of the minimal range of Wi-Fi a few years ago I had an access point on each floor with different network names each time we changed the floor our smart phones lost connection and had to be reconnected to another network in recent years new designs came to the market which resembles mesh networks my micro tech network for example spans one Wi-Fi network across all floors and I do no more have to care about which access point to connect this network uses access points connected by Ethernet I would not call this a mesh network because the transfer between the access points uses a different communication principle still sometimes they are called mesh networks mainly if the communication amongst access points uses Wi-Fi instead of cables and here we come to the next significant difference between star and mesh networks the routers in a mesh have to receive and transmit messages which do not belong to their end node which creates additional traffic in the case of ZigBee on the same frequency so the throughput of such networks unfortunately is reduced this fact is particularly relevant if your network only has a limited throughput on the plus side meshes have a higher resilience because usually they have redundant connections and they automatically adapt to new circumstances and resiliency is a buzzword these days so it must be good in a star topology if one of the access points quits the network is down no resilience at all and you have to have additional cables or separate Wi-Fi channels to connect the access points so far we did not talk about the coordinator as in video number 289 I use SiC p2 mqtt on a Raspberry Pi for my network to get this running we need a cc 25:31 dongle which has to be flashed with a coordinator software the flashing process is the same as for the router and we have to install sig p2m QT t on the raspberry again just follow the excellent documentation another trick you can run SiC p2 MQTT in two different modes either in the foreground or in the background when you start with your experiments type in NPM start to run it in the foreground like that you see what happens if you pair your devices with the coordinator information on how to pair the different devices are found the documentation take the new devices in front of the screen while pairing like that you immediately see if it is successful or if it fails I experienced some timeouts during pairing usually this can be avoided by regularly pressing the reset button after the pairing for another 10 seconds this is called after play not for play like that the devices stay on and a timeout is avoided as in the last video the only device which made trouble was my Phillips you which refused to pair when I used an Ikea button it seems that also devices have preferences touch do not want to pair with sweets incomprehensible another trick add these two lines to your configuration file like that your coordinator queries every two minutes if your notes are online and you see Network changes much faster of course it only queries nodes connected to mains otherwise the batteries of your end nodes would be quickly depleted in operation you can switch it to zero which is off or to a long time because we are already in the configuration file each ZigBee device has a unique number after pairing this number should show up in this configuration file and you can add a friendly name I use my label printer to mark my devices with the numbers and the friendly names this helped me during my tests later friendly names are also used as MQTT topics so keep them short but how can we understand the network structure very difficult because the mqtt messages do not reveal the way the message took it only shows the end nodes but we are fortunate if you publish the message graph with to this topic SiC p2 MQTT sends the information of the whole network to this topic here just subscribe to that pick and you will get all the information but what to do with these cryptic texts here comes the attraction the format of the message is understandable by a program called gravis which can be used to create network maps and the best if you use this small script you automatically get a graphical map of your whole network as an SVG file on a Raspberry you can use the built-in image viewer to see it on windows I used Inkscape for that purpose how cool is that let's have a look at a network with bulbs sensors switches and cubes spread out across the whole house we see all nodes also the ones which currently are offline in different colors red is the coordinator blue the routers and yellow the end nodes we also see most of the connections and signal strength pay attention if the signal strength is very low this particular connection might not exist for the moment and for the end nodes you do not see actual links but you see when they were active for the last time excellent as an example we see that the clear IKEA bulb on the second floor is only connected to the white IKEA lamp on the first floor no other route can be reached from there the white bulb has additional three connections to the IKEA router on the ground floor to the concentrator and two router one which is close to the router on my bench top this router is only used for test purposes the switches and sensors usually are connected to the closest router but not always I suspect that we do not see all the connections when I switched one of the rioters off the sensors were still working they just used another router for the transmission obviously they are able to connect to various routers but we do not see it on the map one question is still open how fast does such a network adapt to a new structure I had all my notes in my lap for the pairing here you see the network structure all routers are connected with all the routers this would be a very stable network then I distributed them across the house as shown before I did not measure the time but it took a few minutes until the new structure was established changes are reflected faster if you use the availability time out or if you use your switches for example because each message increases the chance the network detects changes after the deployment because of the limited range of the notes the network had fewer connections but it still was resilient because most and now it's had more than one route to the coordinator a second pulp or a router on the first floor would make it even more stable of course we still have a single point of failure the coordinator I can live with this fact as far as I know it is not possible to have two coordinators in the same network here I have a different coordinator the can be from Tristan Electronics it seems to be a good dongle and excellent software unfortunately it is not open source this is why a used SiC p2 mqtt for this video next question how can we connect these sensors to our project if you add the address and the credentials of your MQTT broker in the configuration file you automatically get all messages with the respective topic two node rate for example there are a few videos on this channel on how to work with node red influx TB and Pravana maybe you look into the raspberry pi playlist and graha included a container with trick p2 MQTT to his excellent IOT stack project shown in video number 2 9 5 you find a link in the description of course you can integrate such a sick p mesh into a bunch of other tools like home assistant instead of node-red a word about other mesh networks examples are APRs an amateur radio network on VHF or fri funk in germany where they use 2.4 gigahertz routers with special firmware to create a publicly available mesh network an exciting project unfortunately it is forbidden in Switzerland probably because it's too anarchic here we like it clean and well organized how boring summarized mesh networks are very resilient against node failures they can extend the range beyond physical properties of a network technology they are self-organizing and automatically adapt to new situations like extensions or failures but their capacity and response times are lower than the capacity of a star Network and they depend on always-on routers which usually are connected to mains battery-operated notes are no routers you can build battery-operated routers like this one if you only need it for a few hours we can create a coordinator with our Raspberry Pi together with a cheap USB dongle it connects the whole network to the mqtt broker of course the coordinator can use the same raspberry as mosquito node-red and other software a neat functionality makes it possible to extract Network data and automatically draw nice-looking Network Maps other networks also use mesh technology usually they use higher frequencies because they need higher throughput to be efficient one last thing do not buy this sick piece which if you do not live in a country with these blocks even if they sell it as European version they only add this adapter which does not work as you see maybe the inner parts will end in a 3d printed case with Swiss blocks you never know I'm a maker I hope this video was useful or at least interesting for you if true please consider supporting the channel to secure its future existence you find the links in the description thank you bye
Info
Channel: Andreas Spiess
Views: 77,953
Rating: undefined out of 5
Keywords: ESP32, hobby, diy, eevblog, greatscott, andreas spiess, project, how to, nodemcu, ttgo, wemos, internet, iot, internet of things, sensors, github, arduino, arduino project, esp32 project, esp8266 project, beginners, tutorial, Raspberry pi, zigbee, zigbee2mqtt, mqtt, CC2531, cc2531 zigbee, ikea, philips, tradfri ikea, homekit, tradfri, ikea tradfri, philips hue, conbee2, freifunk, aprs
Id: YEtyuDxon7A
Channel Id: undefined
Length: 18min 2sec (1082 seconds)
Published: Sun Dec 15 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.