bsd android tethering using USB cable - intermittent failure

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

bsd android tethering using USB cable - intermittent failure

Julian H. Stacey-3
Hi hackers@,
I tether Androids to FreeBSDs using USB cables, Using
ports/devel/android-tools-adb Mostly it works, but sometimes fails to
connect, I've no idea why.

I've tried: different physical androids, different versions of android (4 & 5),
different physical ports (once I had a cable hanging down didnt connect on
laptop socket), via hub & direct avoiding usb hub, different FreeBSDs
(all of 10.4-RELEASE 11.2-RELEASE 13.0-CURRENT), 2 different FreeBSD PCs

Could someone please please take a look at
        http://www.berklix.org/android/#adb
& perhaps spot what I'm forgetting to initialise ?
Thanks,
Julian
--
Julian Stacey, Consultant Systems Engineer, BSD Linux Unix, Munich Aachen Kent
 UK Stole 700,000 votes from British in EU + 3 million globally; 1.9 M in UK
 were too young + 1.3 M died. Fraud, fines & lies. Brexit prob. now Minority.
 2nd Ref. Avoid Chaos: Revoke Article 50, plan better, re-file 50 or whatever.
 http://www.berklix.uk/brexit/#email_an_mp
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: bsd android tethering using USB cable - intermittent failure

Matthias Apitz-4
El día Tuesday, February 05, 2019 a las 02:36:59PM +0100, Julian H. Stacey escribió:

> Hi hackers@,
> I tether Androids to FreeBSDs using USB cables, Using
> ports/devel/android-tools-adb Mostly it works, but sometimes fails to
> connect, I've no idea why.
>
> I've tried: different physical androids, different versions of android (4 & 5),
> different physical ports (once I had a cable hanging down didnt connect on
> laptop socket), via hub & direct avoiding usb hub, different FreeBSDs
> (all of 10.4-RELEASE 11.2-RELEASE 13.0-CURRENT), 2 different FreeBSD PCs
>
> Could someone please please take a look at
> http://www.berklix.org/android/#adb
> & perhaps spot what I'm forgetting to initialise ?

With my Ubuntu Phone (which has as well an Android kernel behind the
scenes), I learned that one must enable developer mode and even with
this on connect the display *must* be unlocked and a pop up answered
about the permission.

        matthias

--
Matthias Apitz, ✉ [hidden email], http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
October, 7 -- The GDR was different: Peace instead of Bundeswehr and wars, Druschba
instead of Nazis, to live instead of to survive.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: bsd android tethering using USB cable - intermittent failure

Julian H. Stacey-3
Matthias Apitz wrote:

> El día Tuesday, February 05, 2019 a las 02:36:59PM +0100, Julian H. Stacey escribió:
>
> > Hi hackers@,
> > I tether Androids to FreeBSDs using USB cables, Using
> > ports/devel/android-tools-adb Mostly it works, but sometimes fails to
> > connect, I've no idea why.
> >
> > I've tried: different physical androids, different versions of android (4 & 5),
> > different physical ports (once I had a cable hanging down didnt connect on
> > laptop socket), via hub & direct avoiding usb hub, different FreeBSDs
> > (all of 10.4-RELEASE 11.2-RELEASE 13.0-CURRENT), 2 different FreeBSD PCs
> >
> > Could someone please please take a look at
> > http://www.berklix.org/android/#adb
> > & perhaps spot what I'm forgetting to initialise ?
>
> With my Ubuntu Phone (which has as well an Android kernel behind the
> scenes), I learned that one must enable developer mode and even with
> this on connect the display *must* be unlocked and a pop up answered
> about the permission.
Thanks , Yes I've got developer mode on (7 taps on build version)
&  dont know how to lock display so always on, & yes I do always
touch screen to tether.

Ive tried rebooting BSD today didnt help. Dont think ive tried
rebooting the Androids today.  I wondered if I had some hidden
faulty initialiser file so just removed a bunch of ~/.[a-zA-Z]*
that I didnt recognise or didnt want.

Weirdly, adb shell has now just connected on the phone I want to
move data on.

& also weirdly ifconfig -a
does Not display a ue0: eg from past:
        ue0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
  ether xx:xx:xx:xx:xx:xx
though I thought I needed ue to tether with,
ifconfig -a just shows ether & local bge0: & lo0:

Unfortunately my background devd set up the connection before I
killed it & switched to foreground /sbin/devd -d so xterm scroll
back does not show what device, but I grabbed a tar copy of /dev
to look at later

My Android popped up with a less often seen screen: USB PC Connection
        Connect as
                Media device (MTP) which shows pre-ticked Green
                Camera (PTP) which shows blank, un-checked.

Well I wont disturb that pair of devs that are ready to talk,
I'll start long transfer of data I need,

but I will contine to experiment on another pair of devs,

Cheers,
Julian
--
Julian Stacey, Consultant Systems Engineer, BSD Linux Unix, Munich Aachen Kent
 UK Stole 700,000 votes from British in EU + 3 million globally; 1.9 M in UK
 were too young + 1.3 M died. Fraud, fines & lies. Brexit prob. now Minority.
 2nd Ref. Avoid Chaos: Revoke Article 50, plan better, re-file 50 or whatever.
 http://www.berklix.uk/brexit/#email_an_mp

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: bsd android tethering using USB cable - intermittent failure

freebsd-hackers mailing list






‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, February 5, 2019 12:34 PM, Julian H. Stacey <[hidden email]> wrote:

> Matthias Apitz wrote:
>
> > El día Tuesday, February 05, 2019 a las 02:36:59PM +0100, Julian H. Stacey escribió:
> >
> > > Hi hackers@,
> > > I tether Androids to FreeBSDs using USB cables, Using
> > > ports/devel/android-tools-adb Mostly it works, but sometimes fails to
> > > connect, I've no idea why.
> > > I've tried: different physical androids, different versions of android (4 & 5),
> > > different physical ports (once I had a cable hanging down didnt connect on
> > > laptop socket), via hub & direct avoiding usb hub, different FreeBSDs
> > > (all of 10.4-RELEASE 11.2-RELEASE 13.0-CURRENT), 2 different FreeBSD PCs
> > > Could someone please please take a look at
> > > http://www.berklix.org/android/#adb
> > > & perhaps spot what I'm forgetting to initialise ?
> >
> > With my Ubuntu Phone (which has as well an Android kernel behind the
> > scenes), I learned that one must enable developer mode and even with
> > this on connect the display must be unlocked and a pop up answered
> > about the permission.
>
> Thanks , Yes I've got developer mode on (7 taps on build version)
> & dont know how to lock display so always on, & yes I do always
> touch screen to tether.
>
> Ive tried rebooting BSD today didnt help. Dont think ive tried
> rebooting the Androids today. I wondered if I had some hidden
> faulty initialiser file so just removed a bunch of ~/.[a-zA-Z]*
> that I didnt recognise or didnt want.
>
> Weirdly, adb shell has now just connected on the phone I want to
> move data on.
>
> & also weirdly ifconfig -a
> does Not display a ue0: eg from past:
> ue0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>
>     ether xx:xx:xx:xx:xx:xx
>
>
> though I thought I needed ue to tether with,
> ifconfig -a just shows ether & local bge0: & lo0:
>
> Unfortunately my background devd set up the connection before I
> killed it & switched to foreground /sbin/devd -d so xterm scroll
> back does not show what device, but I grabbed a tar copy of /dev
> to look at later
>
> My Android popped up with a less often seen screen: USB PC Connection
> Connect as
> Media device (MTP) which shows pre-ticked Green
> Camera (PTP) which shows blank, un-checked.
>
> Well I wont disturb that pair of devs that are ready to talk,
> I'll start long transfer of data I need,
>
> but I will contine to experiment on another pair of devs,
>
> Cheers,
> Julian
>


I've done the android connect on FreeBSD quite often without any trouble, for years, however one time it acted the way you described I decided it was a crappy cable. I threw the cable in the trash and totally stopped having that problem. (just in case you didn't try different cables)

Waitman Gobble



_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: bsd android tethering using USB cable - intermittent failure

Matthias Apitz-4
In reply to this post by Julian H. Stacey-3
El día Tuesday, February 05, 2019 a las 05:34:42PM +0100, Julian H. Stacey escribió:

> Thanks , Yes I've got developer mode on (7 taps on build version)
> &  dont know how to lock display so always on, & yes I do always
> touch screen to tether.
>
> Ive tried rebooting BSD today didnt help. Dont think ive tried
> rebooting the Androids today.  I wondered if I had some hidden
> faulty initialiser file so just removed a bunch of ~/.[a-zA-Z]*
> that I didnt recognise or didnt want.
>
> Weirdly, adb shell has now just connected on the phone I want to
> move data on.
>
> & also weirdly ifconfig -a
> does Not display a ue0: eg from past:
> ue0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>   ether xx:xx:xx:xx:xx:xx
> though I thought I needed ue to tether with,
> ifconfig -a just shows ether & local bge0: & lo0:
>
> Unfortunately my background devd set up the connection before I
> killed it & switched to foreground /sbin/devd -d so xterm scroll
> back does not show what device, but I grabbed a tar copy of /dev
> to look at later
>
> My Android popped up with a less often seen screen: USB PC Connection
> Connect as
> Media device (MTP) which shows pre-ticked Green
> Camera (PTP) which shows blank, un-checked.
>
> Well I wont disturb that pair of devs that are ready to talk,
> I'll start long transfer of data I need,
>
> but I will contine to experiment on another pair of devs,

I think you must not have this interface 'ue0', i.e. you must not enable
'rndis' in the gadget. Or use TCP and SSH or ADB, not both. See this
life example:

I have not set in the BQ:

android-gadget-service enable rndis

# ifconfig ue0
ifconfig: interface ue0 does not exist

attach BQ E4.5

# tail /var/log/messages
...
Feb  6 08:50:16 c720-r342378 kernel: ugen0.4: <BQ AquarisE4.5> at usbus0

# adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

# adb devices -l
List of devices attached
JU000435               device usb:0:4 product:krillin model:Aquaris_E4_5_Ubuntu_Edition device:krillin transport_id:1

# adb shell
phablet@ubuntu-phablet:~$
phablet@ubuntu-phablet:~$ uname -a
Linux ubuntu-phablet 3.4.67 #1 SMP PREEMPT Mon Jun 6 12:04:40 UTC 2016 b75400e armv7l armv7l armv7l GNU/Linux

        matthias
--
Matthias Apitz, ✉ [hidden email], http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
October, 7 -- The GDR was different: Peace instead of Bundeswehr and wars, Druschba
instead of Nazis, to live instead of to survive.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: bsd android tethering using USB cable - intermittent failure

Julian H. Stacey-3

Matthias Apitz wrote: Wed, 6 Feb 2019 09:05:11 +0100

> El día Tuesday, February 05, 2019 a las 05:34:42PM +0100, Julian H. Stacey escribió:
>
> > Thanks , Yes I've got developer mode on (7 taps on build version)
> > &  dont know how to lock display so always on, & yes I do always
> > touch screen to tether.
> >
> > Ive tried rebooting BSD today didnt help. Dont think ive tried
> > rebooting the Androids today.  I wondered if I had some hidden
> > faulty initialiser file so just removed a bunch of ~/.[a-zA-Z]*
> > that I didnt recognise or didnt want.
> >
> > Weirdly, adb shell has now just connected on the phone I want to
> > move data on.
> >
> > & also weirdly ifconfig -a
> > does Not display a ue0: eg from past:
> > ue0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
> >   ether xx:xx:xx:xx:xx:xx
> > though I thought I needed ue to tether with,
> > ifconfig -a just shows ether & local bge0: & lo0:
> >
> > Unfortunately my background devd set up the connection before I
> > killed it & switched to foreground /sbin/devd -d so xterm scroll
> > back does not show what device, but I grabbed a tar copy of /dev
> > to look at later
> >
> > My Android popped up with a less often seen screen: USB PC Connection
> > Connect as
> > Media device (MTP) which shows pre-ticked Green
> > Camera (PTP) which shows blank, un-checked.
> >
> > Well I wont disturb that pair of devs that are ready to talk,
> > I'll start long transfer of data I need,
> >
> > but I will contine to experiment on another pair of devs,
Hi Matthias & all,

> I think you must not have this interface 'ue0',

Yes, you'r right, thanks, Tethering the smart phone kills
the adb direct over usb connection, not surprising in retrospect ;-)


> i.e. you must not enable
> 'rndis' in the gadget. Or use TCP and SSH or ADB, not both. See this
> life example:
>
> I have not set in the BQ:

I presume BQ is your name for your phone type.


> android-gadget-service enable rndis

I don't know what file on bsd or android you refer to.  (Fortunately
android 6 has find & grep (earlier does not)), but I find nothing
with these:
On android:
        cd /etc;find . -type f -exec grep android-gadget-service {} /dev/null \;
On current freebsd :
        man urndis
        cd /usr/src ; find . -type f -exec grep android-gadget-service {} \;


> # ifconfig ue0
> ifconfig: interface ue0 does not exist
>
> attach  E4.5

Too cryptic, not sure what you mean.
attach is not a command on android 6 or freebsd current
        uname -a
        Linux localhost 3.4.0-12884729 #1 SMP PREEMPT Mon Jan 15 16:53:44 KST 2018 armv7l
        shell@klte:/ $
Though attach is a label for bsd /etc/devd/*.conf
& I recall attach a dev to an interface of old, eg slattach etc.
& on freebsd current : apropos attach : man devmatch
& devinfo | grep rndis # only shows urndis0 when I click tether on android


> # tail /var/log/messages
> ...
> Feb  6 08:50:16 c720-r342378 kernel: ugen0.4: <BQ AquarisE4.5> at usbus0
>
> # adb start-server
> * daemon not running; starting now at tcp:5037
> * daemon started successfully
>
> # adb devices -l
> List of devices attached
> JU000435               device usb:0:4 product:krillin model:Aquaris_E4_5_Ubuntu_Edition device:krillin transport_id:1
Yes, ths was my problem after tethering I was not seeing any devices,
now I dont teher & can connect again & move files.
>
> # adb shell
> phablet@ubuntu-phablet:~$
> phablet@ubuntu-phablet:~$ uname -a
> Linux ubuntu-phablet 3.4.67 #1 SMP PREEMPT Mon Jun 6 12:04:40 UTC 2016 b75400e armv7l armv7l armv7l GNU/Linux

PS Later I'll tether again.  My end aim is find an app for android
that supports NFS & AMD, so the phone can seamlessly become part
of my file system on BSD. but a search on http://play.google.com
& http://www.fdroid.org shows nothing obvious.

I'll probably have to root the phone too before that, & I didnt
root, till after I could backup, & backup wasnt easy with no knowledge
of FS tree, & no commands find & grep on my older android, & locked
read permissions in non root, it was chicken & egg.  

Tips welcome, I add them to my http://www.berklix.com/android/
Thanks

Julian
--
Julian Stacey, Consultant Systems Engineer, BSD Linux Unix, Munich Aachen Kent
 UK Stole 700,000 votes from British in EU + 3 million globally; 1.9 M in UK
 were too young + 1.3 M died. Fraud, fines & lies. Brexit is minority. 2nd Ref.
 Blind Chaos & slump?  Or revoke #50, plan better first, maybe re-file later.
 http://www.berklix.uk/brexit/#email_an_mp

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: bsd android tethering using USB cable - intermittent failure

Matthias Apitz-4
El día Monday, February 11, 2019 a las 02:39:37PM +0100, Julian H. Stacey escribió:

> Hi Matthias & all,
>
> > I think you must not have this interface 'ue0',
>
> Yes, you'r right, thanks, Tethering the smart phone kills
> the adb direct over usb connection, not surprising in retrospect ;-)
>
>
> > i.e. you must not enable
> > 'rndis' in the gadget. Or use TCP and SSH or ADB, not both. See this
> > life example:
> >
> > I have not set in the BQ:
>
> I presume BQ is your name for your phone type.

Yes. It is an E4.5 produced by the Spanish company BQ.com. It runs an
Ubuntu Touch on top of an Android kernel.

> > android-gadget-service enable rndis
>
> I don't know what file on bsd or android you refer to.  (Fortunately
> android 6 has find & grep (earlier does not)), but I find nothing
> with these:
> On android:
> cd /etc;find . -type f -exec grep android-gadget-service {} /dev/null \;
> On current freebsd :
> man urndis
> cd /usr/src ; find . -type f -exec grep android-gadget-service {} \;

No. This is a shell command in the Ubuntu Touch. I was hoping that
Android has something similar in your device. It enables tethering,
which we don't want to have here in our case of ADB.

>
>
> > # ifconfig ue0
> > ifconfig: interface ue0 does not exist
> >
> > attach  E4.5
>
> Too cryptic, not sure what you mean.

I meant: I just pluged-in the USB cable from the E4.5 to my laptop.
 
        matthias
--
Matthias Apitz, ✉ [hidden email], http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
October, 7 -- The GDR was different: Peace instead of Bundeswehr and wars, Druschba
instead of Nazis, to live instead of to survive.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"