Adalight (Arduino Nano) and Hyperion (Rpi 0W) do not talk

  • My best guess at my problem is that there is some sort of communication error between the Rpi and my adalight controller. When the Arduino powers on, it runs the startup flashes and only tests the 88 LEDs I want to turn on, so it seems that that works.


    Additionally, it seems like the hdmi converter and splitter im using are working fine because I can see the live video feed in hyperion and it is trying to control the lights, but nothing is happening.


    Wiring:

    88 WS2812B LEDs and the Pi 0 are powered from a 10amp power brick, i spliced a usb into the adaptor because my Pi does not have soldered pins.

    the nano and the hdmi converter are plugged into a usb hub which is plugged into the raspberry pi. The data line is running from pin 6 on the nano through a resistor to the data line on the LEDs, the directional arrow is facing the right way. I also ran a ground from the nano to the ground from the barrel adaptor on the power brick.


    Software:

    I'll start with what I think the problem is,

    2021-07-29T22:07:53.990Z [hyperiond LEDDEVICE] (ERROR) Device disabled, device 'adalight' signals error: 'Rs232 SerialPortError: Inappropriate ioctl for device'


    This line in the debug log from hyperion seems to explain the problem that I am having I just have no idea how to fix it! haha


    Baudrate on both hyperion and adalight are set to 500000


    Adalight code pulled from Steve Does Stuff on Youtube


    // FastLED - Version: Latest

    #include <FastLED.h>


    // How many leds in your strip?

    #define NUM_LEDS 88


    // For led chips like Neopixels, which have a data line, ground, and power, you just

    // need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,

    // ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN

    #define DATA_PIN 6


    #define COLOR_ORDER RGB


    // Adalight sends a "Magic Word" (defined in /etc/boblight.conf) before sending the pixel data

    uint8_t prefix[] = {'A', 'd', 'a'}, hi, lo, chk, i;


    // Baudrate, higher rate allows faster refresh rate and more LEDs (defined in /etc/boblight.conf)

    #define serialRate 500000

    // #define serialRate 460800


    // Define the array of leds

    CRGB leds[NUM_LEDS];


    void setup() {

    // Uncomment/edit one of the following lines for your leds arrangement.

    // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);

    FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);

    // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);


    // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);


    // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);


    // initial RGB flash

    LEDS.showColor(CRGB(255, 0, 0));

    delay(500);

    LEDS.showColor(CRGB(0, 255, 0));

    delay(500);

    LEDS.showColor(CRGB(0, 0, 255));

    delay(500);

    LEDS.showColor(CRGB(0, 0, 0));


    Serial.begin(serialRate);

    Serial.print("Ada\n"); // Send "Magic Word" string to host


    }


    void loop() {

    // wait for first byte of Magic Word

    for(i = 0; i < sizeof prefix; ++i) {

    waitLoop: while (!Serial.available()) ;;

    // Check next byte in Magic Word

    if(prefix[i] == Serial.read()) continue;

    // otherwise, start over

    i = 0;

    goto waitLoop;

    }


    // Hi, Lo, Checksum


    while (!Serial.available()) ;;

    hi=Serial.read();

    while (!Serial.available()) ;;

    lo=Serial.read();

    while (!Serial.available()) ;;

    chk=Serial.read();


    // if checksum does not match go back to wait

    if (chk != (hi ^ lo ^ 0x55))

    {

    i=0;

    goto waitLoop;

    }


    memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));

    // read the transmission data and set LED values

    for (uint8_t i = 0; i < NUM_LEDS; i++) {

    byte r, g, b;

    while(!Serial.available());

    r = Serial.read();

    while(!Serial.available());

    g = Serial.read();

    while(!Serial.available());

    b = Serial.read();

    leds[i].r = r;

    leds[i].g = g;

    leds[i].b = b;

    }

    // shows new values

    FastLED.show();}


    Hyperion Debug Log


    2021-07-29T22:07:53.990Z [hyperiond LEDDEVICE] (ERROR) Device disabled, device 'adalight' signals error: 'Rs232 SerialPortError: Inappropriate ioctl for device'
    2021-07-30T19:37:54.690Z [hyperiond WEBSOCKET] (DEBUG) (WebSocketClient.cpp:215:sendClose()) send close: 1000
    2021-07-30T19:37:55.600Z [hyperiond WEBSOCKET] (DEBUG) (WebSocketClient.cpp:30:WebSocketClient()) New connection from ::ffff:192.168.1.100
    2021-07-30T19:37:55.607Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:122:handleInstanceSwitch()) Client '::ffff:192.168.1.100' switch to Hyperion instance 0
    2021-07-30T19:37:56.093Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1058:handleLoggingCommand()) log streaming activated for client ::ffff:192.168.1.100
    2021-07-30T19:40:36.321Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1404:handleLedDeviceCommand()) message: [{"command":"leddevice","ledDeviceType":"adalight","subcommand":"discover","tan":99}]
    2021-07-30T19:40:36.570Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1428:handleLedDeviceCommand()) response: [{"devices":[{"description":"USB Serial","manufacturer":"1a86","portName":"ttyUSB0","productIdentifier":"0x7523","serialNumber":"","systemLocation":"/dev/ttyUSB0","vendorIdentifier":"0x1a86"}],"ledDeviceType":"adalight"}]
    2021-07-30T19:41:16.994Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1067:handleLoggingCommand()) log streaming deactivated for client ::ffff:192.168.1.100
    2021-07-30T19:41:17.008Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1058:handleLoggingCommand()) log streaming activated for client ::ffff:192.168.1.100
    2021-07-30T19:41:24.401Z [hyperiond WEBSERVER] (DEBUG) (WebServer.cpp:91:handleSettingsUpdate()) Apply Webserver settings
    2021-07-30T19:41:24.407Z [hyperiond WEBSERVER] (DEBUG) (WebServer.cpp:109:handleSettingsUpdate()) Set document root to: :/webconfig
    2021-07-30T19:41:24.414Z [hyperiond WEBSERVER] (DEBUG) (WebServer.cpp:91:handleSettingsUpdate()) Apply Webserver settings
    2021-07-30T19:41:24.417Z [hyperiond WEBSERVER] (DEBUG) (WebServer.cpp:175:handleSettingsUpdate()) Setup SSL certificate
    2021-07-30T19:41:24.422Z [hyperiond WEBSERVER] (DEBUG) (WebServer.cpp:191:handleSettingsUpdate()) Setup private SSL key
    2021-07-30T19:41:24.420Z [hyperiond WEBSERVER] (DEBUG) (WebServer.cpp:109:handleSettingsUpdate()) Set document root to: :/webconfig
    2021-07-30T19:41:24.433Z [hyperiond WEBSERVER] (INFO) Stopped Hyperion Webserver
    2021-07-30T19:41:24.444Z [hyperiond WEBSERVER] (INFO) Started on port 8090 name 'Hyperion Webserver'
    2021-07-30T19:41:27.745Z [hyperiond WEBSOCKET] (DEBUG) (WebSocketClient.cpp:30:WebSocketClient()) New connection from ::ffff:192.168.1.100
    2021-07-30T19:41:27.754Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:122:handleInstanceSwitch()) Client '::ffff:192.168.1.100' switch to Hyperion instance 0
    2021-07-30T19:41:30.921Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1058:handleLoggingCommand()) log streaming activated for client ::ffff:192.168.1.100
    2021-07-30T20:09:26.793Z [hyperiond WEBSOCKET] (DEBUG) (WebSocketClient.cpp:30:WebSocketClient()) New connection from ::ffff:192.168.1.100
    2021-07-30T20:09:26.801Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:122:handleInstanceSwitch()) Client '::ffff:192.168.1.100' switch to Hyperion instance 0
    2021-07-30T20:09:27.514Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1058:handleLoggingCommand()) log streaming activated for client ::ffff:192.168.1.100
    2021-07-30T20:23:45.456Z [hyperiond JSONSERVER] (DEBUG) (JsonServer.cpp:105:newConnection()) New connection from: ::ffff:192.168.1.108
    2021-07-30T20:23:45.467Z [hyperiond JSONCLIENTCONNECTION] (DEBUG) (JsonAPI.cpp:122:handleInstanceSwitch()) Client '::ffff:192.168.1.125' switch to Hyperion instance 0
    2021-07-30T20:23:51.720Z [hyperiond JSONSERVER] (DEBUG) (JsonServer.cpp:121:closedConnection()) Connection closed
    2021-07-30T20:29:03.641Z [hyperiond JSONSERVER] (DEBUG) (JsonServer.cpp:105:newConnection()) New connection from: ::ffff:192.168.1.108
    2021-07-30T20:29:03.651Z [hyperiond JSONCLIENTCONNECTION] (DEBUG) (JsonAPI.cpp:122:handleInstanceSwitch()) Client '::ffff:192.168.1.125' switch to Hyperion instance 0
    2021-07-30T20:29:29.050Z [hyperiond EFFECTENGINE] (INFO) Run effect "Atomic swirl" on channel 1
    2021-07-30T20:29:29.059Z [hyperiond EFFECTENGINE] (DEBUG) (EffectEngine.cpp:181:runEffectScript()) Start the effect: name [Atomic swirl], smoothCfg [2]
    2021-07-30T20:29:29.170Z [hyperiond HYPERION] (DEBUG) (PriorityMuxer.cpp:374:setCurrentTime()) Set visible priority to 1
    2021-07-30T20:29:29.173Z [hyperiond HYPERION] (DEBUG) (Hyperion.cpp:559:handlePriorityChangedLedDevice()) priority[1], previousPriority[1]
    2021-07-30T20:29:35.079Z [hyperiond JSONSERVER] (DEBUG) (JsonServer.cpp:121:closedConnection()) Connection closed
    2021-07-30T21:03:39.411Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1067:handleLoggingCommand()) log streaming deactivated for client ::ffff:192.168.1.100
    2021-07-30T21:03:39.423Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1058:handleLoggingCommand()) log streaming activated for client ::ffff:192.168.1.100

  • Is the hub powered separately? Is the grabber powered separately? If neither are powered I would guess that it's too much power draw for the w0 usb port. I would also suggest trying a different usb cable for the nano, just to rule that out as well.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!