Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

RTC Pi - OSError: Device or resource busy when running demo_rtcmemory_int.py

6144 Views - Created 29/10/2017

29/10/2017

Posted by:
kyPi2017

kyPi2017 Avatar

Hi,

I follow the instruction on:
https://www.abelectronics.co.uk/kb/article/30/rtc-pi-on-a-raspberry-pi-raspbian-jessie
and everything works fine - thanks.

now running demo_rtcmemory_int.py i get:
OSError: Device or resource busy
so i try to find what is wrong and found this post:
https://stackoverflow.com/questions/17821063/why-does-the-i2cdetect-always-gives-uu-on-my-rtc-in-embedded-linux

i understand that the setup of the rtc pi load the driver when the pi is boot
and the driver probably use the smbus, so its already busy when i try to run the demo.

following the post above, unloading manually the driver in terminal commands:
$ lsmod | grep rtc -->>>> shows the ds_1307 driver
$ rmmod rtc-ds1307

Now, running demo_rtcmemory_int.py works fine!

My question is:
How both can work together:
1. i want the RTC pi to load on boot and set the correct time for the raspberry pi, this is the goal, no ?!
2. i want to use my expansion boards (IO Pi, Servo Pi, ADC ... they all use smbus) while still using the RTC on boot

Can you advise what is the best practice for this issue ?

Many Thanks !

29/10/2017

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

Hi

With the RTC set up using the rtc_ds1307 driver you should be able to access the IO pi, Servo Pi and ADC Pi with smbus but you will not be able to access the RTC Pi directly as the rtc_ds1307 driver blocks access to the I2C address 0x68. Unfortunately, I don't think there is a way around this problem other than manually unloading the driver to access it with the Python library and then reloading the driver afterwards. We wrote the RTC Pi python library so you can access the RTC Pi without using the driver but it was not designed to access the RTC when the driver is loaded.

As you are using the RTC Pi and ADC Pi on the same Raspberry Pi you will also need to change the I2C address of the ADC Pi as the default addresses are 0x68 and 0x69 which will conflict with the RTC Pi. The ADC Pi page shows a list of I2C addresses which you can change using the supplied jumpers.

29/10/2017

Posted by:
kyPi2017

kyPi2017 Avatar

Hi andrew,

Many thanks for your quick response.
I have no problem at all with this "limitation", i just wanted to know if i'm doing something wrong.
my biggest concern was that i'm also not be able to acess the IO Pi, ADC, Servo etc...
because the "whole" I2C bus is bussy, now i understand that its just the 0x68 that busy...

I'll let the driver keep using the I2C 0x68 address, and will NOT access the RTC pi using the python library.

Regarding default addresses 0x68 and 0x69 of ADC Pi , i know that, read the documentation, not a problem and thanks again for your quick answer.
( i also post another question regarding the IO Pi, i notice the default address for the IO Pi, since i have 2 boards, on one of them i also need to solder the jumper to set another address)

Thanks!

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.