Mcp7941x



  • hi

    according to this instruction

    http://unipi.technology/wiki/Installing ... d_software

    "Next, you need to load the kernel driver of MCP7941x. To do this, insert rtc-mcp7941x in the /etc/modules file#

    I'm using Raspian Linux version 3.18.7-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #757 SMP PREEMPT Sat Feb 21 14:54:05 GMT 2015

    My hardware is raspberry pi 2 and the UniPi board

    but this driver seems to be missed, when I boot the system I get the message

    "Module rtc-mcp7941x not found"

    were do I get this driver ?

    regards
    B



  • hi

    according to this instruction

    http://unipi.technology/wiki/Installing ... d_software

    "Next, you need to load the kernel driver of MCP7941x. To do this, insert rtc-mcp7941x in the /etc/modules file#

    I'm using Raspian Linux version 3.18.7-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #757 SMP PREEMPT Sat Feb 21 14:54:05 GMT 2015

    My hardware is raspberry pi 2 and the UniPi board

    but this driver seems to be missed, when I boot the system I get the message

    "Module rtc-mcp7941x not found"

    were do I get this driver ?

    regards
    B



  • Hello,

    please try: sudo modprobe i2c:mcp7941x

    It has changed in the last update of Raspbian.

    Best regards,
    Tomas



  • Hi
    thank you for the answer

    now I get the driver to load but next step failed.

    echo mcp7941x 0x6f > /sys/bus/i2c/devices/i2c-1/new_device

    the result is,
    -bash: /sys/bus/i2c/devices/i2c-1/new_device: permission denied

    I also tryed
    sudo echo mcp7941x 0x6f > /sys/bus/i2c/devices/i2c-1/new_device

    with the same result

    best regards
    B



  • Hi,

    are you sure you run the command as root? It works fine for me…

    Try going to root console by: sudo su
    and then the echo xxxxx

    Regards,
    Tomas



  • I have the same issue.

    Running Raspberry PI V2 on kernel 4.1.10-v7+
    It is being seen with the i2cdetect –y 1 command on 0x6f

    The RTC is not available at login. If I issue :

    hwlcock –r

    It responds with :

    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.

    Lsmod does not show the mcp7941x listed anywhere.

    If I am logged in as the PI user, and I try to re-issue the sudo echo mcp7941x 0x6f > /sys/bus/i2c/devices/i2c-1/new_device I get permission denied.

    The only way I can get it working is to login as root :

    Sudo su

    Then run

    echo mcp7941x 0x6f > /sys/bus/i2c/devices/i2c-1/new_device

    Then hwclock –r works. But only for the root user. And when I reboot – its not available to either the Pi user or the root.

    Attached is the kernel.log – but here it seems to indicate it has communicated with the RTC ok :

    Oct 15 14:23:31 raspberrypi kernel: [ 319.459911] rtc-ds1307 1-006f: SET TIME!
    Oct 15 14:23:31 raspberrypi kernel: [ 319.462591] rtc-ds1307 1-006f: rtc core: registered mcp7941x as rtc0
    Oct 15 14:23:31 raspberrypi kernel: [ 319.462647] rtc-ds1307 1-006f: 64 bytes nvram
    Oct 15 14:23:31 raspberrypi kernel: [ 319.462712] i2c i2c-1: new_device: Instantiated device mcp7941x at 0x6f

    Any help would be much appreciated.



  • Hello,

    the wight way to enable the RTC is to load the driver by at startup by putting it to /etc/modules - just add```
    i2c:mcp7941x

    
    Then you need to tell the system to use the driver for device at i2c bus with address 0x6f (also required at every startup) which can be done in /etc/rc.local file. Just put echo```
    mcp7941x 0x6f > /sys/bus/i2c/devices/i2c-1/new_device
    ```at the end of the file and that should be all.


  • Thanks Thomas,

    That worked - I didn't realise it needed to be echo'd each time. Thanks for you help.