it could be caused by the modem. you may try other wifi (e.g., in McDonald’s ). You can also visit Samsung service center to test the wifi.
Usually, it would be easier to connect to a router than to an ADSL modem.
Occasionally, you may need set the static ip for your phone, for some ADSL modems/gateways.