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:
    22
    Likes Received:
    4
    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 (wrote the Settings Backup system for FPP), front end GUI not so much.

    I'm currently writing up the FPP plugin and see where I am time wise off that, before I have to work on my own display.
    I'm unsure if it will make it out to the wider audience this year. Time is fairly short.

    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)
    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
    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)
    In development - Now Playing

    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 current 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 logo to 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: Oct 13, 2017
  2. Boof63

    Boof63 Senior Elf Generous Elf

    Joined:
    Nov 7, 2011
    Messages:
    513
    Likes Received:
    10
    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:
    51
    Likes Received:
    23
    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:
    549
    Likes Received:
    65
    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:
    22
    Likes Received:
    4
    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:
    51
    Likes Received:
    23
    Location:
    Gold Coast
    Bad link
     
  7. pookie

    pookie New Elf

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

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

    Joined:
    Feb 16, 2011
    Messages:
    22
    Likes Received:
    4
    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:
    519
    Likes Received:
    18
    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:
    22
    Likes Received:
    4
    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
     

Share This Page