توضیحاتی در مورد کتاب Rust for the IoT: Building Internet of Things Apps with Rust and Raspberry Pi
نام کتاب : Rust for the IoT: Building Internet of Things Apps with Rust and Raspberry Pi
ویرایش : 1st ed.
عنوان ترجمه شده به فارسی : Rust for the IoT: ساخت اپلیکیشن های اینترنت اشیا با Rust و Raspberry Pi
سری :
نویسندگان : Joseph Faisal Nusairat
ناشر : Apress
سال نشر : 2020
تعداد صفحات : 605
ISBN (شابک) : 9781484258590 , 9781484258606
زبان کتاب : English
فرمت کتاب : pdf
حجم کتاب : 11 مگابایت
بعد از تکمیل فرایند پرداخت لینک دانلود کتاب ارائه خواهد شد. درصورت ثبت نام و ورود به حساب کاربری خود قادر خواهید بود لیست کتاب های خریداری شده را مشاهده فرمایید.
توضیحاتی در مورد کتاب :
شروع به برنامه نویسی برنامه های Rust برای اینترنت اشیا (IoT). این کتاب یک کتاب مهاجرت مهارت های برنامه نویسی است که تکنیک های برنامه نویسی Rust را که برای کاربردهای اینترنت اشیا مفید هستند را به شما آموزش می دهد. شما در ایجاد مجموعه ای از برنامه های کاربردی اینترنت اشیا از سروری به توسعه برد دیگر گام خواهید برد.
در Rust for the IoT، نحوه ساختن یک سرور مدرن را یاد خواهید گرفت. برنامه با استفاده از Rust در باطن. سپس از docker و Kubernetes برای استقرار آنها در یک ابر مدیریت شده استفاده خواهید کرد. در نهایت شما از Raspberry Pi با SenseHat و دوربین برای ثبت دنیای اطراف خود و ارسال آن اطلاعات به فضای ابری استفاده خواهید کرد.
در حالی که میتوانید بدون هیچ موردی دنبال کنید. ابر یا سختافزار، برای استفاده حداکثری از آن، چند قطعه ابر و سختافزار را توصیه میکنیم که برای ادغام با نرمافزار این کتاب طراحی شدهاند. پس از مطالعه و استفاده از این کتاب، نحوه اعمال Rust را در اینترنت اشیا خواهید دید.
آنچه یاد خواهید گرفت
- یک باطن مدرن Rust را با سازگاری نهایی و تعامل از طریق رابط GraphQL ایجاد کنید
- از Raspberry PI به عنوان یک دستگاه اینترنت اشیا ارزان استفاده کنید که میتوانید به راحتی آن را در سراسر خانه مستقر کنید
- دریافت دما، ویدیو، و استفاده از جوی استیک تعاملی برای تعامل با نرمافزاری که ایجاد کردهاید
- از OpenCV برای انجام تشخیص چهره از دوربین PI و ذخیره آن اطلاعات در فضای ابری استفاده کنید.
- نمودارهای فرمان قابل استقرار را برای ابر ایجاد کنید و برای دستگاه ISOهای کاملی ایجاد کنید که به شما امکان می دهد به راحتی آن را مستقر کنید. نرم افزار سفارشی سیستم عامل Pi
این کتاب برای چه کسی استشما باید حداقل درک اولیه از توسعه برنامه های کاربردی ابری و اصول اولیه Rust داشته باشید. کد نویسی این کتاب برای کسانی است که به IoT و Raspberry Pi علاقه دارند یا با آن کار می کنند و می خواهند یاد بگیرند که Rust چگونه می تواند برای آنها کار کند.
فهرست مطالب :
Table of Contents
About the Author
About the Technical Reviewer
Acknowledgments
Preface
Chapter 1: Introduction
Who Is This Book For?
What Is IoT?
IoT 10K Foot Picture
Why Rust?
Pre-requisites
Components to Purchase
Goals
Source Code
Web Application
Board Application
Basic Rust
Rust Origins
Command Line
Modules
Microservices
Embedded
Learning Rust
Installing Rust
Hello World
Writing in Rust
Variables and Data Types
Borrowing and Ownership
Memory
Reference and Dereferencing
Traits
Typemap
Cargo
Feature Flags
Creating a Release
Summary
Chapter 2: Server Side
Goals
Microservice Architecture
Why Microservices?
Backend Design
Database Design
RESTful Endpoints
Deploying
Docker
Web Framework
Choosing a Web Framework
Start Up Basic Iron
Hello World
Redirects
Response Codes
Parsing Parameters
Params Parsing
URL REST Parsing
JSON Parsing
Routing
Middleware
Logging Middleware
Timer Middleware
Database with Diesel
Getting Started
Configuring the App
Creating the Database Tables
Generating the Database with Docker
Docker Running Containers
Stopping Docker
Starting Docker
Running the Generation Scripts
Schema File
Basics
Inserting
Deleting
Querying
Using Enumerations
Diesel Derive Enum Crate
Relationships
Using a UUID
Integrating with Our Application
Diesel Write Your Own Middleware
Implementing the Connection Pool
Adding the Middleware
Adding a Method to Request
Diesel Middleware
More Web Framework
Command-Line Parameters
Error Handling
Loggers
Summary
Chapter 3: File Uploading and Parsing
Goals
Parsing Image Data
EXIF
Kamadak EXIF
Data Structure
Reading the Image
Parsing Data Types
Parsing GIS
Parsing Video Data
Mp4Parser
Our Data Structure
Reading the Video
File Uploads
Upload File
Saving the File
Creating the Metadata
Upload File
Send Data to Retrieval Services
Storing the Metadata
Update the Database
Update the Structs
Parse the Incoming Data
Save the Data
Summary
Chapter 4: Messaging and GraphQL
Goals
GraphQL
Problems with REST
GraphQL to the Rescue
Query
Mutations
Subscriptions
Playground
Juniper
Setting Up Juniper
Creating the Context
Setting Up the Schema
Creating a Query
Creating a Mutation
Integrating with the Iron Router
Messaging
Purpose in the IoT System
Our Design
Starting Up Local Messaging Service
Calling Messaging Service Locally
Single-Level Wildcard (+)
Multi-Level Wildcard (#)
Subscribing
Publishing
Create the Messaging Service
Subscribe to the Health Topic
Publish to the Recording Topic
Message Queue Middleware
Recording Module
Summary
Chapter 5: Performance
Goals
CQRS
CQRS Steps
Which CQRS to Use?
Event Sourcing
Implementing in Our Application
Gotchas
Setting Up Our Environment
Cargo Update
Creating Our CQRS Objects
Command and Event
Aggregator
Dispatcher
Calling Our Commanded Endpoint
Processing the Event Stream
Creating the Executor
Subscription Stream Monitor
Reading the Connection Stream
Creating Connection to Stream
Launching the CQRS Monitor Service
Run It All
Cap’n Proto
Cap’n Proto
Advantages of Cap’n Proto
Cap’n Proto RPC
Cap’n Proto for Rust
Implementing in Our Application
Installing Cap’n Proto
Define the Message
Creating the Client
Message Queue Layer
Retrieval Service Layer
Summary
Chapter 6: Security
What We Aren’t Covering
Goals
Authenticate Endpoints
Authorization vs. Authentication
OAuth 2
OpenID Connect
Applying AuthZ and AuthN
Auth0
Setting Up Auth0
Authenticating
Device Flow
Processing the Tokens
ID Tokens
Programmatically Parse
Access Tokens
Implement Authorization Check
Refresh Tokens
Securing MQTT
Certificates
Certificate Authority (CA) vs. Self-Signed Certificates
Creating Server Certificates
Generate CA Root Certificate
Message Queue Server Cert
Updating the MQTT Server
Creating Client Certificates
Creating Our New Message Queue Service
Summary
Chapter 7: Deployment
What to Deploy
Microservices
Data Services
How to Deploy
Deployment Options
Goals
Docker
What Is Containerization
Full Machines
Virtual Machines
Containers
Docker Layers
Creating Our Own Containers
Scratch Containers
Using Docker in Our Applications
Upload Service
MQTT Service
Retrieval Service
Deploying with Kubernetes
How Kubernetes Works
Pods
Nodes
Control Plane
Deploying to Kubernetes
Kubectl
Kubernetes Configurations
Namespace
Controllers
Services
Ingress
Helm Charts
What It Does
Installing Helm
Creating a Helm Chart
Templates
Release Metadata
Chart Data
Values.yaml
Mapping Our Deployments
Dependency Helm Charts
Deploy the Extra Charts
EventStore
EMQX
Sealed Secrets
Deploying Our Chart
Helper File
Secret
Upload Service
Retrieval Service
MQTT Service
Service
Ingress
Deploying Your Helm Chart
Standing Up the System
DigitalOcean
Register Your Domain
Attaching to DigitalOcean Kubernetes
Deploying to DigitalOcean
Setting Up Gitlab CI/CD Pipeline
Build Docker Images
Deploying the Helm Chart
Summary
Chapter 8: Raspberry Pi
Goals
Raspberry Pi
Create Raspberry Pi Image
Unbox the Raspberry Pi
Assembling Raspberry Pi
GPIO
OS Software
Installing the Software
Unpack the File
Wipe and Initialize the SD Card
Install Image
Final Setup Steps
Set Up Wi-Fi
Setup SSH Access
Client Application
Hello World Application
Cross Compiling
Developing the Client Application
Creating UUID
Transferring Certificates
Setting Up Arguments
Creating the Heartbeat
Keep Alive
Run from the Command Line
Summary
Chapter 9: Sense HAT
Goals
Hardware
Install
Sensors
LED Display
Frames
LED Controls
Temperature Display
Joystick Control
Creating Interactions
Tokio Async Run
Daily Runs
Joystick
Receiver
Logging In
Yup OAuth 2
Authentication Library
VisualDisplay
Entry Point Struct
Auth0 FlowDelegate
Raspberry Pi App Integration
Summary
Chapter 10: Camera
Goals
Facial Recognition
Installation
Cross
Rust Embedded – Cross Crate
Using Cross
Customizing
Open Computer Vision
Installing OpenCV
Running the Application
Capturing the Video
Displaying to the Camera
Capturing the Facial Recognition
Using Trained Cascades
Running the Cascade
Saving the Video Content
Apply Text to the Video
Saving the Image Content
Calling the Video Processing
Deploying to the Pi
OpenCV Install
Summary
Chapter 11: Integration
Uploading Video
SQLite
Design
Creating the Interactions with the Database
Adding Entry to the Database
Uploading the Video File
Sending to the Server
Marking Entry Successfully Uploaded
Marking Entry when Not Successful
Sending Commands
IPC
Packet IPC
Application
Subscribing to the Message Queue
IPC Server Side
Client Side
IPC Client
Integrating on the Video Loop
HomeKit
HomeKit Accessory Protocol (hap-rs)
Accessories
Creating Our HomeKit
Implement Generic Temperature Sensor
Implementing Temperature Sensor
Implementing Motion Sensor
Video Module
Manager Module
Homekit Module
Adding to Homekit
Summary
Chapter 12: Final Thoughts
Custom Buildroot
Provisioning the Application
Last Words
Index
توضیحاتی در مورد کتاب به زبان اصلی :
Get started programming Rust applications for the Internet of Things (IoT). This book is a programming skills migration book that teaches you the Rust programming techniques most useful for IoT applications. You'll step through from server to board development in creating a set of IoT applications.
In Rust for the IoT, you'll learn how to build a modern server-side application using Rust on the backend. Then you'll use docker and Kubernetes to deploy these to a managed cloud. Finally you will use a Raspberry Pi with a SenseHat and Camera to capture the world around you and send that information to the cloud.
While you will be able to follow along without any cloud or hardware, to make the most of it we recommend a few cloud pieces and hardware that is designed to integrate with the software in this book. After reading and using this book, you'll see how to apply Rust to the Internet of Things.
What You Will Learn
- Create a modern Rust backend complete with handling eventual consistency and interacting via a GraphQL interface
- Use the Raspberry PI to serve as a cheap IoT device that one can easily deploy around the house
- Capture temperature, video, and use the interactive joystick to interact with the software you’ve created
- Use OpenCV to perform facial detection from the PI’s camera and save that information to the cloud.
- Create deployable helm charts for the cloud, and for the device create complete ISOs that allow you to easily deploy the Pi’s OS + custom software
Who This Book Is ForYou will need to have a basic understanding of cloud application development at a minimum and the basics of Rust coding. This book is for those interested in or working with the IoT and the Raspberry Pi who want to learn how Rust can work for them.