Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmr_driver keeps reconnecting #8

Open
janandries opened this issue Jun 28, 2021 · 3 comments
Open

tmr_driver keeps reconnecting #8

janandries opened this issue Jun 28, 2021 · 3 comments

Comments

@janandries
Copy link

janandries commented Jun 28, 2021

The driver in tmrlib keeps reconnecting, even after the connection is reported to be ok.

To reproduce:

  • Start the listennode on the cobot
  • Start the tmr_driver - most of the times the tmr_driver connects
  • stop the listennode - tmr_driver starts trying to reconnect
  • start the listennode
  • tmr_driver will report that the TM robot is connected, but it will keep trying to reconnect forever.

Below the output of starting the listennode after the tmr_driver is started, which will produce the same behavior. I added printing of the return code from the sct_func function

auto rc = sct.recv_spin_once(1000, &n);

Output:

[ INFO] tmr::Communication::Communication
[DEBUG] tmr::SBuffer::SBuffer
[DEBUG] tmr::CommRecv::CommRecv
[DEBUG] tmr::RobotState::RobotState
[DEBUG] Create DataTable
[ INFO] tmr::Communication::Communication
[DEBUG] tmr::SBuffer::SBuffer
[DEBUG] tmr::CommRecv::CommRecv
[ INFO] TM_SVR: halt
[ INFO] TM_SVR: start
[ INFO] TM_COM: ip:=192.168.2.47
[ INFO] TM_COM: rv:=0
[ INFO] TM_COM: Connection is ok
[ INFO] TM_COM: O_NONBLOCK connection is ok
[ INFO] TM_COM: TM robot is connected. sockfd:=17
[INFO] [tmr_svr]: Publisher thread begin
[ INFO] TM_SCT: halt
[ INFO] TM_SCT: start
[ INFO] TM_COM: ip:=192.168.2.47
[ INFO] TM Flow DataTable Checked Item:
[ INFO] - Robot_Link - checked
[ INFO] - Robot_Error - checked
[ INFO] - Project_Run - checked
[ INFO] - Project_Pause - checked
[ INFO] - Safeguard_A - checked
[ INFO] - ESTOP - checked
[ INFO] - Camera_Light - checked
[ INFO] - Error_Code - checked
[ INFO] - Joint_Angle - checked
[ INFO] - Coord_Robot_Flange - checked
[ INFO] - Coord_Robot_Tool - checked
[ INFO] - TCP_Force - checked
[ INFO] - TCP_Force3D - checked
[ INFO] - TCP_Speed - checked
[ INFO] - TCP_Speed3D - checked
[ INFO] - Joint_Speed - checked
[ INFO] - Joint_Torque - checked
[ INFO] - Project_Speed - checked
[ INFO] - MA_Mode - checked
[ INFO] - Robot_Light - checked
[ INFO] - Ctrl_DO0 - checked
[ INFO] - Ctrl_DO1 - checked
[ INFO] - Ctrl_DO2 - checked
[ INFO] - Ctrl_DO3 - checked
[ INFO] - Ctrl_DO4 - checked
[ INFO] - Ctrl_DO5 - checked
[ INFO] - Ctrl_DO6 - checked
[ INFO] - Ctrl_DO7 - checked
[ INFO] - Ctrl_DI0 - checked
[ INFO] - Ctrl_DI1 - checked
[ INFO] - Ctrl_DI2 - checked
[ INFO] - Ctrl_DI3 - checked
[ INFO] - Ctrl_DI4 - checked
[ INFO] - Ctrl_DI5 - checked
[ INFO] - Ctrl_DI6 - checked
[ INFO] - Ctrl_DI7 - checked
[ INFO] - Ctrl_AO0 - checked
[ INFO] - Ctrl_AI0 - checked
[ INFO] - Ctrl_AI1 - checked
[ INFO] - End_DO0 - checked
[ INFO] - End_DO1 - checked
[ INFO] - End_DO2 - checked
[ INFO] - End_DO3 - checked
[ INFO] - End_DI0 - checked
[ INFO] - End_DI1 - checked
[ INFO] - End_DI2 - checked
[ INFO] - End_AI0 - checked
[ INFO] - g_flow_dir - skipped
[ INFO] Total 48 item,47 checked, 1 skipped
[ INFO] TM_COM: rv:=-1
[ WARN] TM_COM: Connection timeout
[ INFO] TM_COM: O_NONBLOCK connection is fail
[INFO] [tmr_sct]: sct_response thread begin
[INFO] [tmr_sct]: (TM_SCT): is not connected
[INFO] [tmr_sct]: (TM_SCT) reconnect in
[INFO] [tmr_sct]: (TM_SCT) connect(1000ms)...
[ INFO] TM_COM: ip:=192.168.2.47
[ INFO] TM_COM: rv:=-1
[ WARN] TM_COM: Connection timeout
[ INFO] TM_COM: O_NONBLOCK connection is fail
[INFO] [tmr_sct]: (TM_SCT): is not connected
[INFO] [tmr_sct]: (TM_SCT) reconnect in 3 sec...

... here I start the ListenNode in the TMFlow ...

[INFO] [tmr_sct]: (TM_SCT) connect(1000ms)...
[ INFO] TM_COM: ip:=192.168.2.47
[ INFO] TM_COM: rv:=0
[ INFO] TM_COM: Connection is ok
[ INFO] TM_COM: O_NONBLOCK connection is ok
[ INFO] TM_COM: TM robot is connected. sockfd:=33
[ERROR] [tmr_sct]: Received communication feedback code: 3
[INFO] [tmr_sct]: (TM_SCT): sct_func returned false
[INFO] [tmr_sct]: (TM_SCT) reconnect in 3 sec...
[INFO] [tmr_sct]: (TM_SCT) connect(1000ms)...
[ INFO] TM_COM: ip:=192.168.2.47
[ INFO] TM_COM: rv:=0
[ INFO] TM_COM: Connection is ok
[ INFO] TM_COM: O_NONBLOCK connection is ok
[ INFO] TM_COM: TM robot is connected. sockfd:=33
[ERROR] [tmr_sct]: Received communication feedback code: 3
[INFO] [tmr_sct]: (TM_SCT): sct_func returned false
[INFO] [tmr_sct]: (TM_SCT) reconnect in 3 sec...
[INFO] [tmr_sct]: (TM_SCT) connect(1000ms)...
[ INFO] TM_COM: ip:=192.168.2.47

etc. etc.

As you can see the TM_COM prints out Connection is ok and that TM robot is conneted. sockfd:=33, but it returns a feedback code 3 (CommRC::NOTCONNECT) however, causing the tmr_sct driver to keep trying to reconnect.

@janandries janandries changed the title Connection fails (CommRC::NOTCONNECT) when starting tmr_controller node after ListenNode program tmr_driver keeps reconnecting Jul 1, 2021
@janandries
Copy link
Author

is there any update on this? this is preventing the tmrlib from reconnecting properly when the ListenNode comes back online

@Inserer-Pseudo
Copy link

Hi there ! Same error here but starts immediatly after first connect. Did you manage to solve it ?
I'lll try to on my own and keep you updated if I succeed.
Bye

@Inserer-Pseudo
Copy link

I solved my issue, for those that are interested:

  • After configuring the PC's IP adress on Ubuntu changes were effective only after reboot
  • The issue was coming from the ethernet slave configuration. After setting the table, when saving it the name has to be Data_Table_Setting_TM_ROS_Default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants