
Learn to turn a light on and off using Java on Raspberry Pi 3B+ and APIs, with practical hardware setup, jar files, and a lightweight container.
Download the latest Raspberry Pi OS image from the official site. Select the stretch image and burn it to an SD card, noting a minimum size of 8 gig.
Choose an SD card for the Raspberry Pi of at least 8 gigabytes. Prefer a 32 gig Samsung class 10 card and use Etcher on Mac to write the image.
Flash the Raspberry Pi SD card with Etcher, verify the process, and set up a headless Pi with Wi-Fi and VNC, then connect from Mac for initial configuration.
Boot a Raspberry Pi from an SD card, resize the file system, and connect to wifi. Configure security and access by changing the password, naming the Pi, and enabling VNC.
Connect a Mac to a Raspberry Pi 3 B+ via screen sharing, verify Java 1.8, and install Eclipse with Maven while updating the system with apt and dist-upgrade.
Verify the Java installation and install the arm version of Eclipse on Raspberry Pi, then configure Maven, create a hello world Java project, and validate the setup.
Install pi4j core, device, and extension jars in a Maven project, create a Java gpio controller via the pi4j factory, and blink an led on the Raspberry Pi.
Develop a remote Vert.x based REST API on a Raspberry Pi using Maven and Eclipse; build a fat jar with Maven shade, and configure a router with on/off endpoints.
Learn to control lamps with a Raspberry Pi and Java by wiring a relay and API to turn lights on or off, using green/red indicators to show build success.
Learn about IoT and Java with this Raspberry PI course.
IoT is the next big thing, grow your skills and learn about this technology combined with Java one of the most popular programming languages today.
If this course you will learn how to load a boot SD Card for the Raspberry PI 3 B+ from scratch using the Raspbian OS (Linux) on a 32Gb card, get Eclipse up and running on the PI and work with Java 8. You will understand how to use the basics of one of the most popular Java libraries for the Raspbery PI the Pi4J library.
You will also learn how to develop on other platforms like a Mac and then move the portable class files (Java compiled files) to the PI for a faster more professional development platform.
We wrap up the course by adding formal API's to the project, you will be able to Turn a Light on and off using a RESTful API to control the lights.
It would not be a a great course if you could not do something useful so we integrate an IoT Relay to Safely control 110V AC and show how to turn on and off a Green and Red Lava lamp, this would be perfect for an Automated Build system to provide a Success / Fail indication of the nightly build, exactly what every real development show needs :)
Note: All the source code for the class is available on my GitHub account and also is attached to the last lecture as a resource as a zip file.