Learning IoT with Python(R) and Raspberry Pi(R)

 

 

  1. Videos
    1. About the Book: An overview of the contents of Learning IoT with Python and Raspberry Pi.
    2. 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.
      
      
    3. 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.
    4. 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.
    5. 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.
    6. 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.
    7. The while statement:T he 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.
    8. 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.
    9. 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.
    10. 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.
    11. list Lesson Part One The viewer will learn how to use the append(), index(), insert(), and remove() methods to modify the contents of a list. In addition, the viewer will learn how to return a list from a function and pass a list to a function.
    12. list Lesson Part Two The viewer will learn how to use the append(), index(), insert(), and remove() methods to modify the contents of a list. In addition, the viewer will learn how to return a list from a function and pass a list to a function.
    13. 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.
    14. Using Dictionaries: In this lesson you will learn how to add, delete, and access items in a dictionary.
    15. 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.
    16. Pickling Lesson: How to write objects to a file and how to read objects from a file.
    17. sets Lesson: How to write code which uses sets and set methods union, intersection, and minus as will as pickling is examined.
    18. 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.
    19. 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.
    20. 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.
    21. 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.
    22. 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.
    23. 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.
    24. Controlling the Hue Light Bulb: In 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.
    25. 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.
    26. 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.
    27. 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.
    28. Learning IoT Recursive Functions Lesson Part One: How to write a recursive function and the characteristics of a recursive function are discussed. A second recursive function that computes a number in the Fibonacci series is implemented. The golden ratio of Fibonacci numbers is calculated.
    29. Learning IoT Recursive Functions Lesson Part Two: A recursive function which computes the factorial, n!, of a number is written. The Bernoulli probability function is implemented which calls the recursive factorial function.