Wifi quality is very bad

Is your router an AVM Fritz!Box by any chance? If yes, fixing 5GHz Wifi to a low channel might help. See here.