- Loading...
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
me@my-computer:$ scp -r build/artifacts/* pi@dukepad:/opt/dukepad |
root@dukepad4:/opt/dukepad# vi run.sh
echo "Using $JAVA_HOME"
cd /opt/dukepad
$JAVA_HOME/bin/java \
-Dcom.sun.javafx.transparentFramebuffer=true \
-Dprism.verbose=true \
-Degl.depthSize=24 -Dprism.glDepthSize=24 \
-Dcom.sun.javafx.experimental.embedded.3d=true \
-Di2c.bus=0 -Di2c.address=0x68 \
-Dprism.maxvram=209717200 \
-Dprism.targetvram=100663296 \
-Xmx90m \
-Xms90m \
-DuseMag=false \
-jar dukepad.jar |
We played with a lot of different command line values (for example, for remote debugging, JMX monitoring, etc). The maxvram and targetvram values are in bytes, and indicate how much of VRAM JavaFX will use for graphics. We didn't fine tune these values, just picked something that seemed reasonable, so there might be the ability to tweak these values for better performance (although it doesn't seem to be highly likely). We set the VM heap size to 90m so as to make startup a bit better, so that instead of the VM running out of space during startup it would just start off with a big chunk of memory. The OS still has another 150MB or so to play with, which is probably excessive, but the DukePad FX app didn't require a lot of heap (a lot less than 90MB actually), so we didn't see a reason to make it really large.
If you execute this script at this point, it should start up the DukePad, with whatever applications you have in your /opt/dukepad/apps directory. A quick note, if you have any MP3 files for music or MP4 files for media or JPG files for images, then put them in /opt/dukepad/media/images, /opt/dukepad/media/movies, /opt/dukepad/media/music as appropriate. If you want preview thumbnails for movies, also include in the movies directory medianame-thumb.jpg, where medianame is the name of the media file. For example, IronMan.mp4 would have IronMan-thumb.jpg.
If you want to enable auto-start, so that when the DukePad is booted up it will automatically launch the UI, then do the followingTo enable auto-start:
| Code Block | ||||
|---|---|---|---|---|
| ||||
root@dukepad:~# nano /etc/inittab |
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
#1:2345:respawn:/sbin/getty 115200 tty1 1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1 |
Edit this file in /etc/init.d
| Code Block | ||||
|---|---|---|---|---|
| ||||
root@dukepad:~# vi /etc/init.d/asplashscreen
#! /bin/sh
### BEGIN INIT INFO
# Provides: asplashscreen
# Required-Start:
# Required-Stop:
# Should-Start:
# Default-Start: S
# Default-Stop:
# Short-Description: Show custom splashscreen
# Description: Show custom splashscreen
### END INIT INFO
do_start () {
echo "Starting Duke Pad"
/usr/bin/fbi -T 1 -noverbose -a /opt/dukepad/Duke-Startup.jpg
exit 0
}
case "$1" in
start|"")
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
# No-op
;;
status)
exit 0
;;
*)
echo "Usage: asplashscreen [start|stop]" >&2
exit 3
;;
esac
: |
Now it is time to get the code for the DukePad JavaFX
and replace with
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
This guide assumes that your Raspberry PI has "dukepad" as the host name, although of course you can use anything (including the raw IP address). The real work starts with step 3, building the DukePad software.
And finally, edit /etc/rc.local before "exit"
| Code Block | ||||
|---|---|---|---|---|
| ||||
# START DUKE PAD
nohup /opt/dukepad/run.sh > /opt/dukepad/log.txt & |
OK, now for the hardware for building the DukePad. Some of the apps require hardware setup. There are some other steps not yet documented on this wiki for setting up accelerometer support. The following two files provide all of the template for laser cutting acrylic for the body of the DukePad. There are two different thicknesses, 3mm(1/8") and 4.5mm (3/16"). We're working with Special Computing to provide pre-built kits that can be ordered. This wiki will be updated with further information as it becomes available.
We'd like to give a special thanks to the following individuals / companies for helping us out in this project, either directly or indirectly. First thanks to Eben Upton and the Raspberry PI foundation, for giving us the PI in the first place, and for taking time out to talk over with us technical details that helped us make JavaFX work well on the PI. We'd like to thank Bill at Special Computing for working with us to make available dev kits of the DukePad for customers.
Also, thanks to the PiBow for an amazing enclosure for normal raspberry PIs, and the inspiration for the design of the DukePad case. And thanks to Rich, Jasper, Alexander K, Stas, Debbie, Gary, John Yoon, and all the others who have helped in producing the hardware and software for the DukePad (and our management for supporting us in this wild JavaOne keynote idea!). We hope it will be useful to the Raspberry PI community, particularly in the Educational markets as a way for kids to learn how computers work and to fire their imaginations for those things that are not yet built, but desperately need a builder to dream them up and make them happen!