top of page
Search
honcisatunyni

How to Use Arduino Yun with Linux and OpenWrt



Note : early models of the Yún with a PoE adapter were incorrectly providing the board with 12V. An updated version will soon be provided to distributors that provide the expected 5V. If you believe you have the wrong PoE adapter on your board, please contact support@arduino.orgThe power pins are as follows:


I arbitrarily chose the URL calls /arduino/temperature/0 and /arduinotemperature/1 to signify to the Arduino Yun to turn the LED on and off, respectively.I could have chosen a totally different URL like /arduino/turnnoff and /arduino/turnon .Whatever I chose, it is important that it has /arduino/ in the first part of the URL. We will program the Arduino Yun to know what particular URL request translates to "LED on" and "LED off". The Arduino will read this URL request as a command and turn the LED on and off accordingly.Besides turning the LED on and off, the Arduino will also automatically send back temperature/humidity datato the webpage every time a URL request is made.




Arduino Yun



$(function() getSensorvalue(););function getSensorvalue() //Every one second, this function obtains sensor values from Arduino Yun and sends to Yun //a request to turn LED on or off (depending on what radio button is pressed).var checked_option_radio = $('input[name=LEDCheck]:checked','#LED_Selection').val(); //Check what//radio button is pressed ("LED on" or "LED off") if (checked_option_radio =='off') //if the user selected for LED to be off, send request to Arduino $('#LED_content').load('/arduino/temperature/0'); if (checked_option_radio =='on') //if the user selected for LED to be on, send request to Arduino $('#LED_content').load('/arduino/temperature/1'); setTimeout("getSensorvalue()",1000); //Pole every one seconds.


  • Open a shell on your Arduino Yún (default login is root, password arduino).

  • Update opkg with $ opkg update

  • Upgrade libopenssl with $ opkg upgrade libopenssl

  • Download and install yalertunnel with $ opkg install -yun/yalertunnel_1_ar71xx.ipk

  • Done. Now install Daemontools.



This file exchange submission is an Embedded Coder custom target for Arduino. It uses the Arduino platform as the example hardware, yet the examples it shows can be used to learn and then be applied on any custom target. In an applied way - it shows capabilities and steps that leverage many features of Embedded Coder and creating custom targets. Arduino has been selected since it is widely accessible, has a large DIY community, and is a great platform to explore the varying things that a custom target would need as the various Arduino platforms change.A custom target author can use this submission to extend/create more Arduino targets, or to simply use this as an example to create your own. An end user that has Embedded Coder can use this submission for their Arduinos.Some highlights included in this custom target include:- Shows how to handle dependencies for different Arduino boards (and even non-Arduino boards). Current set includes Uno, Leonardo, Mega2560.- Options available to drive to minimal footprint and memory- Processor in the Loop (PIL)- Numerous scheduling and timing modes explored.- Overrun detection exposed in the Simulink algorithm directly to allow for algorithmic adjustments when overrun is detected during execution.- A wealth of examples on how to add/change peripherals blocks/capabilities (LCD, Servo Motor, UART, printf into UART, DIO, Ultrasonic sensor, Async interrupt, IC Master, IC Slave, etc, etc).Additional resources for creating custom targets- Embedded Coder Product Documentation www.mathworks.com/help/ecoder/index.html (account/license required)- Developing Embedded Targets Advisory Service www.mathworks.com/services/consulting/proven-solutions/developing-embedded-targets.html- MATLAB Answers: example of developing a custom target www.mathworks.com/matlabcentral/answers/93884Note: Only Arduino IDE version 1.0.5 is supported and this submission is not maintained to support new IDEs.For additional Arduino support, see www.mathworks.com/hardware-support/arduino-simulink.html.


Now we're ready to do some interesting analysis of your temperature data! It's best to collect at least one full day of data before analyzing it, but the code below should work for shorter time periods as well. First we need to get the data from the databin we used to upload the temperature data. The arduino sketch uses 'temperature' as the url parameter for the temperature, so we will need to use the same thing here to retrieve it. In this example, my databin has collected data for about 20 days (for your experiment, replace the text 'YOURBINID' with the bin id shown in the output from CreateDatabin[] above):


2ff7e9595c


0 views0 comments

Recent Posts

See All

Holcim racing mod apk

Holcim Racing Mod Apk: um jogo de corrida divertido e desafiador para Android Se você está procurando um jogo de corrida divertido,...

Comments


bottom of page