# mount camera?



## jayveesea (Jun 26, 2014)

Hello,

I recently took the plunge and installed FreeBSD, but I am having difficulty mounting my camera.  As a non-root user I can mount a standard USB drive, BUT I cannot mount my camera (neither as root or non-root).

The camera is a *P*anasonic DMC-ZS30, and here are some details*:*


```
usbconfig
	ugen7.2: <DMC-ZS30 Panasonic> at usbus7, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)

	camcontrol devlist
	<MATSHITA DMC-ZS30 0100>           at scbus4 target 0 lun 0 (da0,pass2)

	dmesg |grep da0
	da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
	da0: <MATSHITA DMC-ZS30 0100> Removable Direct Access SCSI-5 device 
	da0: Serial Number 0000000000000000000F1603070422
	da0: 40.000MB/s transfers
	da0: 16381003169792MB (33548294491734017 512 byte sectors: 255H 63S/T 930643084C)
	da0: quirks=0x2<NO_6_BYTE>
```

But if I try this*:*


```
file -s /dev/da0
	/dev/da0: ERROR: cannot open `/dev/da0' (No such file or directory)

	file -s /dev/usb/7*
	/dev/usb/7.1.0: ERROR: cannot read `/dev/usb/7.1.0' (Input/output error)
	/dev/usb/7.1.1: ERROR: cannot read `/dev/usb/7.1.1' (Input/output error)
	/dev/usb/7.2.0: ERROR: cannot read `/dev/usb/7.2.0' (Input/output error)
	/dev/usb/7.2.1: writable, no read permission
```

I could use gphoto2*:*

```
gphoto2 --auto-detect
	Model                          Port                                            
	----------------------------------------------------------
	Panasonic DMC-FS62             usb:007,002
```
but the problem with gphoto is I cannot see or download any of the movie files (.mp4). Also, I can only get gphoto to work as root.

Besides using a card reader, does anyone know how i can mount the camera to get the pictures and movies?

More specifically,

can a camera be mounted as a drive?
can gphoto2 recognize non image files?
how do I get gphoto2 to work for non-root user?
Thanks,
-j


----------



## wblock@ (Jun 26, 2014)

jayveesea said:
			
		

> More specifically...
> 1. can a camera be mounted as a drive?



Some of them, yes.  There are two modes.  Some cameras act like drives when connected by USB, some use a camera protocol.  My DSLR can be switched between the two modes.  Most Canon point-and-shoot cameras used to use the camera mode, not sure about now.  (I'd name the modes, but can't recall.)




> 3. how do I get gphoto2 to work for non-root user?



Not having used that in a long time, I'd guess permissions.  Permissions on the devices can be set, but either do that every time the camera is connected or set up devd.conf(5) to do it automatically (non-trivial).

A card reader has a lot of advantages.  They are generally faster at transferring data than the camera, and don't run down the batteries in use.  There are media automounters to do that automatically when the card is detected.


----------



## jayveesea (Jun 26, 2014)

Thanks for the info! I am not opposed to the card reader, i am mostly trying to learn how to do things with FreeBSD. My camera has two modes when connecting with USB cable 1. PictBridge (PTP) and 2. PC. I assume that the PC mode is just like a USB drive. I was able to access with gphoto2 as non-root with info from here: http://gphoto.com/doc/manual/permissions-usb.html.

*I* added the following to /etc/devfs.rules*:*

```
add path 'usb/*' mode 0660 group operator
```
 but as stated before, gphoto is not really a good solution in my case because it seems like it ignores non-image files.

Thanks again!


----------



## vermaden (Jun 26, 2014)

@jayveesea,

Some (better) devices/phones offer a USB drive option for using to transfer data, unfortunately more and more of them are offering only PTP (pictures only) and MTP (all files) protocols instead of USB drive.

To have access to all files you need to use the MTP protocol, here is how to use MTP on FreeBSD:


```
# pkg install fusefs-gphotofs
# kldload fuse
% gphotofs /mnt
% ls /mnt
store_00010001
% mount -t fusefs
/dev/fuse on /mnt (fusefs, local, synchronous)
```


----------



## jayveesea (Jun 27, 2014)

Thanks for this info_rmation_ on FUSE! Is it possible to load the module at runtime? I tried putting the following in /etc/rc.conf...

```
fusefs_enable="YES"
```
... but it is not getting loaded after I boot.


----------



## vermaden (Jun 27, 2014)

@@jayveesea

Put fuse_load=YES into the /boot/loader.conf file.


----------



## jayveesea (Jun 29, 2014)

Thanks for your help!  This works nicely.  _I'm s_till trying to figure out how to use a non-root, but I'll get there.


----------



## jayveesea (Jul 4, 2014)

After some further investigation I have figured out how to use gphoto2 as a non-root user.  From this post: https://forums.freebsd.org/viewtopic.php?&t=23739, I discovered that the USB devices need to be executable by the user.

I took a slightly different approach and modified the following in /etc/devfs.conf:

```
perm    usb*    0776
perm    usb/*   0776
```
and the following modification in /etc/devfs.rules

```
add path 'usb/*'        mode 0776 group operator
add path 'usb*'         mode 0776 group operator
```
I am not sure if I need both usb* and usb/*, but it is working now and I don't feel like making more changes.

Also, to unmount the device I had seen referenced in many places to use `fusermount -u /path/to/mountpoint`, but fusermount is not available on freebsd FreeBSD.  So, to unmount it is as simple as `umount /path/to/mountpoint`.


----------

