无法在Aldebaran Nao上运行代码
我用Python SDK写了一个简单的程序,文件名是say.py。Aldebaran Nao机器人通过IP地址172.26.96.164连接到网络。
from naoqi import ALProxy
pr = ALProxy("ALTextToSpeech", "172.26.96.164", 9559)
pr.say("Hello, You are awesome !")
这个代码运行得很好。但是当我在电脑上启动本地版本的Naoqi时,
> & 'C:\Program Files (x86)\Aldebaran\Choregraphe 1.12.5.3\bin\naoqi-bin.exe'
文件say.py的代码就停止运行,并出现了以下错误。
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.
有人能解释一下这个错误到底是什么意思吗?我怎么知道是谁在使用这个端口?我该如何释放这个端口,或者我可以使用其他端口吗?
3 个回答
0
试着下载一个旧版本的sdk。
0
你可以通过在命令行中使用netstat命令,查看哪个程序正在使用这个端口,以及具体是哪个端口。
1
看看naoqi命令行的选项:
-p [ --broker-port ] arg (=9559) 服务器的端口,默认是9559
--pport arg (=0) 父代理的端口,默认没有父代理(0)。