ws2812b + Arduino mega no communication

  • Hello, I'm working to add a strip of ws2812b leds under on the top of my arcade. I've been playing with Arduino adalight sketch and hypercon for a while but I can't seem to make them talk to each other.


    My hardware is a Rpi 3 b and Arduino mega connected to ws2812b lights, I only have 20 lights set up along the top of the screen from left to right


    When I start up the Arduino the LED do two test flashes so I'm pretty sure my wires are set up correctly, my problem is that once they flash they turn off and never respond to the Hyperion program. My logs say I'm connected and that everything is running from hypercon.


    Here is the Arduino ino file I'm using



    and here are my config files



    Sorry for not using pastebin I couldn't figure out how to get it to work.
    Thanks for the help!

  • Sure, thanks for the reply


    SSH Traffic:
    ssh connected
    ssh out: sudo systemctl stop hyperion.service 2>/dev/null; sudo /etc/init.d/hyperion stop 2>/dev/null ; sudo /sbin/initctl stop hyperion 2>/dev/null
    ssh out: sudo systemctl start hyperion.service 2>/dev/null ; sudo /etc/init.d/hyperion start 2>/dev/null ; sudo /sbin/initctl start hyperion 2>/dev/null
    ssh out: sudo journalctl -u hyperion.service 2>/dev/null
    ssh in: -- Logs begin at Wed 2019-01-23 15:17:01 UTC, end at Wed 2019-01-23 19:37:51 UTC. --
    ssh in: Jan 23 15:17:03 retropie systemd[1]: Starting Hyperion Systemd service...
    ssh in: Jan 23 15:17:03 retropie systemd[1]: Started Hyperion Systemd service.
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: Hyperion Ambilight Deamon (452)
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: Version : V1.03.4 (brindosch-c750c41/dc6a602-1522918225
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: Build Time: Apr 5 2018 01:57:25
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: INFO: Selected configuration file: /etc/hyperion/hyperion.config.json
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: HYPERION INFO: ColorTransform 'default' => [0; 19]
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: HYPERION INFO: ColorCorrection 'default' => [0; 19]
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: HYPERION INFO: ColorAdjustment 'default' => [0; 19]
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: LEDDEVICE INFO: configuration:
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: {
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: "colorOrder" : "rgb",
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: "delayAfterConnect" : 0,
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: "name" : "MyHyperionConfig",
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: "output" : "/dev/ttyACM0",
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: "rate" : 10000,
    ssh in: Jan 23 15:17:04 retropie hyperiond[452]: "type" : "adalight"
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: }
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: Opening UART: /dev/ttyACM0
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: INFO: Creating linear smoothing
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: HYPERION (CS) INFO: Created linear-smoothing(interval_ms=50;settlingTime_ms=200;updateDelay=0
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: EFFECTENGINE INFO: 27 effects loaded from directory /usr/share/hyperion/effects
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: EFFECTENGINE INFO: Initializing Python interpreter
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: INFO: Hyperion started and initialised
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: INFO: Boot sequence 'Rainbow swirl fast' EFFECTENGINE INFO: run effect Rainbow swirl fast on channel 0
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: BLACKBORDER INFO: threshold set to 0 (0)
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: BLACKBORDER INFO: mode:default
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: started
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: INFO: Json server created and started on port 19444
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: INFO: Proto server created and started on port 19445
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: DISPMANXGRABBER INFO: Display opened with resolution: 1360x768
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: BLACKBORDER INFO: threshold set to 0 (0)
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: BLACKBORDER INFO: mode:default
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: INFO: Frame grabber created and started
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: BORDER SWITCH REQUIRED!!
    ssh in: Jan 23 15:17:05 retropie hyperiond[452]: CURRENT BORDER TYPE: unknown=0 hor.size=0 vert.size=0
    ssh in: Jan 23 15:17:08 retropie hyperiond[452]: EFFECTENGINE INFO: effect finished
    ssh in: Jan 23 19:37:48 retropie systemd[1]: Stopping Hyperion Systemd service...
    ssh in: Jan 23 19:37:48 retropie hyperiond[452]: INFO: Application closed with code 0



    This was the startup and then me stopping the service from hypercon

  • ssh in: Jan 23 15:17:04 retropie hyperiond[452]: "rate" : 10000,


    That differs from what you have in your previously posted configs. They have ""rate" : 115200,". Which is correct. As it matches the sketch's rate.


    Hope it helps.

  • Sorry I had been playing around with that value and forgot to set it back to default.


    Updated logs still nothing from the lights tho. If it's of any help my "rx" light on the mega is flashing rapidity when plugged into the pi after boot up.
    I get the two flashes from the ino sketch but no rainbow effect. Thanks for taking a look again.


    ssh in: Jan 23 23:07:08 retropie hyperiond[940]: EFFECTENGINE INFO: effect finished
    ssh in: Jan 23 23:07:35 retropie systemd[1]: Started Hyperion Systemd service.
    ssh in: Jan 23 23:07:56 retropie systemd[1]: Stopping Hyperion Systemd service...
    ssh in: Jan 23 23:07:56 retropie hyperiond[940]: INFO: Application closed with code 0
    ssh in: Jan 23 23:07:56 retropie hyperiond[940]: EFFECTENGINE INFO: Cleaning up Python interpreter
    ssh in: Jan 23 23:07:56 retropie systemd[1]: Stopped Hyperion Systemd service.
    ssh in: Jan 23 23:07:57 retropie systemd[1]: Starting Hyperion Systemd service...
    ssh in: Jan 23 23:07:57 retropie systemd[1]: Started Hyperion Systemd service.
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: Hyperion Ambilight Deamon (1006)
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: Version : V1.03.4 (brindosch-c750c41/dc6a602-1522918225
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: Build Time: Apr 5 2018 01:57:25
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: INFO: Selected configuration file: /etc/hyperion/hyperion.config.json
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: HYPERION INFO: ColorTransform 'default' => [0; 19]
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: HYPERION INFO: ColorCorrection 'default' => [0; 19]
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: HYPERION INFO: ColorAdjustment 'default' => [0; 19]
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: LEDDEVICE INFO: configuration:
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: {
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: "colorOrder" : "rgb",
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: "delayAfterConnect" : 0,
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: "name" : "MyHyperionConfig",
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: "output" : "/dev/ttyACM0",
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: "rate" : 115200,
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: "type" : "adalight"
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: }
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: Opening UART: /dev/ttyACM0
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: INFO: Creating linear smoothing
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: HYPERION (CS) INFO: Created linear-smoothing(interval_ms=50;settlingTime_ms=200;updateDelay=0
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: EFFECTENGINE INFO: 27 effects loaded from directory /usr/share/hyperion/effects
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: EFFECTENGINE INFO: Initializing Python interpreter
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: INFO: Hyperion started and initialised
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: INFO: Boot sequence 'Rainbow swirl fast' EFFECTENGINE INFO: run effect Rainbow swirl fast on channel 0
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: BLACKBORDER INFO: threshold set to 0 (0)
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: BLACKBORDER INFO: mode:default
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: started
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: INFO: Json server created and started on port 19444
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: INFO: Proto server created and started on port 19445
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: DISPMANXGRABBER INFO: Display opened with resolution: 1360x768
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: BLACKBORDER INFO: threshold set to 0 (0)
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: BLACKBORDER INFO: mode:default
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: INFO: Frame grabber created and started
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: BORDER SWITCH REQUIRED!!
    ssh in: Jan 23 23:07:57 retropie hyperiond[1006]: CURRENT BORDER TYPE: unknown=0 hor.size=0 vert.size=0

  • I personally couldnt get my setup working with the Mega but it worked perfectly fine with my Uno.


    I have my delayafterconnect set to 500ms , I dont think it needs to be that high but i had issues when it was at 0. I also use 500,000 for the Rate.

  • Sorry, what file is that argument in that I should edit, I just changed the Delay in hypercon to 500 saved the json and uploaded it


    https://hyperion-project.org/t…-ws2801-ws2812b-apa102.8/


    I wouldnt use that sketch though


    Code:
    Login: root
    Password: openelec


    - Mount the boot partition read/write:


    Code:
    mount -o remount,rw /flash
    - Open boot config:


    Code:
    nano -w /flash/config.txt
    Add the following line at the end and be careful not to adjust anything else:


    Code:
    #Increase UART speed
    init_uart_clock=14745600
    Press F2 to save and reboot your Raspberry.

  • Hey again sorry I have been sick the last few days so couldn't work on the project, but I have good news. Edited config.txt and got the uno today up and running, lights work! thanks so much for your help

  • Hey again sorry I have been sick the last few days so couldn't work on the project, but I have good news. Edited config.txt and got the uno today up and running, lights work! thanks so much for your help


    nice!!!! Yeah im not sure why it doesnt seem to be working correctly with the Mega. I wanted to use the mega because it had a little more memory. Either way glad you are up and running now.

  • we have a mega sketch on github, may you can try this...
    https://github.com/hyperion-pr…ega_pwm/hyperion_mega.ino


    just tried


    sketch uploads just fine and I get the Arduino startup affect when plugged into the laptop. If I plug the successful sketch into the RPI I do not get the Arduino Startup effect which is strange. I checked the baudrate and I have it set to 500000 but it seems the RPI still wont even give the startup Arduino effect.

  • //#define serialRate 460800 // use 115200 for ftdi based boards
    #define serialRate 115200 // use 115200 for ftdi based boards



    try those


    still nothing, im wondering if the Rpi is not supplying enough power to the mega. Like I said earlier when I connect the usb cable to my laptop I get the arduino startup affect. When I connect the UNO to the RPI I get the arduino startup affect. Unfortunately when I connect the Mega to the RPI there is no startup affect.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!