更新时间:2021-07-15 17:10:53
cover
Title Page
Copyright
Full Stack Web Development with Raspberry Pi 3
Credits
About the Author
About the Reviewers
www.PacktPub.com
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
Getting Started on the Raspberry Pi
The Internet of Things
A brief look at our application
The sensor interface - perception
The database - persistence
The user interface - presentation
The application server - middleware
Setting up our Raspberry Pi
Remote access
Summary
Getting Up-and-Running with Web Development on the Raspberry Pi
The network
The web development stack
The UI - the user's first encounter
The server - the brains of the application
Client-server communication
Interfacing with external hardware
The database - adding persistence to our data
Integrating the database into our application
The overall architecture
Running a Node Server on the Pi
Introducing nodes - the server side JavaScript runtime
Installing node on the Pi
Running our first node program
Setting up a version control system
Back to our program
Installing external libraries
Developing the application server
Adding routes to the server
Starting up the server
Keeping the server running in the background
Extracting Information from the GPIO Pins
The GPIO pins on the Pi
The pin as a standalone component
The Write mode
The Read mode
Fine-tuning our control - using the GPIO command-line tools
The DHT11 sensor
Reading from the sensor
Retrieving Sensor Readings from the Server
Understanding how our node process takes readings
Modifying our server code to show sensor readings
Optimizing our server
Abstracting our sensor library code
Caching our results
Creating a Web Page to Display Sensor Data
Extending our application
Serving static files from the Express server
Building the UI's functionality
Adding client-side JavaScript
Fetching sensor readings using XHR
Visually enhancing the UI
Changing the structure of our UI
Adding style to the newly modified structure
Enhancing Our UI - Using Interactive Charts
Considerations when implementing complex features
Introducing Chart.js
Installing Chart.js
Creating our first chart
Making the server response data-friendly
Modifying the sensor dashboards to consume JSON data
Integrating sensor data into our charts
A code overview
index.js
public/index.html
public/script.js
SQLite - The Fast and Portable Database
Picking the correct tool for the job
Installation
Creating the temperature and humidity tables
Running CRUD operations
Create