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 - A tale of two bridges
  • 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: 17 Jun 2015 7:58 AM Date Created
  • Views 1587 views
  • Likes 6 likes
  • Comments 6 comments
  • enchanted_cottage
  • enchanted_objects
  • arduino_yun
Related
Recommended

Enchanted Objects Design Challenge - A tale of two bridges

Workshopshed
Workshopshed
17 Jun 2015

The bridge

Hans had been spending too much time inside coding. So this morning he went for a wander down by the stream. As he neared the town he saw the new bridge that had been put in so that the children could cross the stream to get to the school. The bridge was made of iron and had gates so that cattle did not wander across. There was a solar powered telephone box so that the kids could make calls and send emails and notice board so that the school could leave important bulletins for them to read. The bridge also had a system of bells and whistles to give warning alerts.
Hans spotted the Uart twins, Tex and Rex with their little sister Parity. The three children approached bridge but rather than going through the gates they headed down the side of the bridge and hopped over the stepping stones. Hans remembered how he and Matilda had hopped over those same stones when he was younger.

 

The other bridge

Hans looked at the Arduino code and noticed that the size was 10% bigger when he compiled in the Bridge libraries. Looking at the code it was obvious why. There was code for handling web servers, email and code to start and stop the bridge and check it was running. Following Ambrogio Galbusera's idea, he decided to drop the bridge and use a simple serial communication instead. The Linino side could start up his Python code directly rather than provide a console with root access listening on the serial pins.

 

Are you ready yet?

One of the problems of turning off the Linino portion of the Arduino Yún is that it takes some time to restart and you need to know when it's ready for action.

 

This problem is compounded by the fact that whilst that side is booting the serial connection which is normally used for messaging between the Linino and ATmega sides is used as a console for the Uboot and Linux boot processes. If the ATmega was to send anything across the bridge at that point then it could stop the booting process. The way the Bridge code works is to delay starting until that console has not produced any content for over 1s, however this timing based approach is a little unreliable so some people on the Arduino Forum have suggested adding further delays into the code to ensure that Linux has fully booted.

image

Luckily the system has a hand shaking line installed and that can be used to signal that the process is complete. This is connected up via a level shifter which can be turned on and off via one of the AR 9331's GPIOs.

image

Eberhard Fahle has produced an article that explains what is needed to configure the handshaking line for the Arduino Yún we can then use that either as a digital line or via the interrupts to signal when the boot process is complete.

 

Code

Eberhard's code was combined with the YunSerialTermial code to allow the boot process to be monitored visually as well as via the handshaking line.

 

Code: https://github.com/Workshopshed/EnchantedObjects/tree/master/Code/Examples/HandshakingMonitor

 

Setup

The boot status script was uploaded to the init.d folder and configured for execution.

image

As suggested in the article the init script was tested with

 

/etc/init.d/boot-status start

image

and with

 

/etc/init.d/boot-status stop

image

The serial monitor was started and the boot process watched. Shortly after the last message in the console the red #13 light turned on. The boot-status message does not show in the log.

 

Next: Enchanted Objects Design Challenge - Locking the doors

 

Reference

 

https://gist.github.com/wayoda/db3c023417757f726088

https://www.kernel.org/doc/Documentation/gpio/sysfs.txt

http://www.arduino.cc/en/uploads/Main/arduino-Yun-schematic.pdf

Access GPIO from Linux user space | FalsinSoft

http://wiki.openwrt.org/doc/techref/initscripts

  • Sign in to reply

Top Comments

  • Workshopshed
    Workshopshed over 10 years ago in reply to DAB +1
    DAB wrote: You have a very creative mind. Cheers Dab, hopefully in an "enchanting" way.
  • balearicdynamics
    balearicdynamics over 10 years ago +1
    I had only time to read it now. Very interesting and useful. Well explained with good content references. Thanks. Enrico
  • Workshopshed
    Workshopshed over 10 years ago in reply to amgalbu

    The motivation for the handshaking technique rather than delay is mostly about battery life. The Linino portion uses approximately 100 times the power of the ATMega so we want it to be on for the shortest time possible.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • amgalbu
    amgalbu over 10 years ago

    Thanks Andy!

    very useful! In my implementation I just put a delay before sending anything to Linino... this is a much cleaner, safer and elegant approach

     

    Cheers

    Ambrogio

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 10 years ago in reply to balearicdynamics

    Lots of gems for the Yún hidden away on the Arduino forums. I've been lucky to be able to apply several of them to my project.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago

    I had only time to read it now. Very interesting and useful. Well explained with good content references.

     

    Thanks. Enrico

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 10 years ago in reply to DAB

    DAB wrote:

     

    You have a very creative mind.

    Cheers Dab, hopefully in an "enchanting" way.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
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