1

I have made a simple program using Python SDK in file say.py . Aldebaran Nao is connected to network at IP 172.26.96.164

from naoqi import ALProxy
pr = ALProxy("ALTextToSpeech", "172.26.96.164", 9559)
pr.say("Hello, You are awesome !")

The code runs fine. But when I start local version of Naoqi on computer

> & 'C:\Program Files (x86)\Aldebaran\Choregraphe 1.12.5.3\bin\naoqi-bin.exe'

The code for say.py stops running with following error.

PS C:\Users\admin\Desktop\nehchal> python say.py
[INFO ] Starting ALNetwork
[ERROR] Connection failed ! Port 54010 is already in use. Are you already running NaoQi? Use --broker-port option to specify a different port.
[INFO ] Stopping ALNetwork
[INFO ] Exit
Traceback (most recent call last):
  File "say.py", line 2, in <module>
pr = ALProxy("ALTextToSpeech", "172.26.96.164", 9559)
  File "C:\Python27\lib\site-packages\naoqi.py", line 230, in __init__
inaoqi.proxy.__init__(self, args[0], args[1], args[2])
  File "C:\Python27\lib\site-packages\inaoqi.py", line 322, in __init__
this = _inaoqi.new_proxy(*args)
RuntimeError:   ALBroker::runBroker
    Port 54010 is not free. Another broker is using this port.

Can someone please explain what does this error exactly mean? How to know who is using this port? How do I free the port or how can I use alternate port?

Nehchal Jindal
  • 301
  • 1
  • 7
  • Update: I think there is some race condition for acquiring the port. I have solved the problem by using in while loop where it tries again if it fails. Now, generally it connects by attempting for maximum 4-5 times. – Nehchal Jindal Mar 15 '13 at 21:35

3 Answers3

1

look at the naoqi command line option:

  • -p [ --broker-port ] arg (=9559) Port of the server, default is 9559

  • --pport arg (=0) Port of the parent broker, default is no parent (0).

Alexandre Mazel
  • 2,462
  • 20
  • 26
0

You should be able to see if/and what is using the port using the netstad command from a prompt.

0

Try to download an [older version of sdk]( https://community.aldebaran.com/en/resources/software/212-3-python-naoqi-sdk).

Brett DeWoody
  • 59,771
  • 29
  • 135
  • 184