2012-03-15, 20:53
(2012-03-15, 20:49)beta-j Wrote: So here's a recap of what i've managed to achieve so far and what problems I'm experiencing.
I am running an XBMCBuntu on an Intel Pentium 4 device. For the time beign I'm keeping things extra simple to eliminate possible points of failure. My circuit consists of an Arduino Uno connected to the PC's USB port. A single RGB LED is connected to the arduino with the GND connected to the GND pin on the Arduino and the remaining 3 pins connected to PWM outputs 9,10 and 11.
Running $ boblightd& on xbmc gives me the following output:
Code:james@XBMC-Eden:~$ boblightd&
[1] 1941
james@XBMC-Eden:~$ (InitLog) start of log /home/james/.bob light/boblightd.log
(PrintFlags) starting boblightd
(CConfig::LoadConfigFromFile) opening /etc/boblight.conf
(CConfig::CheckConfig) checking config lines
(CConfig::CheckConfig) config lines valid
(CConfig::BuildConfig) building config
(CConfig::BuildConfig) built config successfully
(main) starting devices
(CClientsHandler::Process) opening listening socket on 127.0.0.1:19333
(CDevice::Process) arduino: starting with output "/dev/ttyACM0"
(CDevice::Process) arduino: setting up
james@XBMC-Eden:~$ (CDevice::Process) arduino: setup succeeded
(CClientsHandler::Process) 127.0.0.1:42906 connected
(CClientsHandler::ParseMessage) 127.0.0.1:42906 said hello
(CClientsHandler::ParseSet) 127.0.0.1:42906 priority set to 255
(CClientsHandler::ParseSet) 127.0.0.1:42906 priority set to 128
^C
At this point the Rx indicator on the Arduino is on and steady.
The plugin on the XBMC GUI says it has successfully connected to boblight, but the LED does not light up at all!
Any ideas? I'm running out of possible options here.
if it helps, this is my boblight.conf:
Code:[global]
interface 127.0.0.1
port 19333
[device]
name arduino
output /dev/ttyACM0
channels 3
type momo
interval 20000
rate 38400
prefix 55 AA
#arduino bootloader runs when opening the serial port for the first time
#delay transmission one second after opening so we don.t send shit to the bootloader
delayafteropen 2000000
#debug on
[color]
name red
rgb FF0000
[color]
name green
rgb 00FF00
[color]
name blue
rgb 0000FF
[color]
name yellow
rgb FFFF00
adjust 0.5
blacklevel 0.1
gamma 2.3
[color]
name white
rgb FFFFFF
adjust 0.3
blacklevel 0.7
gamma 1.6
[light]
name main
color red arduino 1
color green arduino 2
color blue arduino 3
hscan 0 100
vscan 0 100
and here is the code on my Arduino:
Code:void setup()
{
Serial.begin(38400);
}
//arduno
uint8_t outputs[] = {9, 10, 11};
#define NROUTPUTS (sizeof(outputs))
uint8_t values[NROUTPUTS];
void loop()
{
WaitForPrefix();
for (uint8_t i = 0; i < NROUTPUTS; i++)
{
while(!Serial.available());
values[i] = Serial.read();
}
for (uint8_t i = 0; i < NROUTPUTS; i++)
analogWrite(outputs[i], values[i]);
}
//boblightd needs to send 0×55 0xAA before sending the channel bytes
void WaitForPrefix()
{
uint8_t first=0, second=0;
while (second !=0x55 || first !=0xAA);
{
while (!Serial.available());
second = first;
first = Serial.read();
}
}
activate debug log in boblight.conf and see if the correct data is sent.
(2012-03-15, 16:05)bobo1on1 Wrote:(2012-03-15, 02:11)phil65 Wrote: http://www.gtwf-koeln.de/boblight.conf
it even happens when using the sample config from boblight trunk which is automatically added to the squashfs image by the build system.
EDIT: I know that I should take ttyUSB0, but it should at least find the [DEVICE] section, doesn´t it?
Are the read permissions for boblight.conf set correctly?
Code:
root@fritz:/var/mod/root# boblightd -c /var/media/ftp/uStor01/boblight.conf
(InitLog) start of log /mod/root/.boblight/boblightd.log
(PrintFlags) starting boblightd -c /var/media/ftp/uStor01/boblight.conf
(CConfig::LoadConfigFromFile) opening /var/media/ftp/uStor01/boblight.conf
(CConfig::CheckConfig) checking config lines
(CConfig::CheckDeviceConfig) ERROR: /var/media/ftp/uStor01/boblight.conf no devices defined
(CConfig::CheckColorConfig) ERROR: /var/media/ftp/uStor01/boblight.conf no colors defined
(CConfig::CheckLightConfig) ERROR: /var/media/ftp/uStor01/boblight.conf no lights defined
root@fritz:/var/mod/root#
root@fritz:/var/mod/root# cd /var/media
media/ mediapath/
root@fritz:/var/mod/root# cd /var/media/ftp/uStor01/
root@fritz:/var/media/ftp/uStor01# ls -l
drwxrwxrwx 3 root root 4096 Mar 13 17:07 FRITZ
-rwxrwxrwx 1 root root 1800 Mar 13 16:51 boblight.conf
drwxrwxrwx 8 1000 1000 4096 Nov 6 19:14 cs
drwxrwxrwx 3 1000 1000 4096 Oct 22 16:12 fbf
drwxrwxrwx 2 1000 1000 4096 Mar 13 21:06 logs
drwxrwxrwx 2 root root 16384 Mar 13 16:47 lost+found
drwxrwxrwx 10 1000 1000 4096 Nov 6 19:11 tools