Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



boblight config woe...
 
Share:
Notifications
Clear all

[Solved] boblight config woes!

7 Posts
2 Users
0 Likes
2,472 Views
(@callahan)
Active Member
Joined: 8 years ago
Posts: 5
Topic starter  

Hi,

I’m having some problems setting up Boblight with Openelec on an
Intel NUC – Model D54250WYK (all USB 3.0 ports, no USB 2.0 – I’ve a
feeling this may be my issue).

I have uploaded my Sketch to my Arduino Uno Rev.3 board. I used the
config supplied here: //www.tweaking4all.com/home-theatre/xbmc/xbmc-boblight-openelec-ws2811-ws2812 adjusting for number of LEDs and PIN 13.
I’ve installed both boblightd and Kodi-boblight on my NUC running the
latest version of Openelec. I’ve made sure the baudrates match.

I have used the Boblight config maker and uploaded the config to
/storage/.kodi/userdata/addon_data/service.multimedia.boblightd.

When Kodi boots I get the error message that it cannot connect to boblightd.

I have the Pulselight internal HDMI-CEC adapter which Kodi sees on /dev/ttyACM1.

The service.log file in /storage/.kodi/userdata/addon_data/service.multimedia.boblightd shows the following:

(CConfig::CheckDeviceConfig)    ERROR:
/storage/.kodi/userdata/addon_data/service.multimedia.boblightd/boblight.conf
line 31 section [device]: wrong value # for key prefix
(CConfig::CheckDeviceConfig)   
ERROR:
/storage/.kodi/userdata/addon_data/service.multimedia.boblightd/boblight.conf
line 31 section [device]: wrong value PREFIX for key prefix

The Kodi log reads:

### [Kodi Boblight] – connecting to local boblightd
00:15:33
T:140098880403200   DEBUG: ### [Kodi Boblight] – connection to boblightd
failed: SO_ERROR 127.0.0.1:19333 Connection refused

The strange thing is that if I used the sample config that gets
installed on openelec with boblight, it connects to boblightd. The
sample reads:

[global]
interface 127.0.0.1
port      19333

[device]
name            device1
type            momo
output          /dev/ttyACM0
channels        75
prefix        41 64 61 00 18 4D
interval        20000
rate            115200
debug           off #turn this on to see what it’s doing with the serial port
delayafteropen    1000000

Whereas my equivalent config reads:

[global]
interface        127.0.0.1              # IP Address to bind to
port             19333                  # IP Port

[device]
name             Ambilight              # NAME - User readable name for the device
type             momo                   # TYPE - Device type of the LED controller
output           /dev/ttyACM0           # OUPUT - Data output device (port) for your LED controller
channels         324                    # CHANNELS - Number of channels your configuration has (= 3 x number of LEDs)
interval         20000                  # INTERVAL - Refresh rate of your LEDs, 20.000 = 50x per second
rate             460800                 # RATE - Communication baufrate to your LED controller
prefix           41 64 61 00 18 4D    # PREFIX - Magic code to indicate the START of a full color sequence
threadpriority   10                     # THREAD PRIORITY - Boblight process priority
delayafteropen   1000000                # DELAY AFTER OPENING - Time to wait before sending data after opening
debug            on                    # DEBUG - Output debug information (to STDOUT for example)
# colorOrder       RGB                    # NOT NEEDED - HYPERION RGB - Define LED color order (RGB, BRG, etc)

So I’m at a loss, I’ve tried changing the /dev/ttyACM0 to various
others including it’s USB counterparts. Nothing seems to work, all I
have is all the LEDS in white (which is pretty but not the intended
outcome of this weekend’s work!)

If anyone could help me out and point me in the right direction, I’d be very grateful.


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2678
 

Thanks for considering using the forum! 

First thing I would consider is removing the "# PREFIX – Magic code to indicate the START of a full color sequence" from the prefix line.
Maybe this is where Boblight goes nuts?

Second thing is the USB device you're using - might this be the wrong device?


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2678
 

Hi Hans,

Thanks for replying. The only reason I mentioned the Pulselight is because I was concerned that as it sits on ttyACM1, it may be interfering with the boblight setup on ACM0. It plugs into the internal USB header. It allows the TV remote to be used with the NUC as well as offering some other features built into Kodi. I suppose I was at a point at 3am this morning of trying everything!

I did find some articles last night (albeit old ones), suggesting that the prefix was directly tied to the number of LEDs you have and I saw some varying posts with different hex's in them. I couldn't find any articles on how those hex's are created based on number of LEDs.

I also (if this makes any difference) used the latest Adafruit_NeoPixel library built into the Arduino IDE rather than the one you supplied with your article. In desperation last night, I then reverted and re-flashed the board with your Sketch and the library you supplied but to no avail.

I'm getting to a point where I'm thinking to wipe the Openelec box and start again but I'm 100% sure that won't help as I can get the boblightd to connect with a config file that isn't created from the boblight config maker. The only real difference between the 2 is that the number of LEDs is different in the sample conf file (75) which makes me think that the prefix number actually does matter.

I'm going to test again this morning and change the number of LEDs to 75 in the config made by your config maker and see if boblightd connects. If it does then it (to me at least( points firmly at the prefix being wrong for the number of LEDs I have.

Will post back within the hour!

Thanks again for your time writing this article and continuing to help those stuck on this project!


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2678
 

It might indeed be that Pluselight sits on that USB port. Good call! 

The Sketch here (Tweaking4All) doesn't work with the calculated prefix - it's a fixed prefix, mostly because you set it up once and never really change it.
So to me that felt like redundant code.

The code can be calculated with Boblight Config Maker though, but like I said: my sketch will not use it ,and expects exactly the prefix as defined in the Sketch.
Just check the "Use Magic Word" option, and add the magic word (usually it's "Ada"). It will calculate based on the magic word and the number of LEDs what the code should be.

So ... in your config file, the Prefix looks correct, I'd just remove the comment, to see if this is causing the error. 


   
ReplyQuote
(@callahan)
Active Member
Joined: 8 years ago
Posts: 5
Topic starter  

Hi,
Progress to a point. It seems having a comment on that line prevented the connection. Boblightd can now connect.
Although all I see is the white LEDs come on at startup then glow red and blue on the top row then go out completely. Now while watching any movies all I get is a light along the top. What colours there are (just the top over the TV), don't represent what's on the TV.
I'm not sure what part of the config to change however....

Ticking the Magic word box seems to not add anything different to the config file.


   
ReplyQuote
(@callahan)
Active Member
Joined: 8 years ago
Posts: 5
Topic starter  

Hi Hans,

Success!

So it appears as if you can't have comments after the OUTPUT variable or the PREFIX variable. Failing to remove them prevents boblight from parsing the conf file correctly.

However, I believe there may possibly be a slight issue with the boblight config maker. I spent about 2 hours today trying to figure out why none of the lights matched the images on the screen. One of my tests was to take the video you used as a test - https://www.youtube.com/watch?v=JxS56nQPX6s and it made it clear that all the colours were reversed. I re-did the config using the config maker and set them as counter clockwise (which they aren't) and suddenly everything worked perfectly. I removed the TV from the wall to recheck it and the light strip arrows are definitely pointing in a clockwise rotation with the start and end at the top of my TV. This is obviously viewing the TV from the rear as shown in the graphic in the config maker. I'm not sure if I'm being stupid and that doubt has had me check the light direction more than 5 times. They are definitely running clockwise when you look at the arrows on the LEDs themselves. I also confirmed this with a strip test.
I'm certainly not criticising the boblight config maker (I'd never have gotten this far without it!), but thought I should mention it in case it is a bug or anyone else experiences similar issues to me.

My last part of the project is to find a way to stop OpenElec killing the boblight daemon before it can send the lights off command to the LEDs. Currently everything shuts down when required but leaves the lights with the colours of the last image it had on screen. If I find a simple way to do this, I'll post back.

Thanks again for the instructions and help over this weekend.


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2678
 

Awesome! 

Glad you got it to work!!

As for Boblight Config Maker: clockwise and counter-clockwise is as seen from the back of the TV. (TV Rear view)
I can however imagine this to be confusing at times, and something that might be overlooked.
I'll check it here one more time (I have to setup my Boblight again anyway, because the harddisk of my HTPC took a crap and died on me) to make sure there is no mistake in this ...

As for criticism: I always love to hear when there are issues, so I can make programs better. Your input is most welcome!

At least I'm glad that you've got things to work. Nice!


   
ReplyQuote
Share: