Issues with app controll

Hi,

I´m facing some issues when usig the controll app.

I did the set up as described on the webpage 12. PiDog mit der APP spielen — SunFounder PiDog Kit 1.0 Dokumentation

When I start the app_control.py the following error comes up:

~/pidog/examples $ sudo python3 12_app_control.py
vilib 0.3.12 launching …
picamera2 0.3.25
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=29, name=‘GPIO5’, names=frozenset({‘BOARD29’, ‘BCM5’, ‘WPI21’, ‘J8:29’, 5, ‘5’, ‘GPIO5’}), pull=‘’, row=15, col=1, interfaces=frozenset({‘’, ‘uart’, ‘i2c’, ‘spi’, ‘dpi’, ‘gpio’}))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/theo/pidog/examples/12_app_control.py”, line 11, in
my_dog = Pidog()
^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pidog-1.3.9-py3.11.egg/pidog/pidog.py”, line 131, in _init_
utils.reset_mcu()
File “/usr/local/lib/python3.11/dist-packages/robot_hat/utils.py”, line 147, in reset_mcu
mcu_reset = Pin(“MCURST”)
^^^^^^^^^^^^^
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’

Any suggestions?

Best regards ad thanks for your support,

Sebastian

A similar debug log has been posted on this forum previously. The solution in that case was to reinstall the robot hat module. I have no idea if this would help you, but it may be worth a try?

thanks, will try it!

Oops.. it would have been helpful of me to include the reference link … here it is

Thanks, I tried that, but the issue had a different cause. The GPIO busy issue was caused by an autostart script that launched multiple instances and blocked the pin. However, I’m now facing a different problem: the app connection to the Pidog keeps dropping immediately, even though the web stream itself is working.
‘192.xxx.xxx.xx’) disconneted client (1, ‘192.xxx.xxx.xx’) conneted 1: received 1005 (no status received [internal]); then sent 1005 (no status received [internal]) client (1, ‘192.xxx.xxx.xx’) disconneted

Any Idea what I´m doing wrong?

Best regards,
Sebastian

So it’s working/streaming from the pidog to your host (PC?) But not from the host to the pidog. Without more debug info, I’d be guessing at best. Probably best to wait for Sunfounder’s reply at this stage.

Personally I’d probably be checking my firewall configuration at this point, or temporarily disabling it altogether, but without more knowledge about your setup, that’s maybe not even relevant

This error indicates that the GPIO pin (specifically GPIO5/BCM5/BOARD29) is occupied or in conflict.

Are these GPIO pins connected to any other devices besides the hardware normally connected to our product? Have you made any software configurations?

Please ensure that your Pidog/Robot HAT is properly connected, with no short circuits or poor connections.
Are you running multiple code scripts at the same time? This can lead to pin occupation conflicts. It is recommended to end the previous script before running the next one.
Try checking for running programs using commands like ps -aux | grep python or top.
After rebooting the system, run the script again to see if the same error occurs.
If restarting does not resolve the issue, I recommend reinstalling the operating system, then reinstalling all library code, and running the examples to see if they work.

Thanks a lot for the very quick responses.
I’ve managed to solve the GPIO busy issue and also fixed the connection problem (it turned out my WLAN repeater was causing it).
However, I’m now facing another problem – one that I actually had right at the start:

Whenever the Pidog starts moving, the Raspberry Pi immediately restarts. In the app you can see everything freeze, and after the Pi reboots I can reconnect and control it again. But as soon as the Pidog moves, it reboots once more and the app freezes again.

What I’ve already checked / tried

  • Power supply: using the official supply, seems stable
  • All cables and connectors are seated firmly
  • GPIO busy issue has been resolved (no multiple processes running)
  • WLAN connection is stable (no more drops after removing repeater)

I’ve recorded a short video that shows this behavior, but unfortunately I can’t upload it here.

Any ideas what I should check?

I´m using a Raspberry Pi 4 Model B

Is your battery fully charged? The Pidog requires a significant amount of power to operate, as the 12 servos along with the sensor modules need substantial power. This can lead to the PI4 not receiving enough power, potentially causing it to shut down and restart.

We recommend fully charging the battery and then running the system again to see how it performs.