<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tracking on falkp.no/blog</title>
    <link>/blog/tags/tracking/</link>
    <description>falkp.no/blog (Tracking)</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    
      

      
    

    
    <lastBuildDate>Fri, 25 May 2018 00:00:00 +0000</lastBuildDate>
    
    <atom:link href="/blog/tags/tracking/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Car-logger - part 3</title>
      <link>/blog/posts/car_logger_part_3/</link>
      <pubDate>Fri, 25 May 2018 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/car_logger_part_3/</guid>
      <description>&lt;h2 id=&#34;overview&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#overview&#34;&gt;
        #
    &lt;/a&gt;
    Overview
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;A self-hosted, real-time, inexpensive open source car tracker built with &lt;a href=&#34;https://www.raspberrypi.org/&#34;&gt;Raspberry Pi&lt;/a&gt; Zero W, &lt;a href=&#34;https://nextcloud.com/&#34;&gt;Nextcloud&lt;/a&gt;, and optionally &lt;a href=&#34;https://www.home-assistant.io/&#34;&gt;Home Assistant&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;plan.jpg&#34; alt=&#34;Plan&#34;&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve had a few earlier tries at car position logging, read those first if you&amp;rsquo;re interested: &lt;a href=&#34;https://0p.no/2014/09/29/car_logger2.html&#34;&gt;Car logger 2&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;background&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#background&#34;&gt;
        #
    &lt;/a&gt;
    Background
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Goal: logging and sharing location of my non-connected car, for practicality and fun.&lt;/p&gt;
&lt;p&gt;Earlier tries was using a phone, but that had problems. No Android phone will switch back on if it runs out of power without manual intervention.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#prerequisites&#34;&gt;
        #
    &lt;/a&gt;
    Prerequisites
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I needed power from the car, but want it to cut off when the ignition is off. My 12 V outlets didn&amp;rsquo;t. So I used a &lt;a href=&#34;http://www.biltema.no/no/Bil---MC/Bil-tilbehor/Bilelektrisk/Sikring/Flatsikringsholder-med-uttak-2-stk-2000035590/&#34;&gt;fuse holder with outlet&lt;/a&gt; to accomplish this. To that I attached a 12 to 5 V converter.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;fuses.jpg&#34; alt=&#34;Fuse box in car&#34;&gt;&lt;/p&gt;
&lt;p&gt;Also I chose to go without any battery or UPS, so the Pi has to deal with unclean shutdown every time. For this I run the SD card read-only using &lt;a href=&#34;https://github.com/ways/rpi-readonly&#34;&gt;rpi-readonly&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;hardware&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#hardware&#34;&gt;
        #
    &lt;/a&gt;
    Hardware
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I had little experience with Arduino at the time of start, but lots with Pi, so I used a Pi Zero. Mainly for it&amp;rsquo;s low power consumption.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;prototype01.jpg&#34; alt=&#34;Pi, usb hub, gsm modem in an old harddisk cabinet&#34;&gt;&lt;/p&gt;
&lt;p&gt;I first tried &lt;a href=&#34;https://www.amazon.com/Diymall-G-mouse-Glonass-Raspberry-Aviation/dp/B00NWEEWW8/ref=sr_1_2?ie=UTF8&amp;amp;qid=1527193287&amp;amp;sr=8-2&amp;amp;keywords=gps+dongle&amp;amp;dpID=319Yen02YIL&amp;amp;preST=_SY300_QL70_&amp;amp;dpSrc=srch&#34;&gt;Diymall-G-mouse-Glonass&lt;/a&gt; GPS dongle, but reception was very bad, so switched to &lt;a href=&#34;https://www.ebay.com/itm/BN-808-USB-GPS-Antenna-Receiver-Glonass-Dual-Module-Gmouse-For-Car-Laptop-PC-NEW/263511681859?hash=item3d5a852b43:g:vdkAAOSwbF1aRfrF&#34;&gt;BN-808-USB-GPS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For uplink I used a cheap 3G USB modem &lt;a href=&#34;http://www.dx.com/p/Tolkien-Portable-Mini-USB-3G-WiFi-Router-Mobile-Device-Hotspot-Unlocked-Wireless-Modem-Network-Doggle-with-SIMTF-Card-Slot--usb-router-only-916496537&#34;&gt;Tolkien-Portable&lt;/a&gt; and a data-twin SIM card.&lt;/p&gt;
&lt;h2 id=&#34;backend&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#backend&#34;&gt;
        #
    &lt;/a&gt;
    Backend
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I started writing a backend in 2014, &lt;a href=&#34;https://github.com/ways/BigBrotherGPSweb&#34;&gt;BigBrotherGPSweb&lt;/a&gt;, but didn&amp;rsquo;t get very far. Fortunately someone has filled my need. &lt;a href=&#34;https://nextcloud.com/&#34;&gt;Nextcloud&lt;/a&gt;, a self-hosted dropbox alternative, has a plugin called &lt;a href=&#34;https://apps.nextcloud.com/apps/phonetrack&#34;&gt;PhoneTrack&lt;/a&gt;. It has nice features like public sharing, users, filters, etc. and use Openstreetmap. SSL for transport encryption.&lt;/p&gt;
&lt;p&gt;For home automation I use Home Assistant, so I also wanted the data there as well.&lt;/p&gt;
&lt;p&gt;Map in Nextcloud/PhoneTrack:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;map.jpg&#34; alt=&#34;Map&#34;&gt;&lt;/p&gt;
&lt;p&gt;Status in Home Assistant:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;hass.png&#34; alt=&#34;Home assistant&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;software&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#software&#34;&gt;
        #
    &lt;/a&gt;
    Software
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I found no premade solution to use &lt;a href=&#34;https://en.wikipedia.org/wiki/Wi-Fi_positioning_system&#34;&gt;wifi triangulation&lt;/a&gt; in python, so I wrote &lt;a href=&#34;https://github.com/ways/wifindme&#34;&gt;wifindme&lt;/a&gt; (available from pip, python 2 and 3). It can use Mozilla, radiocells.org or, with small changes, Google. Use what has best coverage where you need it.&lt;/p&gt;
&lt;p&gt;For the actual reporting I wrote &lt;a href=&#34;https://github.com/ways/locationreporter&#34;&gt;LocationReporter&lt;/a&gt;. It can use wifi triangulation, GPS or both. It will use wifi while the GPS is warming up, and when GPS fails. The results can be sent to both my backends.&lt;/p&gt;
&lt;h2 id=&#34;build&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#build&#34;&gt;
        #
    &lt;/a&gt;
    Build
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve not yet created any kind of case. The tracker lives in a card board box in my car door.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;door.jpg&#34; alt=&#34;Car door&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;internals.jpg&#34; alt=&#34;Internals&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;problems&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#problems&#34;&gt;
        #
    &lt;/a&gt;
    Problems
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;PhoneTrack could be easier to use on a phone.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;improvements&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#improvements&#34;&gt;
        #
    &lt;/a&gt;
    Improvements
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The setup should be moved to the trunk, out of sight.&lt;/li&gt;
&lt;li&gt;I really should get a case and mount the parts properly.&lt;/li&gt;
&lt;li&gt;The Pi Zero has bluetooth, so I could fetch data from OBD and upload it. Unfortunately my cars OBD doesn&amp;rsquo;t supply very interesting info (no battery voltage, fuel consumption, fuel status).&lt;/li&gt;
&lt;li&gt;Should be enough to send data to either Nextcloud or Home Assistant, not both.&lt;/li&gt;
&lt;li&gt;A switch for private mode or you-don&amp;rsquo;t-have-to-post-every-ten-seconds mode could be nice.&lt;/li&gt;
&lt;li&gt;Radiocells.org let&amp;rsquo;s you download the data set for local use. Local wifi lookup is very fast, so this would make wifi triangulation faster, and less data used and leaked.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;conclusions&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#conclusions&#34;&gt;
        #
    &lt;/a&gt;
    Conclusions
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;m happy with the results. It&amp;rsquo;s been running for months now without problems. And it&amp;rsquo;s good sharing our position real-time on long drives.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Google knows where you are by default</title>
      <link>/blog/posts/google_knows_where_you_are_by_default/</link>
      <pubDate>Thu, 06 Nov 2014 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/google_knows_where_you_are_by_default/</guid>
      <description>&lt;p&gt;Even if you don&amp;rsquo;t use any Goolge services directly, Google will know a lot about you. For example when using the libre web browser &lt;a href=&#34;https://www.mozilla.org/en-US/firefox/desktop/&#34;&gt;Firefox&lt;/a&gt; from Mozilla. Let me quote from their site: &amp;ldquo;We&amp;rsquo;ve always designed Firefox to protect and respect your private information.&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;geoloc.png&#34; alt=&#34;Geo location example&#34;&gt;&lt;/p&gt;
&lt;p&gt;When using a location service, one get the message &amp;ldquo;Would you like to share your location with &amp;lt;website&amp;gt;?&amp;rdquo; when it should really say &amp;ldquo;Would you like to share your location with Google and &amp;lt;website&amp;gt;?&amp;rdquo;. This is stated if you &amp;ldquo;&lt;a href=&#34;https://www.mozilla.org/en-US/firefox/geolocation/&#34;&gt;Learn more&amp;hellip;&lt;/a&gt;&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;This may not supprise you, as Mozilla get &lt;a href=&#34;http://www.zdnet.com/could-mozilla-become-a-branch-of-google-7000023495/&#34;&gt;90 percent of its revenue from Google&lt;/a&gt;, and therefore use lots of Google services out of the box.&lt;/p&gt;
&lt;p&gt;Mozilla started their own &lt;a href=&#34;https://location.services.mozilla.com/&#34;&gt;location service&lt;/a&gt; over a year ago with the &lt;a href=&#34;https://wiki.mozilla.org/Services/Location&#34;&gt;goal&lt;/a&gt; to &amp;ldquo;Improve the privacy aspects of the geolocation service compared to the current market offerings.&amp;rdquo;, which is a good thing. It can be used by following this &lt;a href=&#34;https://mozilla-ichnaea.readthedocs.org/en/latest/usage.html#firefox-desktop&#34;&gt;guide&lt;/a&gt;. My results has been varying.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;notfound.png&#34; alt=&#34;MLS&#34;&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately Mozilla isn&amp;rsquo;t as open as they could be on this. They will not share their database. I recommend using OpenWLANMap instead, as they both are older than Mozilla Location Service and do share the database.&lt;/p&gt;
&lt;p&gt;By installing this &lt;a href=&#34;https://addons.mozilla.org/en-US/firefox/addon/openwlanmap-geolocation/&#34;&gt;add-on&lt;/a&gt; you can transparently use &lt;a href=&#34;http://www.openwlanmap.org/?lang=en&#34;&gt;OpenWLANMap&lt;/a&gt; in Firefox instead.&lt;/p&gt;
&lt;p&gt;You can join in collecting data for both services by using &lt;a href=&#34;https://f-droid.org/repository/browse/?fdfilter=openwlan&amp;amp;fdid=org.mozilla.mozstumbler&#34;&gt;Mozilla Stubmler app&lt;/a&gt; or &lt;a href=&#34;https://f-droid.org/repository/browse/?fdfilter=openwlan&amp;amp;fdid=com.vwp.owmap&#34;&gt;OpenWLANMap app&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not aware of any positioning for web browsers that works off-line, like one can on android using &lt;a href=&#34;https://falkp.no/blog/posts/nogapps___a_replacement_for_gapps/&#34;&gt;Nogapps&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Car-logger - part 2</title>
      <link>/blog/posts/car_logger2/</link>
      <pubDate>Mon, 29 Sep 2014 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/car_logger2/</guid>
      <description>&lt;h2 id=&#34;overview&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#overview&#34;&gt;
        #
    &lt;/a&gt;
    Overview
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Read part one of &lt;a href=&#34;http://0p.no/2014/04/22/car_logger.html#more&#34;&gt;Car-logger&lt;/a&gt; first, if you haven&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;I chose to go with outdated Android phones in the previous article. Phones with CyanogenMod and no Google Play. This means that they run all free software, except for some firmware blobs and drivers. No background services driving up data or battery usage, no third party tracking my location.&lt;/p&gt;
&lt;p&gt;I tried out &lt;a href=&#34;https://www.traccar.org&#34;&gt;Traccar&lt;/a&gt;. The app worked fine, but the backend was a big, horrible java thing. Poor UI, overkill for my purpose, and too much for me to get hacking on.&lt;/p&gt;
&lt;p&gt;After trying out a few different ones I finally found &lt;a href=&#34;http://bk.gnarf.org/creativity/bigbrothergps/&#34;&gt;BigBrotherGPS&lt;/a&gt;. It was half of what I wanted. An app that simply makes a http request with a few parameters in post-data. The backend wasn&amp;rsquo;t more than a proof-of-concept, but http requests are easy to work with and language agnostic.&lt;/p&gt;
&lt;p&gt;So I created &lt;a href=&#34;https://github.com/ways/BigBrotherGPSweb&#34;&gt;BigBrotherGPSweb&lt;/a&gt; (a better name is needed). See github for a proper description, but the basics are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Receive http/https requests.&lt;/li&gt;
&lt;li&gt;Store requests and devices in mysql.&lt;/li&gt;
&lt;li&gt;Display results in a map.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It still need some work, and I&amp;rsquo;ll be working on it until I get bored or find a new project. But it currently serves the purpose.&lt;/p&gt;
&lt;p&gt;And of course it can be used to track more than cars.&lt;/p&gt;
&lt;h2 id=&#34;edit-20140930&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#edit-20140930&#34;&gt;
        #
    &lt;/a&gt;
    Edit 20140930
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;This requires a SIM card. My operator supplies a twin SIM for NOK 20 / month, so it&amp;rsquo;s a low cost for me.&lt;/p&gt;
&lt;h2 id=&#34;pics-or-it-didnt-happen&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#pics-or-it-didnt-happen&#34;&gt;
        #
    &lt;/a&gt;
    Pics, or it didn&amp;rsquo;t happen!
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;screenshot.png&#34; alt=&#34;Map view&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
