Pidog iPad Controller

Instructions on website state:
https://docs.sunfounder.com/projects/pidog/en/latest/python/py_12_app_control.html

cd ~/pidog/examples
sudo python3 12_app_control.py

and the results will be:

Running on: http://192.168.18.138:9000/mjpg

* Serving Flask app “vilib.vilib” (lazy loading)

* Environment: development

* Debug mode: off

* Running on http://0.0.0.0:9000/ (Press CTRL+C to quit)

The results are:

IndexError: list index out of range

And there is no mention on 192 in the dialogue

Needless to say my iPad could not find the PiDog

Thanks for your help

Carl

The 192.xxx.xxx.xxs is the ip address address allocated to your pidog by your own router. The one shown is only an example. ifconfig will show your actual one.

The main problem though seems to be this

IndexError: list index out of range

This usually indicates a bad hardware connection typically camera, so the program cannot progress further. Does the camera and other hardware all work in the example programs?

I believe I have the correct ip address, I am not the person experiencing the index error.

How can I check the camera, I have never seen a display. All of the other servos seem to work when I use the exercise to enter commands via the keyboard.

I ran the following code that I found on the internet:

pi@raspberrypi:~/pidog/examples $ libcamera-hello -t 0
bash: libcamera-hello: command not found
pi@raspberrypi:~/pidog/examples $

Am I missing a module, if so where can I find it?

>>> I am not the person experiencing the index error.

This was what you reported

The results are:
IndexError: list index out of range

Depending on which OS you are using, e.g ubuntu, then you may need to install libcamera

sudo apt install libcamera-apps

If you’re using a newer raspbian style OS then libcamera has been superseded by rpicam* e.g

rpicam-hello

I installed libcamera-apps but I still can’t get the iPad controller to find the pidog.

It’s very important that you report which OS you are using. Im not an expert, and i only try to help out at the weekends until sunfounder get back in the office, but if you let the forum know which os you are using somebody can help you.

Did rpicam-hello work as I suggested?

I apologize for my ignorance, I never realized that I would have to get this technically involved to build a PiDog. I am using the operating system that the instructions required that I install in the Raspberry Pi 3B + computer. I assume that it is some derivative of Linux.

I ran through the testing of the PiDog and all of the servos appear to be operating correctly and I wanted to be able to control it with the controller app on my iPad. However the app can’t connect to the pidog. I gave the controller the ip address and it wouldn’t connect, then I tried the Scan option with the same result.

The rpcam-hello option did not work, the command could not be found.

Thanks for your patience and help

Is your Pidog connected to a Wi-Fi network?
We recommend setting up a Wi-Fi connection for your Pidog and then trying the APP example again to see if it works properly.

Important reminder:
Your Pidog and your mobile phone must be connected to the same local network in order to establish a normal connection and function correctly.

You are correct, it should not be required to get so technically involved to get pidog working. Unfortunately, in your case, something seems to have gone wrong, either in the hardware build or software installation.

So, we now need to establish what is wrong, which is more involved.

Your initial out of range index error suggests a hardware problem, my best guess is that the camera cable isn’t installed properly, or maybe i2c devices and the main program is simply exiting before it gets to the point to connect your controller. If you post your FULL commands output that will be easier to see what’s going on.

Assuming it is the camera then, If you are using a newer raspbian OS, then rpicam-hello is one method to verify camera operation. Neither rpicam-hello nor libcamera-hello, will fix your problem, they will just give more information as to the source of the problem.

You said that the rpicam-hello command was not found, however the command you showed was incorrectly spelled.

It’s rpicam-hello (with an i)

Not

rpcam–hello

Please run this, or libcamera-hello and post the full output here.

If neither command can be found then we need to know your actual OS, as one of them should definitely be available, under all raspbian builds, so something else is amiss. Run this command and post the full output to establish your OS

cat /etc/os-release

Thanks for reporting that the servos run ok, thats a step in the right direction. I also suggested running the sunfounder basic example programs. Some use i2c, so that would let us check i2c connections too.

Whilst typing this I noticed that sunfounder gave some alternative possible fixes. I’d suggest trying their suggestions first before getting deeper technically involved, which may be unnecessary.

I ran the three commands and the results follow:
pi@raspberrypi:~ $ rpicam-hello
[0:12:09.736699009] [1614] INFO Camera camera_manager.cpp:340 libcamera v0.6.0+rpt20251202
Made X/EGL preview window
ERROR: *** no cameras available ***
pi@raspberrypi:~ $ libcamera-hello
bash: libcamera-hello: command not found
pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME=“Debian GNU/Linux 13 (trixie)”
NAME=“Debian GNU/Linux”
VERSION_ID=“13”
VERSION=“13 (trixie)”
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.3
ID=debian
HOME_URL=“https://www.debian.org/
SUPPORT_URL=“https://www.debian.org/support
BUG_REPORT_URL=“https://bugs.debian.org/
pi@raspberrypi:~ $

I am not the person that had the array overflow. I don’t know how that happened.

Thanks again for your help.

OK so you are on Trixie OS. So, rpicam-hello is the correct debug tool to run. As you can see, it reported that you have no camera available.

ERROR: *** no cameras available ***

libcamera-hello didnt work because its for older OS, we now know that we can ignore that option from now on.

So, either you have a genuinely broken camera, which is possible but rare. Or your camera cable isn’t connected correctly. It could be inserted into the socket 180 degrees rotated at either or both ends, I’ve seen this several times on this forum, or it’s simply not been fully inserted. It’s a tricky little cable to get right!

I dont have a photo of the correct connection but there are several posted by sunfounder on this forum. Just search for them.

Good luck!

As an aside, i got the index error report from here…

Something got bollixed up, this was not my posting. I do not know what went wrong.

Carl

I will reseat the cable according to the instructions on https://www.youtube.com/watch?v=PTo6smSIlDY.

I will let you know the results.

Thanks

Be careful of any dangling wires during disassembly and reassembly, those batteries are live and unforgiving!

Thank you, that will be all that I need, I will unplug the battery.

I noticed that the female connectors have a black side and a white side, also the cable has a male black and white side. Should I have black to black in both instances? Also, the kit included two cables - one white and the other yellow labeled HBV-Raspberry-300FPC- I used the white.