CIFS network storage

From edgertronic high speed video camera
Jump to navigation Jump to search

The edgertronic camera supports an experimental (read unsupported) feature allowing captured videos to be saved directly on your host computer using the CIFS protocol.

Common Internet File System

Back in the day, IBM created Server Message Block (SMB), which was adopted as the network file system protocol supported by Microsoft. Eventually the protocol moved forward and Common Internet File System (CIFS) protocol emerged. Windows, OSX, and Linux all support CIFS, as do many network attached storage (NAS) devices.

A host computer (or network attached storage device) can be configured to offer a CIFS share. A CIFS share allows network attached devices to create files, read files, and writes files to the shared storage space. The edgertronic camera is able to save video and metadata files to a CIFS share.

To access a CIFS share, the camera needs to be configured with the following information:

Information Example Required or
Optional
Description
Server name //GATEWAY Required Name of device offering the CIFS share. The server name begins with double slash and is typically uppercase. No space in the name.
CIFS share name videos Required Name of resource being shared. Can be any text the user assigns when configuring the share. No space in the name.
User name admin Optional The CIFS share can require a user name and password before the share can be accessed. No space in the name.
User password xyzzy Optional Password associated with user name. No space in the password.
Workgroup WORKGROUP Optional Different workgroups can be created to organize network resources. No space in the name.
Server IP address 192.168.0.34 Optional If the networking infrastructure doesn't support DNS translation of the server name into an IP address, then the IP address must be provided.

Configuring host computer to share storage space

Each version of each operating system uses a slightly different way to expose storage space over the network. For data security, only expose the directory where you want the camera to save videos.

OSX version 10.9.5

When I again tested these instructions (on Feb 16, 2017), the camera wasn't able to mount the shared network storage. In looking at mac error log (settings -> utilities -> consoles) I see the mac logs a failure SMB client not supported - Unicode, NT Errors, Long Names and Extended Security are required.

From an earth works post: Apple used to use the Samba open source project as the basis for its Windows sharing options in Mac OS X. With Lion and now Mountain Lion, Apple has moved to their own, in-house implementation and Samba is no longer used. This has led to a number of quirks and bugs. If you try to mount a Lion or Mountain Lion hosted SMB share from Linux using the typical options, you will like get a -22 error stating that the request was “bad.”

I have not found a work around yet.

Step 1 create shared directory

Using Finder, I created a folder called edgertronic under the Documents folder by clicking on Documents in the left pane the in the top menus, selecting File -> New Folder

Step 2 enable file sharing

Follow the Apple provided instructions for sharing files.

Simplified instructions:

  • System Preferences -> Sharing: check File Sharing
  • System Preferences -> Sharing: advanced options -> Share files and folder using SMB

Also note your computer name while in the System Preference Sharing dialog.

Step 3 share directory over network

Again in System Preferences -> Sharing,

  • Shared Folders: click plus sign (+)
    • Select Documents/edgertronic folder and click Add button
  • User: highlight Everyone and Read & Write

Windows 10

Enable SMB 1.0 on your computer.

  • Click Start.
  • Select Control Panel.
  • Choose Programs and Features.
  • Click Turn Windows features on or off.
  • Select the Telnet Client option.
Figure 1: Turn Windows features on or off

The instructions below were tested with Windows 10 revision 1803 OS build 17134.556.

You need to enable SMB1 version of the protocol - see Figure 1.

For security reasons, you might want to create a new user (name with no spaces) to allow network access to the hard disk for just that new user.

Another approach, one which is simpler, because it disables most security features, is give read/write access to Everyone and then when configuring th camera use the username Guest and don't include a password.

  • Settings -> Search: Network
    • Select Sharing Options
      • Under Guest or Public (not Home or Work current profile)
        • Turn on network discovery
        • Turn on file and printer sharing
        • Under All Networks: Turn on sharing so anyone with network access can read and write files in the Public folder
        • Enable file sharing for devices that use 40 or 56 bit encryption
        • Turn off password protected sharing

Share a specific directory:

  • Create a edgertronic folder in the root directory on your computer's C: hard disk.
    • Open file browser
    • In left pane, double click This PC
    • Double click hard disk C in the Devices and drives section
    • Right mouse click: New -> Folder
      • Name new folder edgertronic
  • Right mouse click on edgertronic folder
    • Select Give Access To
      • Add Everyone
      • Set Permission Level: Everyone Read/Write

If everything worked correctly, you will see a window that says Network access, Your folder is shared, individual items and in that list will be edgertronic. Copy down the share name (e.g. \\FRED\edgertronic.

Configure Camera:

  • Browse to: http://10.11.12.13/configure_cifs
  • CIFS server name: Use the laptop computer's IP address instead of text name.
  • CIFS share name: edgertronic
  • User name: enter name - use a name with no spaces. You can change the name via Control Panel\All Control Panel Items\User Accounts\Change Your Name
  • User password: enter password
  • Workgroup: WORKGROUP
  • Server IP address: Use the laptop computer's IP address instead of text name.

These instructions were last tested Feb 16, 2017 with camera software version 2.2.1.

Configuring CIFS

Browse to

 http://10.11.12.13/configure_cifs

replacing 10.11.12.13 with your camera's IP address as necessary.

Using CIFS

Troubleshooting CIFS

Mounting the CIFS share will fail if the camera CIFS configuration setting are incorrect or the network storage settings are incorrect. Here is the list of known failure codes and their causes:

Code Text Cause
-6 No such device or address Wrong share name
-13 Permission denied Wrong user name or password
-22 Invalid argument
-110 Connection timed out
-111 Connection refused The CIFS Server name is incorrect or can not be found on the network, or is found, but doesn't have the CIFS server daemon running.
-112 Host is down Make sure SMB1 support is enabled
-113 No route to host Wrong network server IP address or name

CAMAPI support for network storage

configure_cifs

Graphical user interface via a web browser. No CAMAPI method to configure the CIFS configuration. There are several buttons on this page:

  • Submit Settings - invokes CAMAPI set_ext_storage_configuration()
  • Mount CIFS Share - invokes CAMAPI mount()
  • Unmount CIFS Share - invokes CAMAPI unmount()
  • CIFS Directory Listing - invokes CAMAPI dir_listing()
  • Rescan - invokes CAMAPI scan_ext_storage()

get_ext_storage_configuration

set_ext_storage_configuration

'storage_type': 'NET',
		 'net_protocol': 'CIFS',
		 'server': document.getElementById('server').value,
		 'sharename': document.getElementById('sharename').value,
		 'user': document.getElementById('user').value,
		 'password': document.getElementById('password').value,
		 'workgroup': document.getElementById('workgroup').value,
		 'ip': document.getElementById('serverip').value,

mount

Attempts to mount specified storage device. Returns CAMAPI_STATUS_OKAY, CAMAPI_STATUS_STORAGE_ERROR, or CAMAPI_STATUS_INVALID_PARAMETER

  • CAMAPI python - camapi.mount(caminfo.get_net_storage_dir())
  • HTTP/GET/JSON - /mount?device=NET

unmount

Attempts to unmount selected storage device. Unmounting the active storage device causes the camera to select USB if possible or SD if possible or NET if possible, in that order. Returns CAMAPI_STATUS_OKAY or CAMAPI_STATUS_STORAGE_ERROR

  • CAMAPI python - camapi.unmount(caminfo.get_net_storage_dir())
  • HTTP/GET/JSON - /unmount?device=NET

get_storage_info

Returns a dictionary of storage device information.

  • CAMAPI python - camapi.get_storage_info(caminfo.get_net_storage_dir())
  • HTTP/GET/JSON - /get_storage_info?device=NET

See get_storage_info() in the CAMAPI documentation.

check_storage

Check if a change has occurred in the available storage devices and update active storage device as necessary. Always returns CAMAPI_STATUS_OKAY. Fetch the camera status to determine if the active storage device changed.

  • CAMAPI python - camapi.check_storage())
  • HTTP/GET/JSON - /check_storage

directory_listing