jackbk
Posts: 5
Joined: Wed Feb 08, 2017 10:57 am

How to use SMBus to talk with RTC?

Wed Feb 08, 2017 11:41 am

I am a beginner for using SMBus to talk with RTC via I2C protocol. May I have a question?

My board has three i2c in /dev/ as below.
/dev/i2c-0 /dev/i2c-1 /dev/i2c-2

I do not know which i2c connect with my RTC (I am using ISL12057 RTC), so I try 3 times with following

Code: Select all

self._bus = smbus.SMBus(twi)
self._addr = 0x68
Value of twi=0,1, or 2

I get 2 kinds of error.

1.1 IOError: [Errno 16] Device or resource busy
1.2 IOError: [Errno 5] Input/output error

I do not understand what the error 1.1 and 1.2 are.

Could you give me a solution for solving the error? I really need it to start another task in my project.

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: How to use SMBus to talk with RTC?

Wed Feb 08, 2017 1:46 pm

Hi,
which board are you using and how old is the OS ?

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to use SMBus to talk with RTC?

Wed Feb 08, 2017 6:13 pm

What does i2cdetect -y 1 show?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

jackbk
Posts: 5
Joined: Wed Feb 08, 2017 10:57 am

Re: How to use SMBus to talk with RTC?

Thu Feb 09, 2017 1:52 am

texy wrote:Hi,
which board are you using and how old is the OS ?

Texy
I am sorry for unclear information about my board. I am using VAR-DT6CustomBoard from Variscite. This board is connected to DART-MX6 board, and DART board is from Variscite also.

DT6 board
http://www.variscite.com/products/singl ... ustomboard

DART board
http://www.variscite.com/products/syste ... scale-imx6

About my OS, it is Yocto Jethro 4.1.15.

I know that my post may be not suitable in Raspberry Pi forum, but I am developing my system on Variscite's boards, not Raspberry's board. The main thing of my question is to talk with my RTC on Variscite's board by Python.

Yesterday, I visit Raspberry forum and I found a topic that we can talk with RTC on Raspberry board (DS1307) by Python; therefore, I think that I can apply this topic in my board. However, I met an issue when applying that.Therefore, I raised my issue in this topic.

Thank you for any help!

jackbk
Posts: 5
Joined: Wed Feb 08, 2017 10:57 am

Re: How to use SMBus to talk with RTC?

Thu Feb 09, 2017 2:02 am

DougieLawson wrote:What does i2cdetect -y 1 show?
I am sorry. I am using VAR-DT6 board from Variscite, so the command "i2cdetect -y 1" is not available in my board (my OS is Yocto Jethro 4.1.15).

My intention is just to talk with the RTC on my board by Python. So, do you have anymore recommendation for my issue?

Thank you in advance.

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: How to use SMBus to talk with RTC?

Thu Feb 09, 2017 7:05 am

jackbk wrote:
DougieLawson wrote:What does i2cdetect -y 1 show?
I am sorry. I am using VAR-DT6 board from Variscite, so the command "i2cdetect -y 1" is not available in my board (my OS is Yocto Jethro 4.1.15).

My intention is just to talk with the RTC on my board by Python. So, do you have anymore recommendation for my issue?

Thank you in advance.
Hi,
these forums are for the support and community of Raspberry Pi products, paid for by the Raspberry Pi Foundation.
As such, asking for help on other products is not allowed. I'll move this thread to Off-Topic.
Thank you
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

jackbk
Posts: 5
Joined: Wed Feb 08, 2017 10:57 am

Re: How to use SMBus to talk with RTC?

Thu Feb 09, 2017 8:00 am

texy wrote:
jackbk wrote:
DougieLawson wrote:What does i2cdetect -y 1 show?
I am sorry. I am using VAR-DT6 board from Variscite, so the command "i2cdetect -y 1" is not available in my board (my OS is Yocto Jethro 4.1.15).

My intention is just to talk with the RTC on my board by Python. So, do you have anymore recommendation for my issue?

Thank you in advance.
Hi,
these forums are for the support and community of Raspberry Pi products, paid for by the Raspberry Pi Foundation.
As such, asking for help on other products is not allowed. I'll move this thread to Off-Topic.
Thank you
Texy
Sorry, I do not know that. It is OK to move this topic to Off-Topic.

Return to “Off topic discussion”