I am trying to use a Raspberry Pi together with a WS2812 light strip and to make some sort of a IoT device together with these components.
I get how the connection between the web application and the Raspberry Pi works, but how do I translate the command sent to the Raspberry Pi to a command to the GPIO data pin?
How you translate the response fronm the web app to a command for the light strip will depend on how the Pi is communicating with that web page. There are several different protocols available, and the process for handling the response will be different for each. If you can link to the code you are using, or post that code, then it will be possible to see which protocol you have chosen and where you need to interpre the response and insert the required command.
What will your device do at the end of all this? Keen to give you some pointers on how I imagine the structure (and make sure you aren’t reinventing the wheel)
You could extend our guide with Flask, which runs a web server on top of Python. While it may not be as performant as other languages/frameworks, it’s easy to integrate with things like the Raspberry Pi hardware or WS2812s. The possibilities there are endless:
And you can get our latest projects and tips straight away by following us on: