What is Sparkplug B for MQTT?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
warm-up video all right what is spark plug b for mqtt take zero thank you to easyvpn for sponsoring this video here all right in this video so if you have not gone back and watched the two videos from op about you opc ua and the two videos about mqtt which were released in august of 2021 go back and watch those videos very important in this video we're going to go over spark plug b what is it how does it work this is a video for the lay person we're going to do a 10 000 foot and a 5 000 foot discussion but we're going to get into some technical details okay i'm not going to go deep into the weeds so that we have people's eyes glazed over but we are going to get into some technical details all right so what is spark plug b for mqtt all right key elements okay we've already gone over this but some things i want to point out spark plug b the spark plug b specification which you can google mqtt spark plug b is managed by the eclipse foundation okay it is it was developed the spark plug b spec was written in 2016 by cirruslink which is a company owned by the co-inventor of mqtt arlen nipper they turned over that specification to the eclipse foundation in 2019 okay the spark plug b specification is a specification for packaging up industrial data and communicating it to a mqtt infrastructure okay it is based on the mqtt 3.1.1 standard so one of the first things that you learn about spark plug b is that it's an extension of the base mqtt 3.1.1 standard so obviously there will be a new release of the spark plug standard for mqtt 5 at some point and qtt 5 was released in 2019 hasn't really gotten wide adoption yet there are some key elements we're going to talk about here so i'm going to talk about group id edge node id and device id here in a minute okay what's important to note is that we can package up mqtt payloads okay we can group them together and we can transmit them to a broker all packaged up nice and tidy instead of publishing individual topics to our broker okay and i'm going to get to all this here in a second so group id edge note id and device id are important concepts or key elements it's basically the logical grouping of your topic namespace supports store and forward so if the mqtt client that you're using that implements spark the spark plug be spec this is how you get storing forward standardized store and forward with mqtt using the spark plug b specification what is storing forward i have an mqtt client out here on the edge i've got all this stuff changing this is connected to sensors i've got all these values changing and this connection breaks okay so that i can't get the data to the broker and i got all my consumers out here this break storm forward means that what we're going to do is we're going to go ahead and store all the events locally on the client and when this connection's re-established we're going to go ahead and publish them all to the broker with the correct values and time stamps in the order that they happened they basically stream up in the order that they happen and because the timestamp of the value that gets to the broker comes from the client the clients out here it looks to them as if that disconnection was never there okay storing forward another important component spark plug b specification has support for templates what does template mean it's user defined data type templates in spark plug b okay a udt it's basically a a data type object a template in spark plug b is the equivalent of a component spec in opc ua we have support for compression in spark plug b so what is that is that i can spark plug b has support for us compressing the payloads and sending them to the the broker and the most important concept to understand with spark plug b is we create edge of network nodes okay and that's where i'm going to start so remember this spark plug b equals edge of network node okay we're going to create infrastructure so in order for me to explain what this is let's start with the normal mqtt which we talked about in last month's videos okay so i've got my client and i have my client who has established my connection to my broker and i have subscribed to everything with a hashtag that means everything that's in the broker namespace i want you to send me the updates to with normal mqtt we call it vanilla mqtt so version 3.1.1 i can this client can do i could do things like let's do i have two companies right i've got intelic and i've got intellic dallas and temperature okay i can publish intellic dallas temperature to our broker okay the value whatever today it's 97 degrees so the value would be 97. if i'm subscribed to everything i'm gonna get that notification okay 97. at the same time with mqtt 3.1.1 i can also do this i could create a new namespace and i could have 4.0 dallas and temp and i can publish these separately okay so i'm going to establish my connection and i can publish both of these separately flat into my broker so 4.0 dallas temp and let's say the value is 100 even though they're both in the same city so i would end up with one two three and 100 degrees i would get notified when i was a little hot okay 4.0 is a little hot all right that is your that's your vanilla mqtt the the beauty about mqtt 3.1.1 is that i can create a topic namespace that i can basically piece together my unified namespace okay i can take values from sensors and using 3.1.1 i can basically put i can publish those values to basically anywhere okay what does spark plug b do okay so what i'm going to do is i'm going to create a spark plug b client okay so the difference between an mqtt 3.1.1 client and an mqtt spark plug b client is the mqtt spark plug b client is also an mqtt 3.1.1 client number one okay why because spark plug b is an extension of 3.1.1 so it's very important to know if i'm a spark plug b client i i natively support 3.1.1 as well okay because spark plug b is an extension of mqtt 311. what i'm doing with spark plug b is i'm creating an edge of network node okay so what i'm doing number one my goal is to create an edge of network node which basically does this it creates a place in we'll just say these are edge devices okay so these will be spark plug b devices so in my topic namespace i've got this thing called spark plug b edge devices okay what i'm gonna do with spark plug b is i'm gonna package all my data up for one transmission okay so i'm going to create my connection okay and i'm gonna build my topic namespace okay so these are all my tags my uh let's say uh temperature let's say it's all let's just list them as sensors sensor one sensor two okay now what i'm going to do is i'm going to configure spark plug b to send my values to the mqtt broker and this is what it's going to look like i'm going to give it a group id so in my configuration i'm going to give it a group id and in this case i'll say the group is intellic okay so the group id in this case is intellic i'm also going to give it an edge node id i don't have to these are optional edge node or device id but i'm going to give it an edge node id and we're going to call it whatever this edge node is in this case we'll say it's dallas thermostat and when i establish this connection i want to avoid too many of the technical details okay there are some things that are going to happen when i package this all up okay out here in this spark plug b client what's going to happen is we are going to establish a berth that is this edge of node this end uh edge of uh edge of node node wait this is edge of node device yeah edge of network device or node yep when i go ahead i'm going to do ahead and do a berth which is part this is part of the spec which will be stored in this name space there's a bunch of topics that are native to spark plug b i'm going to do a berth and then i'm going to give it a group id in this case i'll give it a edge node id dallas thermostat and then my sensors will be published here okay sensor one sensor two if my client out here supports at spark plug b it will be able to decipher this topic namespace how does this topic name space look like when it's raw what does it look like when it's raw well they use protocol buffers so google pro protobuf i know is one of them and they use another one that that's optional they use pro but they use protocol buffers to to send this data over the over the wire okay if i don't support spark plug b i can't really decipher what this is okay if i just look at it with an mqtt 3.1.1 client i subscribe to it it's just going to look like a jumbled mess you could you can kind of see a couple of the what what some of the stuff i mean like you'll be able to see the edge node actually in the json but it'll be a jumbled mess okay so what i'm doing with spark plug b is i'm creating an end of network node i'm packaging everything up together and i'm there's some technical elements like birth certificates and death certificates that don't exist with 3.1.1 so that up here what i can do is group all these edge of network node edge of network devices together okay so i can group many devices into the same group so i could use my thermostat i could use my my water heater i could use my plc's i could use my cmt svr anything that supports spark plug b and i can group them together logically at the broker okay the reason we use spark plug b is because it was designed for industry it is designed for all the things that we care about with industrial data okay compression's a big component of it okay compression uh buffering so one of the things that we do with these with a spark plug b connection is we say how often should we send our updates publish our updates to the broker so what will happen is let's say i set that at one second and sensor one's value changes five times in one second the only one that gets shipped is the last one okay we published the last value in that happened in that one second okay so there are a bunch of there are a bunch of elements of the spark plug b spec that allow us to optimize the transmission of industrial data okay but why does spark plug b matter okay what's the reason that it actually matters the reason it matters is is that it's far more efficient to use spark plug b for industrial applications because i can build my namespace here i can manually i can build out a local namespace for this node okay organ hierarchy and a semantical namespace okay one that makes sense and then i can package it all up as one node and publish everything for that node up establish a connection now publish my logical namespace and then keep sending my updates as opposed to with mqtt 3.1.1 there are elements i'm missing okay number one but number two i'm sending each topic individually so if i've got 10 000 topics okay i don't want to have to do 10 000 publishes from my mqtt client i may not want to do that it may make more sense for me to to package everything up nice and neat in an edge of network node and publish it to a specific space in our unified namespace couple important things here number one my mqtt broker doesn't care whether my payloads are spark plug b or not okay so i could have a broker that can't decipher that is it can't unpack a spark plug b payload but that doesn't mean that it can't administer it for a client that can okay so as long as my broker is built on the mqtt 3.1.1 specification i can i can connect a spark plug b client to an mqtt 311 broker and a spark plug b client out here will be able to subscribe and and decipher the payload okay that's number one number two because of that i can put mqtt 311 mqtt 5 and spark plug p payloads all together okay where do i want to do this so what's the what's the application for spark plug b where do we do it okay one of the things that you'll remember in in our when we talk about the rules for digital transformation we treat all the smart things in our business as nodes in an ecosystem okay nodes is an eco in an ecosystem so what we will do is we will group industrial data by logical nodes in the organization a really good example would be a production line so i may have a production line that has multiple plc's okay and i have i may have an instance of ignition edge running out there or in an instance of factory tatsos factory studio or i may have an instance of flow software or i may have a canary labs historian i may have not kept wear because they don't support spark plug yet right i may have an i o hub running out there i may have a plc next running out there i may have a group an opto 22 groove epic running out there and what i would do is logically group the data all the instrumentation data and any of the other data that i'm collecting in that node and then i would use spark plug b to package that edge of network node device all nice and neat for publishing to the broker or i could do it manually i could do the same thing except i'm not creating an edge of network logical grouping okay this gives me a lot more flexibility in how the data is going to be presented in the namespace i can take value from this sensor and i can put it over in this location in the namespace i can take value from that sensor and put it in that location in the namespace but anything that i send over spark plug b is all going to be grouped logically in the group id that that connection is publishing to and in the device i if i don't add of edge node edge node id then it's by default it's going to use the mqtt client id in it in that space go ahead for the edge of network device does the device id have to be unique oh this is a one-to-one relationship yeah this is just an extra layer this is an extra layer and this is a common question that comes up in spark plug b is hey when you start building out name space and you're going okay well where do i want to organize my data from my device out there where do i want to organize it this this getting this right is important with spark plug b okay the the most common application for spark plug b for us though is basically two places number one when we're logically grouping by a production line or an area or a plc and we say you know what that's an edge of network device and we want everything that's that i'm collecting to go to the same place in the namespace so let's go ahead and get all the advantages of spark plug b let's get compression okay let's leverage store and forward right all those things uh the protocol buffers let's let's leverage that stuff to optimize that transmission even further okay but number two is when i'm when i this sensor is a in in the opc ua world would be like an information model from a companion spec the way that this is organized is a data type and i want the the clients out here to know that i'm consuming a data type the only way for us to do that seamlessly is by using spark plug b and the mechanisms in the specification to say hey this thing in the topic namespace is a template it is a user-defined data type it is a model it is a it's a data model okay all right so that's spark plug b in a nutshell okay spark plug b a quick run through again it is a it is a standard managed by the eclipse foundation telling you how to create logical edge of network nodes in your mqtt ecosystem that are optimized for publishing industrial data when you are building unified name spaces when you are building uh topic name spaces your topic namespaces topic namespace is almost always a combination of purely flat mqtt 3.1.1 topics and spark plugins topics living alongside one another in the same name space and then we generally use our clients to manipulate this even further and normalize and unify okay so we i may take this value here and a value from this and put them together in a new logical area in the topic namespace okay number two spark plug b introduces the concept of a group id an edge node id and a device id and those things are part of our logical grouping for our sensor data and our spark plug b client number three we introduce support for store and forward using the spark plug b specification if i lose my connection i can buffer the data locally and then i can transmit once i reconnect we add in support for flagging topics as user-defined data types we can there are also other mechanisms in here i'm not there's a whole host of other things the spark plug i'm not highlighting here because there's no way for me to do it without basically boring the out of everybody we add in support for compression additional support for compression and we remember most important what is spark plug b4 it's really for creating edge of network devices in our topic namespace okay so for every spark plug b connection that you have in your ecosystem you have an edge of network device a logical edge of network device that groups everything together okay that's it and it could run on the io yes and it could run on the i o hub all right good thank you to easy vpn for sponsoring september 2021 video content and this video here you should go check out easyvpn at easyvpn.online what i have here is the this is a an appliance made by easyvpn they so they do industrial vpn technology similar to toxibox very similar technology they use an appliance instead of purely software based but they also have software that you can deploy in containers for their vpn technology plus their io hub technology io their io hub technology has full docker support it is an iiot platform for solving problems supports opc ua supports mqtt supports res supports many many many many many many industrial technologies and protocols the beauty of this this device here which is the easyvpn iox1 which is this this appliance right here costs 780 with the i o hub on board the i o hub you'll access it through a web service through the appliance and then you can configure mqtt clients payloads mqtt to mqtt there's a broker that runs on this device this is a excellent edge of network device developed by easyvpn we are going to be doing a lot more content on this device here over the coming month but this video is sponsored by easyvpn if you want to check them out at easyvpn.online this is a new technology by these guys we had an opportunity to take a look at this they engaged with us very early in their go to market strategy it's amazing and there are many people in the community who are going to want this right away to replace for example raspberry pi's running on their demo boards or raspberry pi's running on their edge of network nodes okay again thank you to easyvpn now let's get to the video
Info
Channel: 4.0 Solutions
Views: 3,378
Rating: undefined out of 5
Keywords: intellic integration, walker reynolds, intellic, iiot, industry 4.0, digital factory, digital transformation, sparkplug, mqtt sparkplug b, what is sparplug?, sparkplug c, sparkplug a, mqtt, what is mqtt?, what is opc-ua?
Id: -9vMAe7P25A
Channel Id: undefined
Length: 21min 22sec (1282 seconds)
Published: Wed Sep 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.