The UPnP Media Renderer (Appendix)
Raspberry Pi configuration (cont'd)
Now save the changes and restart the network with this command: /etc/init.d/networking restart
Give an ifconfig wlan0 up
to bring up the wireless interface (don't worry if you don't see it before).
Finally you can use pi as user or add a new one (as root): adduser YOUR_USERNAME
Change the default root password with passwd root
and add you user to the main groups in your /etc/group.
- (Note 1: if you choose to add a new user be sure you can execute root commands with it. At this purpose give a look at the file ~/rasplayer/raspman.sh)
- (Note 2: the audio group in /etc/group is required for our purposes).
How to setup the Java environment to compile/run/test the source code with Apache Ant
I described a full example right here. If you want to use the traditional way instead of using Ant, remember to add all the .jar dependencies to your Java Classpath:
- Cyberlink UPnP APIs: cyberlink-core-2.1.0.jar
- XmlPull parser implementation: xpp3-1.1.4c.jar (required by Cyberlink)
- JSON APIs: json-simple-1.1.1.jar
How to enable autorun for the UPnP Media Renderer
In order to run the UPnP Media Renderer automatically at boot you must create a crontab configuration file associated to your preferred user. Give this command (as user): crontab -u $USER -e
Now add this line at the end of the file: @reboot /usr/bin/java -jar /home/rasplayer/rasplayer.jar
This will run the application in background.
- (Note 1:
$USER
is an environment variable containing the name of the current logged user) - (Note 2: Absolute paths must be included because when the command is executed, the environment variables are not yet loaded).