patience4711 / RPI-APS-inverters

a software for a raspberry pi zero to read the production of aps inverters yc600 and qs1
47 stars 4 forks source link

Raspberry zero disconnections #5

Closed patience4711 closed 2 years ago

patience4711 commented 2 years ago

I think the reason for raspberry zero disconnecting problems should be sought in the settings of your router. If you google you'l see that others who had these problems were able to find a solution. Could also be a too weak powersupply.

Some quotes after a quick google:

I have several rpi zero projects running with the same connection manager and i have never seen one disconnection ever.

To clarify: The connection manager does nothing more than writing the wifi credentials to wpa_supplicant.conf. When this is done it should be able to connect. So there can't be such thing as 'config resetting' as this would mean that the wpa_supplicant.conf file has changed. This is not likely. Anyway, if the wpa_supplicant.conf contains the right credentials and it won't connect, it must have something to do with the router.

The wpa_supplicant.conf looks like this:

country=UK ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="XXXXXXX" psk="XXXXXXX" key_mgmt=WPA-PSK } When you plug the sdcard with the system in a cardreader into your windows computer you can create your own wpa_supplicant in the boot partition. Use notepad for this ! In this file you can provide the right country code (doesn't seem to make any difference, currently i use UK) and your wifi credentials. This way you can avoid the AP if you feel that the problems might origin there.

@WaiH, i am very curious to know how running the system off an usb stick could have anything to do with this?

kentbrock commented 2 years ago

The disconnection also happens also with my RPI 2 with an Edimax WIFI stick. My solution was to disable the WIFI Powersave Mode.

There are 3 variants of doing that:

Variant 1 (worked for me): check with lsmod if there is a modul "8192cu". If so you have to add a new file with sudo nano /etc/modprobe.d/8192cu.conf This file has to contain options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 After that please reboot sudo reboot

Variant 2: open sudo nano /etc/network/interfaces add wireless-power off to the Wifi device after saving the file reboot sudo reboot

Variant 3: open sudo nano /etc/network/interfaces add post-up iw wlan0 set power_save off to the Wifi device after saving the file reboot sudo reboot

To check the status: iw wlan0 get power_save