I’ve found a lot of sensors that have this problem,When I use this loop : While True
After printing a variable number of times, I find the program is stuck.
Only after I rebooted the raspberry pi, Raspberry PI can print out new sensor values.
Can someone help me?
I will be very grateful.
Not the grove Pi, but the Raspberry Pi itself is flawed. . .
Are you using the i2c port or the software i2c via AD1?
There is a known bug with hardware i2c on the Raspberry Pi, where they don’t implement clock-stretching properly.
The issue is that some sensors, (maybe yours too?), are sensitive to the accuracy of the i2c implementation. If it’s not dead-on spec, the sensor does weird things. Since it appears that the people who implemented the i2c hardware solution used on the Pi kinda’ waved at the spec as they drove by, it’s a bit squiffy and the hardware i2c suffers as a result.
The Dexter “software” i2c driver solves these problems since it implements the i2c spec more accurately than the Raspberry Pi’s hardware. The down-side of this is that their software solution uses one of the two A/D ports, leaving you with only one left.
You might want to search around here about that - there are a number of articles, especially about the IMU sensor, that discuss this problem in detail.
Thanks for an excellent question and don’t forget to write back and tell us what happened!
Yeah I asked official staff in China about this problem.
They suggested that I use the official system:Raspbian for Robots
Because when they use the official system, there is no problem like me.
I am trying.
I just installed the official system:Raspbian for Robots.
version: V 9
This version of Raspbian was modified by Dexter Industries on the Stretch Raspbian Build.
This version was updated on 26th of June 2018.
#############
Start: Thu Apr 4 15:58:43 UTC 2019
End: Thu Apr 4 16:04:09 UTC 2019
I am using Raspberry Pi 3B+. Its system is up to date. OS: Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
interface
grovepi.analogRead()
grovepi.dht()
Port
Grove-Moisture Sensor [A1]
Grove-Light Sensor [A2]
Grove-Temperature and Humidity Sensor Blue [D3]
This picture is the data printed by the program I wrote, but the first line I did not print in the program.
And I ran my program on the newly installed system: Raspbian for Robots. and it stuck again after running for an hour. But my Grove Pi hasn’t dropped.
I have already answered all your questions.
It’s not your fault you downloaded an old version, we’re having issues with Sourceforge.
Also, make sure your grovepi has firmware version 1.4, and do not use sudo to run your code, even if the readmes tell you to. The Readmes have not all been updated.
Thank you for your help.
I have contacted the Chinese authorities.
They assumed it was a hardware problem with the Grove Pi.
Because no one else had a similar problem.
There is no fault with the raspberry pi