I just built the PiDog and everything seems to be working but the ultrasonic module. I tried swapping it out with another I’ve had on hand and tired a different cable. The multimeter shows 3.3V when testing ground so the pins seem to be getting power. I tired using d2 and d3 with the test script. I know these pins work since the touch switch works using them.
The following is the output I get in the terminal:
paulhammond@raspberrypi:~ $ cd ~/pidog/examples
paulhammond@raspberrypi:~/pidog/examples $ sudo python3 4_response.py
config_file: /home/paulhammond/.config/pidog/pidog.conf
robot_hat init … done
imu_sh3001 init … done
rgb_strip init … done
dual_touch init … done
sound_direction init … done
sound_effect init … pinctrl set 20 op dh
done
ultrasonic init … fail
Process sensory_process:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/gpiozero/pins/pi.py”, line 411, in pin
pin = self.pins[info]
~~~~~~~~~^^^^^^
KeyError: PinInfo(number=7, name=‘GPIO4’, names=frozenset({‘BOARD7’, ‘BCM4’, 4, ‘WPI7’, ‘J8:7’, ‘GPIO4’, ‘4’}), pull=‘’, row=4, col=1, interfaces=frozenset({‘’, ‘dpi’, ‘spi’, ‘uart’, ‘i2c’, ‘gpio’}))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.11/dist-packages/pidog-1.3.9-py3.11.egg/pidog/pidog.py”, line 583, in sensory_process_work
trig = Pin(‘D1’)
^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/robot_hat/pin.py”, line 96, in init
self.setup(mode, pull, active_state)
File “/usr/local/lib/python3.11/dist-packages/robot_hat/pin.py”, line 134, in setup
self.gpio = OutputDevice(self._pin_num)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/gpiozero/devices.py”, line 108, in call
self = super().call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/gpiozero/output_devices.py”, line 74, in init
super().init(pin, pin_factory=pin_factory)
File “/usr/lib/python3/dist-packages/gpiozero/mixins.py”, line 75, in init
super().init(*args, **kwargs)
File “/usr/lib/python3/dist-packages/gpiozero/devices.py”, line 553, in init
pin = self.pin_factory.pin(pin)
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/gpiozero/pins/pi.py”, line 413, in pin
pin = self.pin_class(self, info)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/gpiozero/pins/lgpio.py”, line 126, in init
lgpio.gpio_claim_input(
File “/usr/lib/python3/dist-packages/lgpio.py”, line 755, in gpio_claim_input
return _u2i(_lgpio._gpio_claim_input(handle&0xffff, lFlags, gpio))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/lgpio.py”, line 458, in _u2i
raise error(error_text(v))
lgpio.error: ‘GPIO busy’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.11/multiprocessing/process.py”, line 314, in _bootstrap
self.run()
File “/usr/lib/python3.11/multiprocessing/process.py”, line 108, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python3.11/dist-packages/pidog-1.3.9-py3.11.egg/pidog/pidog.py”, line 590, in sensory_process_work
raise ValueError(e)
ValueError: ‘GPIO busy’
distance.value: -1.0 cm, touch N
distance.value: -1.0 cm, touch N
distance.value: -1.0 cm, touch N
distance.value: -1.0 cm, touch N