1. New to Christmas lighting? Get started with the AusChristmasLighting 101 Manual:
    auschristmaslighting.com/wiki/AusChristmasLighting-101

FPP Display Voting Website & Yet another 'Christmas Light Finder'

Discussion in 'The Development Lab' started by jaredo, Oct 10, 2017.

  1. jaredo

    jaredo if (blink==true){ doFlash(); }

    Joined:
    Feb 16, 2011
    Messages:
    26
    Likes Received:
    6
    Location:
    Rockhampton
    Find Me On:
    Hi All,

    I've been working on a project on and off for the past year or so. It's primary focus is allowing/enabling voting on sequences in my display and secondary as a Christmas light finder for my local community.
    I'm intending to let viewers use this functionality in 2017

    The aim was to make the site very mobile friendly by making it a Single Page Application (SPA) web app, It's my first time approaching web applications in this manner and has been quite a fun challenge, back-end coding is my forte (very much coding random web stuff regularly), front end GUI not so much.

    Website (still doing tweaks & bugfix)
    https://christmaslightsnear.me (HTTPS is forced here, google maps requirement)

    FPP Plugin
    The FPP plugin has been written, seems to work well in my bench testing.
    I've built it with every option I needed for my display this year,
    https://github.com/jaredb7/FPP-VotingAPI-Integration
    If you wish to play with it, you'll need to change the API Server under Advanced Settings to "Development"
    Then use the Dev site below.

    I just wanted to show everyone what I've been working on and get a feel of what others think?
    Only registered members can see the spoiler. Please log in or register.
    If you find any issues / bugs let me know.
    Site may randomly break!!

    Basic features:
    Playlist voting (for displays that have this turned on)
    'Now Playing' shown on website
    Geolocation - Maps all use the users location, if they open the website outside your display, they will have your display show up in front of them.
    Radius Search for displays around you (reliant on displays being added)
    Address Search to find displays at a location
    Favourites & "To Visit" list (very basic)
    Google Maps Directions to a display or through list of displays (via to visit)
    Adding / Editing displays
    Creation of "devices" & API key (this gets placed into the plugin configuration)


    Tech Features, which you may or may not care about:
    Stateless authentication through the use of Tokens
    Almost all requests checked for authentication where required.
    API Rate limiting on voting API's (to prevent abuse)
    Checks on Voting API so votes aren't accepted outside the Displays show times.
    Device API creates in a basic way so it can be used for systems other the FPP.
    Security checks for display/device modification (preventing abuse)
    Client Side Image resizing (saves uploading 4-10MB images to the back-end for processing)

    Stuff that doesn't work:
    Favourites or "Displays to visit" aren't saved to the server, it's currently being stored in your browsers 'Local Storage' area which is similar to cookies. So favourites added through your PC, won't show when/if you the site on your phone
    I didn't have time to develop this further. Works good enough for now

    More Screenshots / https://imgur.com/a/rGik2

    desktop_full.png desktop_full_display_view.png desktop_full_display_view_voting.png
    View post on imgur.com
     
    Last edited: Nov 12, 2017
  2. Boof63

    Boof63 Senior Elf Generous Elf

    Joined:
    Nov 7, 2011
    Messages:
    543
    Likes Received:
    14
    Location:
    Kadina
    Would like to say well done- looks like a lot of work.. would like to try it out just for voting on sequence, But i have a captive audience (no one else for 100km) so they have to enjoy my selections (insert evil laugh):), Regardless congrats, looks the goods to me.
    Cheers Boof63
     
  3. Ellis

    Ellis Apprentice Elf

    Joined:
    Aug 21, 2017
    Messages:
    91
    Likes Received:
    36
    Location:
    Gold Coast
    I think its a great idea, looking forward to seeing the end result
     
  4. ryanschristmaslights

    ryanschristmaslights Senior Elf Administrator Generous Elf

    Joined:
    Jun 30, 2010
    Messages:
    564
    Likes Received:
    75
    Location:
    Adelaide, Australia
    Find Me On:
    Very interesting :). The light finder portion gives me some ideas for potential changes to AusChristmasLighting's display locations area into the future.
     
    Boof63 likes this.
  5. OP
    OP
    jaredo

    jaredo if (blink==true){ doFlash(); }

    Joined:
    Feb 16, 2011
    Messages:
    26
    Likes Received:
    6
    Location:
    Rockhampton
    Find Me On:
    The all precious dev environment is available, have a look around and let me know.
    Only registered members can see the spoiler. Please log in or register.
    If you find any issues / bugs let me know.
     
    Last edited: Oct 13, 2017
  6. Ellis

    Ellis Apprentice Elf

    Joined:
    Aug 21, 2017
    Messages:
    91
    Likes Received:
    36
    Location:
    Gold Coast
    Bad link
     
  7. pookie

    pookie New Elf

    Joined:
    Nov 28, 2015
    Messages:
    29
    Likes Received:
    10
    Location:
    Warragul
    Link is good now.
     
  8. OP
    OP
    jaredo

    jaredo if (blink==true){ doFlash(); }

    Joined:
    Feb 16, 2011
    Messages:
    26
    Likes Received:
    6
    Location:
    Rockhampton
    Find Me On:
    This is making me look bad lol (this is like the 3rd try), try again?
    dev box doesn't want to talk back out to the internet :(
     
  9. bbayjohn

    bbayjohn Senior Elf

    Joined:
    Mar 4, 2012
    Messages:
    532
    Likes Received:
    19
    Location:
    Batemans Bay
    Find Me On:
    Thats what makes this hobbie so rewarding - failure leads to greatness. :thumbsup::thumbsup:
     
  10. OP
    OP
    jaredo

    jaredo if (blink==true){ doFlash(); }

    Joined:
    Feb 16, 2011
    Messages:
    26
    Likes Received:
    6
    Location:
    Rockhampton
    Find Me On:
    omg it's aliveeeeeeeeee.
    4 hours of careful coding and chin scratching - polling & playing of the highest voted playlist item via the website is a thing now.
    FPP doesn't support or can't (probably for obvious reason) go play a playlist when it's running a scheduled playlist. Seems to cause FPP to restart the currently playing sequence.
    Forcing FPP to stop playing the current playlist is a bit of a risky move so a bit of time was trying to make sure if it did fail or jam up while stopping the currently playlist, the plugin would give FPPD a big kick (eqiv to hitting "Restart FPPD") as a last resort to get it running again (won't attempt to play whatever playlist it was trying to play).

    A event at the start of the Playlist fires off a rather lengthy script that checks for the most voted item, creates/recreates a new playlist for that item.
    Does a bucket load of checks, then tells FPP to stop/pause, then tells it to play that playlist in non-repeating mode.
    By some feature, fluke or bug, if you're running under a schedule, after that playlist is done FPP reverts to the set schedule playlist to start the process again.
    That's really quite handy, and the plugin leverage's that to get the job done.

    plugin keeps track that it transitioned to another playlist, that way when FPP returns to your schedule playlist (thus running event again)it doesn't then go off in a infinite loop of playing the highest voted item.
    The set schedule playlist will play in full & repeat, where it runs the event again and go we off play whatever.

    I'd file this whole thing under "bleeding edge / experimental" most because of the whole "stopping running playlist" thing.
    FPP 2.0 was meant to make that easier, hopefully we see that next year.

    Bit of a demo, screen isn't exactly clear though
    Goes from Schedule Playlist > Repeat then running event > plays skrillex as its the most voted item > it ends > back to schedule playlist > I vote Carol of the bells over and above the skrillex track > wait for schedule playlist to loop around & run event > plays carol of the bells
     
    Boof63 likes this.
  11. ezellner

    ezellner New Elf

    Joined:
    Feb 12, 2017
    Messages:
    18
    Likes Received:
    6
    Location:
    West Bloomfield, Michigan, USA
  12. OP
    OP
    jaredo

    jaredo if (blink==true){ doFlash(); }

    Joined:
    Feb 16, 2011
    Messages:
    26
    Likes Received:
    6
    Location:
    Rockhampton
    Find Me On:
    Just a update on this whole crazy thing. Literally out of time for anything else, time to move to prop build.

    But have managed to get things together, at the very least I wanted to give this a shakedown on my own display this year.

    FPP Plugin
    FPP plugin has been fully written, tested and seems to work fairly well.
    Also sends now playing data to the website, this gets shown about the playlist, website polls for updates every 10 seconds.
    Now playing is sent every time a new sequence starts. The website determines when this should stop showing based on time submitted and media length
    https://github.com/jaredb7/FPP-VotingAPI-Integration

    have included images so you can get an idea of what the settings page looks like + have a read of the option descriptions and see if they make sense.

    Website:
    https://christmaslightsnear.me
    Website is public facing now, Have lost track of what I changed on the website, but put in a feature I wanted which was to be able get a URL/Link for your display so you could link people directly to the displays page. Few tiny bugs and usability issues but nothing major.

    Links are a little like this
    Only registered members can see the spoiler. Please log in or register.

    Still very much "experimental" but comments on where this should go from here and questions welcome.

    Keith is looking into putting this functionality into a tool for xLights too so those wanting to tinker there will able to.
     
    Last edited: Nov 14, 2017

Share This Page