Raspberry Pi 3 Projects for Java Programmers
eBook - ePub

Raspberry Pi 3 Projects for Java Programmers

Pradeeka Seneviratne, John Sirach

Buch teilen
  1. 286 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Raspberry Pi 3 Projects for Java Programmers

Pradeeka Seneviratne, John Sirach

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Learn the art of building enticing projects by unleashing the potential of Raspberry Pi 3 using JavaAbout This Book• Explore the small yet powerful mini computer in order to run java applications• Leverage Java libraries to build exciting projects on home automation, IoT, and Robotics by leveraging Java libraries• Get acquainted with connecting electronic sensors to your Raspberry Pi 3 using Java APIs.Who This Book Is ForThe book is aimed at Java programmers who are eager to get their hands-on Raspberry Pi and build interesting projects using java. They have a very basic knowledge of Raspberry Pi.What You Will Learn• Use presence detection using the integrated bluetooth chip• Automatic light switch using presence detection• Use a centralized IoT service to publish data using RPC• Control a robot by driving motors using PWM• Create a small web service capable of performing actions on the Raspberry Pi and supply readings• Image capture using Java together with the OpenCV frameworkIn DetailRaspberry Pi is a small, low cost and yet very powerful development platform. It is used to interact with attached electronics by the use of it's GPIO pins for multiple use cases, mainly Home Automation and Robotics.Our book is a project-based guide that will show you how to utilize the Raspberry Pi's GPIO with Java and how you can leverage this utilization with your knowledge of Java. You will start with installing and setting up the necessary hardware to create a seamless development platform. You will then straightaway start by building a project that will utilize light for presence detection. Next, you will program the application, capable of handling real time data using MQTT and utilize RPC to publish data to adafruit.io. Further, you will build a wireless robot on top of the zuma chassis with the Raspberry Pi as the main controller. Lastly, you will end the book with advanced projects that will help you to create a multi-purpose IoT controller along with building a security camera that will perform image capture and recognize faces with the help of notifications.By the end of the book, you will be able to build your own real world usable projects not limited to Home Automation, IoT and/or Robotics utilizing logic, user and web interfaces.Style and approachThe book will contain projects that ensure a java programmer gets started with building interesting projects using the small yet powerful Raspberry Pi 3. We will start with brushing up your Raspberry Pi skills followed by building 5-6 projects

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Raspberry Pi 3 Projects for Java Programmers als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Raspberry Pi 3 Projects for Java Programmers von Pradeeka Seneviratne, John Sirach im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatica & Hardware. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2017
ISBN
9781786463616
Auflage
1

Integrating a Real-Time IoT Dashboard

The Raspberry Pi is great for working with sensor systems and controlling actuators in both indoor and outdoor environments. The data can be gathered from local sensors attached to the Raspberry Pi, or sensors connected to a cloud computing environment. Adafruit IO is a system that makes data useful, and it provides useful features to work with your data, such as real-time graphs and sets of UI controls that can be used to either display data from a feed or produce data for a feed on a specific topic.
In this chapter, you will:
  • Create feeds and a dashboard with Adafruit IO
  • Connect the TMP102 temperature sensor with the Raspberry Pi through an I2C bus
  • Get data from the temperature sensor through the I2C with the Pi4J library
  • Work with the Eclipse Paho Java MQTT client library
  • Publish data to the feed on a specific topic
  • Display data on the Adafruit IO dashboard
  • Subscribe to a feed to get data on a specific topic
  • Control an actuator using the Adafruit IO dashboard

Adafruit IO

Adafruit IO is a system that makes your data useful and provides easy-to-use, simple data connections. Basic programming is required to work with the Adafruit IO system, which includes client libraries that wrap its REST and MQTT APIs. Currently, Adafruit provides client libraries to work with following programming languages:
  • Arduino
  • Ruby
  • Python
  • Node.js
Still, there is no official Adafruit client library to work with Java. So, you can use the Eclipse Paho MQTT Java client to work with Adafruit IO.
You can visit Adafruit IO at https://io.adafruit.com/.

Bill of materials

To build all the projects that will be discussed in this chapter, you will need to have the following things in your tool box:
  • One Raspberry Pi 3 (SparkFun part number: DEV-13825)
  • One SparkFun digital temperature sensor breakout board - TMP102 (SparkFun part number: SEN-11931)
  • One LED
  • One breadboard-self-adhesive (white) (SparkFun part number: PRT-12002)
  • Hookup wire or jumper wire kit
  • Wire strippers

Sign in with Adafruit IO

You will need an Adafruit user account to sign in to Adafruit IO:
  1. Using your web browser, visit https://io.adafruit.com/ and click the large text button, SIGN IN TO JOIN THE OPEN BETA.
  2. On the next page, there are two options available for you. If you already have an account with Adafruit, you can use the same credentials to sign in with Adafruit IO by giving the credentials (email/username and password) and clicking on the SIGN IN button. If you don't have an account, click the SIGN UP button to create a new account.
After successfully signing in to Adafruit IO, you will navigate to the Adafruit IO dashboards page, which includes a list of dashboards. Figure 4-1 shows a section of the Adafruit IO dashboards page. The dashboards page is generally located at the (your user name)/dashboards path:
Figure 4-1: Adafruit IO dashboards page
  1. A navigation menu is located on the left-hand side of the page, and provides links to your profile, feeds, groups, dashboards, triggers, and settings.

Finding your AIO key

The Adafruit (AIO) IO key is used to authenticate your client connection with the Adafruit IO system:
  1. In the left navigation bar of the dashboards page, click the Settings menu. You will navigate to the Settings page with a set of settings associated with your Adafruit IO account, as shown in Figure 4-2:
Figure 4-2: Adafruit IO settings page
  1. Click VIEW AIO KEY under Manage AIO Keys. A pop-up window will show the AIO key associated with your account, as shown in Figure 4-3:
Figure 4-3: Adafruit AIO key
The 32-digit AIO key looks similar to this:
 c62d5f647eb44a4098ff0c46403b...

Inhaltsverzeichnis