Hello. I need help please
I finished assembling my Pidog, and the integration with the chatGPT API works fine but only when I use the keyboard. I can’t get voice commands to work. However, when I test the microphone (Rec op.wav, sudo play op.wav) everything works, but when I launch the pidog, I get the error message “/bin/sh: 1: pinctrl: not found” which crashes everything. I made sure that my microphone was set as the default audio input in asound.conf but it still doesn’t work.
Here is what I get:
philemonii@raspberrypi:~ $ cd ~/pidog/gpt_examples/
sudo ~/my_venv/bin/python3 gpt_dog.py
/bin/sh: 1: pinctrl: not found
config_file: /home/philemonii/.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 … done
/bin/sh: 1: pinctrl: not found
ultrasonic init … done
vilib 0.3.11 launching …
picamera2 0.3.12
Web display on: http://192.168.0.250:9000/mjpg
Starting web streaming …
Serving Flask app “vilib.vilib” (lazy loading)
Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
Debug mode: off
listening …
ERROR: No Default Input Device Available
camera close
Stopping and returning to the initial position …
Quit
Pinctrl is relatively new but afaik, it should be included as part of all recent pi raspbian OS’
It can be installed manually if using another / legacy OS.
Try to run the pinctrl command on the CLI, maybe it will give you extra debug info?
The full sf command is
pinctrl set 20 op dh
But not sure if that’s safe to run without any prior setup!
thank you! I’ll wait for the Sunfounder advice before doing it manually as I’m not sure what GPIO 20 does.
Thanks again for your help. I studied programming science, but it was 20 years ago so I’m a bit rusty.
I started with “which pinctrl” few days ago. no luck. I also tried to download it
sudo apt-get update
sudo apt-get install pinctrl
Nothing found.
It’s weird because the speaker works well. It’s the microphone that seems to be the problem. (Mic works when I test it, but not when I engage it with the openAI API. ).
Sorry, this is an issue with robot_hat code not being compatible with the bullseye system because bullseye is missing the pinctrl used to set gpio 20 high to enable speaker, we have fixed the robot code. Please update and reinstall:
cd ~/robot-hat
git pull
sudo python3 setup.py install
sudo bash i2samp.sh
It is also recommended that you use the latest bookworm version of the Raspberry Pi, as code maintenance may not be as up-to-date for compatibility issues with older systems.