p u t t i n g m q t t i n y o u r t o o l k i t
play

P u t t i n g M Q T T i n y o u r t o o l k i - PowerPoint PPT Presentation

P u t t i n g M Q T T i n y o u r t o o l k i t S e a n D a g u e , D e v e l o p e r A d v o c a t e , I B M t h J u l y 1 9 2 0 1 8 I n t e r a c t i o n P a t t e


  1. P u t t i n g M Q T T i n y o u r t o o l k i t S e a n D a g u e , D e v e l o p e r A d v o c a t e , I B M t h J u l y 1 9 2 0 1 8

  2. I n t e r a c t i o n P a t t e r n s C l i e n t d r i v e n q u e r i e s HTTP Client Server Data Data ? Client Server S e r v e r d r i v e n d a t a d i s t r i b u t i o n @s d a g u e

  3. R e a l T i me E v e n t S t r a t e g i e s C l i e n t P o l l i n g We b h o o k s ● ● E a s y t o i mp l e me n t R e g i s t e r c a l l b a c k U R L – – – R e a l l y i n e f fi c i e n t - 9 9 + % n o o p – N e e d h i g h l y a v a i l a b l e " c a t c h e r " s e r v i c e O n l y a v a i l a b l e f o r s e r v i c e o w n e r s – H T T P L o n g P o l l ● M Q T T / A M Q P ● K e e p H T T P s o c k e t o p e n , b l o c k o n r e q u e s t s – – H e a v y s e r v e r r e s o u r c e u s a g e – O p t i mi z e d p u b / s u b s y s t e ms We b c l i e n t s u p p o r t r e q u i r e s b r i d g i n g – We b s o c k e t s ● C o n n e c t e d s o c k e t s i n w e b b r o w s e r – @s d a g u e

  4. P u b l i s h / S u b s c r i b e D e s i g n P a t t e r n C o mmo n me s s a g e b u s ● E v e r y o n e c a n p u b l i s h t o i t – – M e s s a g e s d i r e c t e d t o t o p i c s C o n s u me r s s u b s c r i b e t o s p e c i fi c t o p i c s – ( p o s s i b l y b y w i l d c a r d ) G o o d f o r ma n y t o ma n y i n t e r a c t i o n s ● @s d a g u e

  5. Wh a t i s M Q T T ? M Q T T i s a n o p e n s t a n d a r d ● – C r e a t e d i n 1 9 9 9 b y I B M & C i r r u s L i n k , O A S I S s t a n d a r d s i n c e 2 0 1 3 M Q T T i s d e s i g n e d f o r “ s ma l l f o o t p r i n t ” a n d “ l i mi t e d n e t w o r k b a n d w i d t h ” ● M Q T T i s t h e b a c k b o n e o f a l l ma j o r P u b l i c C l o u d I o T s e r v i c e s ● G o o g l e I o T C o r e - h t t p s : / / c l o u d . g o o g l e . c o m/ i o t - c o r e / – E S P 8 2 6 6 I B M Wa t s o n I o T - h t t p s : / / w w w . i b m. c o m/ i n t e r n e t - o f - t h i n g s / – A r d u i n o w i t h b u i l t i n Wi fi ● A ma z o n I o T - h t t p s : / / a w s . a ma z o n . c o m/ i o t - p l a t f o r m – $ 9 . 9 5 a t A d a f r u i t ● M i c r o s o f t A z u r e I o T - h t t p s : / / a z u r e . mi c r o s o f t . c o m/ e n - u s / s e r v i c e s / i o t - h u b / – M Q T T h a s ma n y o p e n s o u r c e i mp l e me n t a t i o n s ● – M o s q u i t t o v e r y p o p u l a r b r o k e r – C l i e n t s b i n d i n g s : A c o u p l e d o z e n l a n g u a g e s – E v e n a n A r d u i n o l i b r a r y – P u b S u b C l i e n t @s d a g u e

  6. M Q T T M e s s a g e F o r ma t QoS Retain Topic Payload 0,1,2 0,1 220 Any content, up to 2 GB characters ● Q o S - 0 b e s t e f f o r t , 1 d e l i v e r a t l e a s t o n c e , 2 d e l i v e r e x a c t l y o n c e ● R e t a i n - c o n t e n t w i l l b e s t o r e d o n t h e s e r v e r , r e p l a y e d o n c o n n e c t , d e f a u l t s t o n o t s t o r e d ● T o p i c - n a me f o r me s s a g e , / a r e s p e c i a l ● P a y l o a d - a n y t h i n g , 2 G B p a y l o a d l i mi t N o t e : n o m e t a d a t a o n p a c k e t s ( l i k e t i m e s e n t ) , m u s t p u t i t i n p a y l o a d m a n u a l l y @s d a g u e

  7. Wh a t ma k e s a g o o d T o p i c S t r u c t u r e ? R o o t w i t h A p p N a me ● E x a mp l e : A s s u me mu l t i t e n a n c y – { a p p n a me } / { l o c a t i o n } / { d e v i c e t y p e } / { s e n s o r t y p e } F i n d a n y n a t u r a l h i e r a r c h y o f d a t a ● A l l o w s t h e f o l l o w i n g s u b s c r i p t i o n s : O p t i mi z e f o r s u b s c r i b e r e f fi c i e n c y ● – O f t e n n e e d t o r e t h i n k t o p i c s t r u c t u r e o n c e y o u my s e n s o r s / p o r t l a n d / # - s e e e v e r y t h i n g i n P o r t l a n d s e e u s a g e p a t t e r n s my s e n s o r s / + / w e a t h e r / + - s e e a l l w e a t h e r s e n s o r s T h e r e i s n o f o r ma l s c h e ma s y s t e m ● – t o p i c s t r u c t u r e e n c o d e d i n t o a p p l i c a t i o n s @s d a g u e

  8. M Q T T Wi l l s E v e n t b a s e d s y s t e m - me s s a g e s o n l y s e n t w h e n e v e n t h a p p e n s ● I f n o t h i n g i s s e n t , i s t h e c l i e n t h e a l t h y w i t h n o n e w d a t a , o r d i d i t d i s a p p e a r ? ● C l i e n t s c a s e t a " Wi l l " o n c l i e n t c o n n e c t ● a me s s a g e s t o r e d i n t h e s e r v e r t h a t w i l l b e s e n t i f t h e s o c k e t c o n n e c t i o n t o t h e c l i e n t b r e a k s – – b u i l d i n g b l o c k f o r f a u l t t o l e r a n c e @s d a g u e

  9. E x a mp l e A p p l i c a t i o n s @s d a g u e

  10. M y H o me We a t h e r S t a t i o n B i l l o f M a t e r i a l s ● 1 0 + O r e g o n S c i e n t i fi c We a t h e r S e n s o r s – – R a s p b e r r y P i 3 – n e e d s s p e c i fi c p l a c e me n t t o s e e a l l s e n s o r s R T L - S D R D o n g l e t o d e c o d e 4 3 3 M h z s i g n a l o u t o f a i r – L o n g t e r m ( 1 0 y e a r ) b a c k g r o u n d h a c k i n g p r o j e c t ● R e p o r t s t o We a t h e r U n d e r g r o u n d v i a P WS A P I ● C o l l e c t s t e mp e r a t u r e f r o m n e a r l y e v e r y r o o m i n ● t h e h o u s e E x t r e me l y u s e f u l f o r t u n i n g F o r c e d A i r H V A C s y s t e m – @s d a g u e

  11. I n e a r l y 2 0 1 7 , d i s c o v e r e d H o me A s s i s t a n t H o w t o i n t e g r a t e my w e a t h e r s t a t i o n t o t h i s ? @s d a g u e

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend