roleoroleo / sonoff-hack

Custom firmware for Sonoff GK-200MP2B camera
GNU General Public License v3.0
205 stars 48 forks source link

wifi not connected #151

Open matew00 opened 1 year ago

matew00 commented 1 year ago

Hello, I am running firmware version 0.1.5. Model GK-200MP2B and I cannot get wifi working. The wifi configuration is saved , but wifi strength is 0%. Any suggestions please?

Nistp commented 1 year ago

I'm having the same issue with 0.16. Everything works with an Ethernet cable, but the WiFi doesn't connect.

roleoroleo commented 1 year ago

How did you configure wifi settings? Through the app or from my webui? Are you able to read the AP list from the webui? Opening this combo immagine ?

Nistp commented 1 year ago

@roleoroleo I did it from the Web UI. I was able to read and select the AP list from there and when I entered the password and clicked on save it told me it saved. I later checked wpa_supplicant.conf and that wasn't updated - not sure if that's where the WiFi credentials get stored in.

matew00 commented 1 year ago

Hi roleo,

same here basically. version 0.1.5. Model GK-200MP2B

Opening combo/drop down list. I pick SSID and PSK, save it. In webGUI, it remains saved. When checking wpa_supplicant.conf, it does not get saved.

[root@sonoff-31dd]# cat /mnt/mtd/ipc/cfg/wpa_supplicant.conf

20160318 ,New Interface From SmartLink Elian

ctrl_interface=/var/run/wpa_supplicant update_config=1 network={ ssid="0" psk="12345678" }

matew00 commented 1 year ago

Hi Roleo,

update - tried to amend /mnt/mtd/ipc/cfg/wpa_supplicant.conf with the same ssid and psk a put into GUI. The result is still the same. No action to connect. Output from ifconfig:

ra0 Link encap:Ethernet HWaddr 30:4A:26:BC:31:DD UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:19 errors:0 dropped:4 overruns:0 frame:0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2500 (2.4 KiB) TX bytes:576 (576.0 B)

darkxst commented 1 year ago

You can try run wpa_supplicant manually to find the problem wpa_supplicant -Dwext -d -ira0 -c/mnt/mtd/ipc/cfg/wpa_supplicant.conf

You can probably also use wpa_cli to configure wifi (in case there is some error in your wpa_Supplicant.conf file)

Nistp commented 1 year ago

And what should I do if I deleted the file by accident, not realizing it was a read-only system? Re-upload the firmware or download the new version? Hahaha! Because I tried what @matew00 did as well, but manually editing the wpa_supplicant.conf didn't help me either.

darkxst commented 1 year ago

Recreate wpa_supplicant.conf, with the following 2 lines

ctrl_interface=/var/run/wpa_supplicant
update_config=1

Kill wpa_supplicant if its running, then run

wpa_supplicant -Dwext -B -ira0 -c/mnt/mtd/ipc/cfg/wpa_supplicant.conf -P /var/pid_wpa_s

Then follow these instructions for wpa_cli https://wiki.archlinux.org/title/wpa_supplicant#Connecting_with_wpa_cli

I've not tested this, but that should recreate a valid wpa_supplicant.conf for you.

roleoroleo commented 1 year ago

When you save wifi options from webui, the settings are stored to the sqlite db. You need a reboot to see them in the wpa_supplicant.

@darkxst Is it the same for your new model? Are username and password saved to the db?

darkxst commented 1 year ago

They are set both in the db and wpa_supplicant.conf. I've never tried setup via son-hack though, so no idea if just the db setting is sufficient to get it working, but wpa_supplicant.conf is used at runtime to connect to wifi

matew00 commented 1 year ago

Hi Roleoroleo,

sure, I have always done a reboot after updating wifi settings from webgui, however it was never saved to wpa_supplicant.

roleoroleo commented 1 year ago

Could you check the content of the db and the wpa_supplicant.conf after a reboot? Does it match what you put in the webui?

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

blazejp83 commented 8 months ago

I started to have the exact same issues once I decided I want the camera to connect to a different WIFI. After long time, and different yi-hack versions, my GK-200MP2B was connected to a single WiFi, perhaps even connected from Yi app, can't remember. Yesterday, I wanted to change the WiFi. Camera couldn't connect. I see constantly something like this:

image

I can change to a different Wi-Fi, enter password again, and again the same message (not connected). I've upgraded to 1.7 - same issue. I have also deleted everything from the card and extracted 1.7 from scratch, same issue. Any ideas?

roleoroleo commented 8 months ago

Are you connected with the ethernet cable? When both wifi and eth are connected, the label shows "not connected".

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

tequilaj-gh commented 4 months ago

Setting the ssid and password in the interface also does nothing for me. What I have to do is:

  1. Connect by ssh
  2. edit the wpa supplicant file (/mnt/mtd/ipc/cfg/wpa_supplicant.conf)
  3. create an empty file "/mnt/mtd/ipc/cfg/DyVoiceRecog.bin" (touch is enough)
  4. reboot

After that, wifi works. I did not try step 3 before using web interface.

The (strange) step 3 above came from https://github.com/roleoroleo/sonoff-hack/issues/22

matew00 commented 3 months ago

the solution provided by tequilaj-gh works perfectly

github-actions[bot] commented 3 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.