ubuntuusers.de

bq.txt

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
 
 
Things to note (unsorted until now) about the BQ Aquaris E 4.5 Ubuntu phone
                       Matthias Apitz <guru@unixarea.de>
 

http://www.unixarea.de/bq/bq-aquaris-e45-ubuntu.txt

rev.:
Thu Apr 30 13:46:07 CEST 2015

 1. How to get SSH access to the ubuntu-phone via Wifi:
 2. The files (pictures, ...)  end up in:
 3. The touchscreen is capacitive (the Openmoko Freerunner's is resistive) which makes it
 4. The available disk space is like this:
 5. USB networking: tethering
 6. GPS, OSM maps && app
 7. Capturing the MIR screen for presentation, talks etc. on a X11 desktop
 8. Development resources from where to start reading
 9. Firewall
10. Using the phone as a router to Internet for the netbook
11. Import and export of Contacts
12. ssh localhost
13. How to lauch apps from the phablet's cmd line
14. How to alter presented keyboard's Control keys
15. Call history
17. Access to logs in the device
18. How to alter presented apps in the app scope (UNTESTED)
19. Developmen and SDK (completely UNTESTED until now)
20. Sending SMS from shell
xx. Other usefull commands (unsorted)



 
 1. How to get SSH access to the ubuntu-phone via Wifi:
 
    login via terminal app, you will be user 'phablet' (the password is the unlock number)
 
    enable SSH service with (remains after boot):
 
    $ android-gadget-service enable ssh
 
    fetch your public key to the Phone from some place:
 
    $ wget http://www.unixarea.de/id_rsa.pub
    $ mkdir .ssh
    $ chmod 0700 .ssh
    $ mv id_rsa.pub .ssh/authorized_keys
 
    Now you can look up your IP on the phone and use ssh to connect:
 
    $ ip addr show wlan0|grep inet
 
    from your workstation use:
 
    ssh phablet@<IP from above command>
 
    SSH-in is even possible when the device is locked and black; don't know
    if this is intention that it does not suspend; the configuration goes like this
 
    see also: 
    http://askubuntu.com/questions/348714/how-can-i-access-my-ubuntu-phone-over-ssh/599041#599041

 2. The files (pictures, ...)  end up in:
 
    ~/Downloads
    ~/Pictures
    ~/Pictures/Screenshots
    ~/Pictures/com.ubuntu.camera
    ~/Pictures/com.ubuntu.camera/image20150329_183823514.jpg
    ~/Videos
    ~/Videos/com.ubuntu.camera
    ~/Documents
 
    You may copy file to ~/Pictures/com.ubuntu.camera/ but the app only accepts .jpg files;
 
    JPEG fotos are of the following dates:
    $ jhead image20150329_183823514.jpg 
    File name    : image20150329_183823514.jpg
    File size    : 568513 bytes
    File date    : 2015:03:29 18:39:43
    Camera make  : bq                             
    Camera model : Aquaris E4.5                   
    Date/Time    : 2015:03:29 18:38:24
    Resolution   : 2448 x 4352
    Flash used   : Yes
    Focal length :  3.5mm
    Digital Zoom : 1.140x
    Exposure time: 0.030 s  (1/33)
    Aperture     : f/2.4
    ISO equiv.   : 132
    Whitebalance : Auto
    Metering Mode: center weight
    JPEG Quality : 80
 
 
 3. The touchscreen is capacitive (the Openmoko Freerunner's is resistive) which makes it
    difficult to use some pen;
 
 4. The available disk space is like this:
    Filesystem                                   Size  Used Avail Use% Mounted on
    /dev/mmcblk0p6                               2.0G  1.6G  369M  81% /
    /dev/mmcblk0p7                               4.4G  273M  4.0G   7% /home
 
 5. USB networking: tethering
 
    For networking the bq supports tethering via an USB device (run the 
    following in the terminal app):
 
    $ android-gadget-service enable rndis
 
    that will switch USB from MTP to tethering and create a 'rndis0' network device
    whith the IP addr 10.42.0.1;
    it offers to the connected computer an IP via DHCP (somehow it takes sometime)
 
    and SSH is fine too as:
 
    $ ssh phablet@10.42.0.1
    Welcome to Ubuntu Utopic Unicorn (development branch) (GNU/Linux 3.4.67 armv7l) > 
 
    I fill figure out how to permanently set this IP addr inside the Ubuntu,
    maybe an DHCP-server on the host side is to much.
 
    $ netstat -rn
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
    0.0.0.0         192.168.2.1     0.0.0.0         UG        0 0          0 wlan0
    10.42.0.0       0.0.0.0         255.255.255.0   U         0 0          0 rndis0
    172.28.23.131   0.0.0.0         255.255.255.255 UH        0 0          0 ccmni0
    192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0
 
    How can I set it as default to rndis enabled?
 
    Oliver Grawert:
    you cant, it is hardcoded on boot to always have working mtp (until
    here is a UI option to turn it on or off, we want regular users to
    lways be able to exchange files), but you can override it in a user
    pstart job that runs at a later point ...
 
    Create /home/phablet/.config/upstart/rndis.conf with the following
    content:
 
    --------------- snip ------------------
    start on started indicator-network
    
    task
    
    script
        android-gadget-service enable rndis
    end script
 
    --------------- snap ----------------
 
    When the interface rndis0 is enabled, somehow HTTPS access to
    the Ubuntu's app store is no longer possible; investigationg ...
 
 6. GPS, OSM maps && app
 
    Unresolved; foxtrotGPS is not ported, and the existings apps are somewhat
    crappy;
 
    the app OSMtouch stores (uses?) the data from this dir:
    /home/phablet/.cache/me.yohanboniface.osmtouch/osm_100-1-9-260-172.png
 
    Things one can do to check the state of GPS:

    Make sure all switches for the GPS are on:
    1. system settings -> security and privacy -> location access
    2. system settings -> battery -> GPS
    3. pull down top bar -> location -> location detection and GPS.

    $ sudo dmesg | grep GPS

    That will give output like:
    [142058.709985] [GPS] GPS_close: WMT turn off GPS OK!
    [142059.154167] GPS_open: major 191 minor 0 (pid 21501)
    [142059.154506] [WMT-CTRL][I]wmt_ctrl_gps_sync_set:ctrl GPS_SYNC(4)
    [142059.154526] [WMT-FUNC][I]wmt_func_gps_pre_ctrl:ctrl GPS_SYNC_SET(0)
    ok 
    [142059.155455] [WMT-FUNC][I]wmt_func_gps_pre_ctrl:set reg for GPS_SYNC
    function okay by chip ic_pin_ctrl
    [142059.155492] [WMT-CTRL][I]wmt_ctrl_gps_lna_set:ctrl GPS_LNA(2)
    [142059.158530] [GPS] GPS_open: WMT turn on GPS OK!

    so you know the state of the GPS.

    to list the space vehicles:
 
    $ ubuntu-location-serviced-cli --bus system --get --property visible_space_vehicles
    Visible space vehicles:
            (type: gps, prn: 1, snr: 0, has_almanac_data: 0,
	    has_ephimeris_data: 0, used_in_fix: 0, azimuth: 3 deg,
	    elevation: 23 deg)

    Satellites with a snr > 0 are visible;
 
    to run a test:
 
    $ sudo GLOG_v=1000 GLOG_logtostderr=1 ubuntu-location-serviced-cli --bus system --test
 
    The test will try to acquire a fix from GPS only 3 times from cold
    start, and print out diagnostics together with a summary containing
    the mean/std.dev. of time to first fix.
 
    to activate more / better logging: the logs are in this dir:
 
    /var/log/ubuntu-location-service/
 
    they would help in tracking down any potential issues;
    alter the config file:
 
    /etc/init/ubuntu-location-service.override
 
    and add the following two lines before the exec line:
 
    export GLOG_v=100
    export GLOG_logtostderr=1
 
    and reboot the phone. After having tried to acquire a position, the
    same log files as mentioned before contain very verbose information
    about the GPS operation.

    Using the dbus-monitor:

    $ dbus-monitor --system "path=/com/ubuntu/espoo/Service/Provider, interface=com.ubuntu.remote.Service.Provider, member=PositionChanged"

    But you need to switch on 
    system settings -> security and privacy -> location access -> ..anonymized wifi... i believe

 7. Capturing the MIR screen for presentation, talks etc. on a X11 desktop
 
    Launch on the phone my script ~/cast.sh which will do:
 
    +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
    #!/bin/sh
    srcIP=`echo $SSH_CLIENT | cut -f1 -d' '`
    port=12345
    printf "mirscreencast'ing to %s port %s\n" $srcIP $port
 
    # note about --cap-interval / -n and resulting fps (for mplayer):
    # --cap-interval 10 -n 6   gives: 6  frames per sec (use fps=6 in myplayer)
    # --cap-interval 1  -n 1   gives: 60 frames per sec (use fps=60 in myplayer)
    # the later of course with a high cost of launching 60 time per sec
    # the application 'mirscreencast' :-(
    # and this only due to a bug in 'mirscreencast'; see:
    # https://bugs.launchpad.net/mir/+bug/1439549
    #
    while true; do
      mirscreencast -m /run/mir_socket --stdout --cap-interval 1 -s 270 480 -n 1 || break
    done | gzip -c | nc $srcIP $port
    +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
 
    one must use USB tethering (Wifi seems to be to poor for the mass data of the frames);
 
    and launch first on the host 10.42.0.64 the presenter script
    ~/readScreenCast.sh which uses mplayer to present the cast:
 
    +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
    #!/bin/sh
    
    # read the 'mirscreencast' from the Ubuntu phone's MIR server
    # see there 'cast.sh'
    #
    # co guru@unixarea.de, April 2015
    
    nc -l 12345 | gzip -dc |\
        mplayer -demuxer rawvideo -rawvideo fps=60:w=270:h=480:format=rgba -
    +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
 
 
    works fine!
 
 8. Development resources from where to start reading
 
    https://developer.ubuntu.com/en/start/ubuntu-for-devices/porting-new-device/
 
 9. Firewall

    The phone is completely open while connected to Wifi :-(

    but, 'ufw' is shipped on the phone. You can open a terminal and do:

    $ sudo ufw enable

    see also https://wiki.ubuntu.com/UncomplicatedFirewal

    XXX:
    not yet tested:

    $ sudo ufw allow ssh/tcp
    $ sudo ufw logging on
    $ sudo ufw enable
    $ sudo ufw status
    Firewall loaded

10. Using the phone as a router to Internet for the netbook

    Disable Wifi in the phone and in the netbook (if the Wifi is
    not routed to Internet);

    enable USB network with the phone;

    adjust default route and DNS (/etc/resolv.conf) in the netbook
    to the IP of the phone 10.42.0.1;

    restart sendmail in the netbook; and all is fine

    I crafted a script ~guru/route2BQ.sh for this:

    +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
    #!/bin/sh
    #
    # change routing (...) to the Ubuntu phone BQ Aqaris E4.5
    #
    ifconfig ue0 || {
        printf "interface ue0 not found -- exit.\n"
        exit 1
    }
    
    ifconfig wlan0 down
    route delete default
    
    killall dhclient
    rm -f /etc/resolv.conf
    dhclient ue0
    # route add default 10.42.0.1
    
    test -f /etc/resolv.conf || {
        cat <<EOF > /etc/resolv.conf 
    # Generated by ~guru/route2BQ.sh
    nameserver 10.42.0.1
    EOF
        }
    
    /etc/rc.d/sendmail stop
    sleep 3
    /etc/rc.d/sendmail start
    +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+-----


11. Import and export of Contacts

    Contacts can be imported from vCard files:

    $ syncevolution --import test.vcf backend=evolution-contacts
    #0: pas-id-552B785D00000008

    see also: http://askubuntu.com/a/372342

    If you have many vcf files, put them in a directory and pass the directory name as
    the --import argument.

    For export use:

    $ syncevolution --export /home/phablet/Documents/utcontacts.vcf backend=evolution-contacts

12. ssh localhost

    The terminal app is limited in its rights for good reasons; to get rid of
    this you must SSH from outside (Wifi, USB) or inside the terminal app SSH to
    localhost, which all is only posible with RSA keys; generate one and use
    it to connect from the terminal to localhost as:

    generate a key pair just for use on the phone itself (without a                             
    passphrase):

    $ cd ~/.ssh
    $ ssh-keygen -t rsa -f localhost_rsa
    $ cat localhost_rsa.pub >> authorized_keys

    edit ~/.ssh/authorized_keys and add this to the start of the last line:

    from="127.0.0.1" ssh-rsa AAAA...
    
    edit or create ~/.ssh/config and add:
  
    Host localhost
      Hostname 127.0.0.1
      IdentityFile /home/phablet/.ssh/localhost_rsa

    now you can:
  
    $ ssh localhost


13. How to lauch apps from the phablet's cmd line

    There is a common app-launcher 'ubuntu-app-launch' and you may run:

    $ ubuntu-app-launch mediaplayer-app http://stream.dradio.de/7/251/142684/v1/gnl.akacast.akamaistream.net/dradio_mp3_dlf_s

    or to play files in the phone:

    $ ubuntu-app-launch mediaplayer-app file:///home/phablet/Music/VoiceMessage.wav
    $ ubuntu-app-launch mediaplayer-app file:///home/phablet/Music/mutti.mp3

    I have a small script in ~phablet/pl.sh:

    $ cat pl.sh
    ubuntu-app-launch mediaplayer-app $1

    and use just something like

    $ sh pl.sh VoiceMessage.wav


14. How to alter presented keyboard's Control keys

    I started with copying the file presenting the Control Keys:

    $ mkdir ~/.config/com.ubuntu.terminal/Layouts
    $ cp /opt/click.ubuntu.com/com.ubuntu.terminal/0.7.70/qml/KeyboardRows/Layouts/ScrollKeys.json ~/.config/com.ubuntu.terminal/Layouts/BashKeys.json

    name the target file 'BashKeys.json' and modified the main section:

    {
    "name" : "Bash Keys",
    "short_name" : "Bash",

    "buttons": [ ...

    and inserted one new key (after the 'Up' key):

        {
            "main_action" : {
                "type": "key",
                "text" : "\u21b2",
                "key" : "Enter"
            }
        },
  
    after restarting the terminal there is a new function key to select named 'Bash';

    see also:
    https://swordfishslabs.wordpress.com/2015/02/27/json-profiles-in-ubuntu-terminal-app/
    and:
    http://www.unixarea.de/bq/screenshot20151222_081224450.png
    http://www.unixarea.de/bq/BashKeys.json
    and a new file for some network related cmd short-cuts:
    http://www.unixarea.de/bq/NetworkCommands.json


15. Call history

    The history of calls and messages are stored in a MySQL database; for
    safety reasons, we make a copy of it and look into it:

    $ cp .local/share/history-service/history.sqlite ~

    $ sqlite3 history.sqlite 
    SQLite version 3.8.5 2014-06-04 14:06:34
    Enter ".help" for usage hints.

    sqlite> .schema voice_events
    CREATE TABLE voice_events (
      accountId varchar(255),
      threadId varchar(255),
      eventId varchar(255),
      senderId varchar(255),
      timestamp datetime,
      newEvent bool,
      duration int,
      missed bool,
      remoteParticipant varchar(255));
      ...

    sqlite> .schema text_events
      CREATE TABLE text_events (
      accountId varchar(255),
      threadId varchar(255),
      eventId varchar(255),
      senderId varchar(255),
      timestamp datetime,
      newEvent bool,
      message varchar(512),
      messageType tinyint,
      messageStatus tinyint,
      readTimestamp datetime,
      subject varchar(256)
      );
      ...

    sqlite> .output messages.txt
    sqlite> select * from text_events ;
    sqlite> .output calls.txt
    sqlite> select * from voice_events ;
    sqlite> .quit


    $ cat messages.txt
    ...
    ofono/ofono/account0|+49160xxxxxxx|2015-04-18T19:10:23+0200-1|+49160xxxxxxx|2015-04-18T17:10:29.000|0|amor|0|0|2015-04-18T17:11:12.160|

    $ cat calls.txt
    ...
    ofono/ofono/account0|089xxxxxxxx|089xxxxxxxx:mié. abr. 22 20:17:35 2015|self|2015-04-22T18:17:35.645|0|0|0|+4989xxxxxxxx


17. Access to logs in the device

    As root you have access to some ring buffer logs; the default size
    is 4 x 16 KBytes and you may read the ring buffer with something like

    $ sudo /system/bin/logcat -b radio

    which lists and waits for further data written to the ring; or with

    $ sudo /system/bin/logcat -db radio > /tmp/radio.log

    to copy the actual content for 'radio' away; other -b values are:
    'main', 'system', 'radio' or 'events' and there are a lot of filter flags;
    just run the command with -h to understand them;

    Side note: DTMF data is visible in the ring for around 7 minutes; be careful
    after entering PIN or other sensitive data as DTMF into phone calls;



18. How to alter presented apps in the app scope (UNTESTED)

    I have one question regarding the app scope:
    Currently, there are 6 apps listed/pinned to the top (phone, contacts, messages,
    camera, browser and clock).
    Can I add/remove/change them? Replace clock with Dekko for example?

    Actually, you can, but there is no UI to alter that list. It is just a
    dconf key, so it can be customized. To change the clock app in the list,
    one just needs to set the key with all the apps, like so:

    $ gsettings set com.canonical.Unity.ClickScope core-apps '["dialer-app", "messaging-app", "address-book-app", "com.ubuntu.camera_camera", "webbrowser-app", "dekko.dekkoproject"]'

    To restore to default, just run:

    $ gsettings reset com.canonical.Unity.ClickScope core-apps

    It should be possible to run these from the Terminal app, though I am
    not sure if the gsettings command is blocked by apparmor. If so, you can
    enable developer mode and use phablet-shell while connected over USB, to
    run these commands.


19. Developmen and SDK (completely UNTESTED until now)

    From: Alberto Mardegan <alberto.mardegan@canonical.com>:
    SDK: See this IRC logs for instructions:
    http://irclogs.ubuntu.com/2015/03/23/%23ubuntu-app-devel.txt
    Start at 14:20, then see 14:28 and 14:37. Basically you need to get
    those debs Mirv mentioned and just copy the needed files into your
    chroot (which in my machine is in
    /var/lib/schroot/chroots/click-ubuntu-sdk-14.10-armhf/).

20. Sending SMS from shell

    How to send a SMS from the shell smd line:

    $  /usr/share/ofono/scripts/send-sms /ril_0 +4915122xxxxxx "hola amor" 0
    Send message using modem /ril_0 ...
    /ril_0/message_9E43FC88AB4794131903B8CD3BF4D1254D18DBD9


xx. Other usefull commands (unsorted)

    What app is running and consuming time:

    $ ubuntu-app-usage 
    unity8-dash                                                  73963 seconds
    ubuntu-system-settings                                       27909 seconds
    dekko.dekkoproject_dekko                                     25067 seconds
    com.ubuntu.terminal_terminal                                 22741 seconds
    com.ubuntu.clock_clock                                       18282 seconds
    dialer-app                                                   8463 seconds
    webbrowser-app                                               6207 seconds
    ...

    $ system-image-cli --info
    current build number: 21
    device name: krillin
    channel: ubuntu-touch/stable/bq-aquaris.en
    alias: ubuntu-touch/ubuntu-rtm/14.09
    last update: 2015-04-17 01:26:41
    version version: 21
    version ubuntu: 20150410.1
    version device: 20150408-4f14058
    version custom: 20150409-665-29-206
    ...

    $ click list
    com.canonical.scopes.bbc-sport  1.3.1
    com.canonical.scopes.euronews   0.5
    com.popey.osm   0.7
    com.ubuntu.developer.mzanetti.tagger    0.11.0.0
    ...

    From: Alan Pope <alan.pope@canonical.com>
    see also: http://bazaar.launchpad.net/~popey/ubuntu-terminal-app/ubuntu-commands/view/head:/UbuntuCommands.json

    UNTESTED (be carfully)
    From: Jonas Drange <jonas.drange@canonical.com>
    $ /usr/share/ofono/scripts/dial-number ...
    Though, not sure if placing a call like that will spawn the Dialer App. 
    $ /usr/share/ofono/scripts/answer-calls



to be continued
Anhang herunterladen

Diese Revision wurde am 23. März 2020 10:45 von ubuntuusers erstellt.