Installing JReceiver for use with VS2000 MP3 Player
Step 1 - Java Runtime (Version 1.4.2)
You need to have a Java runtime found from a Java SDK installed to run
JReceiver. Download and install the Java SDK from www.javasoft.com. When you have
installed this, you must set the JAVA_HOME environment variable to
point to the JRE provided with the SDK. For example this is as shown
below with Java 1.4.2
set JAVA_HOME=C:\j2sdk1.4.2\jre
Verify this is set by typing the following
%JAVA_HOME%\bin\java -version
This should show the message
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition
(build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed
mode)
Step 2 - Mysql (Version 3.23.52)
Installing MySQL
Open the zip archive containing the mysql distribution and install
using the setup application in the archive. This installs into c:\mysql.
Starting MySQL and configuring the administrator
When this is installed, run the admin application to configure the
administrator.
c:\mysql\bin\winmysqladmin
This displays a dialog box where you must enter the
administrator user name and password. If you don't use the default
password as shown here, you must remember to substitute your chosen
password for the default one where this document specifies.
Enter root as the username and password as
the password and press the OK button.
You need to restart the mysql service. Right click on the traffic light
icon in the system tray, and choose WinNT->Stop the service
and click the yes button in
the dialog box. The traffic light icon should go to red. Now you can
start the service again by choosing WinNT->Start the
service and clicking yes
in the dialog box.
After a short period of time, the traffic light icon in the system tray
should go green.
Creating the JReceiver database and user
You then need to create the database and user for the JReceiver
application. Before you can do this, you need to find out the name of
your local machine, so the JReceiver user can correctly access the
database. Type the following command and substitute the returned value
for every instance of HOSTNAME
in the following instructions.
hostname
Start up the MySQL client as the administrator
c:\mysql\bin\mysql -u root -p mysql
You need to enter the administrator's password
password
This should bring you to the mysql prompt.
mysql>
Now create the database by entering the following at the prompt
CREATE
DATABASE jreceiver;
This returns with the
following message:
Query OK, 1 row affected
(0.02 sec)
You now need to assign permissions to the database. Enter the
following commands at the mysql prompt, remembering to enter the
correct value for HOSTNAME.
Each command should return a Query OK
message.
GRANT SELECT, INSERT, UPDATE, DELETE ON
jreceiver.* TO jreceiver_app@localhost, jreceiver_app@HOSTNAME;
GRANT SELECT ON *.* TO jreceiver_app@localhost,
jreceiver_app@HOSTNAME;
UPDATE user SET Password=PASSWORD('password')
WHERE user='jreceiver_app';
FLUSH PRIVILEGES;
Now quit the mysql client using the following command.
QUIT;
Step 3 - Installing Jetty (Version 4.2.9)
Open the zip file containing Jetty and extract to c:\Program
Files. You must then set the JETTY_HOME environment variable to
this directory. For example, using Jetty 4.2.9, the following
command is used.
set JETTY_HOME=C:\Program Files\Jetty-4.2.9
Now verify that Jetty is correctly installed by starting Jetty.
"%JAVA_HOME%\bin\java" -D"jetty.home=%JETTY_HOME%" -jar
"%JETTY_HOME%\start.jar"
A number of messages appear in the window you started Jetty from,
ending with a 'Started org.mortbay.jetty.Server' message.
If a web browser window has not appeared, open a new browser and
enter the URL 'http://localhost:8080'. This should load
with a Jetty web page, and a message appears on the console
saying 'Loading JettyPage Index'.
Close the web browser and then stop Jetty by pressing Ctrl-C
in the command window. After a few more Stopping and Stopped
messages, Jetty will stop.
Step 4 - Installing JReceiver (Version 0.2.5)
Open the zip file containing JReceiver and extract to C:\Program Files.
You must then set the JREC_HOME environment variable to this directory.
For example, using JReceiver 0.2.5, the following command is used.
set JREC_HOME=C:\Program Files\JReceiver-0.2.5
Initialise the database for JReceiver using the following command
c:\mysql\bin\mysql -u root -p -e "source
%JREC_HOME%\etc\jrec_mysql.sql" jreceiver
When prompted for the password, enter the password
password
The command will complete without any messages.
To verify that the database has been correctly initialised, type the
following command.
c:\mysql\bin\mysql -u root -p jreceiver
When prompted for the password, enter the password
password
This will leave you with the mysql prompt.
mysql>
Enter the following command.
select * from user;
This should return 5 rows.
Now quit mysql.
quit;
Step 5 - Configuring JReceiver application
Edit (using notepad or some other editor)
%JREC_HOME%\etc\jreceiver.properties and change the password as shown
below.
Default version
# Datasource Configuration (used by
JREC_SERV.WAR exclusively)
#
connection.driver=org.gjt.mm.mysql.Driver
connection.url=jdbc:mysql://localhost/jreceiver?useUnicode=true
user=jreceiver_app
password=MYPASSWORD
^^^^^^^^^^
This needs to
be changed
Modified version
# Datasource Configuration (used by
JREC_SERV.WAR exclusively)
#
connection.driver=org.gjt.mm.mysql.Driver
connection.url=jdbc:mysql://localhost/jreceiver?useUnicode=true
user=jreceiver_app
password=password
^^^^^^^^^^
Change to the
password given earlier.
Save the file and exit the editor.
Step 6 - Starting JReceiver
To start JReceiver, run the start script.
"%JREC_HOME%\bin\jrec_jetty.bat"
This produces a large number of messages, finally ending with:
INFO: Initializing,
config='jreceiver.client.mgr.Messages', returnNull=true
Start up a web browser and enter the URL:
http://localhost:8080/jreceiver/logon.do
You should be redicrected to a login page. Enter admin as
the user id and admin as the password.
This will bring you to the main JReceiver page.
Step 7 - Adding MP3 files to JReceiver
Before JReceiver can be used to play MP3 tracks, you must tell it where
to search for tracks. Logon as instructed in step 6 and go to the configuration
screen. You will need to select the Roots option and add
a new root.
Enter the name of the directory where you keep all your MP3 files and
save this.
Go to the configuration screen again and this time select
the scanner option. Press the Start Scan
button to scan the directory root you just entered. The window where
you started JReceiver should show messages for each file scanned.
Step 8 - Creating a playlist
Create a simple playlist to test JReceiver by going to the playlist
page and creating a new tree playlist. In the Tree
Playlist page, press the Add New button to add a new
playlist. Enter a name (e.g. test playlist) and leave the Sort By field
blank. Click on the root pathname and select a few tracks
to add to the playlist. Save the playlist when you have done this. This
should show the playlist and the number of tunes in the playlist.
Click on the play option and the playlist should be played through a
player application. Winamp is a good application for this. This is now
playing the playlist using JReceiver!
Step 9 - Building the VS2000 MP3 Player
The VS2000 MP3 Player is provided as an example with the Software
Development Kit. There are two ways to build this application, the
first is as an eXecute In Place application, the second is as a run
from RAM application.
Building as an XIP application
Change to the MP3 Player example directory
cd %LF_HOME%\examples\mp3player
Rebuild the application with XIP enabled.
ant clean all -Dxip.enabled=yes
Download to the development card.
lfflash --flash --mode=xip
build\nondebug\mp3player.raw
Reboot the development card and the MP3 player application will start.
Building as a run from RAM application
Change to the MP3 Player example directory
cd %LF_HOME%\examples\mp3player
Rebuild the application without XIP enabled.
ant clean all -Dxip.enabled=no
Download to the development card.
lfdownload build\nondebug\mp3player.bin
Step 10 - configuring the MP3 Player
The first time the MP3 player is configured, you must enter the IP
address of the JReceiver server. Start up a web browser and enter the
URL
http://AAA.BBB.CCC.DDD
where AAA.BBB.CCC.DDD
is the IP address of the development card.
Enter the IP address of the JReceiver server in the configuration
screen and apply the change. The player should show a screen confirming
the update. Now reset the player, and if built for run from RAM, you
will need to download the application again.
When the player starts, it connects to and registers with the JReceiver
server and then displays the main player display. The JReceiver
configuration page should also show the player at the bottom of the
settings pane. Select the player and the settings for the player are
displayed.
Step 11 - using the player!
Now everything is configured, you can start using the player. The
default player screen shows the current status of the player. The
following options are available in this display.
|
Play/Pause
|
|
Previous track
|
Menu
|
Next track
|
|
Stop/Clear playlist
|
|
When you select the menu option, navigation is by using the keypad.
Soft button 1
|
Up
|
Soft button 2
|
Left
|
Go
|
Right
|
|
Down
|
|
The majority of the screens allow you to either navigate further down
(using the Go button) or play all the tracks
available from that screen.
When you select multiple tracks to add, they are added to the end of
the playlist and you return to the default screen. If you add
individual tracks, you stay on the same screen.