RPi3 + Arduino Pro mini / ATMega2560 + WS2812: slow updates

  • I've been poking around in the threads for a while and solved most of my setup issues doing so. I'm at the point where I'm still just testing Hyperion's direct control over the WS2812 strip before I start diving into the video capture portion of the setup. I'm trying with two different arduinos and getting the same behavior from both, so I can verify the source of the problem. 99% of the testing I'm doing is using direct terminal commands over ssh rather than using the HyperCon software as I tend to lean toward CLI stuff anyway.


    Testing setup:

    • Raspberry Pi 3 running Raspbian Stretch Lite (who needs a GUI on there anyway?)
    • Arduino Pro mini 16mhz 5v // Arduino Mega 2560
    • WS2812b LED strip (currently utilizing only 10 LED's for testing purposes)


    Raspberry pi config.txt parameters set for this project:


    Arduino sketch used:


    hyperion config (devices section only as the rest is currently default generated by HyperCon


    Things that are working:

    • Test light pattern upon arduino boot up (both behave the same)
    • Rainbow swirl upon hyperion service start

      • When arduino is configured for the test number of LED's of 10 AND when running at 115200 baud


    • Serial connection over GPIO UART ttyAMA0 @ 115200 baud
    • Serial connection over ttyUSB0 @ 115200 baud (only tested using ATMega2560)


    What's not working:

    • Serial control at the recommended 460800 baud on any interface
    • Attempted control over direct SPI using a 1k ohm resistor, GPIO18
    • Rainbow Swirl upon hyperion service start

      • When Ardiuno is configured for full strip use (108 LED's) and it's running at 115200 b, the led updates come in around 5-7 "fps"



    So the big problem I'm seeing is that when I set the arduino sketch to use 108 LED's as I expect to need on my TV, the color transitions become very "choppy" regardless if hyperion is configured to use 108 LED's or just the original 10 LED's.


    I'm pretty sure this has to do with the serial communication rate as I'm thus far unable to get my RPi to work over anything higher than 115200 baud. As you can see in the config.txt above I did try to set the serial clock rate higher, but I'm not sure if that's actually working, or how to check the current clock rate.


    Any help would be apprecaited!

  • Well that's kinda the point I'm getting at. Hyperion seems to be unable to communicate with either the Pro Mini or the Mega2560 at all at 460800. I'm using exactly the same sketch in each instance, just changing the serial rate in the sketch and in hyperion config. The arduino still shows the boot-up test pattern on the LED's but not hyperion's input.


    Both arduinos work when using 115200, albeit with slow refresh rate when I have them configured for 108 LED's


    To clarify, I'm using the UART pins on the RPi direct to TX0/RX0 on the Mega, and obviously the Pro only has the one serial

  • Hmm, sorry I missed the uart bit, thought it was via usb. I have no real experience with arduino communications to and from Pi via gpio's.

  • well I mean, worst case I could use the USB UART I'm using to program the Mini. It's got a Silicone Labs CP2104 (datasheet says max of 2mbps), but I'd rather cut out the middle-man if possible

  • Thanks for the link, unfortunately everything covered in that article I'm past, and it doesn't address increasing baud rates above 115200. A problem I'm running into is I'm not sure how to get serial feedback from the arduino as the adalight sketch doesnt seem to have any serialout for feedback or I could test the connection directly with minicom

  • Update, got ahold of a sketch with a serial print command on boot, tested at 57600 / 115200 / 460800, fun thing, the two slower baud rates worked, but the 460800 came out garbled, so something is definitely wrong with my pi and it's ability to work at higher baud rates, just need to trace that now.


    I'm gonna try a different RPi image and see if I get different results

  • Well I did get different results, but still not getting output I expect. Pic on the left is the raspbian Stretch image, one on the right is NOOBS Jessie using same sketch and 460800 baud. Expected to see it say "hello world":


  • I'm gonna try adding a level shifter, see if that helps.


    edit: No luck. I was able to get feedback from my atmega2560 running at 460800 on it's USB, but not the UART pins.
    I think I've narrowed it down to two possible bottlenecks: UART on the Pi is definitely not liking 460800 baud, and it's possible the Atmega328p can't go above 115200. I'm gonna grab an Atmega32U4 and try with that


    Edit2: Ok finally found something. I'm checking the UART input using an app called minicom. I've got it set to 460800 baud in it's settings, and I tried this with a sketch running at 115200 baud, and it came in correctly, which means the UART port will not go above 115200 even when set to do so.

Jetzt mitmachen!

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