Weecommand Prototype 3 !
Prologue
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.
Thanks to friends of forum.ubuntu-it.org who helped me a lot with bash coding phase, and friend of WDTV-Forum who helped with developing of bin structure, with cron, init.d and a lot of stuff.
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
Prerequisites
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 have a compatible USB to Ethernet adapter or a USB to Wifi Adapter and your WDTV MUST tell its IP on reboot. If your modded WDTV is not able to jump into LAN then ask help on WDTV user forum
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 wcTo 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
/tmp/media/usb/USB1/be2531ef-41e4-43e4-9722-7cf2683edca8
- 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
/tmp/media/usb/USB1/be2531ef-41e4-43e4-9722-7cf2683edca8/Weechat
- 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
dcc_download_path=/media/tera/weechat
- 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.
- weecommand.app.bin
this is the real application. Copy it into the root of the usb boot pen’s root - weecommand.app.event
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!
KNOWN BUG
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
—————
Working
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/weecommand/logfile
- /apps/event-osd/event-osd.log (if any)
- /apps/weecommand/servers.ini
- /.weechat/logs/<server-name>.weechatlog
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,
Realtebo
▌▖▌▞▀▖▞▀▖▞▀▖▞▀▖▛▚▀▖▛▚▀▖▝▀▖▛▀▖▞▀▌
▙▚▌▛▀ ▛▀ ▌ ▖▌ ▌▌▐ ▌▌▐ ▌▞▀▌▌ ▌▌ ▌
▘ ▘▝▀▘▝▀▘▝▀ ▝▀ ▘▝ ▘▘▝ ▘▝▀▘▘ ▘▝▀▘
Hi. Excellent work!!
I have installed it. I works fine, but when I select a file to download it doesn’t download it.
I saw the logs and everything seens to be fine.
The only thing I noticed is that
server_autojoin = “#L3gg3ndar1″
and at servers.ini is #L3Gg3ndar1
G is in capital en servers.ini
Thanks.
Please login into WDTV, open weechat (using screen -r wc if you followed my instructions) and go on darksin server page.
Then retry to start a download. And read on weechat what the server tell to you.
I forced the different capitalization to show at users that this difference seem to be significative for weechat. Also, try to make both with first G capitalized. In my WDTV everything is working also with different capitalization.
Have you verified in weechat that you are really entered into #L3Gg3ndar1 channel ? If you’re not entered into the channel, Weecommand will not be able to ask to weechat to download file from this channel
Thanks for your reply.
I checked the logfile /apps/weecommand/logfile
when I press the ok botton in order to get a file be downloaded.
Found /.weechat/weechat_fifo_1688
darksin,#L3Gg3Ndar1 */msg L3G|A|AUDIO-BOOK xdcc send sended to /.weechat/weechat_fifo_1688
EXIT with error code 0 at Mon Jun 22 19:32:23 GMT 2009
But at screen -r wc I can not see anything related to queue or something like that.
I killed the weechat en excuted manualy
/opt/bin/weechat-curses
[19:39:09] -=- You are now as known DarkSin`30054`
En tried to get the file
*/msg L3G|A|AUDIO-BOOK xdcc
Nothing happended
/msg L3G|A|AUDIO-BOOK xdcc
Noyhing happended
/msg L3G|A|AUDIO-BOOK dcc
Nothing happeded
darksin,#L3Gg3Ndar1 */msg L3G|A|AUDIO-BOOK xdcc
Nothing happeded
What Am I doing wrong? ..
Please, help me..
Thaks a lot..
The problem is here:
>/msg L3G|A|AUDIO-BOOK xdcc send
Tis mean that weecommand is unable to find the pack number.
This is a bug of weecommand p. 3: When file names contains square brackets, the grep regexp used by Weecommand fails!
I’m working to solve this problem. Thanx a lot!
Please, try with filenames don’t containing square brackets. If problem persists, send me the last portion of you logfile, from entering …
ok. I tried “L3G|A|DISCOGRAFIE|02 Bon.Jovi.L3G.rar”
DCC says:
*** –>> Failed [ ] 0% 0.00 MB / 681.89 MB (0.0 KB/s)
/apps/weecommand/logfile:
Entering into /tmp/media/usb/Weecommand/darksin|#L3Gg3Ndar1/L3G|A|DISCOGRAFIE|02
Entered into Filename ‘Bon.Jovi.L3G.rar’
Retrieving chanlist row with file ‘Bon.Jovi.L3G.rar’ served by bot ‘L3G|A|DISCOG
Pack number: #7
Command to send: darksin,#L3Gg3Ndar1 */msg L3G|A|DISCOGRAFIE|02 xdcc send #7
Looking for weechat_fifo_1689
Found /.weechat/weechat_fifo_1689
darksin,#L3Gg3Ndar1 */msg L3G|A|DISCOGRAFIE|02 xdcc send #7 sended to /.weechat/
EXIT with error code 0 at Tue Jun 23 08:00:31 GMT 2009
/.weechat/weechat.log:
[2009-06-23 01:02:03] FIFO pipe is open
[2009-06-23 01:02:10] WeeChat 0.2.6.2 (compiled on Apr 19 2009 19:02:29)
[2009-06-23 01:02:11] Connecting to server irc.darksin.it:6667…
Thanks
I think the problem is with the file name.
I have found this error in darksin.weechatlog log
I think the problem is weechat can not create the file “L3G|A|DISCOGRAFIE|01.Bon.Jovi.L3G.rar” because of the special character (“|”) in it.
Incoming DCC file from L3G|A|DISCOGRAFIE|01 (94.23.50.49):
Discografia.Completa.Renato.Zero.L3G.rar, 1468276684 bytes
WeeChat Error: DCC: unable to write local file
DCC: file Bon.Jovi.L3G.rar (local filename:
/tmp/media/usb/USB2/44C5-A5C1/download/irc/L3G|A|DISCOGRAFIE|01.Bon.Jovi.L3G.rar)
received from L3G|A|DISCOGRAFIE|01: FAILED
L3G|A|DISCOGRAFIE|01 (legend@DarkSin-2B137368.ovh.net): **
Closing Connection: Unable to transfer data (Connection reset by peer)
MSG(L3G|A|DISCOGRAFIE|01): xdcc send #17
Now it is working!!!
The problem was that I can not specify a real directory in dcc_download_path (weechat.rc) I must set a link like /tmp/media/usb/SAMPLE
but there is a problem: after a reboot everything inside /tmp/media/usb/SAMPLE won’t be there.
Thanks for your help..
I really like you application..
Rinopla
I have configured my WDTV like this:
I have my usb disk (NOT THE BOOT PEN) at this path:
/tmp/media/usb/tera
I then linked this path to a NON-EXISTING dirname into /media
ln -s /tmp/media/usb/tera /media/tera
in the root of tera i created a ‘Weechat’ directory so i set
dcc_download_path=/media/tera/Weechat
try in this way
sorry, but it’s a weechat’s bug, not a mine.
Entering into /tmp/media/usb/Weecommand/darksin|#L3Gg3ndar1/L3G|A|ApPz|01/160000.basi.karaoke.rar/, mode thumb, at Sat J$
Entered into Filename ’160000.basi.karaoke.rar’
Retrieving chanlist row with file ’160000.basi.karaoke.rar’ served by bot ‘L3G|A|ApPz|01′
Pack number: #1
Command to send: darksin,#L3Gg3ndar1 */msg L3G|A|ApPz|01 xdcc send #1
Looking for weechat_fifo_3309
ERROR 200:\n not found !!!!
EXIT with error code 200
I can not find this file fifo to edit … where should I look for excuses noise
If you cannot find fifo is because Weechat is not running. execute weechat and retry
but do apologize if the command
wc-screen dms / opt / bin / WeeChat-curses
you should not start
Feel free to write in Italian. Write me at mirkotebaldi @ yahoo . it
The syntax for launching weechat is
screen -dmS wc nice -n 19 /opt/bin/weechat-curses
Forgive my English but use a translator.
I could not even tell if you say the settings you set in the file are weechat.rc default or be made from scratch and then where do I save the download, I have to create a folder outside nell’hd finally connected I can not precisely find the folder WeeChat but where should I try using ssh
Forgive my ignorance, I’m working hard to assure the maximum you
Feel free to write in Italian. Write me at mirkotebaldi @ yahoo . it
Ottimo progetto, complimenti all’autore
Seems like you are a real pro. Did you study about the matter? *lol*
Hi,
i think it is a brilliant idea. Is this project still alive?
Are there any plans to port this to wdtv LIVE?
I must totally rewrite these scripts to adapt them to weechat new version, and to adapt to laterst release of wdlxtv but i’ve not planned to do it.
One day i’ll do, and i’ll update this forum.
sorry, but when i finished this app.bin, weechat team released the new version, and so my weecommand is totally uncompatible with new version of weechat.
one day i’ll do this work.