V2 sunfounder APP does not work for pi zero 2W

kienchen@raspberrypi:~/sunfounder-controller $ cd ~/picar-x/example
sudo python3 12.app_control.py
vilib 0.3.18 launching …
picamera2 0.3.33
websocket server start at port 8765
pinctrl set 20 op dh
ip : 192.168.1.17

Web display on:
eth0: error fetching interface information: Device not found

http://192.168.1.17:9000/mjpg

Starting web streaming …
client (0, ‘192.168.1.14’) conneted

  • Serving Flask app ‘vilib.vilib’

  • Debug mode: off
    stop and exit
    Traceback (most recent call last):
    File “/home/kienchen/picar-x/example/12.app_control.py”, line 221, in
    main()

    
    

File “/home/kienchen/picar-x/example/12.app_control.py”, line 191, in main
pan = min(90, max(-90, Joystick_Q_Val[0]))
~~~~~~~~~~~~~~^^^
TypeError: ‘int’ object is not subscriptable

We have conducted testing and verification, and the APP example can run normally.

We recommend checking if the WiFi network is functioning properly. We suggest restarting the system and then running the APP example again to see if it works.

If possible, we also recommend trying a different WiFi network to check its performance.

only@raspberrypi:~ $ cd ~/picar-x/example

only@raspberrypi:~/picar-x/example $ sudo python3 12.app_control.py

vilib 0.3.18 launching …

picamera2 0.3.33

websocket server start at port 8765

pinctrl set 20 op dh

ip : 192.168.18.95

Web display on:

http://192.168.18.95:9000/mjpg

Starting web streaming …

ALSA lib pcm.c:8772:(snd_pcm_recover) underrun occurred

* Serving Flask app ‘vilib.vilib’

* Debug mode: off

I don’t think this is a WIFI issue, keyborad, calibration and move app use the same WIFI without any problem.

This should be a python package issue. I reinstall the os 64 bits and 32 bits, sunfounder picar -x v2, and all have the same error.

What version of the Raspberry Pi system are you currently using?
Please execute the cat /etc/os-release command and provide us with the printed output for confirmation.

Please also verify whether all library codes are installed correctly and are located in the same directory path.
Based on the screenshot you provided earlier, it appears that sunfounder-controller is not in the same directory path as robot-hat, vilib, and picar-x. The correct setup requires sunfounder-controller to be in the same top-level directory as robot-hat, vilib, and picar-x.

Therefore, when downloading and installing all library codes, we recommend that you copy and paste the download and installation commands directly from our tutorial.

my os info as follows:

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.2
ID=debian
HOME_URL=“https://www.debian.org/”
SUPPORT_URL=“https://www.debian.org/support”

under install root directory

ls
Desktop Downloads picar-x Public save Templates vilib
Documents Music Pictures robot-hat sunfounder-controller Videos

It looks like we may have identified the issue. The error indicates that the value read from the “Q” position of the SunFounder Controller is a number instead of a list, causing a parsing error.

To help us confirm, could you please check the following:

Have you modified the control interface of the SunFounder Controller?

Are you using a control page from another robot model, which might be sending data in a different format?

It would be very helpful if you could provide a screenshot of the control page on your phone’s SunFounder Controller app.

In the meantime, we have improved the code’s error-handling to prevent such parsing issues from causing the program to crash completely.

You can apply the fix by updating your code:

cd ~/picar-x
git pull

Alternatively, you can re-download the entire repository:

rm -rf ~/picar-x
git clone -b 2.1.x GitHub - sunfounder/picar-x

thanks for the supports. I did not modify the control interface of the SunFounder Controller.
on my Linux host, after your suggestion to refresh the picar-x

cd ~/picar-x
git pull

re run 12.app_control.py, the previous error disappear, and works fine now.

however my IOS APP interface does not show “Picar-X” icon as the document, but only “pico 4WD Car V2” icon
I used

cd ~/picar-x/example
sudo python3 12.app_control.py
vilib 0.3.18 launching …
picamera2 0.3.33
websocket server start at port 8765
pinctrl set 20 op dh
ip : 192.168.1.17

Web display on:
eth0: error fetching interface information: Device not found
http://192.168.1.17:9000/mjpg

Starting web streaming …

  • Serving Flask app ‘vilib.vilib’
  • Debug mode: off
    client (0, ‘192.168.1.14’) conneted
    client (1, ‘192.168.1.8’) conneted
    send Exception: received 1005 (no status received [internal]); then sent 1005 (no status received [internal])
    1: received 1005 (no status received [internal]); then sent 1005 (no status received [internal])
    client (1, ‘192.168.1.8’) disconneted

regards,
kelivn

(attachments)

The pre-set controller for PiCar-X is still there. You need to swipe left to see it. Because there are many projects, the pre-set PiCar-X controller has been pushed to the right side.