Shop OBEX P1 Docs P2 Docs Learn Events
Interactive Christmas light display Web UI control — Parallax Forums

Interactive Christmas light display Web UI control

jsaddictionjsaddiction Posts: 84
edited 2013-12-18 06:49 in Robotics
So I am working on a project to control a set of christmas lights. What sets these apart from others is the fact that each "bulb" has 4095 different colors and the entire display will eventually be controlled through a WIZnet ethernet card. I have a complete write up with videos on my website. http://www.lawrence.familyds.com/electronics/New%20Ideas/Web%20Server%20X-mas.html I am unsure of the "how to" for the web server side of thing. Any one try this sort of thing? Provide some Help?

Comments

  • xanaduxanadu Posts: 3,347
    edited 2013-12-08 11:05
    I think you can use any Spinneret code minding the IO assignments.
  • jsaddictionjsaddiction Posts: 84
    edited 2013-12-08 11:45
    I have not seen any code doing anything similar to what I'm trying to do. I may be overlooking something here. I think what im looking to do may require a database server to hold the values associated with each"switch". I have already set up mysql on my linux based server for use with xbmc. Im sure it would be easy enough to create another database with a single table containing each switch value. The wiznet could read This table on a preset time base. The ui Web page could also read this table on load. When ever a user clicks a switch it would change the associated entry in the table. Since the wiznet would be reading the table, the change on the ui would effect the light pattern the next time the wiznet reads the table. Since I want each instance of the ui to be linked to the database and represent the actual "switch" position I think I would have to use ajax in the ui web page to update the visual characteristics of the ui which would notify the user of the current selections. The problem is this. Im new to coding this stuff am im not sure how to get all of this into a final application.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-12-08 11:52
    I don't know if you're aware of this thread about GE-35 lights?

    I think the code posted in the thread is based on the same code you're using.

    I found (and purchased) two strands of 50 bulbs last year. I haven't seen any of the GE-35 lights for sale this year yet.

    I presently don't have an interface to the controller (a QuickStart board) but I plan to incorporate the GE-35 code with my project using a WS2801 strand. The WS2801 project has a wireless fob as an input device.
  • jsaddictionjsaddiction Posts: 84
    edited 2013-12-08 12:27
    Thats exactly where I got some of the code from as outlined in my website above. I am trying to replicate what he Robert did except add a bunch of channels and a different ui. I cheated a little and used his code with a little modification. I plan to modify his code some more to support variable string lengths and numbers of strands I only have one string right now so that part of the coding is on hold now.
  • xanaduxanadu Posts: 3,347
    edited 2013-12-08 21:32
    If you need a web server and database you could just plug an XBee into the web server and serve the control page wireless. Write the controls in PHP, make sure that the webserver has access to the dialout group for the com port.

    I've done this a few times with network robots that need a SQL database on Perfect Debian webserver setup and also XAMPP in windows. Not trying to talk you out of using the Spinneret but just thinking if you need a webserver attached anyway it could make things easier with coding and also be wireless.
  • jsaddictionjsaddiction Posts: 84
    edited 2013-12-08 22:51
    Sounds interesting. Dont think I understood most of what you said either...
  • jsaddictionjsaddiction Posts: 84
    edited 2013-12-09 12:24
    I think I atleast have a starting point with the front end now. Using an ajax call each time a switch is pushed I will pass the name of the switch to a php script that will edit the sql database when this completes it will tell the ajax script that everythink was ok and then the ajax will update the image used for the switch using a transition in css. The only thing I havent figured out at least a little is how to call a "update all switches" function with ajax based on time verses a clicked property.

    As far as the back end I havent researched anything about accessing the database with the wiznet to collect the switch positions and place them into an array. Has anyone tried this?

    Everything else should be the easy part. By the way, what do you guys think about disabling the UI between midnight and sundown using celestial data and the RTC? I could even set up a way to sync time with a time server on a daily basis or something to that effect. Maybe even put a 7 seg display on the web ui indicating minuets to "show time"
  • jsaddictionjsaddiction Posts: 84
    edited 2013-12-18 06:49
    Ok I now have a nice fluid grid control page that communicates with the mysql database. Its being served by my synology nas and works pretty well. I have been doing a lot of reading on php and database interface. I grasp the concept of accessing the db with php but now I need to fingure out how to access the db with the prop/wiznet combo. I read somewhere that one method would be to call a php file with a get or post function to tell php what to get from db and then the reply would be your desired data. I feel like there is a better way to get this done.

    Has anyone ever tried to connect to a mysql db directly using a wiznet?
Sign In or Register to comment.