Hi ,
You can try these steps:
Hi, the reason for having an error 502 mostly is because DNS servers blocks your access to gateway.
1. Disconnect modem to the router, if still getting error 502;
2. Give your PC static IP and DNS server should be also the default gateway which is your router's...