Weecommand Prototype 3 !
Thanks a lot for those of you helping me to develop a stable and functional Weecommand.app.bin.
Be patient for this English text. I’m Italian and my English it’s not really good. If some text needs a best explanation feel free to add a comment to this page. I’ll appreciate it much.
What does Weecomand do?
Weecomand is an application for the WDTV, Western Digital TV High Definition Media Player. If you have modified your WDTV’s firmware, you can add custom application at it. One of this is Weecommand.With Weecommand, your WDTV will be able to browse available file served fron you preferred IRC server bots, and, simply pressing Enter on your remote, WDTV will request the download of the file.
Weecommand use IRC servers and bot to download files. We use Weechat to download and not eMule/aMule because, if there is no queue on a bot , weechat will start immediately to download it, and yo can navigate to your weechat download dir and, if it’s a media file, start immediately to watch/listen it ! weechat downloads file at the max transfer rate available on your connection.
In 3 words: Browse, Choose, Watch ! Really, this is the TV-on-demand I ever looked for !!!
How to use it after setup
From Home Screen of your WDTV, select Videos.
FAQ: It’s only a design choice to start from ‘Video’. Weecommand can manage download of every kind of file (pdf, tar, zip, txt, etc…). Your WDTV will download all of them, but only Photos, Videos or Music can be played by WDTV. You, e.g., cannot watch a PDF document.
In the media list you can see the main root of my application, “Weecommand“.
It’s automatically created at startup. It’s empty. It will be filled 1 time at hour, or when you for the first time enter into it.This dir is located at /tmp/media/usb/Weecommand. So is kept if you power off your WDTV, but will be deleted after a reboot command, of you unplug power chord.
Press Ok to enter into ‘Weecommand’ dir.
So now select a bot pressing OK on it. The first list you see is a list of coupled server and channel names.
FAQ: Weecommand is configurable, see below. So it can handle multiple list per channel, multiple channel and multiple servers. It simply group every list of a channel into a single directory
If you, e.g., enter into darksin#L3Gg3ndar1, one of the pre-configured server (it’s Italian, with Italian content, but like I said before, it’s configurable). You can enter you preferred servers, channels and web lists). Choose an item and press Enter.
If it’s the first time you use Weecommand, WDTV will loads the list of the bot of configured server, directly from web, then it will create a different directory for each of bot present in the channel list
FAQ: Note: This list will be preserved after power off and/or rebooting of WDTV. This list is created into Weecomand directory (see above). Everyone of this dirs, are initially empty. I cannot recreate every time the entire disk structure in one single step, because in some channel there are something like 80 or more bots serving a minium of 100 files each one. Creating 8.000 directory will take about 10 minutes on a WDTV !!!
WDTV will create into the selected directory the list of all files server by selected bot.
FAQ: Differently from eMule or Bearshare or Kazaa-like systems, in the mirc bot you find only tested and verified file. So no fake-file downloaded and no bad impression of your wife after showing to her happy a Disney Film … but it’s really a porn !
If you’ve waited some seconds from one screen page and the next, within one hour no reload/recreating will be done, so navigating in the same path will be instantaneous !
Select what you want download and simply press OK to enqueue it into weechat. If everything is OK, WDTV will show this message.
If weechat is not running on your WDTV, Weecomand warn you to start weecommand (from a telnet or ssh session) then to retry.
Really, it’s very very very simple to use
How to download and run Weecommand
You must have a WDTV.
You must have at least an DSL line. If your line is able to really download at least at 4 Mbit/sec, OK. If you’ve a 1 Mbit/sec line, you can download file, but not watch a film while downloading it. On a 56K line… please don’t even try to download a film.
You must mod your WDTV’s firmware. See the Wiki about ext3-boot-firmware. Simply use the ext3 firmware to update the WDTV’s firmware.
You must download and copy into your usb boot pen’s root the event-osd application. Here the last version. Weecommand use the version r162 of this application to react when you enter into Weecommand directory.
FAQ: If you have a older version of event-osd, simply substitute the event-osd.app.bin into the root of your usb boot device.
You must install weechat, screen, and cron. So telnet / ssh into it and digit:
- ipkg update
- ipkg upgrade
- ipkg install weechat screen cron
FAQ: Weechat is a easy installable, easy configurable, ligth weight, IRC client. Weecommand dialogue with Weechat and Weechat will request (eventually wait) and then download from a bot the file you selected on your TV screen.
Screen is a resident-in-memory program that allow an other software to be executed into a terminal (like telnet or ssh) in a special way. It run the other software into background. After installed Screen, when launching weechat, instead of using classical weechat-curses command, digit:
screen -dmS wc /opt/bin/weechat-curses.
WDTV will execute weechat into background, so you can close your terminal without killing weechat process.
When you want to see the interface of weechat, at the prompt digit:screen -r wc
To exit from weechat without closing on your local keyboard press Ctrl+A then press D (without CTRL). Screen will keep weechat running into background.
Cron is used to execute some task about Weecomand one time at hour.
How to correctly configure Weechat
It’s mandatory that you configure weechat to use the same servers and the channels configure into Weecomand.
TIP: I suggest you to install a small editor called nano; this because pre-installed editor named vi is difficult to use if you don’t already know it (ipkg install nano).
Edit the weechat.rc file. This file is located into /.weechat/ directory, but some of us have it located into /opt/.weechat/ directory. All of following lines are very very very important. Be sure this lines are configured as shown. Certainly, this rows are only a small part of the .rc file. Be patient and search for them into .rc file. None of them are created from scratch, all of them are already into your .rc file.
irc_fifo_pipe = on
This informs weechat to listen from upcoming command from external world. Weecommand use weechat fifo pipe file to communicate to it which command to execute. Essential.
dcc_auto_accept_files = on
This tell weechat to don’t wait for user confirm before download file. Essential.
dcc_download_path = "full-and-quoted-path-to-download-dir".
It’s very important that your download dir is located into one of your usb media. Absolutely don’t leave it into default dir, because it’s located into a sub of the root and WDTV will never show you the content of root dir of a subfolder of the root dir.
FAQ: To avoid some problem due to a weechat’s bug, follow this:
- find the full path to your usb disk: For example my disk is at
- create a dir into the root of the usb disk. For example
# mkdir /tmp/media/usb/USB1/be2531ef-41e4-43e4-9722-7cf2683edca8/Weechat
- now you have the full path where to save files downloaded from Weechat. In this example
- if not present, create an empty and standard directory called media into root of wdtv. This special name allow WDTV to show you every sub dir like it was a phisical media.
# mkdir /media/
- Now create a symbolic link this to a NON-existing subdir of /media dir: For example i named my disk ‘tera’ because it’s 1 TB wide:
# ln -s /media/tera /tmp/media/usb/USB1/be2531ef-41e4-43e4-9722-7cf2683edca8
- Use the directory weechat for weechat download, but use it through the symbolic link
- find the full path to your usb disk: For example my disk is at
dcc_auto_resume = on
if a download after a while stops, you can restart the same file from the same bot and the download will restart from the point it was, without waste of time restarting to download entirely
server_name = "ServerName"
Choose a fantasy (but one-word) name for the first server you want use. To use the Italian preconfigured one configure it to “darksin”.
server_autoconnect = on
If it’s not on, you must login manually every time you start weechat
server_address = "irc.server.it"
Enter the right address of the irc server. For example, the preconfigured server ‘darksin’ has the address “irc.darksin.it”
server_username = "your-nick"
Choose a nick.
server_autojoin = "#channelName"
Absolutely the most important setting. This is the channel from which we can download the listed file. For example, the pre-configure channel is #L3gg3ndar1. (Yes, it’s a funny way to write…, so be carefully when you write these parameters)
Downloading and configuring Weecommand
Now you’re ready to download the 2 files of my application from my MediaFire free space.
this is the real application. Copy it into the root of the usb boot pen’s root
this file is used to interface my app with event-osd application. Copy it into the root of your usb boot pen’s root
Reboot your WDTV (Yes, it’s mandatory, sorry) so It can mount Weecommand as an extension of your firmware. Now edit the file /apps/weecommand/servers.ini. This file include detailed instructions and four rows as example.
Weblist=Leggendari1,darksin,#L3Gg3ndar1,http://siamol3gg3ndar1.altervista.org/lista1/index.php Weblist=Leggendari2,darksin,#L3Gg3ndar1,http://siamol3gg3ndar1.altervista.org/lista2/index.php Weblist=Leggendari3,darksin,#L3Gg3ndar1,http://siamol3gg3ndar1.altervista.org/lista3/index.php Weblist=Eagle,explosion,#eagles,http://listaeagles.altervista.org/index.php
Every entry start with ‘Weblist=’
The first parameter here is a unique fantasy name for this list. It’s mandatory that every name it unique.
The second parameter is the server name. it must be identical to which you configured into weechat.rc file at item server_name = “ServerName”
The third is the channel name. It must be identical to which configured at server_autojoin = “#channelName” into weechat.rc file
The last is the web address of channel content list. If your channel has divided list into more than one file, simply follow the example above and create one row for each web list. WDTV will group every list of channel into a single directory (see the second image of the how-to)
FAQ: The four web lists included into initial servers.ini are full of Italian contents.To find the web list of your preferred channel, you need to open an IRC client on your pc, and enter the channel you love. Then digit !list at the IRC client prompt. The channel will reply writing the address of its list. To be sure, enter this address into your browser, and navigate until you find a web list formatted like this one. Well, if the list you like is table -formatted, you can copy & paste the list URL into a row of servers.ini
After configured this, you must simply enter via OSD into the Weecommand dir. Weecommand will evaluate your .ini file and download every list. Will be created one dir for each server|channel couple, and into this dirs will be created a list of ALL available bot from ALL the lists of this channel. See image 3 from the How-To above to see how does it look.
Now you can enter into a bot, choose a file and start downloading it just pressing OK.
FAQ: Weecommand is able to understand if Weechat is not running. If this is your case, Weecommand will warn you. Just log into WDTV, start weechat (use the method explained above in the section How to download and run Weecommand, start it into a screened session)
How to verify weechat is really downloading your files?
To verify if download is really started you can login via telnet or ssh into WDTV, and open weechat. Navigate to the DCC screen and you’ll se you download progress.
If not downloading, go to server screen and read some rows. Probably the bot told you that you’re enqueued, so you must only wait.
If server tell you that the command is wrong, please, copy this error and past into a comment to this post. it’s very important for me to have as infos as possible from you in case my Weecommand it’s not working on your home!
Weecommand actually is not able to handle download when filename contain ‘[' and / or ']‘. I’m already at work to work-around this bug. Thanks to ‘Rinopla’ for its bug submission.
The complete historical change-log
__ __ _ \ \ / /__ ___ ___ ___ _ __ ___ _ __ ___ __ _ _ __ __| | \ \ /\ / / _ \/ _ \/ __/ _ \| '_ ` _ \| '_ ` _ \ / _` | '_ \ / _` | \ V V / __/ __/ (_| (_) | | | | | | | | | | | (_| | | | | (_| | \_/\_/ \___|\___|\___\___/|_| |_| |_|_| |_| |_|\__,_|_| |_|\__,_| ____ _ _ _____ | _ \ _ __ ___ | |_ ___ | |_ _ _ _ __ ___ |___ / | |_) | '__/ _ \| __/ _ \| __| | | | '_ \ / _ \ |_ \ | __/| | | (_) | || (_) | |_| |_| | |_) | __/ ___) | |_| |_| \___/ \__\___/ \__|\__, | .__/ \___| |____/ |___/|_|
browse file list from IRC bot on you television and download them using your remote !
Realized from Mirko Tebaldi, also known as “REALTEBO”
June 21, 2009: Prototype 3
Fixed: improved detection of strange situation on the first running of updater
Fixed: remove a possible causes of error in hardcoded path
Fixed: remove useless download of list files
Fixed: no more exit code 100 on success of adding a download
Fixed: now forced creation of already existing sim-link to be sure they’re updated
Fixed: no more duplication of crontabs jobs
Fixed: removed some echo commands not directed to logfile
Fixed: diff output correctly redirected
Code: logging simplfied a lot and reduced, in size, a bit
Code: log is recreated after reboot, but the latest log is keeped (with .old extension)
Code: upgraded app.event to use event-osd r162
Code: changelog is now on a separated file
Added: stage 1 for customization. Created an INI file. Simply edit with care following instructions
Added: support for multi-server, multi-channel, multi-list
Added: every bot of a channel is listed under Weecommand/<server_name>|#<channel-name>/
Added: added a second stage of caching: no update of bot list if parent weblist has not changed
Added: added a third stage of caching: no update of file list if parent bot has not changed
Added: if you have only ONE channel, WDTV will not show you the list of server|channel discussed above
Added: new retrieving method for pack numbers. Ten times more fast to add file to weechat fifo!
Known-bug: unable to detect if some bot was removed from server, or if you remove one channel list from .ini. Reboot or delete it manually
June 14, 2009: Prototype 2
Code: completely rewritten, sectioned, modularized and commented
Code: improved debugging infos
Code: improved detecting method for weechat pid
Added: auto-creating of a Weecommand root directory in /tmp/media/usb using a init.d script
Added: hourly auto-updating of the botlist with cron .
Added: first stage of caching system completed.
Added: customized OSD message box on adding download
Added: detection (and warning on OSD to user) if weechat is not running
Added: detection (and warning on OSD to user) if weechat fifo is not found
Fixed: removed any useless files from the .bin before distribution
Fixed: when .weechat.rc is located on classical path the command was not perfect. Now fixed
June 07, 2009: Prototype 1.01
Fixed: file list created was the same into any dirs. (A my typo in the code, sorry)
June 06, 2009: Prototype 1
Where to ask for help
I’m online everyday into WDTV users forum. Start a thread into this section of the forum. Please prefix the title with [Weecommand and-the-version] tag.
Please attach your following file to any help request:
- /apps/event-osd/event-osd.log (if any)
I’m Italian, but on the forum you must write in English. If you want to write to me only in Italian, please use the Private Message system from the forum.
Un saluto affettuoso a tutti gli italiani,