[DIY] Amblight project/guide - Hyperion - WS2801/ WS2812B / APA102 (2 Viewers)

Rick164

MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,006
    Home Country
    Netherlands Netherlands
    Header files ( .h ) are used for definitions while .cpp files contain the actual implementation / code :) , for this only the HardwareSerial.cpp file should be changed.
     

    TheBatfink

    MP Donator
  • Premium Supporter
  • June 11, 2007
    1,288
    221
    Nottingham
    Home Country
    United Kingdom United Kingdom
    Code:
    #if (RAMEND < 1000)
    #define SERIAL_BUFFER_SIZE 16
    #else
    #define SERIAL_BUFFER_SIZE 64
    #endif

    That's what is in USBAPI.h now with the newer version of Arduino core. Looks like that is were it is defined now. I did a search on the whole hardware folder including file contents, it doesn't show SERIAL_BUFFER anywhere else. Will see how we go.
     

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    @TheBatfink what kind of arduino are you using?
    I dont think that the stuff in USBAPI is the right stuff. As most arduinos dont even know usb, but uart. You can connect via usb because they have an extra chip on board that translates from usb to uart and vice versa.
    So if you have an Leonardo or Micro Pro or any other arduino with an ATmega32u4 this might be the right code, but i still dont think so.
    If you have an Arduino with an extra ftdi/ch430 chip, please read this :(
    https://forum.team-mediaportal.com/...ion-ws2801-ws2812b.128526/page-7#post-1119310

    If you have an Uno or other Arduino that uses a dedicated ATmega8/16u4 for usb, check out
    Code:
    #if !(defined(SERIAL_TX_BUFFER_SIZE) && defined(SERIAL_RX_BUFFER_SIZE))
    #if (RAMEND < 1000)
    #define SERIAL_TX_BUFFER_SIZE 16
    #define SERIAL_RX_BUFFER_SIZE 16
    #else
    #define SERIAL_TX_BUFFER_SIZE 64
    #define SERIAL_RX_BUFFER_SIZE 64
    #endif
    #endif

    in C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\HardwareSerial.h with latest Arduino IDE (1.6.0).

    :)
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    But wasn't the resistor needed on the data line for power surges (feedback and such) and optionally the capacitor on power line for better constant power?
    Correct, although even with a resistor on the first LED i was able to blow a couple of them up. The good thing is that it's only the first LED.
    All 'Best Practices' listed here.
     

    TheBatfink

    MP Donator
  • Premium Supporter
  • June 11, 2007
    1,288
    221
    Nottingham
    Home Country
    United Kingdom United Kingdom
    It's an official uno rev 3. Brought it from Maplins brick and mortar store. Maybe when I searched it didn't find that because of the tx rx in the string. Seems older core didn't have the transmit / recieve. Will have another look.

    For those with uno and rpi hyperion. You ever have it unresponsive and need to power cycle? I'm finding sometimes depending on power on sequence, the json server isn't responding.. Does it create a log anywhere on the rpi?

    ITS ALIVE!!! haha finally. Thanks for all your help folks. Really appreciate it :)
     
    Last edited:

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,006
    Home Country
    Netherlands Netherlands
    Have had it running for weeks with an Uno R3 + rPi B+ so could be power or cable issue :)
    No logging option yet but most of the errors you can find by running Hyperion manually in the shell instead of in background like this:

    Code:
    /storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config
    .json
     

    TheBatfink

    MP Donator
  • Premium Supporter
  • June 11, 2007
    1,288
    221
    Nottingham
    Home Country
    United Kingdom United Kingdom
    I figured out why it wasn't responding.. School boy error. I ran 4 network cables to the front of the room for the TV / PC / Receiver etc. but only had 2 spare spots in the switch.. I must of reconnected one of the dead network lines :)

    Following on from the Atmolight thread. Attached my sketch and config..

    Loving this setup haha. Only trouble is I watch the lights more than I do the TV now! :)
     

    Attachments

    • hyperion.config.json.txt
      35.6 KB
    • sketch.txt
      3.4 KB

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,006
    Home Country
    Netherlands Netherlands
    Config looks good, most likely its an hardware issue (cable / interference) which can be tricky to find so would double check cables and if all else fails try the led strips areas (left /right etc..) separately to see if you get the same results.

    If you experience any significant lag in the leds you could double check the buffer size in the Arduino config and the baud rate change in the rPI config as that would also result in data transmit errors (delays / requests piling up), the easiest way to check if that's the case is to reduce the led count to somewhere between 50 and 90 as that is something a baud rate of 115200 can still handle.
     
    Last edited:

    TheBatfink

    MP Donator
  • Premium Supporter
  • June 11, 2007
    1,288
    221
    Nottingham
    Home Country
    United Kingdom United Kingdom
    It works great in use and the blue is not there when it is working, colours look OK. If anything it seems the lights are a little ahead of the picture so seems ok for lag. It's just when it turns off for instance when the PC enters S3, some stay blue. I'll try twisting the wires like Lightening said. Thanks for checking the configs out :)

    The cables presoldered to the strip are very close though as more than one are soldered together. I might remove them and join them half way along the wire so only 1 set of wires need to be soldered directly to the strips..
     

    TheBatfink

    MP Donator
  • Premium Supporter
  • June 11, 2007
    1,288
    221
    Nottingham
    Home Country
    United Kingdom United Kingdom
    So a little more information that seems interesting.
    I have the Hyperion iPhone app that basically has a colour wheel and intensity slider to remotely control the lights..

    When I turn the lights off with the app by sliding the intensity slider all the way to 0 the lights all turn off perfectly!! So there must be something on the Atmolight side as the app is connecting to the rPi, using Hyperion which is in turn making the Arduino work and I don't see the issue? The hardware side seems to be doing its job as expected in this test?
     

    Users who are viewing this thread

    Top Bottom