FAQ

Creating Server TCP listening socket *:6379: bind: Address already in use

Find the PID of the running redis server and kill it.

Could not connect to YourComponentNameHere on device 192.168.0.xxx:

This could have many different causes, but there are a few things to check.

  1. Check the IP address of the robot is correct. Press the chest button to find out.

  2. Make sure the component is running, if it is not a desktop or robot component. E.g. Dialogflow and Whisper have to be started separately.

  3. You are using the desktop or robot components directly. Use the Nao(ip=...)/Pepper(ip=...)/Desktop() wrappers which will start the components for you.

RuntimeError: Wrong path format

Error: RuntimeError: Wrong path format (animations/Stand/BodyTalk/BodyTalk_1) which has been converted in: animations/Stand/BodyTalk/BodyTalk_1, it should follow the pattern: package/path

Solution: BodyTalk/BodyTalk_XX does not work on the NAO’s as of 16/11/2023. The Gestures do work, so try those instead (possible to record your own).

Cannot show the camera output [Mac]

Solution A: run in own terminal or VS code, not in pycharm terminal

Solution B: Check that your OpenCV install is working (https://stackoverflow.com/questions/34966541/how-can-one-display-an-image-using-cv2-in-python). On MacOS you can only use cv2.imshow from the main thread, not from other threads or callbacks (which use threads).

Webcam doesn't turn on but on the iphone it does [Mac]

On mac can turn off "Continuity Camera" or 

On your iPhone, go to Settings > General > AirPlay & Handoff. Turn off Continuity Camera

Pyaudio install problem: fatal error: 'portaudio.h' file not found [All OS]

On Mac
brew install portaudio pip install pyaudio pip install opencv-python six
On Ubuntu
sudo apt-get install portaudio19-dev python3-pyaudio pip install pyaudio pip install opencv-python six

 

ImportError: libGL.so.1: cannot open shared object file: No such file or directory [WSL]

sudo apt-get install python3-opencv

 

Incompatible architecture [Mac]

error: have ‘arm64’, need ‘x86_64’, this seems to affect the newer macbooks only. I was told that the student fix it my trying different answers of this stackoverflow question:

https://stackoverflow.com/questions/71882029/mach-o-file-but-is-an-incompatible-architecture-have-arm64-need-x86-64-i

 

Very laggy camera output [All OS]

Make sure libturbo-jpeg is installed.

#Install libturbo-jpeg 1- download and run installer from https://sourceforge.net/projects/libjpeg-turbo/files/2.1.5.1/libjpeg-turbo-2.1.5.1-gcc64.exe/download 2- add the bin folder where you installed libjpeg-turb to the PATH environment variable  (see e.g. https://www.wikihow.com/Change-the-PATH-Environment-Variable-on-Windows for how to do this) 3- make sure that the dll is called turbojpeg.dll (e.g. by copying and renaming libturbojpeg.dll) 4- pip install -U git+https://github.com/lilohuang/PyTurboJPEG.git

Image is tinted blue [Python]

if using openCV, try adding this line of code:

img= cv2.cvtColor(img, cv2.COLOR_RGB2BGR)

https://stackoverflow.com/questions/57420927/python-opencv-output-avi-screengrab-color-is-blue-intensive

Webcam output is flipped [Python]

flip the image by vertically by adding this line ofcode

img= cv2.flip(img, 0)

Module google not found [Python]

pip install google-cloud-dialogflow

How can I do two things at the same time in my python program?

Use the block=False parameter of the nao.request method to not wait for things to complete. If you do need to wait for the result, but still want to do multiple things: use threads!

face_detection_dnn.py: ERROR: invalid load key, 'v':

Use python 3.9

gRPC error: No DesignTimeAgent found:

You probably are not using the right keys and/or have not created an agent on the dialogflow site. Check the instructions TODO here.

Issue with dialogflow not properly transcribing after subsequent calls:
Try restarting the dialogflow component. E.g. restart dialogflow.py

Unauthenticated: 401 Request had invalid authentication credentials ACCESS_TOKEN_EXPIRED: [dialogflow]

If you see:

google.api_core.exceptions.Unauthenticated: 401 Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project. [reason: "ACCESS_TOKEN_EXPIRED"

Make sure your machine's clock is synced.

How to change the speed a recorded motion?

Use

nao.motion_record.request(PlayRecording(recording, playback_speed=1.7))

Can I use NaoQi without/parallel to SIC?

In theory, yes. However, usually it is quite a hassle to install and run yourself so this is not recommended(either on Mac or Windows) as it usually takes a significant amount of time.

Naoqi SDK installation instructions (if you are using NAO or Pepper directly in Python) http://doc.aldebaran.com/2-5/index_dev_guide.html
Downloads Softwares | Aldebaran
This is the official library for Pepper/Nao robots. One thing you might want to pay particular attention to is the installation of it .
To download PythonSDK, follow here:
Make sure you have python 2.7 (eg. run “python -V” in the terminal)
Download Python SDK from Downloads Softwares | Aldebaran
Tips for installing Naoqi on Mac (and similar on Linux):
After downloading python sdk of naoqi, open the terminal and type in:
$ open ~/.zshrc
Next, add the following lines into your zsh file:

export PYTHONPATH=${PYTHONPATH}: path_to_python_sdk/pynaoqi-python2.7-2.5.7.1-mac64/lib/python2.7/site-packages export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:path_to_python_sdk/pynaoqi-python2.7-2.5.7.1-mac64/lib export DYLD_FRAMEWORK_PATH=${DYLD_FRAMEWORK_PATH}:path_to_python_sdk/pynaoqi-python2.7-2.5.7.1-mac64

Save the changes to zsh file and restart a new terminal. Enter python 2.7 in the terminal and try to import naoqi. If you succeed to import it without any error complaints, then you are good to go.

Issues with naoqi:

Install python 2.7 from website below:

https://www.python.org/downloads/release/python-2710/

if you use conda, type ‘conda deactivate’ in terminal

If your MacOS blocks installing the sdk from an unidentified developer, check the Mac user guide here to override your security settings. The python version should be 2.7 now

How to terminate processes in Windows command prompt if Ctrl + C can't kill them?

If you are using a Dell laptop, try CTRL+Fn+B

 

Failed to build opencv-python ERROR: Could not build wheels for opencv-python:

Try installing an earlier version of OpenCV might work: pip install opencv-python==4.8.1.78

 

Could not connect to redis at 10.0.0.X

If you have a problem connecting to the Redis server, even after running it in another terminal, it could be that your firewall is blocking communication from the robot. Please turn off your firewall to allow the robot to connect to the Redis server.