<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to talk with RTC hardware by Python? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-talk-with-RTC-hardware-by-Python/m-p/611261#M92269</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using DT6 custom board from Variscite . This board is connect with DART MX6 board. DT6 in below link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.variscite.com/products/single-board-computers/dt6customboard"&gt;http://www.variscite.com/products/single-board-computers/dt6customboard&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to handle the RTC hardware on DT6 board by Python. This RTC named ISL12057. I google some info and I understand as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- ISL12057 is same as DS1307. There is a library of Python for DS1307 as link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.switchdoc.com/2014/07/python-driver-ds1307-real-time-clock/" title="http://www.switchdoc.com/2014/07/python-driver-ds1307-real-time-clock/"&gt;http://www.switchdoc.com/2014/07/python-driver-ds1307-real-time-clock/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try this Python library, but I do not understand this library well. So I have some questions as below. Can you answer them? I appreciate your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. As I list in `/dev/`, it has `i2c-0`, `i2c-1`, `i2c-2`. I do not know which I2C that connect to my RTC. I tried 3 of them by `smbus.SMBus(0)`, `smbus.SMBus(1)`, `smbus.SMBus(2)`, there are 2 kinds of error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.1 IOError: [Errno 16] Device or resource busy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.2 IOError: [Errno 5] Input/output error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, firstly, how can I solve `1.1` or `1.2` to talk with my RTC?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I have no experience with Python that can talk with RTC hardware. so, if my usage of DS1307 library for my ISL12057 is not correct, could you tell me another way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ISL12057 has an interrupt function at each second or each minute. In Python, can we detect that interrupt when it is asserted?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Feb 2017 10:01:17 GMT</pubDate>
    <dc:creator>jackbk</dc:creator>
    <dc:date>2017-02-08T10:01:17Z</dc:date>
    <item>
      <title>How to talk with RTC hardware by Python?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-talk-with-RTC-hardware-by-Python/m-p/611261#M92269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using DT6 custom board from Variscite . This board is connect with DART MX6 board. DT6 in below link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.variscite.com/products/single-board-computers/dt6customboard"&gt;http://www.variscite.com/products/single-board-computers/dt6customboard&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to handle the RTC hardware on DT6 board by Python. This RTC named ISL12057. I google some info and I understand as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- ISL12057 is same as DS1307. There is a library of Python for DS1307 as link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.switchdoc.com/2014/07/python-driver-ds1307-real-time-clock/" title="http://www.switchdoc.com/2014/07/python-driver-ds1307-real-time-clock/"&gt;http://www.switchdoc.com/2014/07/python-driver-ds1307-real-time-clock/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try this Python library, but I do not understand this library well. So I have some questions as below. Can you answer them? I appreciate your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. As I list in `/dev/`, it has `i2c-0`, `i2c-1`, `i2c-2`. I do not know which I2C that connect to my RTC. I tried 3 of them by `smbus.SMBus(0)`, `smbus.SMBus(1)`, `smbus.SMBus(2)`, there are 2 kinds of error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.1 IOError: [Errno 16] Device or resource busy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.2 IOError: [Errno 5] Input/output error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, firstly, how can I solve `1.1` or `1.2` to talk with my RTC?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I have no experience with Python that can talk with RTC hardware. so, if my usage of DS1307 library for my ISL12057 is not correct, could you tell me another way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ISL12057 has an interrupt function at each second or each minute. In Python, can we detect that interrupt when it is asserted?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2017 10:01:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-talk-with-RTC-hardware-by-Python/m-p/611261#M92269</guid>
      <dc:creator>jackbk</dc:creator>
      <dc:date>2017-02-08T10:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to talk with RTC hardware by Python?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-talk-with-RTC-hardware-by-Python/m-p/611262#M92270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jack,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Questions on how to read RTC time value on linux OS is not within our support range. I only give you some advice!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(1) About DS1307&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In it's driver source code, APIs are supported, like following:&lt;/P&gt;&lt;P&gt;static const struct rtc_class_ops ds13xx_rtc_ops = {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.read_time&amp;nbsp;&amp;nbsp; &amp;nbsp;= &lt;STRONG&gt;ds1307_get_time&lt;/STRONG&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.set_time&amp;nbsp;&amp;nbsp; &amp;nbsp;= &lt;STRONG&gt;ds1307_set_time&lt;/STRONG&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.read_alarm&amp;nbsp;&amp;nbsp; &amp;nbsp;= &lt;STRONG&gt;ds1337_read_alarm&lt;/STRONG&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.set_alarm&amp;nbsp;&amp;nbsp; &amp;nbsp;= &lt;STRONG&gt;ds1337_set_alarm&lt;/STRONG&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.alarm_irq_enable = &lt;STRONG&gt;ds1307_alarm_irq_enable&lt;/STRONG&gt;,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;So you can use above 5 functions in your appliction to read/modify Real Time.&lt;/P&gt;&lt;P&gt;But I checked driver source code of ISL12057, APIs are not supported in drivers, So you can't operate RTC on application Level.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(2) rtc device path&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Generally, rtc device should be /dev/rtc/rtc0,1,2.... or /dev/misc/rtc/rtc0,1,2.... you can check and confirm it in your linux system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope above information is helpful for you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regads,&lt;/P&gt;&lt;P&gt;Weidong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2017 07:14:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-talk-with-RTC-hardware-by-Python/m-p/611262#M92270</guid>
      <dc:creator>weidong_sun</dc:creator>
      <dc:date>2017-02-09T07:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to talk with RTC hardware by Python?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-talk-with-RTC-hardware-by-Python/m-p/611263#M92271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Weidong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your advice!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is not within your support range. But I think the i.MX forum can solve many questions related to the boards from Variscite. I am using a board of Variscite, and I know that there are many experts can solve my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I need to move my question to suitable Category in i.MX forum?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2017 08:56:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-talk-with-RTC-hardware-by-Python/m-p/611263#M92271</guid>
      <dc:creator>jackbk</dc:creator>
      <dc:date>2017-02-09T08:56:03Z</dc:date>
    </item>
  </channel>
</rss>

