User Tools

Site Tools


2016:smart_remote_control

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:smart_remote_control [2016/05/10 20:37] – [Step #2: Install Software Dependencies] 75.177.137.22016:smart_remote_control [2016/05/10 20:45] (current) – [Step #2: Install Software Dependencies] 75.177.137.2
Line 30: Line 30:
   * After you connect to the Yún's command line, it will show the firmware version. This project has been tested and works with BusyBox v1.19.4 dated 2014-04-10 and later. If you're using an older version, you may need to follow these instructions to update your board.   * After you connect to the Yún's command line, it will show the firmware version. This project has been tested and works with BusyBox v1.19.4 dated 2014-04-10 and later. If you're using an older version, you may need to follow these instructions to update your board.
   * From the command line, execute the following command to update the package manager:   * From the command line, execute the following command to update the package manager:
 +<code>
    opkg update    opkg update
-   +</code>   
   * Now install PIP, the Python package manager:\\   * Now install PIP, the Python package manager:\\
 +<code>
    opkg install distribute && opkg install python-openssl && opkg install python-expat && easy_install pip    opkg install distribute && opkg install python-openssl && opkg install python-expat && easy_install pip
-   +</code>   
 This process may take a few minutes. You may see some warnings; they're safe to ignore. This process may take a few minutes. You may see some warnings; they're safe to ignore.
   * Create a directory on the SD card to store Python packages:   * Create a directory on the SD card to store Python packages:
 +<code>
    mkdir /mnt/sda1/python-packages    mkdir /mnt/sda1/python-packages
-   +</code>   
   * Install the Flask Python web framework:   * Install the Flask Python web framework:
 +<code>
    pip install --target /mnt/sda1/python-packages flask    pip install --target /mnt/sda1/python-packages flask
-   +</code>   
 You may see some warnings; they're safe to ignore. You may see some warnings; they're safe to ignore.
   * Update Python's package search path:   * Update Python's package search path:
 +<code>
    echo "export PYTHONPATH=/mnt/sda1/python-packages" >> /etc/profile    echo "export PYTHONPATH=/mnt/sda1/python-packages" >> /etc/profile
-   +</code>   
   * Create the directories where the Arduino IDE will upload the web server files:   * Create the directories where the Arduino IDE will upload the web server files:
 +<code>
    mkdir /mnt/sda1/arduino    mkdir /mnt/sda1/arduino
    mkdir /mnt/sda1/arduino/www    mkdir /mnt/sda1/arduino/www
-   +</code>   
   * Restart your Arduino Yún to make sure the Python search path is updated.   * Restart your Arduino Yún to make sure the Python search path is updated.
 ==== Step #3: Load Arduino Sketch ==== ==== Step #3: Load Arduino Sketch ====
Line 83: Line 83:
 {{:2016:screen-shot-2014-06-13-at-11-02-32-pm.png?300|}} {{:2016:screen-shot-2014-06-13-at-11-02-32-pm.png?300|}}
   * To run the server, connect to the Yún over SSH. Execute the following command to start the server:   * To run the server, connect to the Yún over SSH. Execute the following command to start the server:
 +<code>
 python /mnt/sda1/arduino/www/SmartRemoteControl/server.py python /mnt/sda1/arduino/www/SmartRemoteControl/server.py
 +</code>
   * If the server starts successfully you should see the following text:   * If the server starts successfully you should see the following text:
-  * +<code>
   Running on http://0.0.0.0:5000/   Running on http://0.0.0.0:5000/
   Restarting with reloader   Restarting with reloader
-  +</code>
   * If you see an error, check that all the required dependencies were installed in the previous steps.   * If you see an error, check that all the required dependencies were installed in the previous steps.
   * In a web browser, navigate to the URL http://arduino.local:5000/. If your browser doesn't support mDNS URLs (like Windows, Android, and some Linux distributions) instead access http://arduino_ip_address:5000/ where arduino_ip_address is the IP address of your Arduino Yún. The IP address can be found at the bottom of the Arduino IDE when the Yún is connected (image 2).   * In a web browser, navigate to the URL http://arduino.local:5000/. If your browser doesn't support mDNS URLs (like Windows, Android, and some Linux distributions) instead access http://arduino_ip_address:5000/ where arduino_ip_address is the IP address of your Arduino Yún. The IP address can be found at the bottom of the Arduino IDE when the Yún is connected (image 2).
   * Once the page is loaded, you should see a list of the configured activities as buttons. If you see an error, check that dependencies were installed properly, the sketch was uploaded, and the server is running without errors.   * Once the page is loaded, you should see a list of the configured activities as buttons. If you see an error, check that dependencies were installed properly, the sketch was uploaded, and the server is running without errors.
   * To stop the server, press Ctrl-C in the command window where you started running the server.   * To stop the server, press Ctrl-C in the command window where you started running the server.
- 
 ==== Step #6: Use Web Interface ==== ==== Step #6: Use Web Interface ====
-{{:2016:screen-shot-2014-06-16-at-2-47-55-am.png?300|}}\\ +{{:2016:screen-shot-2014-06-16-at-2-47-55-am.png?450|}}\\ 
-{{:2016:smrt_remote.jpg?300|}}\\ +{{:2016:smrt_remote.jpg?450|}}\\ 
-{{:2016:screen-shot-2014-06-13-at-11-08-19-pm.png?300|}}\\+{{:2016:screen-shot-2014-06-13-at-11-08-19-pm.png?450|}}\\
   * To use your smart remote control, aim the LED at your electronic devices and press one of the activity buttons. If you don't see all your expected devices turn on, try moving the LED closer to the devices. The range of the LED can be somewhat small, around 6 feet of distance. You can consider adding a transistor to increase the LED range as well.    * To use your smart remote control, aim the LED at your electronic devices and press one of the activity buttons. If you don't see all your expected devices turn on, try moving the LED closer to the devices. The range of the LED can be somewhat small, around 6 feet of distance. You can consider adding a transistor to increase the LED range as well. 
   * You can also test IR codes by opening the Yún Serial Monitor in the Arduino IDE and sending the IR code as a command. For example, sending "SONY: C A90" (without quotes) would cause the hardware to send a Sony A90 power command. (The "C" above represents the bit length of the command, 12, converted to hexadecimal.)   * You can also test IR codes by opening the Yún Serial Monitor in the Arduino IDE and sending the IR code as a command. For example, sending "SONY: C A90" (without quotes) would cause the hardware to send a Sony A90 power command. (The "C" above represents the bit length of the command, 12, converted to hexadecimal.)
2016/smart_remote_control.1462927031.txt.gz · Last modified: 2016/05/10 20:37 by 75.177.137.2