# Thunar does not detect the smartphone  HUAWEI hardware on FreeBSD system!



## teo (Dec 11, 2017)

Thunar does not detect the smartphone HUAWEI hardware on FreeBSD system, thunar only detects the CDROM as  virgin of huawei.  However, in the terminal if it detects and this as disconnected the hardware huawei, how should I proceed so that thunar  detects the hardware huawei?

Thunar-volman manager  is a plugin that helps to configure and launch automatically the devices, in FreeBSD it is not available.



```
#[CMD]dmesg | egrep -i 'HUAWEI'[/CMD]
ugen1.4: <HUAWEI GRACE> at usbus1
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
ugen1.4: <HUAWEI GRACE> at usbus1
#
```
# `dmesg | egrep -i 'cd|HUAWEI'`


```
............    ............   ...........
  ............    ............   ...........
  ............    ............   ...........
ugen1.4: <HUAWEI GRACE> at usbus1
cd1 at umass-sim0 bus 0 scbus3 target 0 lun 0
cd1: <Linux File-CD Gadget 0310> Removable CD-ROM SCSI-2 device
cd1: 40.000MB/s transfers
cd1: 5MB (11700 512 byte sectors)
cd1: quirks=0x10<10_BYTE_ONLY>
(cd1:umass-sim0:0:0:0): READ TOC/PMA/ATIP. CDB: 43 02 00 00 00 00 01 00 0c 00
(cd1:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd1:umass-sim0:0:0:0): SCSI status: Check Condition
(cd1:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
(cd1:umass-sim0:0:0:0): Error 22, Unretryable error
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
cd1 at umass-sim0 bus 0 scbus3 target 0 lun 0
cd1: <Linux File-CD Gadget 0310> detached
(cd1:umass-sim0:0:0:0): Periph destroyed
ugen1.4: <HUAWEI GRACE> at usbus1
cd1 at umass-sim0 bus 0 scbus3 target 0 lun 0
cd1: <Linux File-CD Gadget 0310> Removable CD-ROM SCSI-2 device
cd1: 40.000MB/s transfers
cd1: 5MB (11700 512 byte sectors)
cd1: quirks=0x10<10_BYTE_ONLY>
(cd1:umass-sim0:0:0:0): READ TOC/PMA/ATIP. CDB: 43 02 00 00 00 00 01 00 0c 00
(cd1:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd1:umass-sim0:0:0:0): SCSI status: Check Condition
(cd1:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
(cd1:umass-sim0:0:0:0): Error 22, Unretryable error
 #
```


----------



## Minbari (Dec 11, 2017)

Try to mount is as a storage device with autofs/dsbmc.


----------



## teo (Dec 11, 2017)

Minbari said:
			
		

> Try to mount is as a storage device with autofs/dsbmc.



Still does not detect the huawei hardware, thunar only detects the CDROM of  huawei as virgin.


----------



## Minbari (Dec 11, 2017)

Mine it's working ok. I have dsbmc installed and autofs configured and I can access the phone sd card. Take a look at those two threads (*Autofs. Share your experience** & Mobile phone access*) it may help you solve the problem.


----------



## teo (Dec 11, 2017)

Minbari said:
			
		

> Take a look at those two threads (*Autofs. Share your experience** & Mobile phone access*) it may help you solve the problem.
> 
> View attachment 4197



The port or package is  sysutils/dsbmc , and it is not  autofs/dsbmc.

A visualization of the device in thunar that only detects the cdrom the huawei, and does not detect thunar the hardware huawei, the arrow in direction to Blank Disc  is what detects the thunar of the device huawei.


----------



## Minbari (Dec 12, 2017)

First step: install sysutils/mtpfs & sysutils/fusefs-simple-mtpfs & sysutils/dsbmd &  sysutils/dsbmc .
Add

```
dsbmd_enable="YES"
autofs_enable="YES"
kld_list="fuse"
```
in  /etc/rc.conf and start the service: `service dsbmd start`. This step was necessary so you can access the device via GUI.

Second setep: edit /etc/auto_master and add:

```
/mtp            -simple-mtpfs   -allow_other
```
then add: fuse_load="YES" in /boot/loader.conf or load it with `kldload fuse`, but for the changes to persist after reboot it's good to add it to /boot/loader.conf.

Third step: make a directory in / named /media
`mkdir /media`
where out phone/mp3 player will be mounted and start the following services:

```
service automount start
service automountd start
service autounmountd start
```

Also if the following file doesn't exist create it: /usr/local/etc/automount.conf:



```
MNTPREFIX="/media"
USERUMOUNT="YES"
USER="your_user_name"
ATIME="NO"
REMOVEDIRS="YES"
```

When it comes to /etc/auto_master : you *must* leave the media map commented. Don't enable it. Otherwise you won't have access to this folder as an user.

I don't know if this is the best guide but for me it's works OK with my Android Phone.


----------



## mrclksr (Dec 12, 2017)

Hi Minbari ,

there is no need for automountd/autofs if you're using DSBMD.


Minbari said:


> then add: *fuse_load="YES"* in /boot/loader.conf or load it with kldload fuse


DSBMD loads all needed modules automatically.

See also Thread 63534


----------



## Phishfry (Dec 12, 2017)

I really think this may be a similar problem as Huawei Cellular Modems.
http://www.ogris.de/howtos/freebsd-huawei-e392.html

My theory:
The phone presents a small mass storage device which -on Windows- autolaunches the driver setup.
You need to disable it.
So I wonder if you could use usb-modeswitch to hide this device:
`cd1: <Linux File-CD Gadget 0310> Removable CD-ROM SCSI-2 device`

It seems strange to be cd1. By default first device is usually cd0.
Have you tried to turn off this mass storage device from the phone settings.
That is the easiest route if a setting exists.

Maybe you could post this output:
`usbconfig -u 1 -a 4 dump_device_desc`

Perhaps you could disable cd1 and then the microSD card would show up.
Please do not use any of the settings from the above Cell Modem post.
I posted it to show what I am talking about.
On cellular modems this mass storage device hides the modems USB connection.
So they disable the mass storage device. You just need to disable cd1, not all mass storage.
So you may need to find a usb-modeswitch setting that does that.
In the above example shown as "MessageContent=" but you need to find one for your device.
Note how they are also changing the devices idProduct (Also know as PID or Product ID)
That causes the usb interface to use a different mode.


----------



## teo (Dec 13, 2017)

The procedure performed by Minbari only detected the device as disk  massive of data and unmounted does not open the disk, thunar only detects the CDROM of the device which is mounted and not opens the  folder what this wath padlocked.

 The topic  goes more or less like Phishfry on that link, but I don't know how to proceed after installing that package. I have been using this smartphone Huawei  Grace  for years and there is no massive data storage function to disable in the  settings.

# `dmesg | egrep -i 'HUAWEI'`

```
ugen1.4: <HUAWEI GRACE> at usbus1
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
ugen1.4: <HUAWEI GRACE> at usbus1
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
ugen1.4: <HUAWEI GRACE> at usbus1
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
ugen1.4: <HUAWEI GRACE> at usbus1
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
ugen1.4: <HUAWEI GRACE> at usbus1
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
ugen1.4: <HUAWEI GRACE> at usbus1
#
```
 Or:

# `dmesg | egrep -i 'cd|HUAWEI'`

```
.......   .........    ..........
       .......   .........    ..........
ugen1.4: <HUAWEI GRACE> at usbus1
umass0 on uhub3
umass0: <Mass Storage> on usbus1
umass0:  SCSI over Bulk-Only; quirks = 0x0000
umass0:3:0: Attached to scbus3
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
umass0: at uhub3, port 2, addr 4 (disconnected)
(cd1:umass-sim0:0:0:0): got CAM status 0x44
(cd1:umass-sim0:0:0:0): fatal error, failed to attach to device
umass0: detached
ugen1.4: <HUAWEI GRACE> at usbus1
umass0 on uhub3
umass0: <Mass Storage> on usbus1
umass0:  SCSI over Bulk-Only; quirks = 0x0000
umass0:3:0: Attached to scbus3
cd1 at umass-sim0 bus 0 scbus3 target 0 lun 0
cd1: <Linux File-CD Gadget 0310> Removable CD-ROM SCSI-2 device
cd1: 40.000MB/s transfers
cd1: 5MB (11700 512 byte sectors)
cd1: quirks=0x10<10_BYTE_ONLY>
(cd1:umass-sim0:0:0:0): READ TOC/PMA/ATIP. CDB: 43 02 00 00 00 00 01 00 0c 00
(cd1:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd1:umass-sim0:0:0:0): SCSI status: Check Condition
(cd1:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
(cd1:umass-sim0:0:0:0): Error 22, Unretryable error
(cd1:umass-sim0:0:0:0): READ TOC/PMA/ATIP. CDB: 43 02 00 00 00 00 01 00 0c 00
(cd1:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd1:umass-sim0:0:0:0): SCSI status: Check Condition
(cd1:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
(cd1:umass-sim0:0:0:0): Error 22, Unretryable error
(cd1:umass-sim0:0:0:0): READ TOC/PMA/ATIP. CDB: 43 00 00 00 00 00 01 00 0c 00
(cd1:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd1:umass-sim0:0:0:0): SCSI status: Check Condition
(cd1:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
(cd1:umass-sim0:0:0:0): Error 22, Unretryable error
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
umass0: at uhub3, port 2, addr 4 (disconnected)
cd1 at umass-sim0 bus 0 scbus3 target 0 lun 0
cd1: <Linux File-CD Gadget 0310> detached
(cd1:umass-sim0:0:0:0): Periph destroyed
umass0: detached
ugen1.4: <HUAWEI GRACE> at usbus1
umass0 on uhub3
umass0: <Mass Storage> on usbus1
umass0:  SCSI over Bulk-Only; quirks = 0x0000
umass0:3:0: Attached to scbus3
cd1 at umass-sim0 bus 0 scbus3 target 0 lun 0
cd1: <Linux File-CD Gadget 0310> Removable CD-ROM SCSI-2 device
cd1: 40.000MB/s transfers
cd1: 5MB (11700 512 byte sectors)
cd1: quirks=0x10<10_BYTE_ONLY>
(cd1:umass-sim0:0:0:0): READ TOC/PMA/ATIP. CDB: 43 02 00 00 00 00 01 00 0c 00
(cd1:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd1:umass-sim0:0:0:0): SCSI status: Check Condition
(cd1:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
(cd1:umass-sim0:0:0:0): Error 22, Unretryable error
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
umass0: at uhub3, port 2, addr 4 (disconnected)
cd1 at umass-sim0 bus 0 scbus3 target 0 lun 0
cd1: <Linux File-CD Gadget 0310> detached
(cd1:umass-sim0:0:0:0): Periph destroyed
umass0: detached
ugen1.4: <HUAWEI GRACE> at usbus1
ugen1.4: <HUAWEI GRACE> at usbus1 (disconnected)
ugen1.4: <HUAWEI GRACE> at usbus1
umass0 on uhub3
umass0: <Mass Storage> on usbus1
umass0:  SCSI over Bulk-Only; quirks = 0x0000
umass0:3:0: Attached to scbus3
cd1 at umass-sim0 bus 0 scbus3 target 0 lun 0
cd1: <Linux File-CD Gadget 0310> Removable CD-ROM SCSI-2 device
cd1: 40.000MB/s transfers
cd1: 5MB (11700 512 byte sectors)
cd1: quirks=0x10<10_BYTE_ONLY>
(cd1:umass-sim0:0:0:0): READ TOC/PMA/ATIP. CDB: 43 00 00 00 00 00 01 00 0c 00
(cd1:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd1:umass-sim0:0:0:0): SCSI status: Check Condition
(cd1:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
(cd1:umass-sim0:0:0:0): Error 22, Unretryable error
#
```

# `usbconfig -u 1 -a 4 dump_device_desc`

```
ugen1.4: <HUAWEI GRACE> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x12d1
  idProduct = 0x10XX
  bcdDevice = 0x0299
  iManufacturer = 0x0002  <HUAWEI>
  iProduct = 0x0003  <GRACE>
  iSerialNumber = 0x0004  <xxxxxxxxxxxxxxxxxxxxx>
  bNumConfigurations = 0x0001
#
```


----------



## Phishfry (Dec 14, 2017)

So I think you should google your phone model and the VID and PID and see if you can disable CD
idVendor = 0x12d1
idProduct = 0x10XX


----------

