stanfordroboticsclub / StanfordQuadruped

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

self.udp_publisher.send ConnectionRefusedError on second call

juedongli opened this issue · comments

self.udp_publisher.send ConnectionRefusedError on second call
need to restart run_robot.py

pi@raspberrypi:~ $ sudo systemctl status robot
● robot.service - Robot control service
Loaded: loaded (/home/pi/StanfordQuadruped/robot.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-12-29 13:48:23 GMT; 4min 22s ago
Process: 343 ExecStartPre=/usr/bin/sudo pigpiod (code=exited, status=0/SUCCESS)
Process: 412 ExecStart=/usr/bin/python3 /home/pi/StanfordQuadruped/run_robot.py (code=exited, status=1/FAILURE)
Main PID: 412 (code=exited, status=1/FAILURE)

Dec 29 13:48:13 raspberrypi python3[412]: joystick_interface.set_color(config.ps4_deactivated_color)
Dec 29 13:48:13 raspberrypi python3[412]: File "/home/pi/StanfordQuadruped/src/JoystickInterface.py", line 94, in set_color
Dec 29 13:48:13 raspberrypi python3[412]: self.udp_publisher.send(joystick_msg)
Dec 29 13:48:13 raspberrypi python3[412]: File "/usr/local/lib/python3.7/dist-packages/UDPComms.py", line 53, in send
Dec 29 13:48:13 raspberrypi python3[412]: self.sock.send(msg)
Dec 29 13:48:13 raspberrypi python3[412]: ConnectionRefusedError: [Errno 111] Connection refused
Dec 29 13:48:13 raspberrypi systemd[1]: robot.service: Main process exited, code=exited, status=1/FAILURE
Dec 29 13:48:23 raspberrypi systemd[1]: robot.service: State 'stop-sigterm' timed out. Killing.
Dec 29 13:48:23 raspberrypi systemd[1]: robot.service: Killing process 410 (pigpiod) with signal SIGKILL.
Dec 29 13:48:23 raspberrypi systemd[1]: robot.service: Failed with result 'exit-code'.