prplfoundation / prplMesh

This repository moved to https://gitlab.com/prpl-foundation/prplmesh/prplMesh
Other
65 stars 32 forks source link

Make agents wait for dev_set_config/WPS PBC before master discovery #1572

Open vitalii-komisarenko opened 4 years ago

vitalii-komisarenko commented 4 years ago

https://jira.prplfoundation.org/browse/PPM-143

In certification mode the agent state machine should stop before the MASTER_DISCOVERY state until dev_set_config is received (wired backhaul) or start_wps_registration (wireless backhaul).

This PR should be merged after PR #1590.

ghost commented 4 years ago

@vitalii-komisarenko please also check to see if there is any documentation about the state machine. If it exists -> update it Otherwise, it could be good to add it

itayx commented 4 years ago

Log entries taken from the agent logs (Filtered to show only the backhaul_manager_thread FSM prints)

From the master branch

TRACE 10:23:42:970 <140023053342464> backhaul_manager_thread.cpp[795] --> FSM: INIT --> WAIT_ENABLE
TRACE 10:23:46:045 <140023053342464> backhaul_manager_thread.cpp[809] --> FSM: WAIT_ENABLE --> ENABLED
TRACE 10:23:46:546 <140023053342464> backhaul_manager_thread.cpp[900] --> FSM: ENABLED --> MASTER_DISCOVERY
TRACE 10:23:46:547 <140023053342464> backhaul_manager_thread.cpp[935] --> FSM: MASTER_DISCOVERY --> SEND_AUTOCONFIG_SEARCH_MESSAGE
TRACE 10:23:47:055 <140023053342464> backhaul_manager_thread.cpp[973] --> FSM: SEND_AUTOCONFIG_SEARCH_MESSAGE --> WAIT_FOR_AUTOCONFIG_RESPONSE_MESSAGE
TRACE 10:23:47:058 <140023053342464> backhaul_manager_thread.cpp[3585] --> FSM: WAIT_FOR_AUTOCONFIG_RESPONSE_MESSAGE --> CONNECT_TO_MASTER
TRACE 10:23:47:058 <140023053342464> backhaul_manager_thread.cpp[983] --> FSM: CONNECT_TO_MASTER --> CONNECTED
TRACE 10:23:47:066 <140023053342464> backhaul_manager_thread.cpp[998] --> FSM: CONNECTED --> OPERATIONAL

From this PR

TRACE 10:26:13:974 <140670739035904> backhaul_manager_thread.cpp[795] --> FSM: INIT --> WAIT_ENABLE
TRACE 10:26:17:060 <140670739035904> backhaul_manager_thread.cpp[809] --> FSM: WAIT_ENABLE --> ENABLED
TRACE 10:26:17:561 <140670739035904> backhaul_manager_thread.cpp[900] --> FSM: ENABLED --> READY_FOR_MASTER_DISCOVERY
ERROR 11:08:03:977 <140671996204800> backhaul_manager_thread.cpp[921] --> m_agent_ucc_listener == nullptr

It looks as if the FSM goes to state READY_FOR_MASTER_DISCOVERY then fails because the listener is null

vitalii-komisarenko commented 4 years ago

@itayx it is OK if the backhaul is wireless. The change is working only for the wired ones.

vitalii-komisarenko commented 4 years ago

This PR uses changes from PR #1590.

morantr commented 4 years ago

Approved just make sure not to merge it until #1590 is merged.