What is the proper way to remove the μSD Flash card to prevent corruption?

This is related to my other μSD Flash memory card questions.

There is no “safely remove” option for the flash card.

The FAT32 file system on the μSD Flash memory card is at risk of corruption every time there is a power failure or the card is removed if the SD card is being written to when this happens. This is one reason Dash Cams have batteries or “super capacitors” to allow them to cleanly sync the file system and shutdown when they lose power.

If you have Record on Event active, you will activate recording when you try to take the card out, or even unplug the camera. Also, it may always be recording (see https://www.wyzecam.com/forums/topic/question-for-wyze-when-using-record-on-event-when-is-%ce%bcsd-card-written-to/#post-153265 ).

What I try to do is:

  1. Using the Wyze App turn off recording to μSD.
  2. Wait 70 seconds (I am not sure this is long enough) hoping that the current minute video will complete processing, and the card will be synced.
  3. Power the camera off (unplug).
  4. Remove SD card.
Ideally Wyze should provide a way to "safely remove" or "eject" the card using the App. And it should give an indication that it is safe to shutdown / remove card.

In addition, it would be nice if you could use the “reset” button (perhaps press 3 times), and then when it was safe to power off, it could use voice to say “Ready to power off” and perhaps have a different status light pattern to indicate ok to power off, i.e. writing to μSD has been suspended.

If there is a safely remove on the App, there should also be a “rescan for μSD card”, that would trigger the same routine as “detected card insertion” runs. This would be useful if someone accidentally “ejected” a card on the incorrect camera, and it was not easy to get to e.g. a remote location.

 

Thanks BuckEye I think this what happen to my card that got corrupted, the step you describe make sense for a SAFE ejection but it doesn’t fix the problem when there is a power failure other than keeping fingers crossed

A little common sense goes a long way.

A WyzeCAM is just like a computer, and as you should do in a computer you never remove a USB device or any type of card without “ejecting” the device and waiting. The actual safest method is to power off the device.

Thanks @BuckEye for your great explanation and here’s to hoping that everybody reads it and remembers. No matter how “experienced” you are, a little refresher never hurt anyone.

oaktree,

The vulnerable times are low, but if there is loss of power when the FAT or directory are being written to, there is a good chance of failure.

There is no information about the caching / writing algorithm used by the Wyze cameras. For the flashes sake, you don’t want to update it every time to a frame is added to a recording; there has to be some level of caching in effect. Careful write ordering can reduce the likelihood of an unusable file system, there may be “lost clusters” recorded as in use, but not in any file in the directory, but if a write to the allocation table or a directory is interrupted, that is more likely to cause major problems.

How do you explain https://www.wyzecam.com/forums/topic/record-folder-on-sd-card-corrupted-or-unreadable-on-pc/#post-151786 ? Especially that disabling writing to the μSD card seemed to have made the problem worse? It wasn’t specified if he waited after disabling writing before removing the card. It is possible that turning off writing caused it to sync (write cached contents to the SD), and he powered off the camera or removed the card while that was happening.

I was convinced it was a bad card, but that didn’t appear to be the case.

That’s one reason I opened this topic; Wyze doesn’t have any recommended procedure that I am aware of. And there isn’t any obvious method to tell the camera of your intent to remove power or remove the card (other than to tell it to stop recording, and if you do that, there is still no indication of whether it is safe to remove the card or shut off power).

Flash cards in Video and Cameras with batteries can utilize RAM buffers with little chance of corruption.

Here’s a link to a description of problems with using SD cards as disks in Raspberry Pi. I was running smoke ping on a raspberry pi, and it “used up” the flash memory after about a month. I stopped using smoke ping after that happened.

https://news.ycombinator.com/item?id=4854603 Discussion about SD cards as “disks”

I would guess that there is a risk every time the power is cycled if you have an SD card that is being recorded to. But there are people that use smart outlets to disable recording while they are at home. And there haven’t been complaints from them. So that does support your conjecture.

But if it is writing to a flash “page” when power is lost, my conjecture is that there will be a read error on that page, and how the SD controller deals with it I don’t know. It may attempt to use it again, and test to see if it was able to write to it successfully before giving up and remapping a “spare” to the same logical address.

 

Great advice and a very good discussion here. I’ve been ejecting USB devices on my PCs forever but didn’t think about it with respect to these cameras until now. Disabling recording to the microSD card, waiting, and then powering off prior to card removal is a no-cost procedure I’ll follow going forward. Would be nice to have Wyze input/advice this week on the issue.

bump

I am looking for a way to move my camera and would like some functionality/instructions to support that.

Please respond Wyze team.

If you are moving it within range of the wifi with which it’s already set up, just power it up and you should be good to go.

If you are moving it to a different, but more or less permanent, wifi network, then

  1. From the Live Stream in the app, tap the gear icon, then Delete Device at the bottom of the screen
  2. Set it up from scratch on the new wifi using the standard setup procedure
If you want to frequently move it between wifi networks, or if you want to connect it to a wifi network that has a portal (landing) page, then using a travel router as an intermediary is the way to go. You might want to follow this thread:

https://www.wyzecam.com/forums/topic/connection-to-unsecured-wifi/#post-130701

I’m in the process of generating a cheat sheet for setting up the GL.iNet travel router and will be posting it there when complete.

Good question!!

Thank you for those instructions. They are helpful for changes I might be making with my wifi.

 

My concern with moving the cameras is shutting them down correctly so that the SD card is not corrupted.

Thanks

 

So…still no official response about how to safely turn off the camera to prevent μSD corruption?

 

I have a Wyzecam v2 connected to a smart outlet which turns off when I get home and turns on when I leave. It has a μSD card inside. Is that safe, or am I risking corrupting the μSD card?

Hey guys! Sorry for the delayed reply on this one. I had to speak with the Devs to make sure I was giving an accurate answer on this one.

There is no way to prompt for a safe ejection of the micro SD card. We have taken measures to minimize the risk, so the likelihood of the data on the card becoming corrupted is minimal and the average user is unlikely to come across this issue.

Speaking from personal experience I have 3 cameras on my desk that I use for testing, all with SD cards in them. On a slow day I will take them out 1-2 times, and on a busy 10+ times and have been doing so for months with no issue of data corruption. I hope this helps and please let me know if there is any follow up questions on this one. I will be happy to get the answers!

Thanks for the answer. I would add that to be extra safe, you might want to consider turning off recording for the card before ejecting. And maybe turning the camera off as well.

Wyze actually recommends (indeed, requires) removal of the SDcard while the cam is powered in order to trigger the capture of live camera logs. The process to capture logs is to pull the card, reinsert it, wait for two ‘dings’, then pull it again.

One scheme to minimize the chance that the cam will be writing to the SD card when it’s pulled is to first disable local recording (as suggested by RickO). However, I’ve noticed that the cam writes a status log every six hours to the /log folder. There appears to be a cron job that purges this folder, retaining the last 5 log files. The chances are pretty small that one might be pulling the card at the moment when these log files are being written or deleted, but it might result in data corruption.

Why not have an option to eject the flash from the mobile app? The app could also display a Safe to Eject message when all flash activity had completed, and it was safe to eject the card. You could also make a “ding-ding” sound on the camera. While you are at it, add a tick box to indicate you want the log file to be written to the flash before ejecting, so the extra insert/eject would not be needed.