dfx wallet --network ic add-controller <Principal ID> command to add the “Principal ID” as the “controller”；
dfx wallet --network ic addresses command to query the success of the addition；
3、But when querying at https://nns.ic0.app/, it shows “you are not the controller of this canister and cannot access its details”
Got the same problem. Setup the canister under the default identity then added my previous principal id to the canister as described above. No access via NNS.