User Tools

Site Tools


2016:ha:openhab_mqtt_arduino_and_esp8266

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
2016:ha:openhab_mqtt_arduino_and_esp8266 [2016/05/13 09:16] 75.177.137.22016:ha:openhab_mqtt_arduino_and_esp8266 [2016/05/13 09:23] (current) – [Step #1: Assemble the Raspberry Pi and touchscreen] 75.177.137.2
Line 10: Line 10:
 ==== Step #1: Assemble the Raspberry Pi and touchscreen ==== ==== Step #1: Assemble the Raspberry Pi and touchscreen ====
 {{:2016:ha:touch_display.jpg?300|}} {{:2016:ha:touch_display.jpg?300|}}
 +  * Without instructions, assembling and attaching the screen to the Raspberry Pi can be a bit tricky. 
 +  * Start with the screen face down and flip the display controller board over so that the large connector is visible. Connect the large ribbon cable from the screen to the controller, being sure to push the cable in fully and securing it with the clip on the connector. 
 +  * Flip the display controller board onto the back of the screen, and push the small touchscreen cable into its connector. Screw the standoffs into the back of the screen, through the holes in the controller board. 
 +  * Insert the ribbon cable into the display connector on the side of the controller board, then place the Pi on top of the standoffs and screw it in. Connect the other end of the ribbon cable to the display connector on the Pi. 
 +  * In order to run power and ground to the touchscreen, we'll use the GPIO pins on the Pi. Take the red jumper wire that came with the screen, and plug it into the rightmost lower 5V GPIO pin on the Pi, then plug the other end into the rightmost pin on the controller board below it. Use the black jumper wire to connect the GPIO GND pin (two pins over from the red wire 5V pin) on the Pi to the leftmost pin on the controller board below it. 
 +==== Step #2: Setup the microSD card and configure Raspbian ==== 
 +{{:2016:ha:sd_card.jpg?300|}} 
 +  * Download the latest build of Raspbian from the Raspberry Pi website and flash it onto a microSD card. Then insert the card into the Pi. 
 +  * Plug in a keyboard, mouse, and wifi adaptor, then insert the card into the Pi and boot it up. 
 +  * Go through the configuration process, and when it's fully booted, connect to your WiFi network. 
 +  * In order to get the touchscreen to work, you’ll likely need to run a few commands from the command line to update Raspbian: sudo apt-get update sudo apt-get upgrade This will probably take a while, so be patient! 
 +  * If you restart the Pi after the update, the touchscreen will flip upside-down. If that’s a bother to you, you can flip it by adding lcd_rotate=2 to the last line in the config file in the boot folder, using the following command: sudo nano /boot/config.txt Then hit Ctrl+X to save and exit. 
 +==== Step #3: Install OpenHAB ==== 
 +{{:2016:ha:open_hab_screen.jpg?300|}}\\ 
 +Now it’s time to install our home automation control software, OpenHAB, and the OpenHAB addons we’ll be using. 
 +  * Open a command line on the Pi, and enter the following commands: sudo mkdir /opt/openhab cd /opt/openhab sudo wget https://bintray.com/artifact/download/openhab/bin/distribution-1.7.1-runtime.zip sudo unzip distribution-1.7.1-runtime.zip sudo rm distribution-1.7.1-runtime.zip 
 +Now we'll enter a few more commands to configure OpenHAB to run at startup: sudo wget http://www.element14.com/community/servlet/JiveServlet/download/38-152207/openhab.zip unzip openhab.zip sudo rm openhab.zip sudo cp openhab.sh /etc/init.d sudo chmod 777 /etc/init.d/openhab.sh sudo update-rc.d -f openhab.sh defaults 
 +We'll also need to install the OpenHAB MQTT addons, since that's the protocol we'll be using to communicate with our LED strip: sudo wget https://bintray.com/artifact/download/openhab/bin/distribution-1.7.1-addons.zip sudo unzip distribution-1.7.1-addons.zip -d /addons sudo cp /addons/org.openhab.binding.mqtt-1.7.1.jar /opt/openhab/addons sudo cp /addons/org.openhab.persistence.mqtt-1.7.1.jar /opt/openhab/addons sudo rm distribution-1.7.1-addons.zip
2016/ha/openhab_mqtt_arduino_and_esp8266.1463145365.txt.gz · Last modified: 2016/05/13 09:16 by 75.177.137.2