Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Flame, adb and Debian 8

81 views
Skip to first unread message

Thomas Zimmermann

unread,
Sep 21, 2015, 9:50:37 AM9/21/15
to dev-...@lists.mozilla.org, Chris Mills
@cmills: The information below doesn't seem to be in the FxOS wiki. Can
it be added?

Hi,

I recently upgraded to Debian 8, which brought me some headaches when
figuring out how to use adb with a Flame device reliably. Flame's
interaction with Debian's udev* rules creates a number of problems that
make the device impossible to use for development. I guess that other
distributions are affected as well. I hope this email will be helpful to
anyone who sees similar issues.

1) The first problem is that there's a modeswitch rule for the device,
which makes the Flame 'invisible' to adb. So you won't see your device
listed by 'adb devices'.

The Flame appears to be a multi-state device. When you plug in a
switched-off Flame, its USB id is 05c6:f000. There's a udev rule in
'/lib/udev/rules.d/40-usb_modeswitch.rules' that calls 'usb_modeswitch'
for this device, and usb_modeswitch apparently sets the Flame to be a
USB modem.

You can fix this problem by either

a) deleting the usb_modeswitch tool,
b) out-commenting the line in the rules file, or
c) adding the following line to your android.rules file

ATTR{idVendor}=="05c6", ATTR{idProduct}=="f000", RUN=""

to disable the call to 'usb_modeswitch'.

Solution c) appears to be the best option IMHO.

2) The order of the udev rule files is important. Udev reads all the
files with rules and orders them alphabetically. Whatever comes later
overwrites earlier rules. (That's also why solution 1.c works.)

My rules file was named '51_android.rules' as described in [1]. It turns
out that there's a file named '/lib/udev/rules.d/69_libmtp.rules', which
contains a rule for 05c6:9025 that treats your Flame like a media player
and puts it into the group 'audio'. You won't be able to use the devices
with adb then.

You can fix this problem by renaming your android.rules file;
'99_android.rules' works for my system.

Best regards
Thomas

[1] https://developer.android.com/tools/device.html

* udev is the Linux program that sets up connected devices and maintains
the content in the /dev directory.

Julien Wajsberg

unread,
Sep 21, 2015, 6:56:28 PM9/21/15
to dev-...@lists.mozilla.org
Le 21/09/2015 15:50, Thomas Zimmermann a écrit :
>
> The Flame appears to be a multi-state device. When you plug in a
> switched-off Flame, its USB id is 05c6:f000. There's a udev rule in
> '/lib/udev/rules.d/40-usb_modeswitch.rules' that calls 'usb_modeswitch'
> for this device, and usb_modeswitch apparently sets the Flame to be a
> USB modem.
>
> You can fix this problem by either
>
> a) deleting the usb_modeswitch tool,
> b) out-commenting the line in the rules file, or
> c) adding the following line to your android.rules file
>
> ATTR{idVendor}=="05c6", ATTR{idProduct}=="f000", RUN=""
>
> to disable the call to 'usb_modeswitch'.
>
> Solution c) appears to be the best option IMHO.


I think this comes from the package "usb-modeswitch"; maybe you can just
remove the package ?
But it can be useful with some USB 3G sticks.


I remember I had a similar issue where I blacklisted the "option" kernel
module:

/etc/modprobe.d$ cat option.conf
install option /bin/false

See the thread I started some months ago:
https://groups.google.com/forum/#!topic/mozilla.dev.b2g/UhVJ6bOikOI
I think it's related :)

--
Julien

signature.asc

Thomas Zimmermann

unread,
Sep 22, 2015, 4:06:32 AM9/22/15
to Julien Wajsberg, dev-...@lists.mozilla.org
Hi

Am 22.09.2015 um 00:56 schrieb Julien Wajsberg:
> Le 21/09/2015 15:50, Thomas Zimmermann a écrit :
>> The Flame appears to be a multi-state device. When you plug in a
>> switched-off Flame, its USB id is 05c6:f000. There's a udev rule in
>> '/lib/udev/rules.d/40-usb_modeswitch.rules' that calls 'usb_modeswitch'
>> for this device, and usb_modeswitch apparently sets the Flame to be a
>> USB modem.
>>
>> You can fix this problem by either
>>
>> a) deleting the usb_modeswitch tool,
>> b) out-commenting the line in the rules file, or
>> c) adding the following line to your android.rules file
>>
>> ATTR{idVendor}=="05c6", ATTR{idProduct}=="f000", RUN=""
>>
>> to disable the call to 'usb_modeswitch'.
>>
>> Solution c) appears to be the best option IMHO.
>
> I think this comes from the package "usb-modeswitch"; maybe you can just
> remove the package ?
> But it can be useful with some USB 3G sticks.

Yes, that's what I meant. But you won't be able to use some USB modems
or UMTS sticks then.

Best regards
Thomas

>
>
> I remember I had a similar issue where I blacklisted the "option" kernel
> module:
>
> /etc/modprobe.d$ cat option.conf
> install option /bin/false
>
> See the thread I started some months ago:
> https://groups.google.com/forum/#!topic/mozilla.dev.b2g/UhVJ6bOikOI
> I think it's related :)
>
>
>
> _______________________________________________
> dev-fxos mailing list
> dev-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-fxos

Gabriele Svelto

unread,
Sep 22, 2015, 4:31:58 AM9/22/15
to Thomas Zimmermann, dev-...@lists.mozilla.org, Chris Mills
On 21/09/2015 15:50, Thomas Zimmermann wrote:
> I recently upgraded to Debian 8, which brought me some headaches when
> figuring out how to use adb with a Flame device reliably. Flame's
> interaction with Debian's udev* rules creates a number of problems that
> make the device impossible to use for development. I guess that other
> distributions are affected as well. I hope this email will be helpful to
> anyone who sees similar issues.

[...]

Interestingly I've got similar rules in Fedora 23 (they must be udev's
stock configuration) but never encountered this problem. Nice to know
though.

Gabriele

signature.asc

Thomas Zimmermann

unread,
Sep 22, 2015, 4:49:38 AM9/22/15
to Gabriele Svelto, dev-...@lists.mozilla.org, Chris Mills
Hi Gabriele
It worked for the first two days of using Debian 8. After that it
stopped working completely.

AFAICT, a switched-off Flame has the USB id 05c6:f000. Plugging it into
the USB port triggers the mode-switch utility, which turns the Flame
into a USB modem. But when I switch on the Flame first, the USB id
changes to 05c6:9025, which will only put it into the Unix group 'audio'.

So when I only plugged in a running Flame into my computer *and* because
I'm member of the audio group, I did not see this issue for the first
two days. I guess the situation could be similar on Fedora. I never had
this problem on Debian 7 BTW.

Best regards
Thomas

>
> Gabriele
>

Gabriele Svelto

unread,
Sep 22, 2015, 5:24:17 AM9/22/15
to Thomas Zimmermann, dev-...@lists.mozilla.org, Chris Mills
On 22/09/2015 10:49, Thomas Zimmermann wrote:
> So when I only plugged in a running Flame into my computer *and* because
> I'm member of the audio group, I did not see this issue for the first
> two days. I guess the situation could be similar on Fedora. I never had
> this problem on Debian 7 BTW.

Possibly, I'll keep my eyes peeled and see if this happens too. I see
the same sequence of events as you describe BTW when plugging it off.

Gabriele


signature.asc

Chris Mills

unread,
Sep 22, 2015, 6:19:15 AM9/22/15
to Thomas Zimmermann, dev-...@lists.mozilla.org
Ok, I’ve had a go at documenting this. I’ve written up the specific Flame fix here:

https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Phone_guide/Flame/Initial_setup#Further_adb_issues_modeswitch_and_rule_overrides

And I’ve also added some more generic advice to the troubleshooting section of our Installing ADB and Fastboot article:

https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Debugging/Installing_ADB#adb_still_doesn%27t_recognise_the_device_%E2%80%94_udev_issues

Can you review these and let me know if there are any issues? Feel free to edit directly if you’d prefer.

Chris Mills
Senior tech writer || Mozilla
developer.mozilla.org || MDN
cmi...@mozilla.com || @chrisdavidmills



> On 21 Sep 2015, at 14:50, Thomas Zimmermann <tzimm...@mozilla.com> wrote:
>
> @cmills: The information below doesn't seem to be in the FxOS wiki. Can
> it be added?
>
> Hi,
>
> I recently upgraded to Debian 8, which brought me some headaches when
> figuring out how to use adb with a Flame device reliably. Flame's
> interaction with Debian's udev* rules creates a number of problems that
> make the device impossible to use for development. I guess that other
> distributions are affected as well. I hope this email will be helpful to
> anyone who sees similar issues.
>
> 1) The first problem is that there's a modeswitch rule for the device,
> which makes the Flame 'invisible' to adb. So you won't see your device
> listed by 'adb devices'.
>
> The Flame appears to be a multi-state device. When you plug in a
> switched-off Flame, its USB id is 05c6:f000. There's a udev rule in
> '/lib/udev/rules.d/40-usb_modeswitch.rules' that calls 'usb_modeswitch'
> for this device, and usb_modeswitch apparently sets the Flame to be a
> USB modem.
>
> You can fix this problem by either
>
> a) deleting the usb_modeswitch tool,
> b) out-commenting the line in the rules file, or
> c) adding the following line to your android.rules file
>
> ATTR{idVendor}=="05c6", ATTR{idProduct}=="f000", RUN=""
>
> to disable the call to 'usb_modeswitch'.
>
> Solution c) appears to be the best option IMHO.
>

Thomas Zimmermann

unread,
Sep 22, 2015, 6:59:38 AM9/22/15
to Chris Mills, dev-...@lists.mozilla.org
Looks good to me. Thanks a lot for documenting this.
0 new messages