1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

RPi + OpenELEC UDP effect example

Discussion in 'Software Support' started by MrBramme, 12 January 2017.

  1. MrBramme

    MrBramme New Member

    Messages:
    8
    Hardware:
    RPi3
    Hi guys,


    I’ve got my hyperion ambilight setup perfectly (my setup runs on a raspberry pi à serial to arduino uno à leds), but I’m currently looking into the UDP effect. However, I cannot find any examples on how to use this effect. I see a lot of potential for this effect, just need to find one example to get me going.


    Regards
     
    • Like Like x 1
  2. penfold42

    penfold42 Active Member

    Messages:
    746
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    I wrote that - weve removed it in Hyperion.ng as I wrote a native udp listener so it's built in.

    There's also a udp led device type that I also wrote - the effect was a quick hack to implement a simple receiver for it

    I wrote it so I could forward raw led data between Hyperion instances or to an esp8266 wifi receiver.
    Of course this effect and receiver lets "something else" feed raw data to Hyperion.
     
  3. MrBramme

    MrBramme New Member

    Messages:
    8
    Hardware:
    RPi3
    Hi,
    Thanks, This is exactly what I'm trying to accomplish: let esp8266 talk to my hyperion instance and color the leds as i wish :)
    I'm a bit confused on how to implement this exactly?

    I've seen (I can't check now, not at my home network) 2 UDP effects in the hyperion remote (ios), that's where i've started my search for more info.

    Do you happen to have a link to some github repo's or code etc that I might be able to take a peek at? I'm just not too sure on how I can feed the raw led data to hyperion.

    One of my idea's is listening to sounds in my living room, ..., and based on some logic visualise that sound using hyperion.
     
    • Like Like x 1
  4. penfold42

    penfold42 Active Member

    Messages:
    746
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    The effects are all written in python in the Hyperion effects folder.

    The protocol is as simple as it gets.
    A udp packet
    3 bytes per led = red, green, blue
    Repeat for as many leds as you have
     
    • Like Like x 1
  5. MrBramme

    MrBramme New Member

    Messages:
    8
    Hardware:
    RPi3
    Many thanks! Should have opened that earlier :)
    Seems easy enough. Will have to give it a try this weekend. I'll keep you posted!
     
    • Like Like x 1
  6. iVarco

    iVarco New Member

    Messages:
    11
    Hardware:
    RPi3, 32/64bit
    Is it also possible to have Hyperion react to music? I'd love to work on that, if its possible.
     
  7. penfold42

    penfold42 Active Member

    Messages:
    746
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Not a good clean solution yet.

    People have used separate grabbers to do it, but I think we really need something to get the FFT data directly from kodi.
     
    • Like Like x 1
  8. iVarco

    iVarco New Member

    Messages:
    11
    Hardware:
    RPi3, 32/64bit
    Mhh okay,
    This would be the next level experience for Hyperion I think..

    will stay tuned for any possible solution, is there some - lets say - dirty setup out there?

    FFT Data is new to me.. but is audio grabbing itself possible? like the way v4l-grabbing works?
     
  9. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
  10. MrBramme

    MrBramme New Member

    Messages:
    8
    Hardware:
    RPi3
    I had parked this for a little bit while I focussed on another project. but I've picked it back up today. I've been able to successfully set the colors of the individual leds using python code on another raspberry pi.
    Need to do some more experimenting, with regards to speed and then clean out my code.
    my plan isn't to capture audio from Kodi, but to listen to the surrounds on an Arduino (could be tv, could be my kids, could be anything), and have my leds go bonkers on that :) but then again, I'm testing with python right now and not c++ ;-)

    if you're interested, I don't mind sharing my code after I've cleaned it out a bit.

    My mind is going nuts with applications of this new-found knowledge: a clock-like effect (though precise time won't be an option), effects when the door bell rings, a reminder at a specific time, .... oh boy .... :)
     
  11. penfold42

    penfold42 Active Member

    Messages:
    746
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Clocks been done 3 times already as a python effect !

    Ambient Audio would be interesting if you had something like an esp8266 with external ADC. The internal one is pretty crap
     
  12. MrBramme

    MrBramme New Member

    Messages:
    8
    Hardware:
    RPi3
    the clock was lowest on my todo list since I have a digital clock right beneath my tv and a large analog one on the wall nextto tv :) but it sounds nice. I'll track down the existing scrits first. thanks for the pointer!

    Well, once i've been able to capture the ambient audio (was indeed planning on using an esp) i'll let you know!
     
  13. MrBramme

    MrBramme New Member

    Messages:
    8
    Hardware:
    RPi3
    We'll, I've ordered the parts... now we wait :)
     
  14. drc85

    drc85 New Member

    Messages:
    21
    sorry for bringing this up, im trying to receive the udp signal on my esp...
    i found a tutorial but it has no webserver to change effects etc... its made to use with the app....

    i wanted to use my own local webserver instead so i can have the functions i want when controlling the led...

    how can i use the udp listener on the esp without using the sketch from the link?
    are there some code examples? i cant find the code inside the sketch... i think wrapperudp has somehting to do with it...
    https://github.com/SciLor/ESP8266_Hyperion_LED-Controller
     
  15. penfold42

    penfold42 Active Member

    Messages:
    746
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Who’s sending data to who ?

    Both ways are supported by hyperion.

    This thread is about foreign devices sending LED data into Hyperion to be displayed by Hyperion on the LEDs
     
  16. drc85

    drc85 New Member

    Messages:
    21
    thanks, i know i thought the udp part is similiar since its working both ways. i didnt wanted to open up a thread again i already opened a few..

    in my case hyperion (on htpc) sending the data to the esp wich is controlling the led...

    i would love to use the hyperion app but unfortunatly it dont works if hyperion (on my htpc) is off..
    (pls correct me if im wrong im still new to hyperion and coding)

    if each esp could receive only the udp signal from hyperion, i still could run each esp led device with my color patterns/effects even when hyperion(htpc) is off...the link i posted is doing this but its for the use with the app only... there must be a way to get the esp acting as a udp listener (as a pattern inside my the local webserver im using) without the app... but i cand find any examples

    edit i finally found something
    https://hyperion-project.org/wiki/UDP-Device but still need to figure out how to implement this inside
     

    Attached Files:

    Last edited: 8 January 2018
  17. drc85

    drc85 New Member

    Messages:
    21
    im getting closer... i finally found a simple example how the udp works... now i need to test :Dhttps://github.com/penfold42/stuff/blob/master/ESP-udp-neo.ino
     
  18. penfold42

    penfold42 Active Member

    Messages:
    746
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    That penfold42 guys code is rubbish...
     
    • Like Like x 1
  19. Akriss

    Akriss Active Member

    Messages:
    567
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    LOL.

    Ya this as well https://github.com/penfold42/ESPixelStick, if your running Hyperion.NG that supports UDPE 131 ;)

    The 4 or 5 wemos mini's I have been running that "rubbish" for a bit. :whistle:

    Thanks!
     
  20. drc85

    drc85 New Member

    Messages:
    21
    lol...
    they working for me too if i run them..thanks for that.

    thats not the problem...
    im no developer its hard for me to see what part is neccesary for olny the udp signal inside the sketch...so i can use it for my own local webserver...
    i got the feeling u guys wont tell it because u want ppl to download the app...

    but lets see i will find out :D im getting closer

    looking the neopixel file made me realise there is a UDP RAW file wich seems to do what i need.... :)
     
    Last edited: 8 January 2018