# Pidog: pinctrl: not found

**URL:** <https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208>\
**Category:** Robotic kit for Raspberry Pi\
**Created:** [December 28, 2024, 8:13pm UTC](https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208 "2024-12-28T20:13:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![LesMalins](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@LesMalins](https://forum.sunfounder.com/u/LesMalins)\
**Post date:** [December 28, 2024, 8:13pm UTC](https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208/1 "2024-12-28T20:13:33Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![LesMalins](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@LesMalins](https://forum.sunfounder.com/u/LesMalins)\
**Post date:** [December 29, 2024, 6:00am UTC](https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208/2 "2024-12-29T06:00:38Z")

</div>

Edit: I erased the sim card and reinstalll everything from scratch: I still get the same error.

---

<div class="post-metadata">

**Author:** ![Spf650](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Spf650](https://forum.sunfounder.com/u/Spf650)\
**Post date:** [December 29, 2024, 12:17pm UTC](https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208/3 "2024-12-29T12:17:04Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![LesMalins](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@LesMalins](https://forum.sunfounder.com/u/LesMalins)\
**Post date:** [December 29, 2024, 7:07pm UTC](https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208/4 "2024-12-29T19:07:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Spf650](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Spf650](https://forum.sunfounder.com/u/Spf650)\
**Post date:** [December 29, 2024, 7:21pm UTC](https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208/5 "2024-12-29T19:21:19Z")

</div>

It enables the speaker according to the comment in the code

os.popen(“pinctrl set 20 op dh”) # enable robot\_hat speake switch

But just run it without parameters to see if you have the command… or even safer use

which pinctrl

To see if it’s on your path

but you’re right, the weekend is almost over, so best to await Sunfounder

---

<div class="post-metadata">

**Author:** ![LesMalins](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@LesMalins](https://forum.sunfounder.com/u/LesMalins)\
**Post date:** [December 30, 2024, 2:44am UTC](https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208/6 "2024-12-30T02:44:56Z")

</div>

> [@Spf650](#):
>
> which pinctrl

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. ).

---

<div class="post-metadata">

**Author:** ![Spf650](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Spf650](https://forum.sunfounder.com/u/Spf650)\
**Post date:** [December 30, 2024, 6:27am UTC](https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208/7 "2024-12-30T06:27:29Z")

</div>

i know you are awaiting an answer from Sunfounder, so this is just FYI

AFAIK pinctrl is not available under apt, you need to build from github source or use an OS with it included.

Focussing on the microphone aspect, the recognizer web page has several trouble shooting suggestions depending upon your chosen microphone

> **[SpeechRecognition](https://pypi.org/project/SpeechRecognition/)**
>
> Library for performing speech recognition, with support for several engines and APIs, online and offline.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [December 31, 2024, 9:32am UTC](https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208/9 "2024-12-31T09:32:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![LesMalins](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@LesMalins](https://forum.sunfounder.com/u/LesMalins)\
**Post date:** [December 31, 2024, 3:18pm UTC](https://forum.sunfounder.com/t/pidog-pinctrl-not-found/2208/10 "2024-12-31T15:18:49Z")

</div>

Thank you so much! I’ll install the bookworm version: we were using the Legacy version, as instructed earlier.

Have a nice day.
