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 breast 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.



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

  // Initialize Serial

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

  // run various example processes

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();
  // Ensure the last bit of data is sent.


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




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




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


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