HowTo

From Digisaster
Jump to: navigation, search

Howto: Use fsck.cgi

  1. Start your browser and use this address --> http://kiss_IP
  2. Go to the modules section and select e2fsck module
  3. In the E2FSCK MODULE you have to press link in the bottom of the page
  4. In the E2FSCK PREPARE you have to press on link in the bottom of the page
  5. It appear the html message its time to send me a PM
  6. Close your browser
  7. Telnet to kiss and use these commands:
cd systempart
killall httpd
killall ftpd
umount /hdd
./fsck -x 32000 -X /systempart/bmcache -pvf /dev/discs/disc0/part2

After that all is done, reboot the player from the frontpanel

Howto: Run fsck from shortcut on your PC with Tera Term 2

I've made script that runs fsck on your kiss hdd. It runs via telnet with a program called Tera Term and its depending on the great Martin B FW with telnet and fsck.

To get this working you need:

  1. Tera Term 2.3 installed on your computer
  2. Fsck and reboot tools in your /systempart folder on your DP-558 (The tools can be copied from in /hdd/stage2/bin folder)
  3. A /systempart/bmcache folder on your DP-558
  4. A Tera Term macro/script file that runs fsck:
    1. Copy this to notepad and save it as a *.ttl file (eg fsck.ttl) replacing kiss-ip with the ip of your kiss:
show -1
connect 'kiss-ip'
setdlgpos 200 200
statusbox 'Connecting to DP-558...' 'Kiss fsck'
wait '/ #'
statusbox 'Preparing fsck...' 'Kiss fsck'
sendln 'cd /systempart'
wait '/systempart #'
sendln 'killall httpd'
wait '/systempart #'
sendln 'killall ftpd'
wait '/systempart #'
sendln 'umount /hdd'
wait '/systempart #'
sendln './fsck -x 32000 -X /systempart/bmcache -pvf /dev/discs/disc0/part2'
statusbox 'Running fsck...' 'Kiss fsck'
wait '/systempart #'
sendln './reboot'
statusbox 'Fsck finished, restarting DP-558...' 'Kiss fsck'
Pause 5
closett
    1. you can leave out the closett at the end of the file if you want to leave the telnet window open - to enable you to see the output of the fsck
  1. A shortcut that starts the Tera Term macro/script file
    1. You start the script with ttpmacro.exe (found in the Tera Term install folder)
    2. Shortcut example: "c:\program files\ttermpro\ttpmacro.exe fsck.ttl"

Howto: Set protection on Stage2

TELNET / FTP

  1. Telnet to kiss
  2. Type in "passwd" so you set a password for root
  3. Test this password by typing in "login" and see if this work
  4. Add the following lines to inetd.conf to password protect FTP/TELNET:
ftp stream tcp nowait root /bin/ftpd ftpd -b -H -w -E
telnet stream tcp nowait root /sbin/telnetd telnetd -l /hdd/stage2/bbox/login 

HTTP / KML

When you protect HTTP, your local stage2 KML-page won't work !!!

To enable password protect HTTP, remove "protect/" from the first line and it should result in the following:

/:admin:admin
To make the changes active you have to restart the inetd. 

Type "top" to get the PID# of inetd 
Type kill -1 <PID # of inetd> to restart the service 

Howto: KiSS as remote player

winamp

With this cgi you can stream whatever is playing on your PC's winamp to your KiSS player. Using the PC's mouse and life playlists makes listening to your audio finaly a pleasure (and your KiSS the promised media player).

What you need on you PC:

  1. Winamp
  2. SHOUTcast DSP Plug-In for Winamp
  3. SHOUTcast Server

What you need on your KiSS:

  1. martinb stage2 firmware
  2. CGI code is already included as of stage2RF! (nothing to do here)

Using it (Do everything only on your PC, no need to turn on TV):

  1. Start winamp with DSP plugin (default port 8000, default password: changeme)
  2. Start the Shoutcast server
  3. Browse to http://kissip/cgi/shoutplay.cgi to start the KiSS media player. (Note: Nothing but the main menu will be visible on TV)

The interface is very basic, but so far worked fine for me. Suggestions improvements welcome, I can update the code.

Current issues:

  1. The kiSS mediaplayer stores 15 sec of music, therefore not really live.
  2. When nothing is being played, the connection stops, and has to be re-started once you are playing again.

xmms (Linux)

It took me some time to figure this out but the streaming also works on my Debian Linux box using the XMMS player.

Good change you can get this working on Ubuntu the same way.

First install the packages

icecast-server
xmms
xmms-liveice

The configuration files

In the /etc/icecast/ directory you find the icecast-server configuration files all with extension .dist.

Copy (or move) all those files -without- this extension to activate them

(you need to be root for this or use sudo):

# cp /etc/icecast/icecast.conf.dist    /etc/icecast/icecast.conf

Do the same for the other files.

The access control horror

So you think you got it set up and now you can't get access to your icecast admin webpage.

For my workstation at internal IP 192.168.2.5 I did two things to make this work:

1) /etc/icecast/icecast.conf Lookup server_name part and edit as needed, note for this example I used my local workstation IP:

#hostname disabled
port 8000
port 8001
server_name 192.168.2.5

2) /etc/hosts.allow Here I enabled access to the icecast 8000 port for my workstation (127.0.0.1) and my local network '192.168.2.*':

8000: 127.0.0.1 LOCAL : ALLOW
8000: 192.168.2.

Now restart your icecast server and try to access your admin page:

# /etc/init.d/icecast-server restart

and point your webbrowser to:

http://127.0.0.1:8000/admin

streaming.. & encrypted passwords sooo easy

Well if you know it -then- its easy the big amount of text in the configuration file '/etc/icecast/icecast.conf' is confusing.

Look up the 'Server passwords' part in the '/etc/icecast/icecast.conf' file.

This is what I used for my local experiment to get xmms-liveice to be able to connect to the icecast server:

# tGTqNUb YXjIENHpFiRV2
encoder_password YXjIENHpFiRV2
admin_password   YXjIENHpFiRV2
oper_password    YXjIENHpFiRV2

How does this work ?

  • ) Most important REMOVE ALL CHARACTER AFTER THE PASSWORD, ALSO THE COMMENTS, EVERYTHING!!

The plaintext password in this example is 'tGTqNUb'.

This is the password which I did put in the xmms-liveice plugin.

The 'YXjIENHpFiRV2' part is the crypted password set for all icecast access.

Again.. do not put any character behind this password, no comments, nothing or it will not work.

You can generate your own password with:

makepasswd -crypt

This will output a random password followed by the encrypted password.

Note: the default password 'hackme' also work donno, but only if you remove the -complete- ' # hackme' comment part.

Again restart your icecast-server, see command above.

xmms-liveice plugin settings

So at this stage you should have access to your icecast admin page and have an encrypted passwords setup :P Now the last part, the xmms-liveice plugin. For me xmms did crash many times before I did figure this out.

This is what I think made it work:

  1. Audio format tab

Be sure to fill in the 'Executable name:' field for lame e.g. /usr/bin/lame (or where you did install lame)

  1. Server tab

For my experiment I used:

Server address: 127.0.0.1
Server port: 8000
Encoder Password: tGTqNUb
check the 'Use x-Audiocast Headers checkbox
Fill in a Stream Mountpoint e.g.: /mystream.mp3

Ok now apply your settings and enable the plugin.

Start playing a playlist and check if you see your stream appear on the icecast admin page:

http://127.0.0.1:8000/admin?mode=sources

Note if the stream is there you should be able to connect to it (finally ;)

For my experiment I pointed a webbrowser on another Linux box on my network to:

http://192.168.2.5:8000/mystream.mp3

The last step to your Kiss DP-558

If the above works, you can finally try to get your stream on your Kiss DP-558 player. Startup your webbrowser and point it to:

http://<your_kiss_player_ip>/cgi-bin/shoutplay.cgi

Then click the "Play with cmdplayer" button.

Watch some messages going by and the stream should play :P

// The other button "Play with MediaPlayer" did not work for me.

// Ah I remember 1 last thing I have a firewall running on my box (192.168.2.5), so I had to enable access to port '8000' for my local network.

// Not all stuff is this hard on Linux. This 'icecast-server' is just an old package. The newer 'icecast2' package does install much better. But I could not make this new 'icecast2' server work with my Kiss DP-558 player.

Howto: Samba mounting windows and linux shares

I found an kiss compiled version of smbmount (from http://www.jacek.it.pl/kiss/smbfs/ )

I tried it yesterday and managed to play files direct from my FreeBSB box without the need for any streaming server software. It works to windows shares too.


Make sure you have the stage2 firmware first (or you wont get past step 1)

To install :

  1. telnet into your kiss player
  2. cd /hdd/stage2/bin
  3. wget http://www.task10.com/kiss/smbmount.tar.gz
  4. tar xvzf smbmount.tar.gz
  5. rm smbmount.tar.gz
  6. You can easily edit the mount script by using the cgiscript supplied with the phase2 firmware
http://<IP-Address>/cgi/edit.cgi?.submit=&action=open&filename=/hdd/stage2/bin/smbmnt.sh 

Make sure that you correct the following:

  1. the IP address
  2. the sharename
  3. the username
  4. the password

If you want to access a passwordless windows share use the following options /hdd/stage2/bin/smbmount //192.168.0.1/share /hdd/video/mnt -o username=guest,guest


Add the following to the initscript

http://<IP-Address>/cgi/edit.cgi?.submit=&action=open&filename=/hdd/stage2/initscript 

/hdd/stage2/bin/smbmnt.sh 
WAIT /bin/klcd SMBMNT 

Reboot or run the following command, ignore all the errors... it still worked for me 
/hdd/stage2/bin/smbmnt.sh 

To browse the files in your share just go into the menu, 2nd option down "Harddisk" the pick "Video files" and then go into "mnt"

Howto: smbclient with autoinstall (Stage2RF)

install:

go to webconsole click on update click on update.cgi type in "smbup" and press enter create a mountpoint dir (for example type in "mkdir /hdd/stage2/mnt") you need to insmod smbfs (so type in "insmod smbfs" within telnet

the usage for smbmount is:

./smbmount //192.168.20.2/public /hdd/stage2/mnt -o username=guest,password=pass


==========================> here is the original part, needs update when stage2_rh is released


I found an kiss compiled version of smbmount (from here)

I tried it yesterday and managed to play files direct from my FreeBSD box without the need for any streaming server software. It works windows shares too.

Make sure you have the stage2 firmware first (or you wont get past step 1)

To install:

cd /hdd/stage2/bin
wget http://www.task10.com/kiss/smbmount.tar.gz
tar xvzf smbmount.tar.gz
rm smbmount.tar.gz

You can easily edit the mount script by using the cgiscript supplied with the phase2 firmware:

Make sure that you correct the following:

  1. IP address
  2. Sharename
  3. Username
  4. Password

If you want to access a passwordless windows share use the following options:

/hdd/stage2/bin/smbmount //192.168.0.1/share /hdd/video/mnt -o username=guest,guest

Add the following to the initscript (http://nnn.nnn.nnn.nnn/cgi/edit.cgi?.submit=&action=open&filename=/hdd/stage2/initscript):

/hdd/stage2/bin/smbmnt.sh
WAIT /bin/klcd SMBMNT

Cool reboot or run the following command, ignore all the errors... it still worked for me

/hdd/stage2/bin/smbmnt.sh

To browse the files in your share just go into the menu, 2nd option down "Harddisk" the pick "Video files" and then go into "mnt"

Howto: Change the FTPD

cd /hdd/stage2/bin
mv ftpd ftpd.org
wget http://url_to_server_with_ftpd/ftpd
chmod 777 ftpd

Howto: FTP(Filezilla settings)

You have to adjust/check this setting in Filezilla when transfering files:

  1. Edit, Settings
  2. File transfer settings
  3. ASCII/Binary, Default transfer type has to be BINARY!!!

Howto: Basic CGI

Use Linux LF and not Windows CR+LF in your CGI scrips...

Do you use Windows? Then maybe you will have a Windows vs Linux problem when you try your CGI scripts!

To see this "problem" for your self, do this:

  1. Copy the file ftp://<your-ip>/stage2/download.init to your Windows PC
  2. Open the file with Notepad
  3. Then you should see something like this:
#!/bin/hush#□#□ stage2 initscript download first setup□/bin/lcd INIT...
  1. The □ characters are [Enter] in Linux language (line feed = LF).
  2. You can not change them to a Windows [Enter] character (Carriage Return = CR plus a LF), then it will not work.
  3. If you write the CGI on your Windows PC, you need to convert the CRs+LFs (Windows) to LFs (Linux).


So then you can try one of these tricks:

  1. Copy and paste the □ from download.init and replace your normal Windows [Enter]
  2. Use Linux to write the file
  3. Download a editor that can convert Windows to Linux, e.g. Edit Pad Lite (but I can not guarantee that it will not destroy your computer) can do this:
    1. Open the Windows file
    2. Choose the menu Convert - To UNIX (LF only)
    3. Save the file
  4. Use this or this online converter.
  5. martinb: "I advise to use the internal editprogram > Just open your file (press the edit config link on the html menu and you know how this work) then simply delete all the lines and paste it from your "notepad" then it will work", e.g:
    1. Put your file on the 558, e.g on /hdd/stage2/htmlroot/cgi/ (or where you like)
    2. From your PC, surf to http://192.168.0.100/cgi/edit.cgi?.submit=&action=open&filename=/hdd/stage2/htmlroot/cgi/test.cgi (change the ip "192.168.0.100" to the IP of your 558 and change "/hdd/stage2/htmlroot/cgi/test.cgi" to the path and file you like to use)
    3. Not 100% that this will work in Windows OS...
  6. The most common method for transferring files between systems is to use FTP (File Transfer Protocol). This is a communication program that allows data (files) to be transferred reliably between two systems. FTP has several types or modes of transferring files: Binary, Ascii and sometimes Auto.
    1. ascii - When a file is transferred, CR/LF conversion will be performed on the file. This means files copied from Windows to Linux will have the CR character stripped so the remote copy will be in Linux text format. Files copied from Linux to Windows will have a CR inserted before each LF character so the destination copy will be in Windows text format.
    2. binary - When a file is transferred, all data in the file is transferred unchanged. The source and destination files will be exact copies of each other.
    3. Auto - This mode tries to determine if the file to be transferred is text (i.e. a script) or non-text (i.e. pdf, zip or raw data). How it determines this may be program dependent, some will look at the file contents and others will look at the file extension. If it determines it's text it uses ascii file transfer otherwise it used binary file transfer. Note: this method may not always work and could result in scripts being transferred in binary so no CR/LF conversion will be performed. So use with caution.

PS: Don't forget to do a "chmod 777 test.cgi" (change "test.cgi" to your filename) on your file, otherwise it will not work.


Form more info about CGI:

Test/use your own CGI

To test/use your own CGI, do this:

  1. FTP the cgi file to stage2/htmlroot/cgi/
  2. telnet to the kiss
  3. Do a "cd /hdd/stage2/htmlroot/cgi"
  4. type "chmod 777 filename.cgi" (this make the CGI executable)

Execute commands with exec.cgi

You can also use the command: http://ipkiss/cgi/exec.cgi if you want to execute command (I recommend to use the exec.cgi, its written in C and doesn't use much memory)


Learn more about this firmware

uClinux

uClinux 2.4.17

Here you can read more info about uClinux

UNIX for DOS users

Maybe this page can help a little bit? But please be careful with delete and remove-functions! And not all commands listed are available on the DP-558!

Handy/common commandline commands for linux

This is a list of some handy/common recipes for the command line in Linux.

We can not use all commands (yet)....but I think it's handy

Crosscompiler

If you want to install the crosscompiler I recommend these links

Busybox

busybox httpd/1.35 6-Oct-2004

Have a look for the used busybox-commands. But be aware, the implemented busybox-version is:

/ # busybox
BusyBox v1.00-pre3 (2005.05.28-19:13+0000) multi-call binary

Usage: busybox [function] [arguments]...
   or: [function] [arguments]...

   BusyBox is a multi-call binary that combines many common Unix
   utilities into a single executable.  Most people will create a
   link to busybox for each function they wish to use, and BusyBox
   will act like whatever it was invoked as.

Currently defined functions:
   [, basename, bunzip2, busybox, bzcat, cat, chmod, cmp, cp, df,
   dirname, dmesg, echo, egrep, env, expr, false, fgrep, free, ftpget,
   ftpput, grep, gzip, hush, ifconfig, insmod, kill, killall, lash,
   ln, ls, lsmod, makedevs, md5sum, mkdir, mknod, more, mount, mv,
   ping, ps, realpath, rm, rmdir, rmmod, sh, sleep, strings, sync,
   tar, telnetd, test, top, touch, true, umount, uptime, wc, wget,
   which, yes

/ #

Hush

Hush is part of the busybox.

In cvs we currently have lash, hush, msh, ash. For all size comparisons below, I am leaving BB_FEATURE_COMMAND_EDITING disabled. Enabling it will add about 8k to the size of each shell.

Also quite small (just 18k) and it has very complete Bourne shell grammar. It handles if/then/else/fi just fine, but doesn't handle loops like for/do/done or case/esac and such. It also currently has a problem with job control.

lash

Very small (adds just 10k) and quite usable as a command prompt, but it is not suitable for any but the most trivial scripting since it does not understand Bourne shell grammer. It does handle pipes, redirects, and job control though. Adding in command editing makes it quite nice as a command prompt.

msh

The minix shell (adds just 30k) is quite complete and handles things like for/do/done, case/esac and all the things you expect a Bourne shell to do. It is not always pedantically correct about Bourne shell grammar (try running the shell testscript, tests/sh.testcases, on it and compare vs bash), but for most things it works quite well. It also uses only vfork, so it can be used on uClinux systems. I just added this, so there is still room to shrink it further...

ash

This adds about 60k in the default configuration (I need to review vodz' latest update, perhaps he has made it smaller again) and is the most complete and most correct shell included with busybox. This was also recently added, and both Vladimir and I have been working on it. There are a number of configurable things at the top of ash.c as well. The Posix math stuff is currently disabled, but I intend to fix it up when I get some time.

--X3m 09:05, 29 June 2007 (CEST)