Arduino GE G-35 Mul...
 
Notifications
Clear all

Arduino GE G-35 Multi-String Controller Code

16 Posts
7 Users
0 Reactions
8,642 Views
Posts: 37
Topic starter
(@firstone)
Eminent Member
Joined: 15 years ago

Well, to be perfectly clear, when I said it was too slow, I meant ethernet communications, which, in turn, is caused by SPI. E1.31 protocol is just has too much overhead for Arduino SPI to handle. If I use my own protocol, which is MUCH shorter, it has somewhat useable refresh rate. At the cost of loosing existing software compatibility, of course.


Reply
Posts: 10
(@thombrooks)
Active Member
Joined: 15 years ago

I'm definitely interested in seeing the Java code to send the commands. It would also be nice if you threw an examples/ subdirectory into one or more of these, just to mock up a couple typical uses.

You've written a lot of code to animate lights programmatically; this could help cut down on how much data needs to be sent over the link to achieve a pretty stunning effect over a given range of lights. Are you creating any light sequences using an editing tool, or just writing code to do them on the fly? Had you considered supporting the playback of canned shows (a la Vixen), like some existing projects (e.g. Lumos) do? There seems to be some compatible thought going on there... it looks like it would be fairly straightforward to write a Lumos plugin which supported your remote protocol, if that makes sense.

In my setup, I'm using a Roving Networks RN-XV (wifi module in xbee form factor) on a sparkfun XBee Explorer Regulated board, connected to a Arduino Pro mini, for a small form factor in an enclosure that will live outside. It joins my home wifi network on startup; now I'm programming it to listen for UDP broadcasts to tell it to change the lights. So I think your code/library are an excellent fit!

I hope it will scale pretty easily, too - by either adding more of these wifi+arduino pro mini's, or changing to actual XBee modules to create a mesh network. That way, it would be possible to create almost 'stand-alone' features in a light display, spread out across your yard, without having to worry about running data lines. You could hit one address to control Rudolph's red node blinking, another one (on another controller entirely) to change the color of the star on top of the tree, all transparently from the overall show's scope ...

:freak:


Reply
Posts: 37
Topic starter
(@firstone)
Eminent Member
Joined: 15 years ago

I will add my java project to git as well. The animation is compiled into the main file so there are no examples per se. But it will have stuff that I currently created. Nothing too spectacular though - I'm a programmer, not a designer. Certainly nothing as nice as you can do with some sequencing software. Just some basic runs and color changes.

I have considered writing a player rather than writing code on the fly. But Vixen 3, which supports RGB channels, is not out yet. I've tried LightShow pro, I think. Nice but I don't know their sequence file format. And don't really have time to reverse engineer it. Plug-in would be very easy to write if you know the incoming file format. Also, I don't want to invest too much time into it because I'm hoping that upcoming Arudino Due will be fast enough to process E1.31 properly.

You can certainly scale using multiple arduinos but I don't know if network reading delays are a good reason to scale (and pay associated costs). At that point I might as well get E681. Especially since a single arduino can easily control > 10 strings.

I will post a link once I check in the code.


Reply
Posts: 37
Topic starter
(@firstone)
Eminent Member
Joined: 15 years ago

I've added the code to my java controller to git

latic

If you want to actually compile it, I'll create a README. But feel free to poke around.

The sample animation would be under java/app. File is called Animation.java.

Libraries are under java/libsrc/erissoft.

My custom format is very simple followed by 5 bytes per each string on the same arduino port+ 4 bytes data. This repeats for multiple ports. The fewer ports you use the better of course.

If you have any questions, feel free to ask.


Reply
Posts: 10
(@thombrooks)
Active Member
Joined: 15 years ago

This looks very cool - I love how you're using the user's lat/lon and tz to find the sunrise/sunset times, and factor those in.

It seems like a lot of the code was duplicated between the java and Arduino sources you posted earlier; is this because you started out programming it all on Arduino, then decided to shift the responsibility of who 'calls the shots' over to the machine running java?

It's also neat how in the xml config you target specific strings which are named after the features they're on (door frame, left tree, etc.)

If you did have a chance to put together some kind of README file, I'm sure it would be appreciated by a bunch of people on here, myself included. I feel like there's a lot of power & extensibility here but don't know how to wield the tool yet.

(Monkeys, holding bones, dancing around a black stone slab, etc.)


Reply
Posts: 37
Topic starter
(@firstone)
Eminent Member
Joined: 15 years ago
thombrooks wrote:This looks very cool - I love how you're using the user's lat/lon and tz to find the sunrise/sunset times, and factor those in.

This was done because this program is supposed to work with my large larger home automation application. It shares a couple of common libraries with it. But basically, I have it programmed to turn on all the lights 10 minutes after the sunset. And I don't want extra messages on the network for no reason. Thus, I have a delay here as well.

It seems like a lot of the code was duplicated between the java and Arduino sources you posted earlier; is this because you started out programming it all on Arduino, then decided to shift the responsibility of who 'calls the shots' over to the machine running java?

That is precisely the reason. But also, Java part kept evolving while arduino stayed mostly static. On the plus side, it allows you to code arduino part to display at least some static non-moving picture even when java part is not running. So that when you shut down java part, you're not left with some animation leftovers but have something lit up nicely.

It's also neat how in the xml config you target specific strings which are named after the features they're on (door frame, left tree, etc.)

This is a part of those refinements I've added on java side. I think it makes whole house sequences easier to write. For instance, I start from the roof and when the animation hits certain points in the middle, the tree starts. And when the tree is done, the ground line starts from that point and goes outwards.

If you did have a chance to put together some kind of README file, I'm sure it would be appreciated by a bunch of people on here, myself included. I feel like there's a lot of power & extensibility here but don't know how to wield the tool yet.

I'm working on refining those classes to get rid of a bunch of fluff and make them fairly easier to understand and use. Once I'm done with that, I'll definitely put together a README file.


Reply
Page 2 / 2
Share: