B4J Tutorial [IoT] Headless Raspberry Pi

During my building of a security camera for my wife's mall store and prep for projects with my personal RPi and PiFace, I quickly discovered that having a headless RPi would be nice.

What is a headless Pi you ask? One you just plug in to power and then access remotely from a tablet, phone, laptop or desktop. Now I have two RPi's which do not need a video display nor keyboard/mouse. They connect automatically to my hot spot on my iPad (acting as a router), and I created shortcut VNC connections on my Mac to both the security camera setup and my development RPi/PiFace.

How did I do this? The quick-start steps are listed below with further links to where I gathered this information:

1) Enable SSH via raspi-config
2) Configure a static IP on your RPi to connect to your router or (in my case) wireless hotspot
3) Install TightVNC on the RPi
4) Enable the Raspbian desktop to start automatically via raspi-config
5) Configure TightVNC to run automatically
6) Make sure that your computer, tablet or phone are on the same network as the RPi (not covering DDNS during this tutorial)
7) For convenience, create VNC shortcuts on your devices to easily access the RPi.
8) Once you have everything set up the way you want and working correctly, it's a good idea to clone your microSD card.

Configure a static IP:
http://www.modmypi.com/blog/tutorial-how-to-give-your-raspberry-pi-a-static-ip-address

Remotely access the RPi:
http://computers.tutsplus.com/tutor...pi-using-your-mac-pc-ipad-or-phone--mac-54603

Configure VNC to run automatically:
https://learn.adafruit.com/adafruit...control-with-vnc/running-vncserver-at-startup

Clone SD card (Mac-specific):
http://computers.tutsplus.com/artic...rds-using-the-command-line-in-os-x--mac-59911

IMG_3199.jpg


IMG_3198.jpg


IMG_3196.jpg
 
Last edited:

Mark Turney

Active Member
Licensed User
Longtime User
This may already be known by many, but just in case and to save you a few days of frustration ....

UI apps on Raspberry Pi via VNC will not display anything; yet, you won't see any errors in the debugger logs. Short explanation of why is that this type of app will not display in a virtual environment, only via an actual display connected directly to the device. If my short explanation is off, please clarify :rolleyes:.

I spent all day yesterday trying different java versions AFTER trying the recommended JDK 8u6. I also learned a heck of a lot about how to make Linux choose the default java and javac, even with multiple versions available ... so the experience, although frustrating :eek:, was valuable.

Hope this helps someone!
 
Top