About the Book: An overview of the contents of Learning IoT with Python and Raspberry Pi.
Pickling Lesson: How to write objects to a file and how to read objects from a file.
sets Lesson: How to write code which uses sets and set methods union, intersection, and minus as will as pickling is examined.
Function Lesson: How to write a Python function that returns nothing meaningful and a function that returns more than one object. These concepts are illustrated by a program that predicts the velocity, distance traveled, and acceleration of a car from the time to go from 0 to 60 mph.
SSH Lesson: How to use SSH, the Secure Shell, to remotely control a Raspberry Pi is explained. A Python script on the remote Raspberry Pi is run that gets the humidity from a Sense HAT and a message is scrolled on the Sense HAT.
Introduction to Python objects: Five data types are introduced and the three features of Python objects- value, type, and identity- are explained. In addition, how to use built-in functions to determine the type and identity of a Python object is illustrated. It is shown how to call the methods and access the data descriptors of an object.
Printing out in Python: The nano editor is used to edit text files on many Linux distributions, including Raspbian. In this video, you will learn how to use the nano editor to create and edit Python scripts. Also, you will learn how to run Python scripts from the Terminal.
Using the nano editor: In this video, you will learn how to use the print() function to print out strings, floating-point numbers, integers, and the values of variables. In addition, you will learn how to use escape characters to print out a newline, a tab, a double quotation mark, a single quotation mark, and a backslash.
Thonny IDE to Create Python Scripts: The Thonny Integrated Developers Environment is used to create and edit Python scripts. Run Python code interactively and write, save, and run Python scripts.
Domain Name System: How Fully Qualified Domain Names (FQDNs) are resolved to IP addresses by Domain Name System (DNS) is explained. The purpose of DNS resource records, forward and reverse lookup zones, and the function of primary, secondary, and caching-only name servers is discussed.
DNS Lesson Part Two: This second video covers the steps to install and configure BIND 9 on the Raspberry Pi. You will learn how to implement the Domain Name System that is authoritative for a local domain. Troubleshooting procedure for DNS is also examined.
DNS Lesson Part Three: This third video covers additional commands to troubleshoot DNS, set a static IP address for the Raspberry Pi, SSH into a remote Raspberry Pi, configure a secondary name server with a read only copy of the zones, configuring NTP (Network Time Protocol) to synchronize names servers with a reference clock, and viewing the daemon.log to views zone transfers from the primary name server to the secondary name server.
Basic Debugging: The viewer will learn how to identify the effect of some common programming mistakes including a misspelled variable name, a missing parenthesis, and using a variable before it has been assigned a value.
The if statement: In this video, you will learn how to write an if statement to control the flow of execution. Several examples are explained including a script which demonstrates how to control a piezo buzzer using an if statement.
The if-elif-else statement: The Python if statement with more than one clause is explained, in particular, the if-else statement and the if-elif-else statement. It is demonstrated how an if-elif-else statement can be used to control a piezo buzzer.
The while statement:The Python while statement is explained, and examples of an infinite while loop, a counter control while loop, and a sentinel control while loop are given. It is demonstrated how a while statement can be used to control a piezo buzzer.
Controlling the Hue Light BulbIn this lesson you will learn how to write Python code which will turn on and turn off a Hue light bulb. The encode() method of the JSONEncoder class and the urlopen() method of the Request class will be used in the code. The light bulb will also be turned on and off in response to a change in humidity measured by the Sense HAT.
The for statement:In this video lecture, you will learn how to use a for loop to iterate over a sequence of numbers, the characters in a string, and the items in a list.
Writing and reading text files:In this video lecture, you will learn how to open a text file with write-only access and with read/write access. Humidity data is read in from the Sense HAT and written to a text file.
Using Tuples:In this lesson you will learn about tuples. A tuple is an iterable,immutable data type. How to create a tuple, the count() method and index() method, and how an item in a tuple cannot be updated are explained. A function is defined which returns a tuple, and a for loop is used to iterate through the items in the returned tuple.
Using Dictionaries:In this lesson you will learn how to add, delete, and access items in a dictionary.
Network File System:In this lesson you will learn how to install and configure the Network File System (NFS) on a Raspberry Pi. When one Raspberry Pi is an NFS client and writes to a local directory that is mounted to an NFS share on a remote Raspberry Pi, the files are stored on the remote Raspberry Pi. The humidity will be read from the Sense HAT by a Python script on the Raspberry Pi which is the NFS client and written to a remote NFS share. The file will be read by a second Python script on the remote NFS server.
The Heapsort Algorithm Part One: This video lecture discusses the heapsort algorithm and its
implementation in Python. The heapsort algorithm is a version of
selection sorting that uses a binary heap to hold the elements that
remain to be sorted.
The Heapsort Algorithm Part Two: This second video lecture on the heapsort algorithm discusses the
runtime complexity of the heapsort algorigthm and compares the runtime
complexity of the heapsort algorithm with other sorting algorithms, and an implementation with timing for sorting sample lists.
The Heapsort Algorithm Part Three: This third video lecture on the heapsort algorithm uses the heapsort
algorithm to sort a list of lists that contains humidity readings and
times into ascending order based upon the humidity values. The
humidity readings are read in from the Sense HAT emulator.
lambda expressions: In this video you will learn how to write a lambda expression in the Python programming language and will learn how lambda expressions can be used to write cleaner and more flexible code.