Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

IOT Explained Part 1

Status
Not open for further replies.

large_ghostman

Well-Known Member
Most Helpful Member
I was going to do this ages ago and didnt get around to it. I will do it in short chunks as its a big subject, i will say sorry in advance for the ruffled feathers. Some wont agree or like these posts, in general IOT is badly misunderstood, in mesh network circles its described as the global warming of networks. By that they mean the name is wrong, or wrongly used. like Global warming should be called climate change, IOT in most applications is better described as Things of the internet.

So lets start there and explain why turning a light off over the internet, does not make that like IOT but rather the light is a thing on the internet.

IOT was a slang term used to try and described an address system used to route messages in a mesh network. It then got overused and taken over, so now everyone with a board they can access via the net thinks its a IOT device, sorry but its not, its just a TOI (thing on internet).

True IOT of better yet a true mesh network is slightly frightening and very very clever in how it works.
Before we go deep into how it how it works and what its for, i will loosely explain the purpose and maybe an example of a similar system people are more familiar in. It might also help if i explain some of how i got into them......

My initial contact with it was via the mesh network system silicon labs has, the dev kit for it starts at around £7,000 and gives you 4 nodes. I got hold of it almost by accident, i was asked to review a new GUI for there system, someone sent me the entire kit instead of just the new front end bit!! I was also trying to get 3 windturbines to talk to each other and base over difficult terrain and circumstances, so in the end i kept the dev kit.

First thing with a mesh network is to imagine a honeycomb in a beehive, every place the lines intersect is a node point. Address wise its was based on IPV4 and something alot like postcodes in the UK or ZIP codes in America, now i dont really understand ZIP codes so will stick with postcodes. An example of a UK postcode is HP2 4PG

So on a broad postcode map like this one
2018-04-09_00-44-17.png


You see that straight away 2 letters have got you from something the size of the UK to a fairly small area, but if you consider some 30 odd million postcode addresses, then thats still a big area. In fact in the UK there is roughly 1.8m postcodes, each postcode gets you down to roughly 15 addresses.
Back to our postcode HP2 4PG, the HP area is broken down into towns like this.

2018-04-09_00-53-19.png


And a list of towns just for clarity
2018-04-09_00-54-37.png


So whats this got to do with a mesh network? The original idea is alot like the internet, being honeycomb shape makes it one of the most mathematical perfect shapes to fit any other shape with little waste. It also allows something special with addresses.

The main idea was for a system to be able to send a fairly simple message to any node taking the fastest route. So lets say you wanted to set off a ICBM over a network. Using a true mesh network it would be extremely hard to stop.

So lets say this point on the honeycomb is your icbm node
2018-04-09_01-03-36.png
Its off slightly but you get the point, you can trace many different routes from any spot on that grid and reach the node from a number of directly connected nodes. This is where the mesh code comes in.

But with mesh or IOT there were other requirements, first and above all it had to have the highest chance of getting through, it had to be as fast as it could be, it had to be able to self route the message depending on the network at the time, it had to be able to cope with outages in places and at no point should the message be returned simply because large parts of the mesh are offline or busy...

This is why true IOT devices are Master and Slave all in one, it differs from the internet as such because the way the addressing works, you get the most direct route depending on the situation at the time. Not all nodes read the message, if we stick with postcodes as examples..

I will do part 2 tomorrow and it should start to make more sense.
 
Part 1A

I will do part 2 later, but i wanted to point something out first. The real power from a mesh network dosnt become clear until you get down to the device level addressing, the system is mature and in place but not really used at the moment, its unfortunate that the slang name took off, people swamped the market with things called IOT and i think its held it up.

Eventually when every washing machine and fridge etc has IoT built in, then its real power will come into play. At the moment its cute to turn your lights off over the net, but here in the UK for example we have a problem, the actual Grid infrastructure is reaching critical mass, it physically cant handle the demand for electric placed on it. Much of this has nothing to do with not enough power stations, its mainly we cant physically pull more power from it, that and the added problem of the number of inverters grid tied from various mickey mouse alternative energy sources.

I mention this now because its worth keeping in mind, eventually this problem is what will drive us to true IoT. Instead of trying to pull a pint from a quart pot, we will selectively route power. An example of this is freezers, if you set your freezer to -22C it dosnt matter if it falls to -20C. But that 2C is alot of time energy wise, so in a situation where your address range is at capacity, and your freezer hasnt indicated recent constant door opeing, IoT will tell your freezer to stay off until -20C.

Dosnt sound much, but do that to 2.2m freezers in a town and you keep the lights on in alot of houses at the main peak loads. For example known trouble times, here in the UK certain TV programs etc are planned for at the power stations, They have extra turbines spinning up ready for certain advert breaks in certain TV programs. This is because people are creatures of habit, this is the times they will go make a brew and put the kettle on.

If you go look at a load map for the power stations, you can spot the start and end times of programs, or special events like say a royal wedding or election. At the moment they cope by having extra capacity ready for those 8 mins or whatever it is. But the winter just gone, was the first time we faced the real risk of planned outages because we were at full grid capacity. We had spare generating capacity (alot of it), but the grid couldnt handle it. In the end we got lucky and no planned outages happened.

In the future what will happen is, instead of having alot of wasted power sitting ready to go at peak load, they will decrease the system load already on the grid. If you think about it then it makes alot of sense, say a freezer hasnt had its door opened for 2 days, its unlikely to have it opened at the moment you need the extra power, even if it was opened it isnt going to melt the freezer being off for 10 mins.

But turn 2 million freezer compressors off just before your peak, then you have alot more capacity. You know in advance they are not going to kick in, switch off or more likely slow down spin speeds on washing machines just before people push the kettle button, you smooth out that huge spike in usage. Once everyone has sat back down to watch TV, you then bring any freezers that hit the low level of -20C on first, then the others in a controlled way.

I havnt described it very well, but this is what true IoT was intended for, what makes its real clever is the addressing bit, because next doors freezer might get its power down message via your IoT light bulb one day, or your IoT TV the next. Or you might be away and the message gets to it via someone elses coffee machine.

I will go back to addressing later on, its hard to explain it well and consists of 4 parts. But my main goal is to end this notion of putting a thick as a brick relay on the net, and calling it a IoT device. Although somewhat pointless as even the main players have given in now, dosnt mean true IoT is dead (very far from it), its like i said before, scientists talk to people about global warming, but to each other they discuss climate change.....
 
So, what you're saying is that I could have a mesh network in my apartment connected via my router but if my internet disconnects, it will just piggy back on to my neighbours network? Via their toaster? Sounds like a security nightmare waiting to happen. I can see the advantage of meshed devices controllable via the power companies but can't see the shared utopia. Actually, here you can get a discount by having your aircon controllable by the network so they can reduce base load at high demand times (40C outside type demand). They do exactly what you describe, nobody notices a 2C rise, 24C to 26C.

Mike.
P.S. Enjoying your explanation - looking forward to next instalment. However, the title is going to come back to bite you. How many part ones can you have? When we get to part 1z you have a problem.
 
So, what you're saying is that I could have a mesh network in my apartment connected via my router but if my internet disconnects, it will just piggy back on to my neighbours network? Via their toaster? Sounds like a security nightmare waiting to happen. I can see the advantage of meshed devices controllable via the power companies but can't see the shared utopia. Actually, here you can get a discount by having your aircon controllable by the network so they can reduce base load at high demand times (40C outside type demand). They do exactly what you describe, nobody notices a 2C rise, 24C to 26C.

Mike.
P.S. Enjoying your explanation - looking forward to next instalment. However, the title is going to come back to bite you. How many part ones can you have? When we get to part 1z you have a problem.
The first part is exactly what i am saying, security wise the true mesh system is secure. Its designed to be 64bit packets and any packet injection would mess the address up, the address alters slightly on each hop.
I am explaining the postcode kind of side first, the other side is normal IPV4 IPV6, the actual data contained in each packet is real simple stuff, like 1 or 0. on or off.


Your grid system is ahead of ours a little because of the high demand for cooling, apparently us is ahead by 5 years for the mean temperature estimate, hence why they have started implementing the system now instead of later. Whats really neat is when they put the temp back to normal they do it in stages according to capacity. So lets say a power station is running at 70%, they start to put on normal temps until they are near 85% of current capacity, they try and not start another turbine if you see what i mean, they try and use the drops in capacity.

With fridges its simpler, you just wait until the compressor is off, then you get it to stay off, you dont switch it off while its running a cycle. That way you get little ripple and spikes. I got a huge amount of info on this somewhere. I keep meaning to stick it on my blog
 
Sorry Mike i forgot the most important bit....

This is no utopia, far far from it.
Its being phased in because we have no realistic way to make the national grid handle more power, not with the green targets and wind and solar stuff etc etc. The other reason is even more sinister to me, you can take the internet out to a great extent, but not only will a mesh jump from network to network.... but think what else is a network with data? Mobile phones ;), it can ride the signal that checks your phone connection every few mins, so in theory it could ride in on your mobile if you data thing is on and you walk into the house.

Now think about war, and a country on its knees and most the infrastructure gone, the internet has just about been taken out, you could in theory set your last missiles off via toasters and phones etc etc. Thats why mesh networking was devised, its already here and in place, it just rarely used as a mesh, you dont need a mesh network in your house, you already have it, what you lack is true mesh network devices and they are coming, well you already got one in yours, your aircon.
 
LOL, now i know why we dont have one! we use the grill, but then again my mum still thinks steam is not to be trusted new tech!
 
Part 1 cont..... POST CODES

Just to clear up the post codes, HP gets you down to several million houses, HP2 narrows this to 508K, add in HP2 4 and your down to 4,000 possible houses, so already you have gone from over 30 million possibles to 4,000 with just 2 letters and 2 numbers. The last two letter will give you the road and if its on the odd or even numbered side. So Mesh addressing is a bit like this, consider each device as having a kind of postcode, it starts with a blank one actually. Keep in mind true IoT is Bi directional but with selective addressing, it has a serial number or house number if you like, but its address or post code is depends on what is around it.

I made a mistake earlier, they are 32 bit not 64 bit. the postcode is 8 letters and 7 numbers, the rest of the address header should contain 0, i am unsure how many levels are in the address, by this i mean i dont know how deep they know the address system. To explain this, look at the honeycomb again. You see how a signal can come in from a number of directions? the device reads bit 16 if its a 1, it then reads bit 15, if bit 15 is 0 it reads from bit 0 onto bit 8, this is an address check.

By reading only one bit it knows if the last read was correct or not, or put another way it knows if the packet is going the right direction or needs checking (it could be a message for itself!). Everytime a message is checked and found to be going the wrong way it is read, as each node has 6 possible directions (honeycomb) it knows which of those have thrown up a recent 1 or 0, so it knows which way is working and which is not.

By reading the address and comparing to its address, it knows in an ideal world which node to pass it onto, but lets say its the left hand top of the comb, and thats thrown 3 1's in a row but bottom right has thrown no errors at all, it will pass down to the right....

I am going to come back and explain all the above better later on, i dont want to bog down in the detail at the moment. Now while its also using IPV4 or IPV6 it can use any form of data network that it is personally connected to, so if the IoT device that gets a packet happens to be the wifi part of your cell phone, it has a choice, it can send on via any router OR other TRUE IoT device or it can use the mobile data carrier network.

Its designed as an organic system, so which is chosen depends on the number of bits it has had to check before it reaches a bit that says it hasnt had an error in route. I think this determines or at least puts bias on which route is chosen. The idea is to go direct, but direct depends on how many errors have come through, this is shown in every message by the 4-8 bits used to check address error depth.

I will hold it there until later, i will come back and use postcodes to explain address error depth.
By the way there is a good number of hotels, particularly the brand new one in Dubai, that use pure mesh networks throughout the entire building, every light and anything that is powered even for a short period is full mesh network compliant.

Its a monster to get your head around, and i dont explain things well. But try and hang on and I will clarify things as we go. The original aim was to simply explain that what most call, The Internet Of Things, is in fact simply dumb devices normally uni directional that happen to be connected to the net. The actual meaning is in many way LITERAL. Its an entire network made up of different things, apart from the address system it isnt complicated, so even a light bulb dosnt need a Cortex M4 core to be a IoT device.

Only certain devices address check, and how deep they check depends on the error bits, not all devices on the mesh record error depth, but every honeycomb node has at least one that does, the rest may simply just pass on the packet or even ignore it.

The reason i am explaining the addresses is simply because it shows the real purpose of a mesh network, it shows you what happens when you take a large chunk of a network out, thats when the mesh really starts to come into its own.

Anyway later i will go over the above using normal UK postcodes as examples, and true IOT devices will be postal sorting centers and postmen (or women obviously:rolleyes:). One thing I wont be able to tell you is exactly how the address gets constructed to begin with, or how the encryption side works, i know some the basics but its a bit like this...

If you knew how smart meters worked in terms of serial key numbers, then you wouldnt say a word because then you could not only read any meter (actually anyone can read a smart meter) but you could talk to the meter and change things. So some of the details I genuinely dont know because i am not supposed to know.

If i say something really confusing, feel free to ask for it to be explained better, it starts to get deep pretty quick, but it dosnt last long before it gets alot more normal. If you understand MAC addresses and how webserver stacks work on a software level, then your 3/4 there and a bit ahead of me :D.
 
Ok i am going to post a link to a datasheet, a while back these chips were going to be used with the zig bee mesh network system, no idea why they wernt put in zig bee in the end, but a bit later parts of the data sheet help explain how the message packets and in particular the preamble bit works.

Note that unlike most chips and systems, these can use a single byte for pre amble while the RX is asleep and still not miss a thing, although as the sheet says....recommended number is two bytes.

https://www.silabs.com/documents/public/data-sheets/Si4463-61-60-C.pdf

There are obviously many other chips that can be used, these have micros built into them and the system also has a connected mcu to it. My reason for using the chip to explain things is simply because its one i have used more than any other. Its a seriously cool chip BTW.
 
Smallish delay on next part, so far its sounded alot like the internet is heavily involved etc, and to a great extent it is. But its so much more, take a look at this pic
enhance-home-auto-webinar-2.jpg

In this they are only showing/using 2 protocols, Zigbee and blue tooth. Watch the video on this page https://www.silabs.com/solutions/home-automation-and-entertainment its the one called demonstration combining zigbee and bluetooth beacons, its right at the bottom of the page in a small square near the center. These are really simple demos using just two protocols, but near the end it shows a bunch of rooms and bluetooth beacons, it makes a point in the video of this can be used for tracking.

What it dosnt mention is alot of the dev kits including the $30 boards, can run all kinds of protocols natively at the same time.
The reason for my small delay is because i have started to go into detail about addressing etc, but because a project i need to do has cropped up i actually have a chance to show what a true mesh looks like, and how it works. In the drone project i am doing again, there is an opportunity to actually use a mesh network on it. The project is kind of simple in scope, the dron needs to lift a high end Nikon Camera with a 2.8f 300mm lens.

The camera is for taking shots of a specific area of land at a defined height. The thing is the drone will near enough be self flying to grid system so it takes a large number of pics of around a few hundred square meters. The camera needs to use bluetooth connected to a board that then sends back the picture and info via wifi or maybe zigbee. This will go to lightroom on a laptop. The camera is effectively tethered and the person at the laptop will press the camera shutter button when the picture is correctly focused and in the right place.

Because of the size of the lens and weight, the camera and lens are going to be fixed on the drone, so the drone has to do all the moving about to get each square foot or whatever area size they shooting. The point is the whole thing uses 3-4 boards and 4-5 protocols, any of which can control the drone position or take the picture/operate the camera. While it dosnt have to be done like this, it should show off really nicely how true IoT works.

In the pic above it shows bluetooth, but lets say you had another tablet sitting on the table running wifi, and the bluetooth tablet runs out of power or gets busy sending something over BT to another device, then true IoT would simply switch to the other tablet and send or receive the info using wifi.

Lets say you have a large office block, everyone has a mobile phone and most have their tooth on, although the range is small, if you use a true mesh system, then there is no reason you couldnt send a pic or whatever to a guy on the top floor, from the bottom floor, it would simply hop from device to device all encoded, if it ran out of bluetooth then it looks for wifi or whatever is handy.

And that is really where the real power of a mesh network is, its also the bit that i find scary. So many of these devices already run IRDA/bluetooth/wifi/ethernet (my pc for a start), that a mesh network dosnt depend on any particular protocol, the more SOC we develop and use the closer we get to a world mesh system. Again without my tin foil hat, going back to that video.... If you got bluetooth on your phone your already within a small area of possible places, if you send a packet looking for a certain beacon, it could travel all over the place and simply send the query string when it encounters bluetooth, it would ask the device what beacons are in its range. If your is in range then the data is sent back and your location has been pinpointed to a small area.

Sounds far fetched, but in the UK we have a huge number of cctv cameras and car reg recognition cameras. Say one picked your car up, are you in the car? well if you got your hands free kit on and therefore bluetooth, there is a good chance your in the car. Yes the police can get a warrant to ask a phone company to beacon data, but you dont need a warrant to ask one phone what other beacons are in its area ;).
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top