5 months

40 views
Skip to first unread message

Tom Enos

unread,
Jun 18, 2015, 4:28:00 AM6/18/15
to lightsh...@googlegroups.com
I know this is only a part time project for all of us, but there are only 5 months (or 4 for some) left until most people will start there Christmas light projects.

Maybe we should set some goals for a new stable update by October, one that includes a web interface and maybe network support (I loved Paul's implementation and Chad Brochard has done some good work on the webUI).


If not adding in new features by then, then we maybe should just think about maintaining current features.  The version of pygoogle voice that is used no longer works.  I found a version that does work, but changing the install scripts (and depending on someone else to fix it) is a poor substitute for updating the code to a working version ourselves.  Maybe we should fork pygoogle voice to lightshowpi or a separate for lightshowpi repo and update the code ourselves as needed.  And with the closure of google code in the near future we would need to do something anyway.  

Any thoughts, comments, questions, concerns, doubts, rejections, should I shut-up and just go with the flow?

Some side notes

I have been playing with the code base and made some discoveries.

Chris had the idea of each pin encapsulated in it's own class.  I though that would lead to a performance lose, but I was WRONG.  It worked great if the rest of the class was implemented correctly (without a lot of what I thought looked like clever code).  And if the pins were encapsulated a lambda could tell the pin which write method to use (digital write, softPWM write, analog write) and with a little effort that would make adding in LED strips easy. 

Paul's network code (for the server) can be moved to the hardware manager and expanded on, and with a little cPickle magic it can be customized, to work with the pre and post shows, and use the untapped potential of the clients to do a little of the math and show only the channels you want it do display.

I also was able to make Tkinter display a working gut of the lightshow in linux without major mods to anything but the hardware manager, and with a little effort and the addition of pyaudio, Linux and Windows could display a virtual lightshow in a Tkinter gui (I don't have a Mac to play with so that is up in the air).  

And with the network additions I could control multiple RPI's from my desktop, 2 RPI's were controlled by my desktop, playing music from an mp3 playlist or audio-in streams, each only lighting up chosen channels (1-7 on the first, 8-16 on the second) in pwm or onoff modes with no performance issues (My desktop could handle the math, as could most desktops, laptops, netbooks). And a second stream of just the audio could be added for speaker output on one of the PI's.  
And the input audio stream could be an mp3, pandora, lastFM, Youtube, pretty much anything you could get audio from.

I still ran into a lot of performance issues if the PI had to decode an mp3 and use a lot of PWM channels (lame needs cpu and so does softPWM).  But converting mp3 to wav, and using wav was a simple solution.  

In PWM mode for all channels and an mp3 file for audio and SMS enabled, it was some where about 26 to 30 channels (depended on t the mp3 file) that played without a stutter.  Using a wav file changed all the results and I never tested for a max PWM channel limit with wav as input.

SMS resulted in a 10-20 percent decrease in performance, because of the current  implementation, stop and restart in after a time period.  Instead it should run, check for messages, then sleep for a period, then check again.   The start up and rereading the config is a big cost. Running SMS in a loop resulted is on a 7 percent cost when checking for messages.




Todd Giles

unread,
Jun 18, 2015, 2:20:22 PM6/18/15
to lightsh...@googlegroups.com
Love all the ideas you present.  My personal situation is such that I'm simply unable to put much time into right now.  If you'd like to take a branch and simply move forward that is always a reasonable option.  I'll try to review changes if / when I have time - but I simply cannot give any guarantees.

Again - my main point is don't use my lack of time as a reason to not continue improving the software!  Simply take a branch and run with it, and share the results!

-Todd

--
http://www.lightshowpi.org/
---
You received this message because you are subscribed to the Google Groups "LightShow Pi Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lightshowpi-d...@googlegroups.com.
To post to this group, send email to lightsh...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lightshowpi-dev/0b3141bf-5c4c-4a51-9efc-b519e59aca06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Enos

unread,
Jun 19, 2015, 1:15:38 AM6/19/15
to lightsh...@googlegroups.com
Okay then, I created a new branch in my repo.  And I worked in most of what I mentioned earlier,  the Desktop GUI (I need to work out a good way to install it on a Windows box and a generic Linux installer, no Mac for testing), A modified version of Paul's network code that customizes the channels that the clients display, It's a fully OOP version of the code with some improvements.  I still need to get the documentation together.  I'll start on getting the WebUi working with it too.


It's still very rough.  There are a few code stubs that are not finished, but everything is working.

Also I will in the next few day submit updates to the install scripts in the project master and stable to use an updated version of PyGoogleVoice,  I am also forking PyGoogleVoice and will look into maintaining a version for us.  

On a side note
Anybody here any good with Java?

Chris Usey

unread,
Jun 19, 2015, 8:55:26 AM6/19/15
to lightsh...@googlegroups.com

Tom 

I am excited to see you pushing forward with this. I love the ideas and your drive. I wish I could lend more time to this project but I'm in the same boat as Tod. My time is short and my attention is needed elsewhere at this point in time. I keep crossing the box with all my LightshowPi stuff in the garage and it eats at me not to be able to pick it up and start playing lol! I hope to be able to find the time to contribute more soon, but right now I can't offer much more than ideas, thoughts, and past experiences. Keep us updated and please share your developments, I look forward to being able to test and contribute again soon.

Chris Usey

Todd Giles

unread,
Jun 19, 2015, 9:26:15 AM6/19/15
to lightsh...@googlegroups.com

Java - that's the primary language I'm working in at work...  I chose python for this project when I started simply to learn ;). What Java needs do you have?


Tom Enos

unread,
Jun 19, 2015, 4:19:17 PM6/19/15
to lightsh...@googlegroups.com
I'm teaching myself Java and I am doing so by porting lightshowpi to java, and that means the java version must be 100% comparable with the python version (config files, sync files, network broadcast data).  I use python pickles to send the network data and also numpy stores one array I have as a pickle.  
Long story to short,  any idea how to unpickle a python pickle in Java?  I can't find any information of how the pickle is structured. 

Tom Enos

unread,
Jun 19, 2015, 4:27:12 PM6/19/15
to lightsh...@googlegroups.com
Ideas,  keep them coming.  You have pointed me in the right direction more then once.

Todd Giles

unread,
Jun 19, 2015, 4:29:49 PM6/19/15
to lightsh...@googlegroups.com

I've no experience with python pickles outside of this project.  I'll ask colleagues though, I work with many Java gurus...


Tom Slick

unread,
Jun 19, 2015, 4:56:23 PM6/19/15
to lightsh...@googlegroups.com
Thanks

--
http://www.lightshowpi.org/
---
You received this message because you are subscribed to a topic in the Google Groups "LightShow Pi Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lightshowpi-dev/qAlbkPlCm4I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lightshowpi-d...@googlegroups.com.

To post to this group, send email to lightsh...@googlegroups.com.

Todd Giles

unread,
Jun 20, 2015, 11:45:49 PM6/20/15
to lightsh...@googlegroups.com
So - no one in my immediate circle has had to deal with unpickle'ing in java ... a quick google search found this possibility:




Tom Slick

unread,
Jun 21, 2015, 5:19:43 PM6/21/15
to lightsh...@googlegroups.com
Thanks, I'll look into it.  

I don't like the way I am doing it now for the numpy pickle
And something similar for the cPickles

[code]
String out;
String script = "import numpy;\narrays = numpy.load('" + name + "');\narray = arrays['" + key + "'];\nfor a in array:\n print a;\n";
try {
      Process python = Runtime.getRuntime().exec(new String[]{"python", "-c", script});
      pythonProcess.waitFor();
      try (BufferedReader reader = new BufferedReader(new InputStreamReader(python.getInputStream()));) {
          StringBuilder buf = new StringBuilder();
          String line = null;
             while ((line = reader.readLine()) != null) {
                buf.append(line).append('\n');
             }
             out = buf.toString();
      }
catch (IOException | InterruptedException ex) {
   Logger.getLogger(Reader.class.getName()).log(Level.SEVERE, null, ex);
}
[/code]


Reply all
Reply to author
Forward
0 new messages