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
Dev Tools
  • Products
  • More
Dev Tools
Forum PiFace Shim RTC not recognised on a RPi B+
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Dev Tools to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 27 replies
  • Answers 5 answers
  • Subscribers 82 subscribers
  • Views 5145 views
  • Users 0 members are here
  • clock
  • shim-rtc
  • rtc
  • timestamp
  • rtcc
  • realtime
  • calendar
Related

PiFace Shim RTC not recognised on a RPi B+

Former Member
Former Member over 10 years ago

PiFace Shim RTC not recognised on a RPi B+

 

New stock Raspberry Pi B+, new stock PiFace Shim RTC, fresh battery, all updates applied

 

Here's the error messages

 

pi@raspberrypi ~ $ hwclock

hwclock: Cannot access the Hardware Clock via any known method.

hwclock: Use the --debug option to see the details of our search for an access method.

 

pi@raspberrypi ~ $ sudo hwclock

hwclock: Cannot access the Hardware Clock via any known method.

hwclock: Use the --debug option to see the details of our search for an access method.

 

pi@raspberrypi ~ $ sudo hwclock -s

hwclock: Cannot access the Hardware Clock via any known method.

hwclock: Use the --debug option to see the details of our search for an access method.

pi@raspberrypi ~ $ sudo hwclock --debug

hwclock from util-linux 2.20.1

hwclock: Open of /dev/rtc failed: No such file or directory

No usable clock interface found.

hwclock: Cannot access the Hardware Clock via any known method.

 

Cheers

  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 10 years ago in reply to Former Member +1
    Hi, seems to work now: sudo hwclock -r su 15. helmikuuta 2015 23.54.22 -0.035001 seconds In my case Raspberry's i2c did not work properly and there seems to be some problem in installation script, too…
  • Former Member
    Former Member over 10 years ago in reply to Former Member +1
    Jukka, I want to thank you very much for this splendid piece of work which taught me a lot. Prof. of Physics, CERN collaborator for over 50 years, I have seen very few such things. Jacques Goldberg
  • mconners
    mconners over 9 years ago in reply to mconners +1
    As promised here is my experience setting up a RTC device via I2C on a Ras Pi 2 Enabling RTC on the Raspberry Pi 2 Mike
Parents
  • amgalbu
    0 amgalbu over 10 years ago

    Hi @bandit-rider

    did you get an error when you ran the installation script install_pi_facereal_time_clock.sh?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to amgalbu

    Hello amgalbu 

     

    I've just entered the command again and got the same result

     

    Though new to the Raspberry Pi, I've entered Unix/Linux commands in various flavours of Linux on both PCs and the iMac I own

     

    pi@raspberrypi ~ $ sudo ./install-piface-real-time-clock.sh

    Enabling I2C module.

    Changing /etc/rc.local to load time from PiFace Clock.

    Please reboot and then set your clock with:

     

        sudo date -s "14 JAN 2014 10:10:30"

     

    pi@raspberrypi ~ $

     

    Again any ideas to through light on what's happening would be much appreciated

     

    Regards

     

    Andrea

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • amgalbu
    0 amgalbu over 10 years ago in reply to Former Member

    Is it possible I2C module is not installed?

    try to run

     

    lsmod

     

    if you see any module named i2c_*

    Eventually, run

     

    sudo aptget install i2ctools

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to amgalbu

    Hello amgalbu

     

     

     

    Here is the result of run lsmod

     

     

     

    pi@raspberrypi ~ $ lsmod

     

    Module                  Size  Used by

     

    ctr                     3993  1

     

    ccm                     8238  1

     

    rtc_ds1307              9868  0

     

    i2c_dev                 6709  0

     

    i2c_bcm2708             6004  0

     

    snd_bcm2835            21342  0

     

    snd_pcm                93100  1 snd_bcm2835

     

    snd_seq                61097  0

     

    snd_seq_device          7209  1 snd_seq

     

    snd_timer              23007  2 snd_pcm,snd_seq

     

    snd                    67211  5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device

     

    arc4                    1964  2

     

    rt2800usb              18970  0

     

    rt2800lib              81833  1 rt2800usb

     

    rt2x00usb              12510  1 rt2800usb

     

    rt2x00lib              48797  3 rt2x00usb,rt2800lib,rt2800usb

     

    mac80211              557746  3 rt2x00lib,rt2x00usb,rt2800lib

     

    evdev                  11000  3

     

    cfg80211              472025  2 mac80211,rt2x00lib

     

    crc_ccitt               1612  1 rt2800lib

     

    rfkill                 22347  2 cfg80211

     

    uio_pdrv_genirq         3666  0

     

    uio                     9897  1 uio_pdrv_genirq

     

    pi@raspberrypi ~ $

     

     

     

    and for aptget

     

     

     

    pi@raspberrypi ~ $ sudo aptget install i2ctools

     

    sudo: aptget: command not found

     

     

     

    pi@raspberrypi ~ $ sudo apt-get install i2ctools

     

    Reading package lists... Done

     

    Building dependency tree

     

    Reading state information... Done

     

    E: Unable to locate package i2ctools

     

     

     

    pi@raspberrypi ~ $ sudo apt-get install i2c-tools

     

    Reading package lists... Done

     

    Building dependency tree

     

    Reading state information... Done

     

    i2c-tools is already the newest version.

     

    0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

     

    pi@raspberrypi ~ $

     

     

     

    I’ve also swapped with another RPi B+ board as I bought two at the same time, results are the same

     

     

     

    Just done an update and upgrade process and found a couple of changes to the raspi-config app

     

     

     

    pi@raspberrypi ~ $ sudo raspi-config

     

    pi@raspberrypi ~ $ sudo hwclock -s

     

    hwclock: Cannot access the Hardware Clock via any known method.

     

    hwclock: Use the --debug option to see the details of our search for an access method.

     

    pi@raspberrypi ~ $ lsmod

     

    Module                  Size  Used by

     

    ctr                     3993  1

     

    ccm                     8238  1

     

    rtc_ds1307              9868  0

     

    i2c_dev                 6709  0

     

    snd_bcm2835            21342  0

     

    snd_pcm                93100  1 snd_bcm2835

     

    snd_seq                61097  0

     

    snd_seq_device          7209  1 snd_seq

     

    snd_timer              23007  2 snd_pcm,snd_seq

     

    snd                    67211  5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device

     

    arc4                    1964  2

     

    rt2800usb              18970  0

     

    rt2800lib              81833  1 rt2800usb

     

    rt2x00usb              12510  1 rt2800usb

     

    rt2x00lib              48797  3 rt2x00usb,rt2800lib,rt2800usb

     

    mac80211              557746  3 rt2x00lib,rt2x00usb,rt2800lib

     

    i2c_bcm2708             6004  0

     

    spi_bcm2708             6018  0

     

    evdev                  11000  3

     

    cfg80211              472025  2 mac80211,rt2x00lib

     

    crc_ccitt               1612  1 rt2800lib

     

    rfkill                 22347  2 cfg80211

     

    uio_pdrv_genirq         3666  0

     

    uio                     9897  1 uio_pdrv_genirq

     

    pi@raspberrypi ~ $

     

     

     

    though still getting the same result with sudo hwclock

     

     

     

    A Raspberry Pi NoIR camera was also bought, this has a blue film stuck to the front, it this intended to be removed or is it to remain in place whilst using the camera

     

     

     

    Regards

     

     

     

    Andrea

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • amgalbu
    0 amgalbu over 10 years ago in reply to Former Member

    Can you at least see the Shim RTC board by typing

    i2cdetect -y -r 1


    If not, I would check the hardware connections between the two boards...


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to amgalbu

    Hi Amgalbu

     

    Here's the output of i2cdetect -y -r 1

     

    pi@raspberrypi ~ $ i2cdetect -y -r 1

         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

    00:          -- -- -- -- -- -- -- -- -- -- -- -- --

    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 6f

    70: -- -- -- -- -- -- -- --

    pi@raspberrypi ~ $

     

    Does Raspian install the RTC if present from a NOOBS installer

     

    Regards

     

    Andrea

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to Former Member

    Got the same problem, PiFace Shim RTC + Raspbian NOOBS installation on B+. I think it worked before latest upgrades a few days ago.

     

    I tried to re-install according to PiFace instructions, but no-work.

     

    Err msgs:

    1) With hwclock --debug

    "hwclock from util-linux 2.20.1

    hwclock: Open of /dev/rtc/ failed: No file or directory exist (= or equivalent; the last sentenc in my language)

    No usable clock interface found.

    hwclock: Cannot access the Hardware Clock via any known method."

     

    2) lsmod

    "i2c_dev  (size) 6709 (Used by) 0

    i2c_bcm2708 (size) 6200 (Used by) 0"

     

    3) sudo i2detect - y 1

    in address 60:f 6f

     

    Any help appreciated!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to Former Member

    Hi, seems to work now:

     

    sudo hwclock -r

    su 15. helmikuuta 2015 23.54.22  -0.035001 seconds

     

    In my case Raspberry's i2c did not work properly and there seems to be some problem in installation script, too.

     

    I got first the i2c working this way before doing the clock adjustments into the system. It was not enough to turn i2c on with raspi-config, but I had to do this additional manual stuff.

     

    1) add (if they are missing) to /etc/modules

     

    i2c-bcm2708

    i2c-dev

     

    and save.

     

    You might have to edit /etc/modprobe.d/raspi-blacklist.conf, I did not have it, so no changes here for me (if you have it, check https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c).

     

     

    2) edit /boot/config.txt

     

    dtparam=i2c1=on (here one means B+, i.e., ver. 2 using bus 1)

    dtparam=i2c_arm=on

     

    save, and reboot.

     

     

    3) test that the PiFace Shim RTC is connected and found on the bus

     

    sudo i2cdetect -y 1 (again, 1 is the bus)

     

    In this case 6f is marked at 60:f meaning 0x6f. It may also show as UU at 60:f, which is ok.

     

     

    4) Loading and testing the PiFace Shim RTC module

     

    sudo modprobe i2c:mcp7941x

     

    and then with root rights (= sudo bash)

     

    echo mcp7941x 0x6f > /sys/class/i2c-adapter/i2c-1/new_device

     

    exit (= to quit root rights' shell), and try

     

    sudo hwclock -r

     

    It should show very old date on the first time, but you can fix it by writing the system time to the PiFace Shim RTC with

     

    sudo hwclock -w

     

    Thereafter the time should be right, and the clock works!

     

     

    5) make it load when booting:

     

    add to /etc/modules (after the line i2c-dev)

     

    i2c:mcp7941x

     

    add to /etc/rc.local (before the line exit 0)

     

    echo mcp7941x 0x6f > /sys/class/i2c-adapter/i2c-1/new_device

    ( sleep 2; hwclock -s ) &

     

    and it should give the system a time from RTC thereafter.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to Former Member

    I have a Pi2 and using the fresh Raspbian image. I enabled i2c and (multiple times) ran the script.

     

    When I do:

         sudo i2cdetect -y 1

    I get the UU on 60:f (which I understood is ok! image )

     

    But when I sudo su or just su and type     

        echo i2c:mcp7941x 0x6f > /sys/class/i2c-adapter/i2c-1/new_device

    I get the following error:

    bash: echo: write error: Invalid argument

    Also when I first modprobe i2c:mcp7941x

     

    Any idea?

    Cheers!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to Former Member

    I guess you just mixed when to use and when not to use i2c: in front of the driver name? See carefully 4) above.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 10 years ago in reply to Former Member

    I guess you just mixed when to use and when not to use i2c: in front of the driver name? See carefully 4) above.

    • 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