Rick's b.log - 2010/05/08 |
|
It is the 24th of November 2024 You are 3.133.145.17, pleased to meet you! |
|
mailto:
blog -at- heyrick -dot- eu
There are three ways to access the command line. The first is the advanced tools part of the graphical user interface (hereafter called the "UI"). It has "awesome" factor, name me anything else that lets you prod its innards right there on the telly. Now look carefully at your remote control. Can you really envisage typing out commands using that? No? Me neither.
That leaves ethernet. Most modern computers have an ethernet socket. If you are British, it is the one that looks like a bigger version of the plug on the other end of your telephone (i.e. the bit that plugs into the phone, not the wall). If you are American, it looks like a phone socket. If you are something else or confused, it may be any number of cryptic weird symbols that is supposed to represent a network. Easiest advice, look at that big socket on the back of the OSD in the middle. Now find one that looks like it on your computer...
The screenshots/instructions assume you are running the "OSDng" firmware.
Once you have your OSD plugged into the network, the final thing you will need to know is your OSD's IP address. You could ask your router, but it's just as easy to ask the OSD. Just look in Tools → Settings → Network ... that means from the base menu of the OSD's interface, go to the Tools option, select the Settings option, then choose the Network option. What you see will look something like this:
If you do not have any wired networking on your PC, then set the OSD to say the following:
Note that WiFi interfaces, while using TCP/IP networking, are distinct to the wired network, so it is perfectly possible to specify a fixed IP address for the OSD to talk to, while using WiFi for all your internet needs. Actually, that is exactly what I'm doing right now!
Here's a photo of a back-to-back connection. The OSD is directly connected to my computer, and the other box is a video capture box (for the screenshots). All of this is on the living room table.
DHCP, in case you weren't aware, is the protocol by which a computer is automatically assigned an IP address at connection time. Most low-speed dial-up modem internet access works like this, and most WiFi access works like this too.
However, if we want to talk to it, there is a big caveat, as explained by pfft2001 on the Neuros forum:
[if this paragraph seemed like gibberish, I'll summarise: static IP good, DHCP bad. ☺]
All being well, you should see:
You should login, if for the first time, using the user name root and the password pablod
When you're in, it will look like:
Once you're logged in, simply issue the command
Wouldn't it be nicer to get a slightly more detailed report for everything at once?
Possible!
At the command line, simply issue the command
The two entries at the end are the important ones. I can tell, just at a glance, that my SD card (3.7Gb, so it'll be a 4Gb card) has a paltry 32.6Mb free space, in other words it is full. My USB device (7.5Gb, so it is an 8Gb flash key) has a whopping 6.7Gb free, with only 10% used. I can record stuff on this...
Pay attention to the /dev/blahblah stuff on the left, because...
Enter the "umount" command. You see, "mount", well, mounts devices. It's like mounting a horse really, you stick in your SD card and you tell the machine to sit on it. Actually, the sitting on part happens automatically on the OSD so you don't need to worry about that part. But to unsit on the horse, you need to unmount it.
Remember I said remember the slash-dev stuff from above? You'll need to tell the u(n!)mount command what to unmount by specifying a device, namely:
Nothing will appear to happen. Don't worry, Unix is like that too. Don't expect cute "it is now safe to remove..." messages. That would be too much like friendly. But if you issue the df -h command again, you'll see it no longer listed.
Now you can remove the device... safely.
If you wish to see the status, namely the title of the current song, just ask:
Here's a look at all of this in action:
Kawaii-Radio plays Japanese music, with a heavy emphasis on animé tunes. If that isn't your thing, you could always try:
How to find the information for a radio channel...
It will look like this:
xmms2 is capable of handling WMA, WAV, Ogg/Vorbis, MP3, MPEG audio (as in DVDs), MP4/AAC, FLAC, and reading ID3 tags, plus popular playlist files (.m3u, .pls...).
xmms2 has a number of playlist features that are woeful when accessed through the UI. I will discuss these at a later time.
Seriously. That's it!
Wait - why not just pull the power cord? There's a simple reason for this. You wouldn't pull the plug on your computer would you? Doing that could corrupt your harddisc and cause all sorts of chaos.
Using the OSD, you can assign filenames to recordings, so not only do recordings assume a logical filename (instead of either osd or osd-with-date-suffix), but when looking at the schedule you know immediately what is what...
Sadly there is (yet?) no way to interrogate or edit the schedule database via telnet.
If you're used to the likes of the DOS/Windows system, you'll need to know a few commands. The first is:
If you enter:
The left nonsense is the file permissions. You can mostly ignore this, except for the leftmost character, which is d for a directory (folder), l for a hard link, s for a symbolic link, and - for a file.
But wait, what's that arrow-something-else all about?
Wanna have some fun? You can symlink files too. There's a clever bit of software called "Busybox" that does a myriad of different things depending on what you call it. So try:
Thing is, if you just do:
There's nothing wrong. You are in the
In order to break out, try:
Grew up with DOS? Forget all about it. Under Unix there is no C: and D: and your CD-ROMs won't ever be E: and your SD cards won't be G:.
Here's a crash course to where you'll find stuff:
Give the following commands:
You should see something more or less like this:
Move your cursor (using the arrows) until the blinking cursor is below the speech marks at the end of the word "/media/" on the second line.
Move down to the blank line under "server.follow-symlink" and press Enter once, to add a blank line. Move up so what you write next will follow on from the previous stuff.
Your modified file should look like this:
Now go down. Down, down, off the screen (it will scroll) until you reach the line where everything else is set to "application/octet-stream".
Press Esc, then type in exactly:
You'll be back at the command prompt. There are two more commands to go. The first is:
Finally, issue:
Now point your browser to the OSD...
Time to fix this.
This modification installs software which can alter critical parts of a FAT based device.
The first step is to install the
This file should be placed in the
If your OSD is online, the following should do it:
If your OSD is not online, or the above gives weird errors, then download it to your computer as normal. Copy it to the root folder of a USB flash device. Put that flash device into your OSD, then:
You're not quite ready, the OSD will refuse to run it. To fix this, say:
The final part of the puzzle is to set up some symlinks. I'm not sure what the purpose of these is, exactly, but it isn't hard to do...
Okay, you're done. Time to test drive it. If you give the options -v -n, it will simply look (and not alter anything) and report verbosely.
However, please note that this requires memory for indexing context and content, so if you hit it with a big device, it will fail...
It seems to be okay with smaller devices, say 4Mb and under, even if cluttered. To check out those large ones, you'll need to use your desktop machine. If you fancy a fun and frivolous weekend, you can install a complete live working copy of Ubuntu on to a USB device (or SD card, in my case!) and get your computer to boot from it. Geek points a-plenty for that exercise! All that to check out a storage device? Well, why not? It beats reading forums for the day...
This last little exercise is especially impressive as we've cobbled together a precompiled executable for an ARM-based version of Linux within our OSD, and got it to work.Neuros OSD - geeky tips and tricks
The topic today is a selection of tips and tricks you can perform using the Neuros OSD...
Yoo-hoo! Talk to me baby...
For a lot of this, we'll need to access the command line of the OSD. If you aren't a card-carrying geek of some description (yikes! why are you reading this b.log if you aren't a geek!? ☺) then it's pretty much like "the DOS prompt", not that rugrats whizzing around Windows7 and totally pwning their hapless parents will ever appreciate the arrangement of pixels that spells out the C:\> prompt...
The second way is via the serial port. It is a basic 115kbit 8N1 link with no handshaking whatsoever. Don't worry if that meant nothing, we're not touching it. Serial link will be useful in the future for some specific boot-up fiddling that is invoked before the operating system proper, but given that an ever-increasing number of computers don't even have a serial port, we'll forget about it for now.
There are several ways you can connect this to your computer, all of which are beyond the scope of this article. The simplest is an ethernet router running a DHCP server - you ought to be able to get one of these for around £20 - but note that plugging the OSD into your ADSL box may well do the exact same thing!
The later "Arizona" firmware should be broadly similar, I cannot say about "Torfu" (the original firmware, your OSD may have had this when shipped... it may still...).
Talk to me - on a budget
You can talk to your OSD with nothing more than a cross-over network cable. Simply set up your OSD to use a fixed IP address, in Tools → Settings → Network. Press the right arrow button to Configure network, then choose Specify a static IP address (advanced).
If you already have a wired network, you will need to slot the OSD into the existing setup. This is beyond the scope of this article.
If you are unsure of this networking stuff, ask a local friendly geek - it's dead easy to set up a way to get your OSD and your computer talking (in other words: if you get charged anything at all, it should be no more than the cost of a jar of Nescafé...).
About the OSD and DHCP
[this section added 2010/09/05]
Your OSD can work with DHCP where getting the OSD on-line is little more than "plug it in".
Let me add that even though your router does give out DHCP addresses (I say this because I don't think there are any routers commercially available that don't), you should always configure the OSD to have a fixed IP address. This is because (AFAICT) the OSD doesn't broadcast a recognizable "NETBIOS" name - so if you set it up with dynamic IP, you may not be able to find it from the other machines on your LAN.
In other words, if you don't know to OSD's IP address, it could be complicated to discover it. It is much better to run the device with a fixed IP address so you will always know where to access it.
Yoo-hoo, actually talk to me!
On Windows, go to the Command Prompt (or press Windows+R to open the "Run" dialogue) and issue the command:
Password:
BusyBox v1.6.1 (2009-05-21 23:20:05 PDT) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
~ $Change your password NOW!
That the Neuros' default password is pablod is not a secret. If you have the OSD hooked to an intranet router (in other words, to your own computer(s) and nothing else), then this may not be so important; however if your OSD is on an ADSL box, its security and safety are less assured, especially with a known default password and a device that announces exactly what it is...
Changing password for root
New password:
Retype password:
Password for root changed by root
~ $Free space?
When you use the UI, if you Play.Browse you will see a hard-to-read (as in white on lightish-blue) bar showing the free space on the chosen device, be it SD card or USB key. I mean, like this:
and this:
Filesystem Size Used Available Use% Mounted on
none 15.5M 4.0k 15.5M 0% /boot
/dev/hda1 120.3M 77.4M 36.7M 68% /boot/external
/dev/loop0 43.0M 43.0M 0 100% /boot/new_root
/dev/loop1 9.7M 3.2M 6.0M 35% /boot/new_root_storage
/new_root 43.0M 43.0M 0 100% /
/dev/loop2 1003.0k 213.0k 739.0k 22% /mnt/OSD
tmpfs 256.0k 52.0k 204.0k 20% /mnt/tmpfs
/dev/hda1 120.3M 77.4M 36.7M 68% /mnt/tmpfs/mount_CF-card
/dev/mmcblk0p1 3.7G 3.7G 32.6M 99% /mnt/tmpfs/mount_SD-card
/dev/sda 7.5G 751.8M 6.7G 10% /mnt/tmpfs/mount_USB
~ $Device dismount
You can just pull out the USB device, or SD card. But if you end up with damaged files, that's your bad luck. It is always better to dismount the device. The fancy-GUI way is to highlight the device in Play.Browse, press the Xi key and select Eject.
This, of course, presupposes you have a TV on, you are able to change to the OSD's output, you can find the remote...
Now, of course, you might be thinking "if it is a command to unmount, why is it called umount and not unmount?". Very good question. The answer? Because Unix is like that. (the brand of Debian Linux running on the OSD is basically a modern-day Unix-alike) It will drive you insane for the want of one letter.
So the command to unmount the USB making it safe to remove is
Radio? Piece of cake...
Well, not so much radio as internet radio. But in a nutshell, if it is on Shoutcast, it can be on your OSD.
While OSDng contains a Shoutcast player, I found the player to be somewhat lacking (limited choice of channels, not to mention frequently hanging). But fear not, there's an easier option!
Just issue the command:
Accordingly, you can stop the music with:
Note that the status is not entirely correct. The time counts up from when you started playing, and the "of" is always zero. But at least you can see what's playing.
Added http://server3.kawaii-radio.net:9000
~ $ xmms2 play
~ $ xmms2 status
Playing: [stream] Iwasaki Taku - Kou no Kodou (Angel He...: 02:11 of 00:00
Playing: [stream] Mitsuru Hongo - Bus ha Yuku Yuku Yume...: 06:13 of 00:00
Playing: [stream] Yuzuki - you - Visionen im Spiegel (H...: 09:54 of 00:00
Playing: [stream] Utada Hikaru - Beautiful World (Evang...: 10:16 of 00:00
http://scfire-dtc-aa02.stream.aol.com:80/stream/1013
http://chill.wavestreamer.com:8062/
The simplest way, if it is bookmarked on your PC, is to look for the link information in your player (I use WinAMP). This is usually available under something like "Edit bookmarks".
Otherwise, go to the Shoutcast website and look for interesting stations. You see those little yellow "Tune in!" buttons?
Right-click the button and "Save target as" (or similar wording) to save the resultant file to your harddisc. This is important, for if you just click it, your .pls
handler will most likely load and tune to that channel automatically.
Go to where your downloads are kept, right-click the file (they're always called "tunein-station.pls
") and open it in Notepad (you may need to "Open with..." and choose Notepad.
[playlist]
numberofentries=1
File1=http://69.162.101.49:8000
Title1=(#1 - 94/100) AnimeNfo Radio | Serving you the best Anime music!
Length1=-1
Version=2
And there you have it, http://69.162.101.49:8000
- just pass that to xmms2.
Reboot your OSD
There's an option to do this somewhere in the UI, but to be honest it is so much simpler to telnet in and say:
Well, the thing is once you are using the CF card you are using an actual mounted filesystem instead of simply reading things from Flash. Moreso when using OSDng which resides entirely on read/write storage as a proper filesystem. Don't forget, of course, that a CF card is like a flashised form of an IDE device. So don't assume, just because it is a little thing stuck in your OSD, that is isn't a vulnerable device.
Shut down responsibly.
Schedule sanity
One thing that really bugs me is a lot of equipment offers a schedule, but remarkably little equipment offers a way to tell what the schedule is.
Consider:
15/05/2010 20:59 - 22:01 [weekly]
13/05/2010 22:59 - 00:01 [weekly]
13/05/2010 21:29 - 22:01 [weekly]
10/05/2010 20:59 - 22:01 [weekly]
08/05/2010 20:59 - 22:01 [weekly]
08/05/2010 17:59 - 18:46 [weekly]
What's wrong? Well, what day is the 10th? What time is it? Okay, now what is it?
Walk around the filesystem (the painful way)
Telnet in, start looking. ☺
drwxrwxr-x 1 root root 1.1k Jan 1 1970 bin
drwxrwxrwt 7 root root 160 Jan 1 1970 boot
drwxr-xr-x 2 root root 1.0k Jan 1 1970 dev
drwxr-xr-x 4 1000 1000 1.0k May 8 16:10 etc
drwxrwxr-x 1 root root 4.6k Jan 1 1970 lib
lrwxrwxrwx 1 root root 11 Jan 1 1970 linuxrc -> bin/busybox
drwx------ 2 root root 12.0k May 8 16:03 lost+found
lrwxrwxrwx 1 root root 16 Jan 1 1970 media -> /mnt/tmpfs/media
drwxr-xr-x 3 root root 1.0k Jan 1 1970 mnt
drwxr-xr-x 3 root root 1.0k May 8 17:11 opt
dr-xr-xr-x 72 root root 0 Jan 1 1970 proc
drwxr-xr-x 2 root root 1.0k May 8 16:11 root
drwxr-xr-x 2 1000 1000 1.0k May 8 16:10 sbin
drwxr-xr-x 10 root root 0 Jan 1 1970 sys
lrwxrwxrwx 1 root root 14 Jan 1 1970 tmp -> /mnt/tmpfs/tmp
drwxr-xr-x 5 1000 1000 1.0k Jun 16 2009 usr
lrwxrwxrwx 1 root root 14 Jan 1 1970 var -> /mnt/tmpfs/var
~ $
Then are numbers and something that'll probably say "root" twice. Ignore this, it's ownership information, not really relevant on the OSD.
Next, the file size. If in 'pretty' form, it will be a managable number followed by k for kilobytes or M for megabytes.
Then follows the date. The start of Unix time is the 1st of January 1970, so files that pretty much don't have a specific time will say this.
Finally, the name of the item in question. Remember, Unix is case sensitive so while "windows", "Windows" and "WINDOWS" may be the same thing on a DOS/Windows computer, it would be three different things on a Unix machine.
Ah... There, my friend, is a symlink (hard or symbolic link). If you've grown up used to the DOS system, this will be new to you. In a nutshell, if you look at the example above you will see that var is followed by /mnt/tmpfs/var which means that if you go to the var directory, you'll be magically teleported to the /mnt/tmpfs/var directory instead.
/root
directory, and it's empty. You are root, /root
is your home, where you go to when you log in. That's what the wiggly line (~) means.
ls
No. There is only /. That slash is God. From that point lays forth the entire filesystem. It doesn't matter if it is split across partitions or harddiscs (not uncommon) or devices or even networked to the far side of the planet. Hell, it doesn't even have to be in anything even remotely like the same physical format, never mind logical (disc) format. So long as it has files and folders and is understood by the operating system, it all comes to rest under the mighty slash. End of.
/
In the beginning there was lightslash./bin
Essential user programs everybody needs access to. /boot
Start-up stuff. This is so not a playground. /dev
Unix sees the world through "devices". They're all in here. Most of them aren't
real, just a way to interact with the driver of said device. /etc
System-wide configuration stuff. Being Unix, they named it after et cetera
instead of something logical like, oh, I dunno... config? /lib
System libraries (for /bin and /sbin). /lost+found
To do with disc integrity scanning (like "scandisk", only it actually works). /media
Mount points for removable media, USB cards and the like.
(it is actually a symlink into...)/mnt
Temporarily mounted filesystems go here. /opt
For "optional" software. The OSD UI is in here. /proc
Like /dev, this is a non-real filesystem that is supposed to provide information
on the system as text files... but they're all empty files. It is in /sys now. /root
Your 'home' directory. /sbin
Essential system programs. /sys
Complex yet informative "virtual" filesystem describing the hardware, the
processes, and so on. /tmp
Temporary files. /usr
A place to stuff user data and programs so's not to clutter up the
base system. Contains: /usr/bin
User programs, the unessential ones. /usr/lib
Libraries for user programs. /usr/sbin
Systems programs, the unessentials... /var
Log files, lock files, status files, and all sorts of variable randomness. Walk around the filesystem (the pretty way)
For looking around, for "seeing what's there", and generally being nosy, you can do better. How about a web server that lists the contents of the directories? Actually... not difficult...
vi lighttpd.conf
server.document-root = "/media/"
server.port = 80
server.errorlog = "/dev/null"
server.follow-symlink = "enable"
mimetype.assign = (
".asc" => "text/plain",
".asf" => "application/vnd.ms-asf",
".asx" => "application/vnd.ms-asf",
".avi" => "video/x-msvideo",
".flv" => "video/x-flv",
".gif" => "image/gif",
".html" => "text/html",
".htm" => "text/html",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".m4a" => "audio/mp4",
".m4b" => "audio/mp4",
".mov" => "video/quicktime",
".mp3" => "audio/mpeg",
".mp4" => "video/mp4",
".mpeg" => "video/mpeg",
".mpg" => "video/mpeg",
- lighttpd.conf.orig 1/39 2%
Press i once. Nothing will appear to happen, but you are now in insert mode.
Press Delete until the word media is gone, and you are left with a single slash character.
Enter, exactly:
server.document-root = "/"
server.port = 80
server.errorlog = "/dev/null"
server.follow-symlink = "enable"
dir-listing.activate = "enable"
mimetype.assign = (
".asc" => "text/plain",
".asf" => "application/vnd.ms-asf",
".asx" => "application/vnd.ms-asf",
".avi" => "video/x-msvideo",
".flv" => "video/x-flv",
".gif" => "image/gif",
".html" => "text/html",
".htm" => "text/html",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".m4a" => "audio/mp4",
".m4b" => "audio/mp4",
".mov" => "video/quicktime",
".mp3" => "audio/mpeg",
".mp4" => "video/mp4",
".mpeg" => "video/mpeg",
- lighttpd.conf 1/40 2%
Go and delete those words. You dont want "application/octet-stream", you want text/plain, so type that in instead. It will now look like:
"" => "text/plain"To look at what we actually did...
Why does that last one matter? Because for octet streams, you will be offered a download prompt. It is a pain to download, find, and load a script when you just want to read it. By setting the type to text/plain, we are saying to the browser "just show me this". And so it does...
If you happen upon clicking an application, what happens next depends upon your browser. Some will try to show it, some will override the type specified and offer up the "save as" dialogue.
If it looks like gibberish, most likely with the word "ELF" buried in the beginning, it is probably an executable. You can't really read that (well, you can, but there's no point) so hit the back button and pick something else!
FAT device verification
One of the annoying things about the OSD is that it has no built-in way to check the integrity of DOS-based filesystems. I say annoying because anybody who uses FAT devices will know that Scandisk is worse than useless, while Chkdsk does let some rather nasty stuff pass - my favourite is a mismatch of the free space map, so Windows will tell you you've got gigabytes free, while everything else will tell you you've got six megabytes free.
USE IT AT YOUR OWN RISK.
dosfsck
program. Now, if you don't trust me, you should look for the Debian-etch version for the ARM architecture. Then work out how to get it out of a .deb file (for the OSD has no .deb installer).
Or you can download it from here! ☺
/sbin
directory. There are two ways, depending on whether or not your OSD is online...
wget http://www.heyrick.co.uk/blog/files/dosfsck
cp dosfsck /sbin/
cd /sbin
ln -s dosfsck fsck.vfat
For example:
will result in this:
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID " "
Media byte 0xf8 (hard disk)
512 bytes per logical sector
32768 bytes per cluster
6304 reserved sectors
First FAT starts at byte 3227648 (sector 6304)
2 FATs, 32 bit entries
483328 bytes per FAT (= 944 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 4194304 (sector 8192)
120752 data clusters (3956801536 bytes)
63 sectors/track, 128 heads
8192 hidden sectors
7736320 sectors total
Checking for unused clusters.
Checking free cluster summary.
/dev/mmcblk0p1: 82 files, 119709/120752 clusters
dosfsck 2.11 (12 Mar 2005)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "MSDOS5.0"
Media byte 0xf8 (hard disk)
512 bytes per logical sector
4096 bytes per cluster
34 reserved sectors
First FAT starts at byte 17408 (sector 34)
2 FATs, 32 bit entries
7818752 bytes per FAT (= 15271 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 15654912 (sector 30576)
1954578 data clusters (8005951488 bytes)
63 sectors/track, 255 heads
0 hidden sectors
15667201 sectors total
malloc:Cannot allocate memory
/sbin $
The second (8Gb USB) device is more advanced, offering 4K clusters, but with the downside that there's now 1,954,578 - considerably more! And your OSD has how much memory?
Now, there are a myriad of potential problems as the version of Linux in the OSD runs to around 20Mb, while a real ARM install of Debian runs to 100Mb more than that. So as you can see, a lot of stuff has been pared out of the OSD's version.
That said, there's several thousand software packages. I've got one to work, what will you pick? Begin your adventure! (don't forget, ARM builds only!)
No comments yet...
© 2010 Rick Murray |
This web page is licenced for your personal, private, non-commercial use only. No automated processing by advertising systems is permitted. RIPA notice: No consent is given for interception of page transmission. |