1

I need help in python. I tried to put this code in python shell:

from naoqi import ALProxy

tts = ALProxy("ALTextToSpeech", "127.0.0.1",9559)
tts.say("Hello, world!")

and I get this error:

Traceback (most recent call last):
  File "C:/Users/USER/Desktop/say.py", line 2, in <module>
    tts = ALProxy("ALTextToSpeech", "127.0.0.1",9559)
  File "C:/Users/USER/Desktop\naoqi.py", line 227, in __init__
    inaoqi.proxy.__init__(self, args[0], args[1], args[2])
  File "C:\Python27\lib\site-packages\inaoqi.py", line 318, in __init__
    this = _inaoqi.new_proxy(*args)
RuntimeError:   ALBroker::createBroker
    Cannot connect to tcp://127.0.0.1:9559

This order happen whether I use virtual robot or real, I use choregraphe 1.14.5 version and python version 2.7.13

Partho63
  • 3,117
  • 2
  • 21
  • 39
Rawan
  • 9
  • 2

1 Answers1

0

The connection is almost never done to 127.0.0.1:9559:

  • If you're connecting to a real robot, you should replace 127.0.0.1 by it's IP address (or it's domain name, e.g. "nao.local", but may or may not work depending of your local network configuration; when it does work it's more convenient)

  • If you're connecting to Choregraphe's virtual robot, you should replace 9559 by the virtual robot's port, which you can find in Choregraphe's preferences, at the bottom of the "Virtual Robot" tab, as seen in this image.

Emile
  • 2,946
  • 2
  • 19
  • 22
  • I tried on my real robot with him address but the same Error – Rawan Feb 12 '19 at 04:03
  • Same error message ? And are you able to ping that robot from the Machine on which you're running this script ? – Emile Feb 12 '19 at 13:07
  • i solved this problem as you said i put nao.local , can i ask you for mapping ? – Rawan Feb 12 '19 at 14:43
  • i need to create map for nao robot by python and i do not know how can i start please if you have any idea help me , or give me a good resource – Rawan Feb 12 '19 at 14:44