---
title: Web Page Control of WS2811 LEDs Using the IoT Gateway on Raspberry Pi
description: "[P2 Quick Byte: RPi IoT Gateway with Propeller 2 Edge Module](https://www.youtube.com/embed/q_sy_4rSkOM?feature=oembed) ##### 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…"
url: "https://obex.parallax.com/docs/quick-bytes/propeller-2/web-page-control-of-ws2811-leds-using-the-iot-gateway-on-raspberry-pi/"
updated: "2026-09-29"
category: Propeller 2
---

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

[P2 Quick Byte: RPi IoT Gateway with Propeller 2 Edge Module](https://www.youtube.com/embed/q_sy_4rSkOM?feature=oembed)

##### 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](https://www.parallax.com/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](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](https://www.parallax.com/approved-raspberry-pi-reseller-with-inventory/). 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.

- [P2 Edge Module](https://www.parallax.com/product/p2-edge-module/)
- [P2 Edge Mini Breakout Board](https://www.parallax.com/product/p2-edge-mini-breakout-board/)
- [P2 Live Forum Holiday Spin2 Kit](https://www.parallax.com/product/p2-live-forum-holiday-spin2-kit/)
- [200mm Jumper Wires, FF 40-piece Ribbon](https://www.parallax.com/product/200mm-jumper-wires-ff-40-piece-ribbon/)
- [USB Mains Adapter, 18W, 5V, 3A](https://www.parallax.com/product/usb-mains-adapter-18w-5v-3a/)
- [USB A to DC 2.1mm Jack Cable](https://www.parallax.com/product/usb-a-to-dc-2-1mm-jack-cable/)
- [Prop Plug Rev E](https://www.parallax.com/product/prop-plug/)
- [USB A to Micro B Cable](https://www.parallax.com/product/usb-a-to-micro-b-cable/)

##### Source Code

- [Web Page Control of WS2811 LEDs using RPi IoT Gateway](/qbi/downloads/Web-page-control-IoT-Gateway.zip)

##### Programming Language

- [Spin 2](https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/)
- [PASM2](https://docs.google.com/spreadsheets/d/1_vJk-Ad569UMwgXTKTdfJkHYHpc1rZwxB-DcIiAZNdk/)

##### Tools and Operating System

- [Propeller Tool for Windows](https://www.parallax.com/package/propeller-tool-software-for-windows-spin-assembly-2/)
- [FlexProp for Windows, Mac and Linux](https://www.patreon.com/totalspectrum)

##### Additional Resources

- [Stephen Moraco's GitHub Page](https://www.parallax.com/web-page-control-of-ws2811-leds-using-the-iot-gateway-on-raspberry-pi/)
- [Propeller 2 Spin Documentation](https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/edit)

##### Document Author

- Michael Mulholland

##### Source Code Author

- Stephen M. Moraco
