HclX / WyzeHacks

Hacks I discovered allowing Wyze camera owners to do customizations
MIT License
789 stars 75 forks source link

[Solution] Windows NFS Server #51

Closed twig123 closed 3 years ago

twig123 commented 3 years ago

Hello,

After much headache, I've found a solution for hosting a NFS share on Windows and getting Wyze Hacks to work with it. I'm hoping this info could be added to the setup information somewhere.

Grab a copy of haneWIN NFS Server for Windows: https://www.hanewin.net/nfs-e.htm

Edit the "exports" file, and place a # at the beginning of each line (to comment out the default lines). Add a new line similar to the `following:

A:\NFS -name:nfsroot -umask:000 -public -mapall:0

(Edit/Change "A:\NFS" to the folder you want to be the root of your NFS share.

Run "nfssrv.exe" to start the NFS Server. Edit > Preferences NFS tab: ----- Change "Maximum NFS transfer size (bytes)" to 32768 Server tab: ----- Check "Save attributes/uid/gid on NTFS volumes"

For your cam, edit the /params/wyze_hack.cfg and set the following:

export NFS_ROOT='192.168.1.147:/nfsroot' (Edit/Change "192.168.1.147" to the IP of your NFS Server's IP)

export NFS_OPTIONS='-o nolock -o tcp -o rsize=32768,wsize=32768'

You should now have a fully functional NFS Share on Windows 😎

Edit: I was having issues with my NFS server randomly dying or failing to start. I found out this is because Windows has "float" ports, where Windows will use some of the needed ports for it's own operations randomly. To stop this, we have to reserve (exclude) the ports listed blow that are needed for NFS so that they won't be used by the Windows subsystem:

111 (TCP & UDP) - PortMapper Service 1058 (TCP & UDP) - Mount Daemon Port 2049 (TCP & UDP) - NFS Server Port

Run the following commands from an Administrative command prompt to reserve ports on both protocols: netsh int ipv4 add excludedportrange protocol=tcp startport=111 numberofports=1 netsh int ipv4 add excludedportrange protocol=udp startport=111 numberofports=1 netsh int ipv4 add excludedportrange protocol=tcp startport=1058 numberofports=1 netsh int ipv4 add excludedportrange protocol=udp startport=1058 numberofports=1 netsh int ipv4 add excludedportrange protocol=tcp startport=2049 numberofports=1 netsh int ipv4 add excludedportrange protocol=udp startport=2049 numberofports=1

gszakacs commented 3 years ago

Thanks for posting this. Haven't figured out what the issue is with my setup, I get access denied errors in the hanewin log. Disabled Windows firewall, updated camera nfs options. Running on win 10 ltsc.

Any idea if the camera NFS options can be modified for compatibility with WinNFsd ?

update: never got winnfsd to work properly, the cameras started writing into the share but after saving some files the cameras kept rebooting during the process. Never got recordings this way.

Then I tried haneWin NFS and I get recordings but my v3 cameras still keep rebooting randomly at every 5-15 minutes. the v2 seems to perform more reliably. I did not have this issue whene I was using a linux NFS.

While I like Shinobi, I have a strong preference toward working with BlueIris and I want to have all video recording related services/files on a single hardware.

HclX commented 3 years ago

I have never tried that since I have a dedicated Linux server. However, I remember someone created a writeup in one of the closed issues.

On Mon, May 17, 2021, 12:06 gszakacs @.***> wrote:

Any idea if the camera NFS options can be modified for compatibility with WinNFsd ?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/HclX/WyzeHacks/issues/51#issuecomment-842560948, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZNWDZXCK3ZBT3VJ6PJQUDTOFSJXANCNFSM4T66XEFA .

gszakacs commented 3 years ago

To the folks who want to record to nfs using windows 10:

After some trial&error, I found that the winnfsd version posted at https://github.com/winnfsd/winnfsd/issues/73#issuecomment-452092487 resolved all of my nfs issues on windows. This version was not officially released so you have to download it from the linked post.

Example: In the wyzehacks config.inc, set the nfs share: export NFS_ROOT='192.168.2.XY:/mnt/nfs_share'

then call winnfsd-64byte from a batch file with the following switches: D:\mnt\WinNFSd-64byte.exe -id 0 0 -addr 192.168.2.XY -log on D:\mnt /mnt/nfs_share

The above allows the reliable recording of the videoclips from 2 x wyzecam v3 and 1 x wyzecam v2 to the nfs share,