element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Enchanted Objects
  • Challenges & Projects
  • Design Challenges
  • Enchanted Objects
  • More
  • Cancel
Enchanted Objects
Blog Enchanted Objects Design Challenge - Yum Yum Yun at the Enchanted Cottage
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Workshopshed
  • Date Created: 14 Apr 2015 12:08 AM Date Created
  • Views 539 views
  • Likes 4 likes
  • Comments 0 comments
  • enchanted_cottage
  • enchanted_objects
  • arduino_yun
Related
Recommended

Enchanted Objects Design Challenge - Yum Yum Yun at the Enchanted Cottage

Workshopshed
Workshopshed
14 Apr 2015

Whilst Matilda was planning and rebuilding Hans hit the books to study the new electronics they were going to add to their house. Hans was having trouble understanding the Yun parts, "why does it need two processors on one board?" he thought to himself.

    

Dinner at the Sprats'

 

Hans and Matilda were lucky to have kind neighbours and everyone has helped them out following the fire. One the night they visited their friends Mr and Mrs Sprat. When it came to dinner, Mr Sprat carved up a roast duck. Hans and Matilda were served the best slices of *** meat. On his wife's plate he placed a leg covered in a rich crispy skin. On his own plate were placed the dry pieces that had been a bit overcooked. At the end of the meal there was nothing left but bones. After dinner Mrs Sprat mentioned that she'd heard in the market place that the Wolf was planning to interfere with their weather reporting but was not sure how.

 

Fun with the Yun

 

The following day Hans was studying the Yun manual again and he thought of Jack Sprat and his wife. The Yun was made up of two parts, an Atmel ATMega microcontroller designed to interface to sensors and the real world and an Atheros processor running router software to connect to the WiFi and internet. Complementary functions fulfilled by each part.

image

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Useful links

 

PighiXXX – Yun Pinout

Linino wiki - upgradeimage
Arduino - YunUBootReflash

 

Checking the weather

 

The there was a curl example in the ArduinoYun Getting Started Guide that looked appropriate "It should be simple to modify this to connect to the weather service", he thought.

 

#include <Process.h>
void setup() {
  // Initialize Bridge
  Bridge.begin();

  // Initialize Serial
  Serial.begin(9600);

  // Wait until a Serial Monitor is connected.
  while (!Serial);

  // run various example processes
  runCurl();
}

void loop() {
  // Do nothing here.
}

void runCurl() {
  // Launch "curl" command and get Arduino ascii art logo from the network
  // curl is command line program for transferring data using different internet protocols
  Process p;        // Create a process and call it "p"
  p.begin("curl");  // Process that launch the "curl" command
  p.addParameter("http://arduino.cc/asciilogo.txt"); // Add the URL parameter to "curl"
  p.run();      // Run the process and wait for its termination

  // Print arduino logo over the Serial
  // A process output can be read with the stream methods
  while (p.available()>0) {
    char c = p.read();
    Serial.print(c);
  }
  // Ensure the last bit of data is sent.
  Serial.flush();
}

 

swapping out the URL parameter with one for the for the weather in Chicago

 

http://query.yahooapis.com/v1/public/yql?q=select%20item.condition.text%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22Chicago%20IL%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys

 

produced a JSON result with the weather conditions that would need to be parsed.

 

{"query":
    {"count":1,"created":"2015-04-10T10:24:59Z","lang":"en-GB","results":
       {"channel":
          {"item":
             {"condition":
                 {"text":"Cloudy"}
             }
          }
       }
   }
}

 

Based on his experiments Hans sketched up a class diagram for the software.

image

Thoughts of the Wolf

 

Hans smiled as the message appeared on his screen but his thoughts soon turned to the Wolf. How could he be sure that the server he was connecting to was the real server? How could he ensure his request had not been tampered with and how did he know that the response was legitimate?

 

Next: Enchanted Objects Design Challenge - Channels and a special delivery to the Enchanted Cottage

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube