charcoalgray99's xsl stylesheet v1.2

Posted by: charcoalgray99

charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 12:06

These files provide a web interface to control your empeg via hijack's khttp server.

Requirements: hijack v251+, IE6 or IE5.5 + XML Parser 3.0 or Mozilla 0.9.9

v1.2 is available here.

New features in v1.2
FTP Browser
Now Playing display on home page
My Links / My Commands / My Directories are built from JavaScript arrays. Edit jscripts.js to add/edit your own links.
Optional support for empegVNC.

To enable support for empegVNC, open the jscripts.js file and comment the appropriate line near the top. Then, download empegVNC and install using the instructions here. By default, the old html display will be used.

Here's a screenshot showing the new ftp browser:


Tom
Posted by: tfabris

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 12:13

Just to clarify CharcoalGray's post here...

You do not need VNC to use this. In fact, by default, the VNC thing is disabled.

Also: To install this, use Hijack to upload the contents of this zip (with the proper subfolder structure) to the root directory of your player.

I've been testing interim builds of this for CharcoalGray, and it really works well. Quite fun.

By the way, the FTP browser might not work optimally unless you've installed the latest Internet Explorer FTP browser enhancements. And it might not let you upload to the player from the FTP broswer window until you've told IE that the http://empeg and ftp://empeg are "trusted sites". But after that, it should work OK. Works fine for me in IE6...
Posted by: loren

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 12:47

do you have to do anything special to get the "now playing" function to display a song? Mine just shows a "-".
Posted by: crazymelki

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 12:50

I have the same "." Whats about the download and stream button? How is this working?

But the other 99% is looking cool!

bye
Posted by: tfabris

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 12:58

For the Now Playing thing to work, you have to enable the Notify feature.

I forget the exact syntax in config.ini, but it's in your Hijack FAQ...
Posted by: crazymelki

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 13:05

too cool! And then the stream and download button is also working...Thanks man!

bye
Posted by: NiCKEL

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 13:08

[output]
notify=1
[hijack]
supress_notify=1
Posted by: charcoalgray99

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 15:09

Thanks Tony, I knew there was some stuff I left out.

I think most of it was covered above. I'll try to add a "enable notify" error message to the now playing section instead of what it does now.

Tom
Posted by: rjf

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 16:40

Just FYI, i added the suggested notify sections to my config.ini and rebooted the player, but I still don't get a now playing section. /proc/empeg_notify looks like:

notify_FidTime = "3450 0:03:07";
notify_Artist = "";
notify_FID = "0x3450";
notify_Genre = "";
notify_MixerInput = "PCM";
notify_Track = "9";
notify_Sound = "1";
notify_Title = "05) Not The Doctor (acoustic)";
notify_Volume = "69";
notify_L = "";
notify_Other = "";

I am using IE 6.0.2600. Also, with mozilla .9.9 the floating remote doesn't show, and under same when in the playlist page the riocar image has a bloated center section (looks fine under IE).

And finally, I like some of the stuff that is showing up in your screenshot Tom -- the ftp browser, etc. Can you tell me how to add that, or make it part of the default?

Thanks for the hard work, it looks great.

rjf&
Posted by: tfabris

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 16:46

All that stuff you listed should work under IE, assuming that the files were placed into the proper folder structure (not all in the root directory, there is an "images" subfolder and some folders under that) on the player, and assuming that Javascript is allowed to run for that web site. And assuming the player has been marked back to RO again and rebooted.

If all of the above conditions have been met, try exiting IE and restarting it.
Posted by: rjf

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 16:54

Nope, no go. I added my empeg as a trusted site under IE, so everything is enabled. I rebooted the player, restarted IE. The only thing I haven't done is reboot.

Is there some bit of info I can reap to help figure this out?

Thanks,
rjf&
Posted by: tfabris

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 16:57

And Charcoal's files are added with the proper directory structure onto the car player?
Posted by: tfabris

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 16:59

Also, do you have anything else running or configured on your home system that might stop Javascript?

For example, disabling javascript in IE, or running the PC-Cillin web-plug-in that over-compensates for pages with Javascript (I hate PC-Cillin).
Posted by: rjf

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 17:09

Yeah. So here is a listing of my root:

empeg:/# ls
bin drive0 etc index.html mnt sbin usr
default.xsl drive1 images lib proc swapfile var
dev empeg images.tar lost+found readme.txt tmp

then a list of /images:

empeg:/images# ls
default.css display_red.png fascia_top.gif rioremote
display_amber.png empeg.gif icon_play.gif show_remote.gif
display_blank.png fascia_bottom.gif icon_stream.gif
display_blue.png fascia_left.gif jscripts.js
display_green.png fascia_right.gif pix.gif

and rioremote has the right stuff in it too (shows up okay).

Where should the "now playing" show up? Front page? Where on the page?

rjf&
Posted by: rjf

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 17:12

Right, nothing else. Pure IE 6.0 (and I have Mozilla installed, and it doesn't work there either).

rjf&
Posted by: tfabris

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 17:35

What's up with the ".tar" at the end of images?

It should not be a tar file. It should be a directory with all those files loose inside of it. That's your problem.
Posted by: NiCKEL

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 18:35

The directory listing appears to have
images

In addition to
images.tar

So that may not be his problem.

Did you try adding the empeg's address to your trusted sites? The ftp goodies were acting odd for me untill I did that.

-Geoff
Posted by: rjf

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 18:37

As a subsequent post notes, the images directory is there, and the tar file I just accidently left there.

Just to make sure, I just deleted it, and no change.

rjf&
Posted by: rjf

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 18:38

Yeah, it's in my trusted list.

And in fact shows as a trusted site in the statusbar...

rjf&
Posted by: Flatline

Re: charcoalgray99's xsl stylesheet v1.2 - 27/03/2002 19:26

I couldn't get the ftp section working until I enabled both commands and removed my password protection. I still haven't gotten Now Playing to show anything besides the two little icons
Posted by: charcoalgray99

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 01:22

I haven't tested the ftp browser with a password, I doubt it will work unless IE prompts you to login.

I honestly have no idea why the now playing isn't working for you guys, sorry.

I found a hijack bug when I tried to set notify back to 0. The /proc/empeg_nofity will permanently show the last track played before notify was turned off.

Tom
Posted by: mlord

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 07:46

There's no such thing as a Hijack bug, only user bugs.

When changing config.ini, you should always reboot the player afterwards.

-ml
Posted by: crocklobster

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 08:06

Here's one. Are you browsing to http://yourempeg/ or http://yourempeg?FID=101&ext=.xml? If you don't browse to the former, you won't see the index.html I believe. (Though I could be totally off base, as I haven't loaded this on yet). I think all of that stuff you see in the screen shot is from the index.html wrapper.

Posted by: rjf

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 09:29

The former, just plain http://empeg. I get the basic screen, with the flyout remote, and various links on the side. but no ftp browser link, and no no playing text or icons.
Posted by: eternalsun

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 10:59

Charcoal,

I have to say your stuff is really cool. Is it possible to put in a non-owner mode in there? I'd like to expose the interface to some co-workers but I don't really need them mucking around with FTP, setting off random songs in my headphones and so forth. How about it? :-D

Calvin
Posted by: adavidw

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 11:00

Hey Tom,

This version still has the bug that I found in the last version and forgot to report. Basically, the code for the remote has a press on the '3' button actually sending the code for the '6' button instead. Makes it kind of hard to do text entry and stuff that way...
Posted by: tfabris

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 12:24

I thought he'd long since fixed that. I reported that one in one of the earliest releases of the XSL files...
Posted by: ellweber

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 12:56

Tom,

This is a great contribution, thanks for all of your work. I have a few questions, however

Any idea why the VNC display only works the first time I open up the page. On subsequent attempts I just get a grey block where the facia used to be. It says "Loading Java Applet" and then goes grey.

Also, should the "Now Playing" field get updated when the track changes or just show what was playing when you first open the window?

Lynn
Posted by: Draghtnod

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 14:15

how do i get that VNC thing working? the link to the install instructions doesnt work..
Posted by: wfaulk

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 16:51

Sorry. My power was out today. Try again now.
Posted by: charcoalgray99

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 21:10

a press on the '3' button actually sending the code for the '6' button instead.

Yeah, I fixed that once. It must have worked it's way back in... not sure how. It will be fixed in the next release.

Tom
Posted by: charcoalgray99

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 21:13

Is it possible to put in a non-owner mode in there?

I already do this now, a little bit. If allow_commands=0 is set in config.ini, some of the things in the playlist page are hidden, like the my commands drop-down, the remote, and the play icons.

It should be very easy to take the ftp page out, just don't upload it and remove the two links to it.

Tom
Posted by: tonyc

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 21:17

Hey Charcoal, just wanted to say that this thing is really cool, thanks for all the work you've put into it. It certainly adds to the "drool factor" especially if the person is geeky enough to comprehend the fact that you're "surfing" your car stereo. The VNC applet takes away what was my one gripe, which was the slow updating of the screen image. It's "little things" like your stylesheet (little in size, not in the work you put into it, I'm sure) add so much in the long run.

My only gripe is I that have to re-write the /proc/empeg_notify parser I wrote for one of my projects... But hey, you need to break a few eggs to make an omelette.
Posted by: charcoalgray99

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 21:22

Any idea why the VNC display only works the first time I open up the page.

I have the SAME problem. wfaulk said he had a couple ideas what it could be. I know it worked for me before I installed J2SE 1.4, but I haven't confirmed that as the cause.

I don't think it's possible to update the "Now Playing" when the track changes.

Tom
Posted by: charcoalgray99

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 21:30

Thanks yn0t_. I get a kick out of showing off that I can surf my car stereo too.

Sorry about changing the format of empeg_nofity. I did ask mark to use empeg_nofity?EXT=.js and make it an option. I'm not sure why he made it the default, but I'm sure he had a reason.

Tom
Posted by: tonyc

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 21:34

Eh, it's no biggie. It actually makes the parsing rules easier because you've got quote characters to begin and end the strings. Short term loss = long term gain.
Posted by: charcoalgray99

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 21:37

I get the basic screen, with the flyout remote, and various links on the side. but no ftp browser link, and no no playing text or icons.

It sounds like you have an older version. Is it possible you didn't overwrite index.html? I have no idea why the ftp browser link would not show up, it's just html, and I'm sure it's in there...

Tom
Posted by: rjf

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 21:41

It sounds like you have an older version. Is it possible you didn't overwrite index.html?

This is the first time I have ever installed it :-)

I will completely delete it, then reinstall it again.

Suggestion, distribute it as a plain tar file, since empeg's have tar onboard -- then we can transfer the tar to the empeg and untar it.

rjf&
Posted by: charcoalgray99

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 21:50

distribute it as a plain tar file, since empeg's have tar onboard -- then we can transfer the tar to the empeg and untar it.

I think I'll wait for the App Installer project.

Tom
Posted by: wfaulk

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 21:51

I probably exaggerated somewhat. I'm fairly confident that it's because when you end the java applet, it doesn't really get ended, and it's still attached to the VNC server somewhere. (Maybe it's just closing it's end without notifying the server?) And since the VNC server accepts only one connection at a time currently, the applet just sits and waits for it to respond.

And since you're using IE, there's not really any way to totally shut down the browser to make sure that the applet is no longer running (which wouldn't necessarily prove anything, because if it never sent a FIN packet to the server, the server still wouldn't know).

I'm not near a place where I can figure this out right now, but if someone can reproduce this problem and then log onto the empeg and run ``netstat -atup'', that would help out. (Does the empeg even have a netstat binary on it? If not, I could compile one I guess.)
Posted by: tonyc

Re: charcoalgray99's xsl stylesheet v1.2 - 28/03/2002 22:02


Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.1.3:5900 192.168.1.2:3008 ESTABLISHED 26/empegvnc
tcp 0 0 192.168.1.3:80 192.168.1.2:3007 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:3005 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:3004 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:3002 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:3001 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:3000 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2999 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2998 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2997 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2996 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2995 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2994 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2993 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2992 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2991 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2990 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2989 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2988 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2987 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2986 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2985 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2984 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2983 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2982 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2981 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2980 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2979 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2977 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2976 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2975 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2974 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2973 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2972 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2971 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2970 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2969 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2968 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2967 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2966 TIME_WAIT -
tcp 0 0 192.168.1.3:80 192.168.1.2:2965 TIME_WAIT -
tcp 0 306 192.168.1.3:23 192.168.1.2:2959 ESTABLISHED 12/telnetd
tcp 0 0 *:8301 *:* LISTEN 33/player
tcp 0 0 *:8300 *:* LISTEN 33/player
tcp 0 0 *:21 *:* LISTEN -
tcp 0 0 *:80 *:* LISTEN -
tcp 0 0 *:5900 *:* LISTEN 26/empegvnc
tcp 0 0 *:23 *:* LISTEN 12/telnetd
udp 0 0 *:8300 *:* 33/player


.
Posted by: wfaulk

Re: charcoalgray99's xsl stylesheet v1.2 - 29/03/2002 10:19

I just realized that I should have been a little more specific about when that information should have been gathered. Was that taken during the first connection or between connections or during the second (attempted) connection or afterwards?
Posted by: tonyc

Re: charcoalgray99's xsl stylesheet v1.2 - 31/03/2002 18:30

That was after:

1. Hitting the Empeg's index stylesheet and bringing up the VNC applet.
2. Closing the browser.
3. Bringing up the applet again and having it fail to load

Then I did the netstat.
Posted by: wfaulk

Re: charcoalgray99's xsl stylesheet v1.2 - 31/03/2002 18:52

Just to make sure, try doing it after you close your browser, but before you bring it up again. Then do bring it up again after you run the netstat to make sure that it fails.

Again, my guess is that IE is not really closing the Java applet. Or, perhaps, that empegVNC never sees the applet close because it's been killed abruptly (I didn't write the applet; I just ripped it out of the WinVNC implementation). The reason that it would work with WinVNC is because WinVNC would just kill the old session arbitrarily when it got the new connection. empegVNC waits for the old connection to end. Maybe I should figure out how to change that.
Posted by: TheAmigo

Re: charcoalgray99's xsl stylesheet v1.2 - 31/03/2002 21:52

I've noticed the same thing with the web server when testing this util.
Posted by: cmtempeg

Re: charcoalgray99's xsl stylesheet v1.2 - 29/07/2003 11:44

I was having the same problem. Here's what I did:

1) Download the TightVNC Java viewer from tightvnc.com (tightvnc-1.2.8_javabin.zip as of today).

2) Rename the original vncviewer.jar file (/drive0/opt/khttpd/charcoalgray99/jar/vncviewer.jar) to vncviewer.jar.orig (if you want a backup)

3) Drop the VncViewer.jar from TightVNC into the jar directory and rename to match the original jarfile's name -- case sensitive (I renamed VncViewer.jar to vncviewer.jar)

4) Modify jscripts.js (/drive0/opt/khttpd/charcoalgray99/js/jscripts.js) such that parameters which TightVNC likes are passed to the applet. The first few lines of the drawFascia(url) function (approximately line 189) should look like this:

function drawFascia(url)
{
if (useVNC == true)
{
document.write("<applet CODE=VncViewer.class ARCHIVE=\"/drive0/opt/khttpd/charcoalgray99/jar/vncviewer.jar\" WIDTH=\"300\" HEIGHT=\"93\">");
document.write("<param name=\"PORT\" value=\"5900\"/>");
document.write("<param name=\"PASSWORD\" value=\"\"/>");
document.write("<param name=\"Encoding\" value=\"Raw\"/>");
document.write("<param name=\"Restricted colors\" value=\"Yes\"/>");
document.write("<param name=\"Show controls\" value=\"No\"/>");
document.write("</applet>");
}

.... function continues, but I do not list it here.


TightVNC's applet code seems to work better than ATT's when navigating between pages, etc.

I am using J2SE 1.4 with the plugin and it's pretty solid. Just don't try to connect twice (as wfaulk has mentioned) or you will crash the vnc server and will need to restart it.

The parameters I added were just my first guesses, so other combinations will likely work also. Here are my guesses and why I chose them:

PASSWORD="" -- don't use authentication
Encoding="Raw" -- guessed based on the att java client patchfile
"Restricted colors"="Yes" -- empegVNC doesn't like 24-bit connections
"Show controls"="No" -- don't add the GUI buttons (Options, etc) to the TightVNC client applet