This is a demonstrator web application. It shows how to control the Particle RGB led over the Cloud and over a Local network See the video on YouTube..
More information about the creation and development process in the articles on my website:
Particle Photon RGB Cloud Remote Control
Particle Photon RGB Local Remote Control
The code is well-documented so I hope it's a nice starting point to create some nice remote stuff.
I don't consider the used Webduino library stable enough. It doesn't support multiple clients. Problably Particle will implement an HTTP server in one of the upcoming releases (hopefully 0.8.0)
- Upload this build.particle.io RGB_LOCAL_REMOTE project on your Photon.
- Go to http://myphoton.local or http:/// the '.local' might not work on Windows systems, because they don't support mDNS by default (installing iTunes can help).
- Play around with the sliders to control the color of the RGB indicator led on the Photon.
- Upload this build.particle.io RGB_CLOUD_REMOTE project on your Photon.
- Download the code in "web_code/RGB CloudRemote" to your own computer.
- Modify the index.js code and add your own
deviceId
andaccessToken
to the code.- You can find the deviceId in Particle build under Devices.
- You can find your accessToken in Particle build under Settings.
- Open the index.html file on your local system.
- Play around with the sliders to control the color of the RGB indicator led on the Photon.
Upload the code to your Particle with an offline tool (https://po-util.com). You can control the RGB led directly by connecting to the PHOTON access-point. By opening http://192.168.0.1/index.htm in your browser.
See the steps above, you online need to install it on a (local) webserver that supports PHP. deviceID and accessToken are hidden in the php code (api.php), so they won't be visible to the end-user. In this way you can put a remote control publically online, without someone get more access to your device than desirable.
Have fun!