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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Installing Code for PiFace Real Time Clock
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 52 replies
  • Answers 4 answers
  • Subscribers 665 subscribers
  • Views 5657 views
  • Users 0 members are here
  • raspberry_pi
Related

Installing Code for PiFace Real Time Clock

fc-element
fc-element over 8 years ago

Dear Element 14 Community.

All my Raspberry Pi devices (RPi 2, RPi Zero, and RPi 3 (planned) are running with the current Raspbian Jessie version. I have successfully installed PiFace Real Time Clock using the PiFace website instructions and GitHub.com software download on a number of RPi 2's and one of my three RPi Zero's.

 

I have recently continued the installations on another two RPi's and cannot continue because after these two lines:

1. chmod +x install-piface-real-time-clock.sh

2. sudo ./install-piface-real-time-clock.sh

 

The following new comments are returned: 1

1.. create new pifacertc init script to load time from PiFace RTC

2. Adding /etc/init.d/pifacertc .

3. install the pifacertc init script

4. enable I2c by using raspi-config

 

As I am a Linux beginner, can someone lead me through (expand) the coding of these lines so I may install PiFace RTC currently and in the future. The changelog on GitHub refers to a revision change but I am not knowledgable enough to understand why the install went through previously by not currently.

 

Thank you very much,

Frank.

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    0 Former Member over 8 years ago

    Are those all of the comments that are returned? Having a glance at the install script it seems there should be a piece saying to reboot and another demonstrating how to set the clock etc... If these are missing it would indicate that the install script has not completed correctly.

     

    Has the install script created the /etc/init.d/pifacertc file? check by typing cat /etc/init.d/pifacertc into a terminal window, there should be around 37 lines of text print out into the terminal as a result.

     

    If the installer hasnt completed succesfully it should be easy enough to replicate the procedure manually, everything is provided in that script to do that.

     

    p.s.the comments 1,2 and 3 that appear ate just the install script telling you where it is up to. Comment 4 is an instruction to you to run raspi-config, as I said above, there should also be more text below this

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • fc-element
    0 fc-element over 8 years ago in reply to Former Member

    Thanks for the response of the many users over the last 48 hrs. 
    Dear lucie tozer:

    Let me respond directly to your suggestion:

    I opened the /etc/init.d/pifacertc file in from the File Manager
    and typed cat /etc/init.d/pifacertc at the terminal.
    Both ways yielded:

    # !/bin/sh
    ### BEGIN INIT INFO
    # Provides:   pifacertc
    # Required-Start:    udev mountkernfs $remote_fs raspi-config
    # Required-Stop:  
    # Required-Start:    S
    # Default-Stop:
    # Short Description: Add the PiFace RTC
    # Description:          Add the PiFace RTC
    ### END INIT INFO

    . /lib/lsb/init-functions

    case "$1" in
       start)
           log_success_msg "Probe the i2c-dev"
           modprobe i2c-dev
           # Calibrate the clock ( default: 0x47).  See datasheet or MCP7940N
           log_success_msg "Calibrate the clock"
           i2cset -y 0x6f 0x08 0x47
           log_success_msg "Probe the mcp7941x driver
           modprobe i2c :mcp7941x
           log-success-msg "Add the mcp7941x device in the sys filesystem"
           #https://www.kernel.org/doc/Documentation/i2c/instantiating-devices
           echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
           log-success-msg "Synchronise the system clock and hardware RTC"
           hwclock --hctosys
           ;;
       stop)
           ;;
       restart)
           ;;
       force-reload)
           ;;
       #)
          echo "Usage: $0 start" >&2
          exit 3
          ;;
    esac

     

    I opened the /etc/init.d/rc.local file in from the File Manager
    and typed cat /etc/init.d/rc.local at the terminal.
    Both ways yielded:

    # !/bin/sh
    ### BEGIN INIT INFO
    # Provides:     rc.local
    # Required-Start:      $ all
    # Required-Stop:  
    # Required-Start:      2 3 4 5
    # Required-Stop:
    # Short Description:  Run /etc/rc.local if it exist 
    ### END INIT INFO

     

    PATH=/sbin:/usr/sbin:/bin:/usr/bin

    ./lib/init/vars.sh
    ./lib/lsb/init-functions

    do_start () {
          if [ -x /etc/rc.local ]; then
                    [ "$VERBOSE" !=no ] && log_begin_msg "Running local boot scripts (/etc/rc.local)"
                    /etc/rc.local
                    ES=$?
                    [ "$VERBOSE" !=no ] && log_end_msg $ES
                    return $ES
          fi
    }
    case "$1" in
          start )
             do_start
             ;;
          restart | reload | force-reload)
                echo "Error: argument "$1" not supported" >&2
                exit 3
                ;;
          stop | status )
                # No-op
                exit 0
                ;;
          *)
                echo "Usage: 0 start|stop" >&2
                exit 3
                ;;
    esac

    I appreciate you speedy response to continue with my problem. To re-summarize my total experience with Installing the PiFace Real Time Clock here's additional, more-specific information.

    I had successully installed previous RPi 2's and one of my RPi 0's all running the current Rasbian Jessie software following these websites:

    Starting Website to Add PiFace Real Time Clock
    http://www.piface.org.uk/products/piface_clock/

    Two Links (located towards bottom of site) were followed:

    1. Documentation (downloaded pdf File)

    2. PiFace Real Time Clock on GitHub
    https://github.com/piface/PiFace-Real-Time-Clock

    The previous installation on a RPi Zero (which was successfull) did not generate a /etc/init.d/pifacertc  file
    and during the boot phase, I did see a line:
    [Failed (in red): Failed to start /etc/rc.local compatibility.
    but evidently the clock installed correctly.
    The text for the rc.local files on this device and the RPi Zero device that failed are identical.

    My PATH to install on the failed device is briefly described next:

    pi@raspberrypi ~$ ls
    Downloads  (among other files)
    pi@raspberrypi ~$ cd Downloads
    install-piface-real-time-clock.sh  (in bold yellow/green color)
    chmod +/ install-piface-real-time-clock.sh  (returns prompt)
    sudo ./install-piface-real-time-clock.sh (problems occur)
    returns:
    Create a new pifacertc init script to load time from PiFace RTC
    Adding /etc/init.d/pifacertc .
    Install the pifacertc init script
    Enable I2C by adding:

    raspi-config

    then navigate to "Advanced Options" > I2C
    and select 'yes' to enable the ARM I2C interface. Then *reboot* ans set the clock with:

    sudo date -s "10 JAN 2014 10:10:30"
    sudo hwclock --systohc
    Downloads $

    (end of PATH return)

    I type the command:
    sudo reboot.
    During the boot phase, I noted the following 2 lines:
     
    [FAILED] Failed to start LSB: Add the PiFace Device
    See "systemct1 status pifacertc service" for details

    In fact, I have configured another RPi Zero device in a separate electrical system and tried the install and the same failure occurs.

    This begs two questions:
    1. How to Run command to "See systemct1 status pifacertc service for details" and
    2. Relative to the long-winded response from the terminal after the sudo ./install ... command (PATH above), what should the new pifacertc script contain, why add another /etc/init.d/pifacertc . , and how to install it. It does not detail any of these returns. Finally, you have indicated that the install script may not have completed correctly. Based on all of the above, did the script complete successully or do I need to create another script of which Iis unknown to me.

    Dear lucie tozer:

    If you've arrived here without abandoning me I appeciate it. I just don't understand why an installation can proceed in entirely two different paths on identical systems but yielding different file structures. I'm sure its my mistake and I am confident I'll find the solution through your and many others help. Thanks again. Frank

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 8 years ago in reply to fc-element

    Swap SD cards and if the problem moves, then the problem is on that card and is not identical!

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • clem57
    0 clem57 over 8 years ago in reply to fc-element

    Swap SD cards and if the problem moves, then the problem is on that card and is not identical!

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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