ds3231 | platform agnostic driver to interface with the DS3231
kandi X-RAY | ds3231 Summary
kandi X-RAY | ds3231 Summary
A platform agnostic driver to interface with the DS3231 real-time clock.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ds3231
ds3231 Key Features
ds3231 Examples and Code Snippets
Community Discussions
Trending Discussions on ds3231
QUESTION
I'm trying to display time and temperature and other variables on an LCD display, and on a web page (local network only) when it's accessed. This is running on a Raspberry pi Zero 2 W, using python. My thinking is, the flask app should be running in the background, and serving up the template when it's called. Meanwhile, the timer should interrupt every second and cause the LCD display to be updated.
The LCD display works as it should, with the data refreshed every second, as long as the flask server is not active (commented out the "flask_app.run..."). But when flask is enabled, the web page works but the display does not.
I'm about at my limit of understanding python and flask -- can you see what's wrong here? Thanks.
...ANSWER
Answered 2022-Jan-25 at 17:47Once you call flask_app.run(), that is a blocking call...it will stay inside that function forever. Therefore, when flask_app.run() is uncommented, your LCD timer loop never gets executed. My suggestion is to use a multithreaded approach where one thread takes care of the flask app and the other thread takes care of other board-level I/O that you want to do. Here's a simplistic working example where the flask app uses the main thread and a simulated LCD process updates a counter (the console simulates your LCD):
QUESTION
I want to install this library using Thonny https://github.com/adafruit/Adafruit-uRTC to use a DS3231 with my Raspberry Pi Pico. I cannot install it via the built-in package manager feature for two reasons. The version on PyPi is out of date and apparently buggy, I want to use the latest version. Even if I wanted to use the version on PyPi micropip fails to install it with an opaque and unhelpful error message "micropip returned with error code 1".
I have the source files, they have no dependencies, how can i just install them manually?
...ANSWER
Answered 2021-May-03 at 15:18The library you are trying to install is deprecated. Maybe you want a more specific driver like this one. You can just upload it to your board like any other .py file.
Generally to install libraries manually you enter the REPL and type.
QUESTION
I'm working on a ASUS TinkerBoard, OS Linaro 9.5 - Kernel 4.4.132
I added a little RTC board based on DS3231 chip.
The system creates the device /dev/rtc1 added to /dev/rtc0 and /dev/rtc (link to /dev/rtc0).
I'm able to talk with the RTC chip via i2cdetect and hwclock commands but I have a strange behavior.
This is my tests - of course I'm disconnected from the network to avoid the ntp sync:
WITHOUT RTC: at every power up the board/OS resets the date and time from Nov 03 2016 00:00
WITH RTC:
- synced the date/time by Internet connection
- forced the RTC value set by
hwclock -f /dev/rtc1 --systohc
- checked the value by 'hwclock -f /dev/rtc1 --get'
- disconnected from the network and powered down the board - let's say at 18:00
- powered up the board at 18:15
- when the desktop is ready I see the system time is set to 18:00 (?)
- if I read the RTC by
hwclock -f /dev/rtc1 --get
and I have 18:15 - the data is correctly set to today (!)
It seems the system date is restored, the system time is freezed at the power down time, the RTC time is correct but it is not restored to the system time.
Any idea?
...ANSWER
Answered 2021-Mar-20 at 14:03You say that /dev/rtc is a link to /dev/rtc0, this means that your kernel is configured with CONFIG_RTC_HCTOSYS_DEVICE
set to rtc0. You can either set it to rtc1 or update your device tree aliases so that the DS3231 becomes rtc0.
The other solution would be to stop relying on the kernel hctosys and use hwclock -f /dev/rtc1 --hctosys
in a startup script.
QUESTION
I have written a bluez application on Raspbian Buster, Raspberry Pi 4. In some reboots, the bluetooth module and service are not loaded.
On checking the bluetooth.service with command: $ sudo systemctl status bluetooth.service
,
I see, Condition check resulted in Bluetooth service being skipped
.
I checked $ lsmod
and $ dmesg
logs for both issue and non-issue conditions.
The difference I find in the lsmod is shown below:
The difference I find in the dmesg log is shown below:
The left side is the issue case and the right side is non issue case.
How can I fix the issue so that the bluetooth works consistently? I am using Raspbian Lite OS 2020-02-14.
Update 1 [03 Feb 2021]: I checked the journalctl log for the issue case and found this:
...ANSWER
Answered 2021-Feb-03 at 09:02My orientation sensor was interfaced to UART2 of Raspberry Pi 4. On getting suggestion from @svin83 , I disabled UART2. After that I rebooted the Pi 4 10 times and the bluetooth worked correctly all the times.
I moved the sensor to I2C-3 bus in Raspberry Pi 4.
As per the documentation, UART Configuration, the UART2 should not have interfered with bluetooth functionality, but it turns out it does.
QUESTION
I'm currently trying to measure remaining time until a given timestamp using Adafruit's RTClib library. My RTC module is a DS3231. here is my TimeSpan object in code:
...ANSWER
Answered 2020-Dec-06 at 05:19Your line of code:
QUESTION
My intention is a program a system that turns on at a certain time and also turns off at a particular time. But the problem I'm facing is that each time it gets to the scheduled time to turn on the sensor starts sensing motion even when there's no motion for a few seconds after that it goes back to normal. Normal in the sense that it stops sensing motion when there's no motion. I ran a basic motion dection code using PIR sensor and led just to check if the sensor is working properly, it worked out fine so I don't really know why I'm still getting that error. Please how can I eliminate this error cus I have very little knowledge on how to program an Arduino.
...ANSWER
Answered 2020-Jul-31 at 08:22A PIR sensor like the HC-SR501 will not immediately switch back to "low". It will switch to "high" once motion is detected and sustain the output for around 10 seconds.
In my applications I usually use multiple sensors, for example a PIR motion sensor combined with a camera. Once the PIR triggers, the application will start checking for motion inside the camera picture.
QUESTION
This code is meant to be useful for detecting an intruder at a particular time interval, then it turns on 2 led's and a buzzer and then send a text message to the pre-programmed number. But the challenge I'm facing is that when the system comes on the pir sensor keeps sending a logic 1 and that in turn makes the gsm module to keep sending text message even when no intruder is in range also immediately the scheduled time elapses the sensor then again sends a logic 1 before finally going off. Secondly the text message I receive shows Content not support. Please I'm really in need of help I'm confused and I don't know what to do anymore.
...ANSWER
Answered 2020-Jul-28 at 06:35Try to get 1 variable to be for help. I'll name it help just to show. This will make so the text msg will be sent only first time after change of state from low to high.
QUESTION
i am having a bit of trouble understanding why the "while" loop in my code doesn't stop when the condition is met.
...ANSWER
Answered 2020-Jun-24 at 09:02It is evident from your code that, you are using an 'OR' between these conditions as in (x or y). So the loop will continue its execution until both of these conditions equate to a false value.
ex : Consider the following while loop
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ds3231
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page