• 1
  • 63
  • 64
  • 65(current)
  • 66
  • 67
  • 107
[RELEASE] Official XBMC boblight Addon
I can try to add it to the config creator but I have to read into devic first.
Reply
(2013-12-25, 13:41)hannemann Wrote:
(2013-09-19, 16:11)TeKo Wrote: You can create a 2nd boblight.conf for movies with hardcoded blackborders.

But that would man that you have to restart boblight everytime you switch from zoomed to normal.

I am searching for a solution on the same problem.
I have a second boblight.conf and wrote a script that copys the config file to /etc/boblight.conf and restarts the daemon. But it seems that the addon has to be restarted also.
Does anyone know if it is possible to activate/deactivate an addon via command line?
I've found a solution for my Setup.

On my machine the Boblight starts to flicker if i restart boblightd several times.
A new configuration for boblightd and a restart of the daemon does not apply immediatly. A restart of the addon solves that issues. It is possible to start/stop an addon via jsonrpc.

On Linux you can use
Code:
curl -s -H "Accept: application/json" -H "Content-type: application/json" -d '{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","id":1,"params":{"addonid":"script.xbmc.boblight","enabled":false}}' http://localhost:8080/jsonrpc
The JSON looks like
Code:
{
    "jsonrpc":"2.0",
    "method":"Addons.SetAddonEnabled",
    "id":1,
    "params":{
        "addonid":"script.xbmc.boblight",
        "enabled":false
    }
}
Possible values for parameter enabled are (bool)true, (bool)false and (string)toggle

Hardcoded black borders are especially a problem if you watch TV and if youre lights areas are quite small. I use e.g. one percent only.
Therefore i wrote some scripts that allow me to start/stop the addon and daemon and handle different configurations with only one button on my remote.

My configurations for the Daemon are splitted into parts. The common configuration is located in the file /etc/default/boblight.conf/device.conf and the lights specific files are located in the same path and named e.g 16:9.conf and 21:9.conf
According to the coosen configuration these files are put together in /etc/boblight.conf

I want to have the addon disabled on startup so i insert the addonId into the disabled table in the Addons DB before XBMC start up, if it doesn't already exist. I've done that via the script boblightXbmc which accepts one argument $1: on|off. If XBMC is running, the addon will be toggled via jsonrpc, if not its done directly in the Addons DB

boblightStatus checks if the addon is enabled or not. Just like boblightXbmc this is done via jsonrpc or Database.

toggleBoblight starts/stops the daemon and builds the desired configuration. Arguments are $1: on|off $2: configuration (here 16:9|21:9)

Here are my scripts. Maybe its useful for someone:
boblightStatus (check if addon is enabled)
Code:
#!/bin/bash

if pidof xbmc.bin > /dev/null; then
    STATUS=$(curl -s -H "Accept: application/json" -H "Content-type: application/json" -d '{"jsonrpc":"2.0","method":"Addons.GetAddonDetails","id":1,"params":{"addonid":"script.xbmc.boblight","properties":["enabled"]}}' http://localhost:8080/jsonrpc | egrep -o 'true|false')
else
    STATUS=$(/usr/bin/sqlite3 /home/xbmc/.xbmc/userdata/Database/Addons15.db 'SELECT * FROM disabled WHERE addonid="script.xbmc.boblight"')
    if [ "$STATUS" == "" ]; then
        STATUS="true"
    else
        STATUS="false";
    fi
fi
if [ "$STATUS" == "true" ]; then
        exit 0
elif [ "$STATUS" == "false" ]; then
        exit 1
else
        exit 2
fi
boblightXbmc (enable/disable addon, arguments: on/off)
Code:
#!/bin/bash

XBMC=true
if pidof xbmc.bin > /dev/null; then
    CMD="/usr/bin/curl -s -H \"Accept: application/json\" -H \"Content-type: application/json\" -d '{\"jsonrpc\":\"2.0\",\"method\":\"Addons.SetAddonEnabled\",\"id\":1,\"params\":{\"addonid\":\"script.xbmc.boblight\",\"enabled\":XXX}}' http://localhost:8080/jsonrpc"
    SET='"toggle"'
else
    XBMC=false
    CMD="/usr/bin/sqlite3 /home/xbmc/.xbmc/userdata/Database/Addons15.db 'XXX'"
fi

logger -t BOBLIGHT "Toggle XBMC Addon $1"
if [ "$1" == "on" ]; then
    if ! /usr/local/bin/boblightStatus; then
        logger -t BOBLIGHT "XBMC Addon is not running"
        if pidof boblightd > /dev/null; then
            logger -t BOBLIGHT 'Daemon running...'
            if $XBMC; then
                logger -t BOBLIGHT "XBMC is running"
                eval ${CMD/XXX/true} > /dev/null
            fi
        elif $XBMC; then
            logger -t BOBLIGHT 'XBMC running but Daemon seems to bo off'
            xbmc-send --action="Notification(Boblight error, Daemon not running, 5000, /home/xbmc/.xbmc/addons/script.xbmc.boblight/icon.png)"
        else
            logger -t BOBLIGHT 'XBMC is not running, deleting disabled status from Addons DB'
            eval ${CMD/XXX/DELETE FROM disabled WHERE addonid=\"script.xbmc.boblight\"}
        fi
        if /usr/local/bin/boblightStatus; then
            logger -t BOBLIGHT 'successfully enabled'
            exit 0
        else
            logger -t BOBLIGHT 'error enabling addon'
            exit 1
        fi
    else
        logger -t BOBLIGHT "XBMC Addon is already running"
        exit 0
    fi
elif [ "$1" == "off" ]; then
    if /usr/local/bin/boblightStatus; then
        logger -t BOBLIGHT "XBMC Addon is running"
        
        if $XBMC; then
            logger -t BOBLIGHT "XBMC is running"
            eval ${CMD/XXX/false} > /dev/null
        else
            logger -t BOBLIGHT 'XBMC is not running, inserting disabled status into Addons DB'
            eval ${CMD/XXX/INSERT INTO disabled (addonID) VALUES(\"script.xbmc.boblight\")}
        fi
        if ! /usr/local/bin/boblightStatus; then
            logger -t BOBLIGHT 'successfully disabled'
            exit 0
        else
            logger -t BOBLIGHT 'error disabling addon'
            exit 1
        fi
    else
        logger -t BOBLIGHT "XBMC Addon is already disabled"
        exit 0
    fi
fi

${CMD/XXX/"toggle"} > /dev/null
toggleBoblight (enable/disable the daemon, arguments: on/off configuration)
Code:
#!/bin/bash

LOCK=/tmp/boblightToggle
if [ -e $LOCK ]; then
    logger -t BOBLIGHT locked...
    exit 1
fi

function unlock {
    sleep 5
    rm $LOCK
}

logger -t BOBLIGHT "toggle Boblight Daemon $1 $2"

touch $LOCK

if pidof boblightd > /dev/null && [ "$1" != "on" ]; then
    logger -t BOBLIGHT disable
    
    xbmc-send --action="notification(Boblight,Disabling Daemon,5000,/home/xbmc/.xbmc/addons/script.xbmc.boblight/icon.png)"
    service boblight stop
    [ -e /etc/boblight.conf ] && rm /etc/boblight.conf
    if ! pidof boblightd > /dev/null; then
        unlock &
        exit 0
    fi
elif [ "$1" == "on" ]; then
    logger -t BOBLIGHT "enable $2"

    NEWCONF=false
    if [ -e /etc/boblight.conf ]; then
        CONF=$(egrep -o 'CONFIG;[0-9:]*' /etc/boblight.conf | cut -d';' -f2)
    else
        CONF=none
    fi

    logger -t BOBLIGHT "Current: $CONF, New: $2"

    if [ "$2" != "" ] && [ "$2" != "$CONF" ]; then
        logger -t BOBLIGHT "Preparing new configuration $2"
        NEWCONF=true
        cat /etc/default/boblight.conf/device.conf /etc/default/boblight.conf/$2.conf > /etc/boblight.conf
    elif [ "$2" != "" ]; then
        logger -t BOBLIGHT "Current configuration $2 is OK"
        if pidof boblightd > /dev/null; then
            logger -t BOBLIGHT "Boblight already running... exit..."
            unlock &
            exit 0
        else
            logger -t BOBLIGHT "...starting Boblight Daemon"
            service boblight start
        fi
    fi

    if $NEWCONF && pidof boblightd > /dev/null; then
        logger -t BOBLIGHT "...restarting Boblight Daemon"
        service boblight restart
    fi

    if pidof boblightd > /dev/null; then
        unlock &
        exit 0
    fi
fi
unlock &
exit 1
Boblight upstart (pre-start script)
Code:
pre-start script

[ ! -e /etc/boblight.conf ] && cat /etc/default/boblight.conf/device.conf /etc/default/boblight.conf/16:9.conf > /etc/boblight.conf

if pidof xbmc.bin > /dev/null; then
    CONF=$(egrep 'CONFIG;.*' /etc/boblight.conf | cut -d';' -f2)
    xbmc-send --action="notification(Boblight configuration,$CONF,5000,/home/xbmc/.xbmc/addons/script.xbmc.boblight/icon.png)"
fi

end script
XBMC Upstart
Code:
pre-start script
logger -t XBMC-INIT 'Checking Status of Boblight addon'
if boblightStatus; then
    logger -t XBMC-INIT "disabling Boblight addon"
    boblightXbmc off
fi
if ! pidof boblightd > /dev/null; then
    service boblight start
fi

end script

pre-stop script
if boblightStatus; then
    boblightXbmc off
fi
service boblight stop
end script
/etc/lirc/lircrc
Code:
# boblight toggle
begin
    prog = irexec
    button = toggle_boblight
    config = /usr/local/bin/toggleBoblight on 16:9 && /usr/local/bin/boblightXbmc on
    config = /usr/local/bin/boblightXbmc off && /usr/local/bin/toggleBoblight on 21:9 && /usr/local/bin/boblightXbmc on
    config = /usr/local/bin/boblightXbmc off
end
I know this is a whole bunch of code that surely could be simplified, but it works.
Dependencies are curl, sqlite3, logger, xbmc-eventclient xbmc-send
Reply
(2013-12-26, 23:28)Oxize Wrote: Teko do you have any Boblight config for an Lightpack 60 led (10 channels)? I cant get it working.

Check out my blog - it's for a rpi but conf file should be the same

http://ajpawelski.wordpress.com/2013/10/...lightpack/
Reply
The full config you using on you site is only for 1 led strip activated.
Reply
(2013-12-29, 01:19)Oxize Wrote: The full config you using on you site is only for 1 led strip activated.
Yes that's right but it tells you how to do the 10 it's exactly the same for each strip
Reply
Not sure if it's mentioned before but some time back i asked for such feature and that is to toggle Boblight addon Off and On. (not using addon settings menu)
I was told that wasn't possible but today i found this topic Autoplay music when XBMC is idle and there is a toggle_service script in it that does what i want.
I'm sharing it here for other users who would like to have such function.

Edit:
Seems i'm to late. How could i miss this http://forum.xbmc.org/showthread.php?tid...pid1583896
Reply
(2014-01-09, 16:00)schumi2004 Wrote: Not sure if it's mentioned before but some time back i asked for such feature and that is to toggle Boblight addon Off and On. (not using addon settings menu)

I added some new features to the plugin over the last few days that'll give you a little more control over when Boblight does what. You can disable Boblight for a given category and you can customize your settings better. Look for the updated version of the add-on as Memphis pushed it to the repo last night.
Reply
(2014-01-13, 09:41)George Wrote:
(2014-01-09, 16:00)schumi2004 Wrote: Not sure if it's mentioned before but some time back i asked for such feature and that is to toggle Boblight addon Off and On. (not using addon settings menu)

I added some new features to the plugin over the last few days that'll give you a little more control over when Boblight does what. You can disable Boblight for a given category and you can customize your settings better. Look for the updated version of the add-on as Memphis pushed it to the repo last night.

Thanks, i'll check it out.

Edit:
Looks good but only thing missing is to disable boblight when playback is paused.
I'm aware of the option to disable when screensaver is active but not sure how that should work, only with static boblight settings maybe?

Edit2:
Is it possible to disable leds using priority like done here?
Code:
bob.bob_set_priority(255) # we are shutting down, kill the LEDs

If so we could use it for pause handling or not?
Reply
Sorry if this has been covered, but does boblight work with vdpau accelerated video? (I have searched for VDPAU within this thread but the results were not conclusive).

I ask because I read in the adalight tutorial "Anything using hardware-assisted decoding or rendering — some DVD player software and 3D games — bypasses the normal frame buffer and are not accessible to code running on the computer".

Thanks for any clarification.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
Works 100%, both the boblight add on and boblight-x11
Reply
Thanks teee.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
Hello guys. I've been installing all the stuff in my htpc.

I come from a raspberry pi with boblight working great! But I needed more power so I built an htpc.

All things are working for me. boblight up and working, boblight addon for xbmc connected to boblight. but...Even if I use the same values that I used for raspberry pi, or slow or fast. I'm getting like white fog in the leds while I play a movie. Do you understand what I mean? Black scenes arent black, are black with white fog...

These are my settings and my tuto http://www.grabthiscode.com/diy/how-to-s...ie-trying/

Do you know what is failling?
Reply
White fog? Are you leds burning or so? - sorry - but i guess without a photo or something nobody really knows what you mean Wink
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
you are right, I'll record a video today Big Grin
Reply
(2014-01-14, 18:16)davisdmg Wrote: you are right, I'll record a video today Big Grin
c'mon now - almost 24hrs since your last post.
Reply
  • 1
  • 63
  • 64
  • 65(current)
  • 66
  • 67
  • 107

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Official XBMC boblight Addon3