I tried the same but didn't work, looks like its a software issue, people are posting issue from more than 6 months but samsung is not releasing proper fix in upcoming releases. It's ridiculous..
I am also facing same problem with M31 internet connection. worst thing with the samsung support no proper solution still eventhough many people r raising same issue.