Java Programs for the Raspberry Pi

Here are a few programs I have written in Java for the Raspberry Pi. They include a program to set static IP addresses on Pis running Raspbian Jessie, a full screen image viewer and a program to detect motion and capture images with a Raspberry Pi camera.

Javadocs for the complete library are located here and the complete library may be downloaded here. Extract the library file in your ~/bin directory and you can use the included build scripts.

All of these programs require Java 8 but that is already installed on your Raspbian running Pi.

Please direct all questions, comments, suggestions or requests to: pi at 585ranch dot com.


Intercom Program The Intercom program is a simple voice over IP intercom that will send voice data to another copy of the Intercom program.


MotionDetection Program The MotionDetection program continuously takes images with the Raspberry Pi camera and displays them on the program window. If motion is detected a green dot indicator is displayed in the upper right corner of the screen. The images where motion is detected may be captured to storage or emailed. Also, as in the photo, a composite image may be displayed consisting of the previous image and a set of blue boxes showing where motion was detected in the image.


ChatServer ChatClient

The ChatServer and ChatClient are meant to be a simple but usable chat system for closed networks such as a classroom or learning environment. The programs could both use considerable improvement and the security features are woefully inadequate for a commercial environment but the programs are functional. Several classes are used by both the client and server and so were split out into individual files.

Directions for configuration are found in the Help -> Directions menu on both programs. Currently the only way to create a file of user handles and passwords is via the Edit -> Add or Change User menu or by editing the file with a text editor. The format of the file is handle=password with each user on a separate line. The passwords are in plain text. Creating a password encryption scheme might be a good project for a programming class.

Browser Based User Management For ChatServer/ChatClient

Web Management Page A browser based user management system. Adding the command line option 'web' enables the ChatServer to continuously update the user information from the database file. This feature disables user management directly from the ChatServer program.

The browser based user management system requires apache to be running and the cgid modules to be enabled. Once apache is installed, run the command 'a2enmod cgid' to enable CGI programs to be run. Install all the perl scripts to /usr/lib/cgi-bin, change their ownership and group to www-data, and set their permissions to 750. The main user interface HTML page is 'manage.html'. The others are information pages to display a confirmation or an error message. Install all the HTML pages to /var/www/html and set their ownership to 'pi'. Change the permissions on all the HTML files to 644.


ARP Program The ARP program presents the output of the arp command on a Java component. The program automatically adjusts the size of the component as the data displayed changes.