Lcdproc client to display sabnzbd infos

Got a program that plays well with SABnzbd? Share it here!
Post Reply
Elfish
Newbie
Newbie
Posts: 6
Joined: November 10th, 2010, 6:46 pm

Lcdproc client to display sabnzbd infos

Post by Elfish »

Hello,

i discovered sabnzbd a few weeks ago.
since i got a headless server, i got myself a 20x4 lcd display to show some stats.
lcdproc provides a server which is connected to the lcd display.

i wrote a client in pure tcl to display some infos. if u need any help feel free to ask...
basicly there are 2 screens:

- detailed info on about the item that is downloaded atm
- infos about your entire queue

edit the script to change settings...

requirements:
- tcl 8.5 (might work with 8.4 aswell)
- tcl packages: http, json, tls
- working lcdproc (i used the latest (0.5.3) for my testing, older versions should work aswell)

here's vid, what the screens will look like.
sorry for the shitty vid.

http://www.youtube.com/watch?v=9KiQeR-S_H4

changelog:

v0.1
- initial release

Downloads:

v0.1
http://www.mediafire.com/?31nndd7d2qfhbcn
Last edited by Elfish on November 10th, 2010, 7:19 pm, edited 1 time in total.
dbznokia
Newbie
Newbie
Posts: 11
Joined: July 13th, 2011, 7:04 am

Re: Lcdproc client to display sabnzbd infos

Post by dbznokia »

This is exactly what I've been after. How do you get this to work? When I try to run under Ubuntu 11.04 I keep getting the following error:

Code: Select all

$ ./lcd_sabnzbd.tcl
can't find package json
    while executing
"package require json"
    (file "./lcd_sabnzbd.tcl" line 113)
I thought TCL\JSON support was included in Ubuntu?
Elfish
Newbie
Newbie
Posts: 6
Joined: November 10th, 2010, 6:46 pm

Re: Lcdproc client to display sabnzbd infos

Post by Elfish »

hi,

you need to install the tcllib
there should be a package in the ubuntu repos.
dbznokia
Newbie
Newbie
Posts: 11
Joined: July 13th, 2011, 7:04 am

Re: Lcdproc client to display sabnzbd infos

Post by dbznokia »

Thanks for the reply but I'm still having issues. I've tried executing normally and using sudo. Error is:

Code: Select all

sudo ./lcd_sabnzbd.tcl
can't find package dict
    while executing
"package require dict"
    invoked from within
"if {$::tcl_version < 8.5} {
    package require dict
}"
    (file "/usr/share/tcltk/tcllib1.12/json/json.tcl" line 11)
    invoked from within
"source /usr/share/tcltk/tcllib1.12/json/json.tcl"
    ("package ifneeded" script)
    invoked from within
"package require json"
    (file "./lcd_sabnzbd.tcl" line 113)
I've done the following installs as well with no luck:

Code: Select all

sudo apt-get install tcllib
sudo apt-get install dict
I am using Ubuntu 11.04.
Elfish
Newbie
Newbie
Posts: 6
Joined: November 10th, 2010, 6:46 pm

Re: Lcdproc client to display sabnzbd infos

Post by Elfish »

make sure u got tcl 8.5 installed
otherwise u need to install the dict package.

oh and if you decide to upgrade. dont forget to uninstall tcl8.4
dbznokia
Newbie
Newbie
Posts: 11
Joined: July 13th, 2011, 7:04 am

Re: Lcdproc client to display sabnzbd infos

Post by dbznokia »

Ok for the benefit of other newbies, this is what I had to do on a fresh Ubuntu 11.04 install to get this script to run:

Code: Select all

sudo apt-get remove tk8.4 tcl8.4
sudo apt-get install tk8.5 tcl8.5
sudo apt-get install tcllib
sudo apt-get install tcltls
It runs and the LCD changes to a blinking heart so it's at least communicating properly now. However, I am getting this error:

Code: Select all

$ ./lcd_sabnzbd.tcl
SSL channel "sock6": error: unknown protocol
SSL channel "sock6": error: unknown protocol
SSL channel "sock6": error: unknown protocol
SSL channel "sock6": error: unknown protocol
SSL channel "sock6": error: unknown protocol
^C
The other question I have is how your script handles a username and password for sabnzbd? I usually have one but removed it to test this. Would like to re-enable once I have this working.
Elfish
Newbie
Newbie
Posts: 6
Joined: November 10th, 2010, 6:46 pm

Re: Lcdproc client to display sabnzbd infos

Post by Elfish »

it's using the api key provided in your webinterface.
did u change the settings in the tcl script?

Code: Select all

# port LCDd is listening on
set config(lcddport) "13666"
# ip LCDd is bound to
set config(lcddhost) "127.0.0.1"
# sabnzbd webinterface ip
set config(sabnzbdhost) "127.0.0.1"
# sabnznd webinterface port
set config(sabnzbdport) "9090"
# sabnzbd webinterface ssl (legal values are: 0 / 1)
set config(sabnzbdssl) "1"
# sabnzbd api key
set config(apikey) "ENTERAPIKEYHERE"
# LCDd screen name
set config(clientname) "sabnzbd"
# time delay for refreshing in ms
set config(datarefresh) "1000"
# reconnect delay in ms
set config(reconnectdelay) "10000"
# path to your logfile (empty string disables logging)
set config(logfile) "~/lcd_sabnzbd.log"
# max log size in kbytes
set config(logmaxsize) "1024"
# show download+speed
set config(screenspeed) 1
# show queue:
set config(screenqueue) 1
dbznokia
Newbie
Newbie
Posts: 11
Joined: July 13th, 2011, 7:04 am

Re: Lcdproc client to display sabnzbd infos

Post by dbznokia »

Yes the api key has been entered. I am assuming the api key is for the username/password question. What about the issue with the SSL protocol error?
Elfish
Newbie
Newbie
Posts: 6
Joined: November 10th, 2010, 6:46 pm

Re: Lcdproc client to display sabnzbd infos

Post by Elfish »

are you behind some proxy or anything?
i never ran into that error before

did u try to turn off ssl in sabnzbd and in the script?
i wonder if it works then (if you didn't try it yet)
dbznokia
Newbie
Newbie
Posts: 11
Joined: July 13th, 2011, 7:04 am

Re: Lcdproc client to display sabnzbd infos

Post by dbznokia »

Yup that did the trick. Turned off SSL and it's working great now. Is it possible to run this in the background on startup?
Elfish
Newbie
Newbie
Posts: 6
Joined: November 10th, 2010, 6:46 pm

Re: Lcdproc client to display sabnzbd infos

Post by Elfish »

./scriptname.tcl &

will run it in the backround.

if u want to autostart you need a script in init.d and a symlink.
best thing would be to google for that :P

anyway, i still wonder why ssl doesn't work for you.
it worked fine on my box.

regards
dbznokia
Newbie
Newbie
Posts: 11
Joined: July 13th, 2011, 7:04 am

Re: Lcdproc client to display sabnzbd infos

Post by dbznokia »

It didn't work because it's not enabled in sabnzbd. I've actually got it running via startup applications at the moment. Works but at the expense of my other LCD scripts. I'll look into putting it in init.d. I tried to add it to the LCDd init.d script along with lcdproc but it only worked with one or the other for some reason.
Post Reply