Web Page Control of WS2811 LEDs Using the IoT Gateway on Raspberry Pi

Table of Contents
Description

This Quick Byte further demonstrates the possibilities for IoT and the Propeller 2. It’s the second in a series with Send Email from the Propeller 2 Using the IoT Gateway on Raspberry Pi, and uses the same setup. 

Using the Raspberry Pi as an internet gateway, the included code allows a set of RGB lights connected to the Propeller 2 to be controlled via a webpage hosted on the RPi.

Whilst this simple demo allows two-way control of the WS2811 LEDs, the example could be extended to other forms of remote control or data acquisition from a Propeller 2. 

The example webpage is written in standard html and php, and you can find the index.php file in this folder once you download the project from GitHub : demoFiles-webCtrl \ webCtrl.

Review the index.php example to see how to adapt the code on the RPi side of the gateway for your own purposes.

For the Propeller 2, you can start with our full Spin2 at the bottom of this Quick Byte. Use our free Propeller Tool IDE to open the “demo_p2gw_web_control.spin2” file from the archive. The code communicates with the index.php file on the RPi, and you will be able to see how the system exchanges data between the two microcontrollers to expand it for your own needs.

Whilst we provide the basics to get the RPi IoT gateway up and running, further learning about PHP, Spin2, RPi and Linux would allow this “simple” demo to be expanded for other professional uses.

The example code shown in the video was provided by Stephen Moraco at Ironsheep. The very latest version of the code can always be found at the IronSheep GitHub repository https://github.com/ironsheep/P2-RPi-IoT-gateway

The GitHub also includes every step-by-step detail on how to set up the hardware and install the software and was followed to make the video guide so that you can see how things should work.

For help please feel free to ask your questions here, on the GitHub page, or ideally for a wider audience of helpers at our https://forums.parallax.com

Combining the real-time processing power of the 8-core Parallax P2 with the RPi internet and Linux OS capabilities is an interesting and powerful partnership!

Parts Used

The Raspberry Pi Model 4 is now available through Parallax under our reseller agreement. As of the time of the posting of this Quick Byte, we had received our first shipment of Raspberry Pi Model 4 and had not yet posted them.

Programming Language
Document Author
Source Code Author
0 0 votes
Article Rating
Subscribe
Notify of

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Loading...