0

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

user9805040
  • 73
  • 1
  • 9

1 Answers1

0

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)
Victor Paléologue
  • 2,025
  • 1
  • 17
  • 27