万本电子书0元读

万本电子书0元读

顶部广告

Hands-On MQTT Programming with Python电子书

售       价:¥

74人正在读 | 0人评论 6.2

作       者:Gaston C. Hillar

出  版  社:Packt Publishing

出版时间:2018-05-22

字       数:30.6万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:此类商品不支持退换货,不支持下载打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Explore the features included in the latest versions of MQTT for IoT and M2M communications and use them with modern Python 3. About This Book ? Make your connected devices less prone to attackers by understanding security mechanisms ? Take advantage of MQTT features for IoT and Machine-to-Machine communications ? The only book that covers MQTT with a single language, Python Who This Book Is For This book is for developers who want to learn about the MQTT protocol for their IoT projects. Prior knowledge of working with IoT and Python will be helpful. What You Will Learn ? Learn how MQTT and its lightweight messaging system work ? Understand the MQTT puzzle: clients, servers (formerly known as brokers), and connections ? Explore the features included in the latest versions of MQTT for IoT and M2M communications ? Publish and receive MQTT messages with Python ? Learn the difference between blocking and threaded network loops ? Take advantage of the last will and testament feature ? Work with cloud-based MQTT interfaces in Python In Detail MQTT is a lightweight messaging protocol for small sensors and mobile devices. This book explores the features of the latest versions of MQTT for IoT and M2M communications, how to use them with Python 3, and allow you to interact with sensors and actuators using Python. The book begins with the specific vocabulary of MQTT and its working modes, followed by installing a Mosquitto MQTT broker. You will use different utilities and diagrams to understand the most important concepts related to MQTT. You will learn to?make all the necessary configuration to work with digital certificates for encrypting all data sent between the MQTT clients and the server. You will also work with the different Quality of Service levels and later analyze and compare their overheads. You will write Python 3.x code to control a vehicle with MQTT messages delivered through encrypted connections (TLS 1.2), and learn how leverage your knowledge of the MQTT protocol to build a solution based on requirements. Towards the end, you will write Python code to use the PubNub cloud-based real-time MQTT provider to monitor a surfing competition. In the end, you will have a solution that was built from scratch by analyzing the requirements and then write Python code that will run on water-proof IoT boards connected to multiple sensors in surfboards. Style and approach This book shows you what MQTT is, and how to install and secure an MQTT server. You will write Python 3 code to control a vehicle with MQTT messages, test and improve, then monitor a surfing competition with cloud-based real-time MQTT providers.
目录展开

Title Page

Copyright and Credits

Hands-On MQTT Programming with Python

Packt Upsell

Why subscribe?

PacktPub.com

About the Author

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

Installing an MQTT 3.1.1 Mosquitto Server

Understanding convenient scenarios for the MQTT protocol

Working with the publish-subscribe pattern

Working with message filtering

Understanding the MQTT puzzle – clients, servers, and connections

Installing a Mosquitto server on Linux

Installing a Mosquitto server on macOS

Installing a Mosquitto server on Windows

Considerations for running a Mosquitto server in the cloud

Test your knowledge

Summary

Using Command-Line and GUI Tools to Learn How MQTT Works

Subscribing to topics with a command-line tool

Subscribing to topics with a GUI tool

Publishing messages with a command-line tool

Publishing messages with a GUI tool

Unsubscribing from topics with a GUI tool

Learning best practices for topics

Understanding MQTT wildcards

Learning about the different QoS levels

Working with at least once delivery (QoS level 1)

Working with exactly once delivery (QoS level 2)

Understanding overhead in the different Quality of Service levels

Test your knowledge

Summary

Securing an MQTT 3.1.1 Mosquitto Server

Understanding the importance of securing a Mosquitto server

Generating a private certificate authority to use TLS with Mosquitto

Creating a certificate for the Mosquitto server

Configuring TLS transport security in Mosquitto

Testing the MQTT TLS configuration with command-line tools

Testing the MQTT TLS configuration with GUI tools

Creating a certificate for each MQTT client

Configuring TLS client certificate authentication in Mosquitto

Testing the MQTT TLS client authentication with command-line tools

Testing the MQTT TLS configuration with GUI tools

Forcing the TLS protocol version to a specific number

Test your knowledge

Summary

Writing Code to Control a Vehicle with Python and MQTT Messages

Understanding the requirements to control a vehicle with MQTT

Defining the topics and commands

Creating a virtual environment with Python 3.6.x and PEP 405

Understanding the directory structure for a virtual environment

Activating the virtual environment

Deactivating the virtual environment

Installing paho-mqtt for Python

Connecting a client to the secured MQTT server with paho-mqtt

Understanding callbacks

Subscribing to topics with Python

Configuring certificates for IoT boards that will work as clients

Creating a class to represent a vehicle

Receiving messages in Python

Working with multiple calls to the loop method

Test your knowledge

Summary

Testing and Improving Our Vehicle Control Solution in Python

Processing commands with Python

Sending messages with Python

Working with the network loop with Python

Working with last will and testament with Python

Working with retained last will messages

Understanding blocking and non-blocking code

Using the threaded client interface

Test your knowledge

Summary

Monitoring a Surfing Competition with Cloud-Based Real-Time MQTT Providers and Python

Understanding the requirements

Defining the topics and payloads

Coding a surfboard sensor emulator

Configuring the PubNub MQTT interface

Publishing data retrieved from sensors to the cloud-based MQTT server

Working with multiple MQTT servers

Running multiple clients

Building a web-based dashboard with freeboard

Test your knowledge

Summary

Solutions

Chapter 1: Installing an MQTT 3.1.1 Mosquitto server

Chapter 2: Using Command-Line and GUI Tools to Learn How MQTT Works

Chapter 3: Securing an MQTT 3.1.1 Mosquitto Server

Chapter 4: Writing Code to Control a Vehicle with Python and MQTT Messages

Chapter 5: Testing and Improving our Vehicle Control Solution in Python

Chapter 6: Monitoring a Surfing Competition with Cloud-Based Real-Time MQTT Providers and Python

Other Books You May Enjoy

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部