Comments (5)
Hello Elliott
Unfortunately due to the way the RTC driver works in Linux when the DS1307 module is enabled, using the RTC Pi as a hardware clock blocks access to any other programs trying to access the DS1307 RTC chip through the I2C bus. This is indicated when you use i2cdetect as the device shows as UU instead of 68. You can use the RTC Pi as a hardware clock or access it directly through the I2C bus but you can not do both at the same time.
To use the Python library with the RTC you will need to disable the hardware clock by reversing the steps you did in our RTC Pi setup tutorial.
You can do this by editing "/boot/config.txt" and removing the line "dtoverlay=i2c-rtc,ds1307".
You also need to edit /etc/modules and remove "rtc-ds1307".
In "/lib/udev/hwclock-set" remove the comments around the following lines:
if [ -e /run/systemd/system ] ; then
exit 0
fi
Reboot your Raspberry Pi and the RTC should appear on address 0x68.
from abelectronics_python_libraries.
Hello,
Again thank you for your amazingly quick response and clear instructions.
I thought it might have been something like that given it was the only additional board.
Will try and reply.
Thank you once again.
from abelectronics_python_libraries.
Hello
I have followed the instructions (or reverse) and confirmed that the output of i2cdectect is no connection, all address are --
Additionally, when running the demo_rtcgetdate.py I receive [Errno 121 Remote I/O error ], which is expected given the no detection from i2cdectect
As an aside:
" You can use the RTC Pi as a hardware clock or access it directly through the I2C bus but you can not do both at the same time."
I thought this RTC was suitable for data logging, that is depolyed without a WiFi connection and the "Date/Time" from the RTC could be used to start/ stop events and to be used as a timestamp in filenames.
Is this not the case ?
from abelectronics_python_libraries.
The RTC should be showing up on 0x68 if the hardware clock modules are disabled so I am not sure why it is not appearing on the I2C bus. Try disconnecting the RTC Pi and removing the battery to reset the module and power down the Raspberry Pi. Hopefully when you reconnect it and turn the Pi back on it will appear again on the I2C bus.
You can use the RTC to get the current date and time when the Raspberry Pi is disconnected from the internet. To use it for starting and stopping events you will need a program that regularly checks the date and time and runs events at scheduled times.
There are two ways to use the RTC Pi.
You can use it as a hardware clock for Linux which automatically keeps the system time accurate when there is no internet connection or after the Pi has been powered down. When using it this way you would use the datetime library in Python to work with dates. The datetime library uses the Linux system time so the RTC Pi would be working in the background within Linux and you wouldn't interact with it directly.
The second option is to use the RTC Pi independently of Linux with our RTC Python library. This allows you to use the functions in the library to read the date directly from the DS1307 RTC chip. With the RTC library you can access some features that are not available through the Linux hardware clock, mainly access to the 56 bytes of battery-backed RAM that are available in the DS1307. The downside of using it this way is Linux will not have access to the DS1307 so if you are using the Raspberry Pi without internet access it will not have the correct system date when the Raspberry Pi is rebooted.
If you want to use the Raspberry Pi for data logging the best option would be to use the RTC Pi as a hardware clock for Linux by running through the steps again in our RTC tutorial. This way you can use the RTC Pi to keep the system date and time accurate without a WiFi connection and use the datetime Python library or schedule a CRON job to log your data at set intervals.
from abelectronics_python_libraries.
Thank you for your reply,
I have been able to set the i2c (software) mode and tested with i2cietect and demo_rtcgetdate.py which has work.
By editing "/boot/config.txt" and removing the line "dtoverlay=i2c-rtc,ds1307".
I have been able to the Hardware/ system Clock and tested with python's datetime library.
By following the RTCPi tutorial.
Thank you once again for your help.
from abelectronics_python_libraries.
Related Issues (20)
- Bug fixes and suggestion for ABElectronics_IOPi.py HOT 1
- ADCPi Plus -- can't get example to work HOT 2
- [ServoPi.py] Invalid servo range in the Servo.move method HOT 2
- Error running demo_pwm.py HOT 3
- Use smbus2 from PyPI HOT 1
- Publish this project on PyPI
- Timeouterror causing values to freeze HOT 8
- MPC23017 works with Thinkpad Laptop i2c bus but it seems like it times out when writing to it too fast HOT 2
- ADCPi.read_voltage() freezes without raising an exception
- SPI Bus too fast HOT 2
- TimeoutError not defined in Python 2.7 HOT 2
- Setting channel 0 or negative in read_raw in ADCPi does not raise a ValueError HOT 1
- IOPi.py more "generic" constructor HOT 2
- Add exceptions for errors HOT 2
- Resistance on ADC Pi HOT 2
- Can not install libraries as GitHub removed password support HOT 2
- Convert this to python library HOT 2
- Duplicate readings of channels HOT 4
- Whitespace issues in ABE_helpers.py HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abelectronics_python_libraries.