The reason why the Raspberry Pi is so powerful is its networking function and numerous open source web application support. We can easily use it to realize our own Internet of Things system. In this lesson, we will control an LED based on web with the Raspberry Pi. You can use your mobile phone, tablet pc or computer to control the LED too, as long as it is in the same Local Area Network (LAN) with your Raspberry Pi.
– 1*Raspberry Pi
– 1*Network cable (or USB wireless network adapter)
– 1*Resistor (220Ω)
– Jumper wires
WebIOPi is a fully integrated Internet of Things framework for the Raspberry Pi. Webiopi is a lightweight web server program on Raspberry Pi platform. It provides users a solution that can access Raspberry Pi remotely. Based on this, you can remotely operate your Raspberry Pi and control the hardware connected to it by a browser or an APP.
1.Connect the circuit as shown in the following diagram
|tar xvzf WebIOPi-0.5.3.tar.gz|
3.Set or modify the password of WebIOPi
If you do not modify the password, the default password is: raspberry
4. Start WebIOPi
|sudo python -m webiopi 8000|
You can change the port by yourself, the default port is 8000
5.RunWebIOPi in background, or it will be killed when you press ctrl+C
|sudo /etc/init.d/webiopi startandsudo /etc/init.d/webiopi stop|
6.Set WebIOPi to start with the system
7.Open IP address access management interface with a browser
1) Click outside IN/OUT to switch between the input and output mode of GPIOs
2) In output mode, click inside figures to switch output between high and low. After connecting the LED to GPIO17, when you click block 11, you will see the states of the LED changed
3) In input mode, inside figures represent the input states of GPIO
In this lesson, we have learnt how to build Internet of Things for WebIOPi platform based on Raspberry Pi and learnt how to control our device remotely based on this platform. I hope you can learn WebIOPi in depth and use your brain to make many more fun things.