Issue with ultasonic

After a break of a few months I returned to the pidog and reinstalled all software. However now there is an issue with the untrasonic initialising. It just reports -1.0 cm and I get the error message shown below. I have reseated the GPIOs several times.

config_file: /home/drxtal/.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({‘WPI7’, 4, ‘4’, ‘BOARD7’, ‘BCM4’, ‘J8:7’, ‘GPIO4’}), pull=‘’, row=4, col=1, interfaces=frozenset({‘’, ‘dpi’, ‘uart’, ‘i2c’, ‘spi’, ‘gpio’}))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/usr/local/lib/python3.13/dist-packages/pidog/pidog.py”, line 590, in sensory_process_work

trig = Pin('D1')

File “/usr/local/lib/python3.13/dist-packages/robot_hat/pin.py”, line 96, in _init_

self.setup(mode, pull, active_state)

\~\~\~\~\~\~\~\~\~\~^^^^^^^^^^^^^^^^^^^^^^^^^^

File “/usr/local/lib/python3.13/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(

\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~^

    self.factory.\_handle, self.\_number, lgpio.SET_PULL_NONE)

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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.13/multiprocessing/process.py”, line 313, in _bootstrap

self.run()

\~\~\~\~\~\~\~\~^^

File “/usr/lib/python3.13/multiprocessing/process.py”, line 108, in run

self.\_target(\*self.\_args, \*\*self.\_kwargs)

\~\~\~\~\~\~\~\~\~\~\~\~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File “/usr/local/lib/python3.13/dist-packages/pidog/pidog.py”, line 597, in sensory_process_work

raise ValueError(e)

ValueError: ‘GPIO busy’

Please check if the wiring of your ultrasonic module is correct.
Refer to the assembly diagram to confirm the ultrasonic sensor connections:

Black → GND

Red → 3.3V

White → Pin 17

Yellow → Pin 4

After confirming the ultrasonic module wiring is correct, it is recommended to restart the system and then run the example code again to see if it works.

Please check if the WiFi network you are connected to is stable. If possible, try switching to a WiFi network with a stronger signal and then run the code example again.