EliasKotlyar / Xiaomi-Dafang-Hacks

4.19k stars 1k forks source link

Possible missing samba config #1232

Closed JCSynthTux closed 4 years ago

JCSynthTux commented 4 years ago

I recently tried to connect to a other samba server for footage storage.
So I edited the motion config file and then rebooted. Weird enough the camera took a unusal long time to reboot and then did not connect to the samba share. The samba share is accessible form my Fedora desktop and macBook without any problems.
Next I started playing around with fstab and cifs which does not work at all. So after sometime I played around with smbclient. Evertime I did something with the smbclient I got this error:

params.c:OpenConfFile() - Unable to open configuration file "/usr/samba/config/smb.conf":No such file or directory
Can't load /usr/samba/config/smb.conf - run testparm to debug it
load_client_codepage: filename /usr/samba/lib/codepages/codepage.850 does not exist.
load_unicode_map: filename /usr/samba/lib/codepages/unicode_map.850 does not exist.
load_unicode_map: filename /usr/samba/lib/codepages/unicode_map.ISO8859-1 does not exist.

Is this normal or did the smb.conf go missing?

cwiggs commented 4 years ago

I get the same error when I run /system/bin/smbclient on my wyze v2 camera so it looks to be normal. I found a similar issue with using cron, so I wouldn't expect this to be a normal linux system where you can run smbclient normally.

That being said, smbclient throws those errors, but it doesn't seem to actually crash or anything. I don't have a smb share on my network so I can't test. If you use smbclient -L <IP_address_of_smb_server> what does it output?

JCSynthTux commented 4 years ago
params.c:OpenConfFile() - Unable to open configuration file "/usr/samba/config/smb.conf":
    No such file or directory
Can't load /usr/samba/config/smb.conf - run testparm to debug it
load_client_codepage: filename /usr/samba/lib/codepages/codepage.850 does not exist.
load_unicode_map: filename /usr/samba/lib/codepages/unicode_map.850 does not exist.
load_unicode_map: filename /usr/samba/lib/codepages/unicode_map.ISO8859-1 does not exist.
added interface ip=192.168.1.51 bcast=192.168.1.255 nmask=255.255.255.0
protocol negotiation failed
JCSynthTux commented 4 years ago

Something to mention is that after the long reboot I mentioned in my first post, it seems like none of my samba shares seem to work for the camera (but the samba shares work for every other device in my network). By now I am really wondering if some file got damaged while rebooting.

fhl206 commented 4 years ago

What version of smbclient is on the camera? I'm assuming its trying to use the deprecated SMB1 protocol which is why the protocol negotiation is failing.

JCSynthTux commented 4 years ago

What version of smbclient is on the camera? I'm assuming its trying to use the deprecated SMB1 protocol which is why the protocol negotiation is failing.

Version 2.2.7a

Combie81 commented 4 years ago

I have the same issue and am getting the same log output as JCSynthTux and it also reports as version 2.2.7a

I've also tried with SMBv1 enabled on my Win device but still no luck.

Has anyone got saving to a Windows share working and if so how did you go about it? Can you please share your config/changes made?

stale[bot] commented 4 years 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.

AndroX55 commented 3 years ago

does any one has solution? try to save footage to freenas

JCSynthTux commented 3 years ago

does any one has solution? try to save footage to freenas

I just went with NFS. Works fine.

AndroX55 commented 3 years ago

@JCSynthTux thanks!

broyuken commented 3 years ago

How did you connect NFS to Dafang? Did you do it via cli or is there somewhere in the GUI you were able to make it happen?

caraar12345 commented 2 years ago

👋 Is it just me, or does smbclient no longer exist?

M3TIOR commented 2 years ago

Yeah it no longer exists on my end either, could check the commit history

M3TIOR commented 2 years ago

Just double-checked and there's no smb.conf on the filesystem either, and trying to save samba configuration in the web UI does absolutely nothing.

JCSynthTux commented 2 years ago

How did you connect NFS to Dafang? Did you do it via cli or is there somewhere in the GUI you were able to make it happen?

I just did via CLI and added the same command to be executed on startup. I also wrote a BASH script, which would check if the share is still connected. I have to redo this, since the sdcard of my cam died