2012-03-15, 20:49
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:
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:
and here is the code on my Arduino:
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();
}
}