You can reset the network settings on your iPhone by navigating to the "Reset" menu in the Settings app.
If your iPhone's sensors aren't working correctly, you may need to calibrate them. Here's how to calibrate an iPhone's brightness and motion sensors.