You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgraded to version 0.5.11 of RPi.GPIO and am receiving the following error when raspisump initiates a reading with sensor.py
Traceback (most recent call last):
File "/usr/local/bin/rsump.py", line 19, in
reading.water_reading()
File "/usr/local/lib/python2.7/dist-packages/raspisump/reading.py", line 36, in water_reading
water_depth = pit_depth - value.distance()
File "/usr/local/lib/python2.7/dist-packages/raspisump/sensor.py", line 32, in distance
GPIO.setup(self.trig_pin, GPIO.OUT)
RuntimeError: Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)
The text was updated successfully, but these errors were encountered:
As of version 0.5.11 of RPi.GPIO the GPIO.setmode statement in sensor.py has to be moved inside the 'for loop' in distance(self) method.
This happens because, according to the changelog for version 0.5.11 of RPi.GPIO, the 'GPIO.cleanup() unsets the current pin mode'
So it was getting unset after the first sample was taken.
This will be fixed in version 0.5.3 of Raspi-Sump. In the meantime simply downgrade RPi.GPIO to version 0.5.10 as stated above. Will try to fix by this weekend.
Upgraded to version 0.5.11 of RPi.GPIO and am receiving the following error when raspisump initiates a reading with sensor.py
Traceback (most recent call last):
File "/usr/local/bin/rsump.py", line 19, in
reading.water_reading()
File "/usr/local/lib/python2.7/dist-packages/raspisump/reading.py", line 36, in water_reading
water_depth = pit_depth - value.distance()
File "/usr/local/lib/python2.7/dist-packages/raspisump/sensor.py", line 32, in distance
GPIO.setup(self.trig_pin, GPIO.OUT)
RuntimeError: Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)
The text was updated successfully, but these errors were encountered: