link back to primary post BYOB Party #1, "Bring you own Bulbs" - The Internet of Holiday Lights
In this episode I will demonstrate and provide all the code used to allow a browser / smartphone / tablet to adjust the colour of a light strip that is connected via an NRF24L01 2.5Ghz wireless link
In a previous episode I showed how to get Mosquitto server, pub and sub clients loaded into the YUN and how to use them
This post is extending on Benjamin Cabé's excellent demonstration and after finding all the scripts and getting the page hosted by the YUN itself I have a working demonstration that looks like the following
I can enter colours from either a subscription to the wheel ("theBreadBoard_Strip") being hosted at iot.elcipse.org or by entering colour selections directly at the YUN or the UNO via their serial terminals
Pay attention to case as the subscriptions are case sensitive
any changes via the wheel is almost instantly relayed to the UNO and subsequently displayed on the light strip,
The UNO is supporting a command interpreter to allow direct commands to be sent to it via any configured input mechanism (Serial or NRF at this time)
The YUN is supporting a simpler command structure at this time and simply relays the commands it receives onto the UNO via the NRF radio
A point to note is the YUN does not support the standard output pins for SPI, namely the MISO, MOSI and SCK lines do not exist on pins 11, 12, 13 and are only accessible via the programming header and the Infineon Shield needs stacking headers if your to add additional IO devices like a NRF24L01
Once all the pins where sorted out it was simply a matter of finding all the additional libraries for the web page to operate, the basic functionality required for talking to iot.elcipse.org of course comes from the PAHO js libraries but the colour wheel , Raphael and the boostrap all had to be found
Bootstrap · The world's most popular mobile-first and responsive front-end framework.
on the YUN you need to create a folder and sub folder in the root of a micro SD card "/arduino/www", once loaded into the YUN it immediately shows up at this location under the LINUX "/mnt/sda1/arduino/www" and a simpler path "/www/sd", from the home network it can be accessed as "http://arduino.local/sd/", it will automatically serve index.html
I have zipped up the SD card structure and attached for you to use
also the modified sketches for the YUN and the UNO with MQTT support and NRF24L01, there not cleaned up yet but they all work
I will be cleaning up the sketches as I add more functionality etc, I am getting close to full ram usage so it is essential before I continue much further
here is a quick video to show how it functions,
Top Comments