roleoroleo / yi-hack-MStar

Custom firmware for Yi 1080p camera based on MStar platform
GNU General Public License v3.0
844 stars 112 forks source link

Wifi configuration lost every power cycle #66

Closed sfs325 closed 3 years ago

sfs325 commented 4 years ago

I have a Yi 1080p Home 6FUS camera. I flashed the firmware and it works perfectly. The problem I have now is that everytime I power cycle the camera it loses the wifi configuration and I need to cofigure it again (I start listeing waiting to connect and so on).

Best regards, Sergio

Rocket200 commented 4 years ago

i have same Problem with a 4FUS 3-4 weeks before

I can not finished the wifi connect process with the Original APP (disabled cloud) but I can now go back to the hack (webif) and I enabled there the cloud Service again and reboot. and again I connect the cam with the Original App and after a reboot I go back to the hack (webif) and disabled the cloud again.

this work for me

I think the Original APP need to save the WIFI SSID and Password somewhere on the CAM

sfs325 commented 4 years ago

Thank you very much for your comment.

I didn't really understand your procedure. What I understood is, I should configure it with the cloud enabled and then I can disable it? (I have it disabled now.)

Rocket200 commented 4 years ago

Yes Same me bevor Enable the cloud again Connect with the APP I Reboot sometime at Last disable the cloud again

mklan commented 4 years ago

Sadly this does not work for me. It still loses wifi on each power cut. Anyone with the same problem?

alexkutsan commented 4 years ago

I have the save issue. i was looking into log. txt and find a lot of resolving hostname error. How to fix dns ?

/tmp # cat log.txt | grep resol
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
curl_easy_perform() failed: {"curl_code":6} Couldn't resolve host name
][1/19/6:48:0:806]: p2p_tnp.c(tnp_proc-6408) P2P Server IP resolved : NO
][1/19/6:53:20:807]: p2p_tnp.c(tnp_proc-6408) P2P Server IP resolved : NO
divemasterjm commented 4 years ago

same issue here, every reboot i have to show qr code for wifi connection

executer-uno commented 4 years ago

Same problem, https://github.com/shadow-1/yi-hack-v3/issues/274 Does someone know where WIFI SSID and Password could be stored in camera? Then It will be easy to connects by WinSCP and edit this file manually.

roleoroleo commented 4 years ago

They are stored in a raw partition. You can't edit it with winscp.

divemasterjm commented 3 years ago

They are stored in a raw partition. You can't edit it with winscp.

roleoroleo any progress? is very anoying having cameras without connection after rebooting or power/router failure

roleoroleo commented 3 years ago

No, I tried different configurations but I can't replicate this problem.

krue81 commented 3 years ago

Since last night, I've been having the same issue with a Yi Dome 1080p (BFUS). I rebooted the camera and began to hear the "Waiting to connect" voice... I tried to access the camera via the Yi Home App to no avail... deleted the camera from the app and resetted it to add it again... The camera reads the QR Code successfully and connects my Wifi network, but the pairing process stops at retrieving pairing status (after 2 or 3 minutes) and shows a "Failed to load, please reset the camera" message.

At this point, I can access the camera via its ip:8080, but as soon as I reset it, I lose wifi connection and the camera starts again the pairing process (Waiting to connect...).

roleoroleo commented 3 years ago

If anyone still has this problem I made a wiki page which might be useful:

https://github.com/roleoroleo/yi-hack-MStar/wiki/Change-WiFi-credentials

divemasterjm commented 3 years ago

i've tried it but still the same

On Sat, Nov 21, 2020 at 8:09 PM roleo notifications@github.com wrote:

If anyone still has this problem I made a wiki page which might be useful:

https://github.com/roleoroleo/yi-hack-MStar/wiki/Change-WiFi-credentials

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/roleoroleo/yi-hack-MStar/issues/66#issuecomment-731622874, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALECS4SX6QOV6YHLRLDEYTLSRAF5NANCNFSM4KEKGDMA .

ethempekin commented 3 years ago

I have this problem with h201c. Local time is also not updating. My fw 0.3.5 I wonder if I should update it to 0.3.8 can solve the problem.

roleoroleo commented 3 years ago

I found an error in the script sdwifi and I updated it in the wiki. Please try again with the new version.

divemasterjm commented 3 years ago

doesn't work (((

ethempekin commented 3 years ago

My problem resolved when upgrading to 0.3.8.

roleoroleo commented 3 years ago

@divemasterjm Could you try again? I improved the script more.

divemasterjm commented 3 years ago

i tried your script, and every time i reboot camera still waiting for wifi, even i try to execute your script and ive got error config is alredy defined

divemasterjm commented 3 years ago

ive inserted sd card reboot camera keep asking waiting to connect

roleoroleo commented 3 years ago

Ok, I will check again.

executer-uno commented 3 years ago

Hi, thanks for your effort! I updated my Yi 1080p Home 4FCN with actual FW https://github.com/roleoroleo/yi-hack-MStar/releases/tag/0.3.8 All behaves the same. Scan QR -> WiFi connected and web interface ok. Reboot -> Waiting to connect...

After I try a trick https://github.com/roleoroleo/yi-hack-MStar/wiki/Change-WiFi-credentials but looks like nothing happened. After reboot I check with WinSCP if somewhere configure_wifi.cfg stored on camera, but no files found in root and subfolders. May I help somehow more? To check it with WinSCP or Telnet etc...?

roleoroleo commented 3 years ago

Check if your settings are correctly stored in flash: hexdump -C /dev/mtd/mtd5

executer-uno commented 3 years ago

In /tmp/sd/log/log_wifi_connected.tar.gz i found some kind of log data. here it is attached (with cleared passwords) wifi_connected.zip

executer-uno commented 3 years ago

Check if your settings are correctly stored in flash: hexdump -C /dev/mtd/mtd5 2020-11-29_172436

Yes. SSID and Password are stored in mtd5. But I can check it only if I already show QR to camera an it connects to WiFi. I can not check if file is there while it is telling "waiting to connect" after reboot.

Here is all files in folder. Rights are rw----, and timestamps are all same 2020-11-29_200437

roleoroleo commented 3 years ago

This is not correct. immagine This word should be "00". Did you use the last sdwifi.tar.gz?

executer-uno commented 3 years ago

Yep. The latest (today rechecked from https://github.com/roleoroleo/yi-hack-MStar/wiki/Change-WiFi-credentials) Still no luck, but I done some investigations, could be make some new idea: 1) I reboot camera with FAT32 SD card with the yi-hack folder on it. It still boots same way. LED...click...wellcome...waiting to connect... I show it QR with wifi config - it becomes online. BUT. In Startup.sh there is "/tmp/sd/yi-hack/configure_wifi.sh" - looks like SD card script call, but there is no yi-hack folder in /tmp/sd/ when I check it in WinSCP. 2020-11-30_224217

2) I check if SD card content appears somewhere else in hierarchy - no. But i found /etc/init.d/yi-hack file with some script callup. So i try to append yi-hack/configure_wifi.sh there, to be sure script will be called. SD content copyed to /etc/init.d/yihack folder: image But it makes no any change after reboot either. I even made chmode +x for configure_wifi.sh, So it should be executable.

3) SD card formatted in Win10 as FAT32. Its just 1GB size, clear and only yi-hack folder contained. I also try with folder contents copyed to SD root. It not helped. Should I try with some proper SD card format tool?

PS: looks like its time to take a soldering iron in scope ) https://github.com/roleoroleo/yi-hack-MStar/wiki/Dump-your-backup-firmware - I see there are way to get boot log. Should be helpful for diagnose.

roleoroleo commented 3 years ago

Probably when the cam is not configured, the script is not executed.

executer-uno commented 3 years ago

PuTTY log cold boot wo MMC.log putty_log - show QR and connect to WiFi.log PuTTY log cold boot with MMC.log

I managed to get a log from UART. But can not catch "Stop the boot at the U-Boot prompt (should be "MStar #") pressing "Enter"." to send any commands. In logs I see nothing interesting. Almost no difference between boot with SD and without SD, so, looks like sripts not starts.

Will keep trying to catch "MStar#" prompt on boot up.

executer-uno commented 3 years ago

Ok, just putty restart was required. Any helpful things I can do in MSTAR# prompt? Here is 'help' response:

MStar # help
?       - alias for 'help'
base    - print or set address offset
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
cmp     - memory compare
cp      - memory copy
crc32   - checksum calculation
dbg     - set debug message level. Default level is INFO
dcache  - enable or disable data cache
debug   - Disable uart rx via PAD_DDCA to use debug tool
dhcp    - boot image via network using DHCP/TFTP protocol
dstar   - script via SD/MMC
eeprom  - EEPROM sub-system
env     - environment handling commands
estar   - script via network
estart  - EMAC start
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fatread - FAT fatread with FSTART
fatsize - determine a file's size
go      - start application at address 'addr'
gpio    - Config gpio port
help    - print command description/usage
i2c     - I2C sub-system
icache  - enable or disable instruction cache
initDbgLevel- Initial varaible 'dbgLevel'
loop    - infinite loop on address range
macaddr - setup EMAC MAC addr
md      - memory display
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mssdmmc - Mstar SD/MMC IP Verification System
mstar   - script via TFTP
mw      - memory write (fill)
mxp     - MXP function for Mstar MXP partition
net_upgrade- do net update from the specified file that is in tftpserver

nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
reset   - Perform RESET of the CPU
riu     - riu  - riu command

run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
sdupgrade- do SD card auto upgrade - one.bin

setenv  - set environment variables
sf      - SPI flash sub-system
sfbin   - for uploading sf image to a server(via network using TFTP protocol)
srcfg   - sensor pin and mclk configuration.
tftpboot- boot image via network using TFTP protocol
version - print monitor, compiler and linker version
executer-uno commented 3 years ago

Hmm. It works! sdwifi.tar.gz really helps!

It could be a improperly formatted SD card by Win10. It works after I formatted it to FAT32 with RuFus. It was one of the steps. And I doubt about Win10 issue, because I can not reproduce it with FAT16 full format -> FAT32 quick format - it still works.

Also I digging around in uboot MStar# prompt. Making:

mmc rescan
mmc part
fatls mmc 0
fatls mmc 0 /yi-hack

I seen that files are visible and available. Then I perform reset command - camera reboots twice, as described in sdwifi.tar.gz wiki and it becomes available in my home wifi network. Nice. I have a log output available, but there are even no script echo output, so I cant see anything interesting that can points the initial problem. PS: Surely I tried to reboot camera before, without supply cut, from web interface.

PPS: hexdump -C /dev/mtd/mtd5 now shows zeroes before SSID, as @roleoroleo sad. Great, but not clear ))

All UART console actions log: putty_log - script finally started.zip

PPPS: Will keeps wires soldered for a while, If any additional ideas will appears to investigate.

roleoroleo commented 3 years ago

Great! Maybe @divemasterjm could try another SD card or another format system?

PS I found that it's possible to load a custom wpa_supplicant.conf from SD. Unfortunately is not permanent, if you reboot without SD the cam starts with the old credentials.

Create wpa_supplicant.conf in the folder Factory of the SD card.

ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
network={
ssid="YOUR_SSID"
scan_ssid=1
proto=WPA RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="YOUR_PASSWORD"
}
divemasterjm commented 3 years ago

i formated with rufus and put also factory folder and it worked!!! thanks both of you!!!

roleoroleo commented 3 years ago

Thank you for your support. I close this issue.