Socket is not connected Pepper

639 views Asked by At

I use pythonsdk and naoqi for programming my pepper robot. i created a session and call the main by it is follows:

    try
       session = qi.Session()
       session.connect("tcp://#.#.#.#:9559")

    except RuntimeError:
       print ("Cannot connect to robot ")

    main(session)

each run of my program may take about 2 hourse. Actually it is a toutrial based interaction which is a loop of two phase: robot speech and playing a video clip on pepper's tablet, then a new topic and new video clip and so on. but after a while i got these errors:

RuntimeError: Session not connected.
RuntimeError: Socket is not connected

so what these errors mean? and how can i overcome them? Thanks in advance

session not connected

1

There are 1 answers

1
Victor Paléologue On

You should make sure your session remains alive, by using it from the scope it was created:

session = qi.Session()
session.connect("tcp://#.#.#.#:9559")
main(session)