Skip to content

Instantly share code, notes, and snippets.

View hkskoglund's full-sized avatar
💭
Hi!

Henning Skoglund hkskoglund

💭
Hi!
View GitHub Profile
@hkskoglund
hkskoglund / checkbattery
Last active December 26, 2020 23:09
bluetooth battery service uuid 0x2A19 polling with gatttool
#!/usr/bin/bash
# prints in CSV format for import into visualization tools
hextodec ()
{
hci_test_device_batterylevel=$((16#$1))
}
if [ -z "$1" ]
@hkskoglund
hkskoglund / gist:3f9c1c57f779cfd9040a0a9d0e80e097
Created October 31, 2018 16:58
Fix DJI Mavic Air 360 panorama for upload to google photo
exiv2 -M"set Xmp.GPano.CaptureSoftware DJI" -M"set Xmp.GPano.CroppedAreaImageHeightPixels 4096" -M"set Xmp.GPano.CroppedAreaImageWidthPixels 8192" -M"set Xmp.GPano.CroppedAreaLeftPixels 0" -M"set Xmp.GPano.CroppedAreaTopPixels 0" -M"set Xmp.GPano.FullPanoHeightPixels 4096" -M"set Xmp.GPano.FullPanoWidthPixels 8192" -M"set Xmp.GPano.ProjectionType equirectangular" ~/Bilder/DJI_0178.JPG
@hkskoglund
hkskoglund / gist:a54d8181c5e6c40b64eb0d4930ab12ce
Created October 3, 2018 08:57
DJI GO Android App v4.3.2 - tcp network connections in CLOSE_WAIT state
[henning@satellite ~]$ while true; do adb shell netstat -a -e -W -t | (head -2; grep a200); adb shell ps -w -k +TIME -T -u u0_a200 -l -O STIME -O RSS -O TCNT | (head -1; grep -i http); sleep 1; done
Active Internet connections (established and servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode
tcp6 0 0 ::ffff:192.168.0.140:41329 ::ffff:120.132.176.172:http ESTABLISHED u0_a200 8577882
tcp6 32 0 ::ffff:192.168.0.140:39496 ::ffff:47.88.66.155:https CLOSE_WAIT u0_a200 8004871
tcp6 32 0 ::ffff:192.168.0.140:39492 ::ffff:47.88.66.155:https CLOSE_WAIT u0_a200 7998088
tcp6 0 1 ::ffff:192.168.0.140:44219 ::ffff:192.168.1.1:19005 SYN_SENT
@hkskoglund
hkskoglund / gist:cc8269c211806aa6207bd0e7a9f5b467
Created October 2, 2018 06:08
DJI Go Android app 4.3.2 - memory leak when analysing flight/flightlog
10-02 08:04:13.021 20843 20843 E InputEventReceiver: Exception dispatching input event.
10-02 08:04:13.026 20843 20843 D AndroidRuntime: Shutting down VM
10-02 08:04:13.037 20843 20843 E AndroidRuntime: FATAL EXCEPTION: main
10-02 08:04:13.037 20843 20843 E AndroidRuntime: Process: dji.go.v4, PID: 20843
10-02 08:04:13.037 20843 20843 E AndroidRuntime: java.lang.Error: std::bad_alloc
10-02 08:04:13.037 20843 20843 E AndroidRuntime: at com.mapbox.mapboxsdk.style.sources.GeoJsonSource.nativeSetFeatureCollection(Native Method)
10-02 08:04:13.037 20843 20843 E AndroidRuntime: at com.mapbox.mapboxsdk.style.sources.GeoJsonSource.setGeoJson(SourceFile:200)
10-02 08:04:13.037 20843 20843 E AndroidRuntime: at com.dji.mapkit.mapbox.a.b.a(Unknown Source:75)
10-02 08:04:13.037 20843 20843 E AndroidRuntime: at com.dji.mapkit.mapbox.map.c.a(Unknown Source:78)
10-02 08:04:13.037 20843 20843 E AndroidRuntime: at dji.gs.c.a.a(Unknown Source:9)
@hkskoglund
hkskoglund / gist:cb60fb454ecb27951f4e4bea339f1f83
Created September 25, 2018 07:09
DJI GO Android app v4.3.0
Testing DJILocationManager (has GPS sensor enabled all the time...)
[henning@satellite ~]$ adb -e logcat --pid=$(adb shell pidof dji.go.v4) | grep -i DJILoc
09-25 09:04:03.692 516 722 I DJILocationManager: Attempting to get last known location from AMap Service Location Provider...
09-25 09:04:03.692 516 722 I DJILocationManager: AMapServiceLocationProvider: getSourceProvider()
09-25 09:04:03.734 516 722 I DJILocationManager: Attempting to get last known location from default providers...
09-25 09:04:03.783 516 516 I DJILocationManager: Configuration requires not to use Google Play Service, so skipping that step to AMap Service Location Provider
09-25 09:04:03.783 516 516 I DJILocationManager: Attempting to get location from AMap Service Location Provider...
09-25 09:04:03.783 516 516 I DJILocationManager: AMapServiceLocationProvider: getSourceProvider()
09-25 09:04:03.911 516 516 I DJILocationManager: Configuration requires not to use Google Play Service, so skipping that step to
@hkskoglund
hkskoglund / gist:970e5612f7a98bbfb5893651292374bf
Created September 24, 2018 07:44
DJI GO v4.3.0 Android - Explicit concurrent copying GC - is it necessary?
09-24 09:39:59.085 11279 11279 I DJILocationManager: Attempting to get last known location from default providers...
09-24 09:39:59.980 11279 11422 I zygote : Explicit concurrent copying GC freed 4979(320KB) AllocSpace objects, 1(20KB) LOS objects, 50% free, 17MB/35MB, paused 1.854ms total 277.349ms
09-24 09:40:00.847 11279 11348 E getNetworkObject: network type:1
09-24 09:40:00.853 11279 11348 E SwUdpService: SwUdpConnect ...result=1
09-24 09:40:01.196 11279 11279 I DJILocationManager: Attempting to get last known location from default providers...
09-24 09:40:02.706 11279 11422 I zygote : Explicit concurrent copying GC freed 6591(655KB) AllocSpace objects, 1(20KB) LOS objects, 49% free, 17MB/35MB, paused 2.517ms total 276.893ms
09-24 09:40:02.932 11279 11348 E getNetworkObject: network type:1
09-24 09:40:02.934 11279 11348 E SwUdpService: SwUdpConnect ...result=1
09-24 09:40:03.198 11279 11279 I DJILocationManager: Attempting to get last known location from default providers...
09-24 09:40:04.945 11279 11
@hkskoglund
hkskoglund / gist:9fdcfe89b562295b92f33c5757c402da
Created September 23, 2018 06:42
DJI GO Android v4.3.0 - signed out of app resource use
I signed out of the app to see the resource utilization.
Why is SwUdpService and timer-0..4 + amapLocCoreThre running when signed out of app?
Why is two location listeners active (1m and 900ms) ?
Every 5,0s: adb shell dumpsys cpuinfo | grep -A20 dji.go satellite: Sun Sep 23 08:38:33 2018
3.9% 31624/dji.go.v4: 2.4% user + 1.4% kernel / faults: 4838 minor
@hkskoglund
hkskoglund / gist:b0e6408b8e068f4d6891d7dda27551bf
Created September 14, 2018 11:34
Moving flight record slider back and forth leads to out of memory (see RSS) -DJI GO v 4.3.0
while sleep 1; do adb shell ps -p $(adb shell pgrep dji | head -n 1) -T; done
USER PID TID PPID VSZ RSS WCHAN ADDR S CMD
u0_a200 27682 27682 763 2506844 730904 0 0 S dji.go.v4
USER PID TID PPID VSZ RSS WCHAN ADDR S CMD
u0_a200 27682 27682 763 2506844 730908 0 0 S dji.go.v4
USER PID TID PPID VSZ RSS WCHAN ADDR S CMD
u0_a200 27682 27682 763 2506844 731176 0 0 S dji.go.v4
USER PID TID PPID VSZ RSS WCHAN ADDR S CMD
u0_a200 27682 27682 763 2506844 731692 0 0 S dji.go.v4
@hkskoglund
hkskoglund / gist:5a04773b573cc28613b5d35f5e02127c
Created October 14, 2017 08:37
Disable SD recording D-link DCS-936L camera curl command
curl 'http://192.168.0.110/eng/admin/adv_record.cgi' -H 'Cookie: usePath=null' -H 'Origin: http://192.168.0.110' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: nb-NO,en-US;q=0.8,sv-SE;q=0.6,sv;q=0.4,da-DK;q=0.2,da;q=0.2,nb;q=0.2,no;q=0.2,nn;q=0.2,en;q=0.2' -H 'Upgrade-Insecure-Requests: 1' -H 'Authorization: Basic YWRtaW46' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61 Safari/537.36' -H 'Cache-Control: max-age=0' -H 'Referer: http://192.168.0.110/eng/admin/adv_record.cgi' -H 'Connection: keep-alive' -H 'DNT: 1' --data 'enable=0' --compressed -s -w "%{http_code}\n" -o /dev/null
@hkskoglund
hkskoglund / gist:af5adb82df36ecf6d1d0cd233e267bd3
Created December 20, 2017 15:27
Get root folderstring DCS-936L camera
curl --anyauth -u admin: 'http://192.168.0.110/eng/admin/adv_sdcard.cgi?folderpath=&command=video' -s -e 'http://192.168.0.110/eng/admin/adv_sdcard.cgi?folderpath=20171220&command=video&filesperpage=100' | grep folderstring | cut -d ">" -f 2 | cut -d "<" -f 1