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

Bluetooth re-connection issue #5

Open
mattyoung101 opened this issue Jun 20, 2019 · 0 comments
Open

Bluetooth re-connection issue #5

mattyoung101 opened this issue Jun 20, 2019 · 0 comments
Assignees
Labels
High Priority Serious and constant bugs which majorly affect the robot's performance

Comments

@mattyoung101
Copy link
Owner

Upon quickly power cycling the slave, the master will get into an invalid state and refuse all future connections from the slave. This is a serious issue as it could happen in the competition if someone bumps the button accidentally.

Steps to reproduce:

  1. Connect to master. Turn on slave, wait for them to establish connection.
  2. Turn off slave
  3. Quickly turn it back on, before the "second timeout" occurs (which shouldn't happen anyway as we dispose the connection with esp_spp_disconnect)
  4. Observe that they will no longer connect.

Master logs:

...
D (48144) BTReceive: Received BT packet: state: AttackIdle, robotX: 1516.000000, robotY: -1009.000000, switch ok: no
////////// (NB: at this point the slave is powered off)
D (48214) BTSend: Sending 23 bytes
D (48298) BTSend: Sending 23 bytes
D (48382) BTSend: Sending 23 bytes
D (48466) BTSend: Sending 23 bytes
D (48550) BTSend: Sending 23 bytes
W (48592) BTTimeout: Packet timeout has gone off, other robot is off for damage
W (48592) CommsBT_M: Slave has disconnected (SPP connection closed), deleting controller task
E (51280) BT_L2CAP: L2CAP got conn_req while connected (state:4). Reject it

E (55921) BT_L2CAP: L2CAP got conn_comp in bad state: 4  status: 0x16

W (55921) BT_RFCOMM: port_rfc_closed RFCOMM connection in state 2 closed: Peer connection failed (res: 16)
W (55928) CommsBT_M: Slave has disconnected (SPP connection closed), deleting controller task

Observations:

  • gets into an invalid state or something, unsure as to why

Slave logs:

...
I (1397) CommsBT_S: Found other robot. Attempting to establish SPP connection...
I (2216) CommsBT_S: SPP discovery completed, status=0 scn_num=1
I (2216) CommsBT_S: Connecting to SPP server...
I (2216) CommsBT_S: SPP client connection initiated
W (2272) BT_RFCOMM: port_rfc_closed RFCOMM connection in state 1 closed: Closed (res: 19)
W (2272) CommsBT_S: Master has disconnected (SPP connection closed), deleting controller task
I (2279) CommsBT: Restarting GAP discovery
D (2860) PursueState: Ball is not visible, braking
I (4050) CommsBT_S: Found other robot. Attempting to establish SPP connection...
I (4092) CommsBT_S: SPP discovery completed, status=0 scn_num=1
I (4092) CommsBT_S: Connecting to SPP server...
I (4099) CommsBT_S: SPP client connection initiated
W (4134) BT_RFCOMM: port_rfc_closed RFCOMM connection in state 1 closed: Closed (res: 19)
W (4134) CommsBT_S: Master has disconnected (SPP connection closed), deleting controller task
I (4141) CommsBT: Restarting GAP discovery
I (4442) CommsBT_S: Found other robot. Attempting to establish SPP connection...
I (4512) CommsBT_S: SPP discovery completed, status=0 scn_num=1
I (4512) CommsBT_S: Connecting to SPP server...
I (4512) CommsBT_S: SPP client connection initiated
W (4519) BT_RFCOMM: port_rfc_closed RFCOMM connection in state 1 closed: Closed (res: 19)
W (4526) CommsBT_S: Master has disconnected (SPP connection closed), deleting controller task
I (4533) CommsBT: Restarting GAP discovery
I (4939) CommsBT_S: Found other robot. Attempting to establish SPP connection...
I (5009) CommsBT_S: SPP discovery completed, status=0 scn_num=1
I (5009) CommsBT_S: Connecting to SPP server...
I (5016) CommsBT_S: SPP client connection initiated
W (5016) BT_RFCOMM: port_rfc_closed RFCOMM connection in state 1 closed: Closed (res: 19)
W (5023) CommsBT_S: Master has disconnected (SPP connection closed), deleting controller task
I (5037) CommsBT: Restarting GAP discovery
I (5436) CommsBT_S: Found other robot. Attempting to establish SPP connection...
I (5499) CommsBT_S: SPP discovery completed, status=0 scn_num=1
I (5499) CommsBT_S: Connecting to SPP server...
I (5499) CommsBT_S: SPP client connection initiated
W (5506) BT_RFCOMM: port_rfc_closed RFCOMM connection in state 1 closed: Closed (res: 19)
W (5513) CommsBT_S: Master has disconnected (SPP connection closed), deleting controller task
I (5520) CommsBT: Restarting GAP discovery
I (5548) IdleTimerCallback: Idle timer has gone off, switching to idle state
I (5548) FSM: Switching states from AttackPursue to AttackIdle
I (5849) CommsBT_S: Found other robot. Attempting to establish SPP connection...
I (5912) CommsBT_S: SPP discovery completed, status=0 scn_num=1
I (5912) CommsBT_S: Connecting to SPP server...
W (5912) BT_BTM: BTM_SEC_REG: Out of Service Records (8)
E (5919) BT_APPL: sec_id:57 is zero or BTM_SetSecurityLevel failed, remote_scn:1
I (5926) CommsBT_S: SPP client connection initiated

Observations:

  • keeps trying to reconnect, but it seems either it or the master keeps disconnecting itself
  • then eventually it just gives up
@mattyoung101 mattyoung101 added the High Priority Serious and constant bugs which majorly affect the robot's performance label Jun 20, 2019
@mattyoung101 mattyoung101 self-assigned this Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority Serious and constant bugs which majorly affect the robot's performance
Projects
None yet
Development

No branches or pull requests

1 participant