moodlite

moodlite => moonlite Builds => Topic started by: AgileNebula on January 05, 2019, 01:02:29 PM

Title: AgileNebula Moodlite Build
Post by: AgileNebula on January 05, 2019, 01:02:29 PM
First, let me say thank you to CdRsKuLL and everyone actively contributing to the project.  It is an amazing project.

Now on to my build.  I have chosen to go with a different micro controller, a Particle Photon board.  This is a board that I have used before which is a big reason I am going with it but there are a number of pros and cons which caused me to go this way. 

(https://i.imgur.com/4BMWXmw.jpg)

Pros:

Cons:


Currently, working on getting the electronics squared away and the LED strip working, hopefully by the end of the weekend.  I will post more pictures and updates as I make progress.   I am looking forward to seeing what people come up with to help with the diffusion issues.  I have a few ideas but need to order some more filament to test them.
Title: Re: AgileNebula Moodlite Build
Post by: CdRsKuLL on January 05, 2019, 01:12:37 PM
very interesting and great idea :-) looking forward to your updates.  FYI, the NodeMCU output is only 3.3v so you should be okay :-)


Please keep posting..


Steve
Title: Re: AgileNebula Moodlite Build
Post by: AgileNebula on January 07, 2019, 01:21:47 PM
Progress Update:

I have got my power module done and I am moving to testing different panel designs to try and get better diffusion. 

Completed Power Module.  Tape is temporary until I get out my hot glue gun.
(https://i.imgur.com/6fe9FkE.jpg)

Functioning LED Strip
(https://i.imgur.com/hWUTIOS.jpg)

I got Google Assistant working.  I can change brightness, speed and program from voice commands.  Each program uses a string for it's name, Google Assistant parses the string out and calls a ChangeProgram function on the Photon.  This allows me to name each program instead of using a number.  I also got an Android app working.  I will try and upload a video of the Android app later today.
Warning: If you have google assistant, this video may activate it.  :)



If anyone else decides to go the Photon route, let me know I am happy to provide the code/stls and help you through the process.
Title: Re: AgileNebula Moodlite Build
Post by: Bratag on January 11, 2019, 05:40:07 PM
This is pretty awesome. I may make this moodlite MKII
Title: Re: AgileNebula Moodlite Build
Post by: LordVader on January 11, 2019, 06:25:15 PM
Hi there!
Those Photon boards seem to be really cool! Unfortunately they are quite expensive here in Germany (around 40 EUR) but maybe I'll buy one just for the fun of playing around with it.

I've seen that you are planning to hot glue the Photon board into the power block. Do you have interest that I do some CAD'ing so that you can mount the board properly?
Title: Re: AgileNebula Moodlite Build
Post by: AgileNebula on January 12, 2019, 12:27:33 PM
I already hot glued my board in place but if you want to spend some time working on a version that doesn't require that, I am sure it would be appreciated.  I intend to build a 2nd one and not having to hot glue the board would be nice.  If you need the board's dimensions, Particle's website has them all.

https://docs.particle.io/datasheets/wi-fi/photon-datasheet/#recommended-pcb-land-pattern-photon-with-headers-
Title: Re: AgileNebula Moodlite Build
Post by: AgileNebula on January 13, 2019, 01:46:17 PM
I have had a couple of people ask about how I got Google Assistant to work, so I am doing a quick write up to explain the process.  Note: This only works with the Particle Photon boards, it will not work with the NodeMCU.

Connecting Google Assistant to the Photon board is really easy.  First, you have to write a function and expose it to the Particle cloud so that Assistant can call it.

Here are the functions I have exposed.  As you can see I have exposed functions to control the program, brightness, speed and to turn on and off the Moodlite.
(https://i.imgur.com/sI5m14fl.png)

Here are the functions in the Particle cloud interface.  This is a great way to test the functions to make sure they work properly.  I have the variables exposed as well so I can make sure the program is changing them.
(https://i.imgur.com/efe6eTW.png)

Now it is just a matter of setting up IFTTT applets (http://ifttt.com) to connect Assistant and the Particle cloud.  Here are the applets that control my Moodlite.
(https://i.imgur.com/yAsvqXql.png)

It very simple to create a new applet.  If Google Assistant then Particle Cloud.
(https://i.imgur.com/0xzXjEFl.png)

This is how my ChangeProgram applet is set up.  If I say "Change Moodlite Program to $" then it calls the ChangeProgram function on the Photon passing in whatever I said in place of $.
(https://i.imgur.com/oKeM1JMl.png)

That is it!  Now you just have to create an applet for each function and you are good to go.

It is worth noting that sometimes Google doesn't understand what you meant and saying it a different way will work, i.e. If I tell Google to "Change Moodlite Brightness to two-fifty" it fails, but if I tell Google to "Change Moodlite Brightness to two hundred and fifty" it works.  So if you set up an applet and it doesn't seem to work, try phrasing it differently.

I have gone ahead and attached the code that I am running on my Photon in case anyone wants to give it a try.  I am happy to answer any questions.
Title: Re: AgileNebula Moodlite Build
Post by: hauschka on February 01, 2019, 11:58:16 AM
Hi,

Thank you for the awesome port to the particle ecosystem!

I had a few Spark cores laying around from their Kickstarter phase and thought I'll quickly try your code. Not shure wether the 2 boards are directly compatible, but since the Photon is one of their successor boards, I thought I'll try.

I got a few errors and it seems like they stem form the FastLED library:

lib/FastLED/src/lib8tion.h:804:5: warning: "CLEANUP_R1_AVRASM" is not defined [-Wundef]
lib/FastLED/src/fastspi.h:11:6: warning: "CLK_DBL" is not defined [-Wundef]

And then there's this particularity, which Iassume is not a problem anymore with the Photon?

In Particle.function, name must be (12) characters or less
         static_assert(!is_string_literal<T>::value || sizeof(name) <= USER_FUNC_KEY_LENGTH + 1,

Just wanted to know whether you encountered similar errors when compiling your code?

Best regards,
Title: Re: AgileNebula Moodlite Build
Post by: AgileNebula on February 01, 2019, 01:18:47 PM
Interesting, I don't get any of the warnings when compiling for the Photon.   The code should be compatible with both the Photon and the Spark Core. 

The FastLED library is definitely compatible with the Spark Core so I don't think the warnings are an issue. 

I am specifically running OS target 0.8.0-rc.12 on the Photon.  I am assuming the Spark Core is targeting an older OS version which may be why I am not seeing the Particle.function error.   

If possible I would see what the latest OS version the Spark Core can run is and if that still doesn't fix it, it is easy enough to rename the functions to something shorter.

Unfortunately, I don't have a Spark Core to test against or I would try it myself.  Happy to help any way I can if you still run into problems.
Title: Re: AgileNebula Moodlite Build
Post by: hauschka on April 06, 2019, 01:48:11 PM
Ok, I found out that the "older" version of the Photon (the original Particle Photon) was limited the length of a function's name.

Spark/Particle had an awesome customer support and replaced the old board with a new board.

I have adapted your build  to make hexagons:
Check out the thread if you're interested: https://moodlite.co.uk/index.php?topic=134.0


Also, so far I couldn't get the on/off to work, I think it should trigger the
FastLED.show()  and FastLED.clear() functions.
Title: Re: AgileNebula Moodlite Build
Post by: AgileNebula on April 06, 2019, 05:36:28 PM
I got the On/Off working a while ago and forgot to update here.   To get it to work you have to change the color of each LED to Black.   Hope this helps.

Here is the code in my loop function:
(https://i.imgur.com/FU1N5Dt.jpg)

Glad Particle's support could help you out and nice work on the hexagons.  It looks good, I may have to give them a try later.
Title: Re: AgileNebula Moodlite Build
Post by: abvdo on April 09, 2019, 12:44:38 PM
Is there any cheaper board than this Photon which can communicate with Google assistant like this?
Title: Re: AgileNebula Moodlite Build
Post by: AgileNebula on April 10, 2019, 12:18:28 PM
The Photon is the cheapest board that Particle makes.  Since the setup to get Google Assistant working uses IFTTT, any board that can receive an email or a SMS message could be triggered by Google Assistant.   I personally have never set this up since the Particle boards make it easy.  I believe some of the other people were working on this with MQTT but I haven't paid much attention to how far they have gotten with the process.