News

moodlite - Coming soon


AgileNebula Moodlite Build

AgileNebula · 1247

AgileNebula

  • Newbie
  • *
    • Posts: 13
    • Likes: +1/-0
    • View Profile
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. 



Pros:
  • Particle Cloud Support.  I am able to expose variables and functions to the cloud and that I don't have to open any ports on my router to call them.
  • Photon handles all the WiFi connection internally and it stores network credentials.  This means I don't have to put the SSID or password in the code which prevents accidentally forgetting to remove them before sharing the files.
  • Particle has native IFTTT support.  Because it uses a cloud, it took me 30 seconds to setup applets to get Google Assistant to call the functions.
  • Native Android & iOS support.  Instead of a built-in webpage, I am writing a native Android app to allow me to change settings.  This means I can control the Moodlite from anywhere, not just on the same network.  Not sure it is really useful but why not.  I don't have any Apple devices so I can't do an iOS app but if someone wants it, the SDK should make it easy to create.  Particle does have their own app which allows you to call the functions, my app is just to have a nicer UI.

Cons:
  • More expensive - $20
  • Operates at 3.3V - This may require a level converter to connect to the signal line on the LED strip.  Still testing this...
  • The footprint is different (i.e. smaller) so I am having to modify the Power Bottom file to make it fit cleanly.  Also, no screw holes in the board, so it will have to be attached with tape or hot glue.


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.



CdRsKuLL

  • The Fat Dude
  • Administrator
  • Full Member
  • *****
    • Posts: 110
    • Likes: +15/-0
  • Lighting the way...
    • View Profile
Reply #1 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

Moodlite is a completely free open source project.
If however you would like to say thanks and help contribute to this site, or just buy me a beer then please donate below. :-)



AgileNebula

  • Newbie
  • *
    • Posts: 13
    • Likes: +1/-0
    • View Profile
Reply #2 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.


Functioning LED Strip


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.



Bratag

  • Newbie
  • *
    • Posts: 2
    • Likes: +1/-0
    • View Profile
Reply #3 on: January 11, 2019, 05:40:07 PM
This is pretty awesome. I may make this moodlite MKII



LordVader

  • moodlite Developer
  • Full Member
  • *****
    • Posts: 113
    • Likes: +5/-0
  • I find your lack of faith disturbing!
    • View Profile
Reply #4 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?


AgileNebula

  • Newbie
  • *
    • Posts: 13
    • Likes: +1/-0
    • View Profile
Reply #5 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-



AgileNebula

  • Newbie
  • *
    • Posts: 13
    • Likes: +1/-0
    • View Profile
Reply #6 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.


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.


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.


It very simple to create a new applet.  If Google Assistant then Particle Cloud.


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 $.


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.
« Last Edit: January 14, 2019, 12:03:09 PM by AgileNebula »



hauschka

  • Newbie
  • *
    • Posts: 8
    • Likes: +0/-0
    • View Profile
Reply #7 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,



AgileNebula

  • Newbie
  • *
    • Posts: 13
    • Likes: +1/-0
    • View Profile
Reply #8 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.



hauschka

  • Newbie
  • *
    • Posts: 8
    • Likes: +0/-0
    • View Profile
Reply #9 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.



AgileNebula

  • Newbie
  • *
    • Posts: 13
    • Likes: +1/-0
    • View Profile
Reply #10 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:


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.



abvdo

  • Newbie
  • *
    • Posts: 1
    • Likes: +0/-0
    • View Profile
Reply #11 on: April 09, 2019, 12:44:38 PM
Is there any cheaper board than this Photon which can communicate with Google assistant like this?



AgileNebula

  • Newbie
  • *
    • Posts: 13
    • Likes: +1/-0
    • View Profile
Reply #12 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.



 


SMF spam blocked by CleanTalk