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

      
    

    
    <lastBuildDate>Fri, 23 Nov 2018 00:00:00 +0000</lastBuildDate>
    
    <atom:link href="/blog/tags/raspberrypi/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Ninjabox</title>
      <link>/blog/posts/ninjabox/</link>
      <pubDate>Fri, 23 Nov 2018 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/ninjabox/</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;Untrickable laser alarm, with an easy-to-knock-out fusebox.&lt;/p&gt;
&lt;p&gt;A tribute to (the alarms in) &lt;a href=&#34;https://en.wikipedia.org/wiki/Mark_of_the_Ninja&#34;&gt;Mark of the Ninja&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;fusebox.jpg&#34; alt=&#34;Fusebox&#34;&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;In the game you have to sneak into buildings with high tech alarms. Some of the laser traps can be deactivated by knocking out the fuse box with a dart.&lt;/p&gt;
&lt;p&gt;So I made a laser alarm with a fusebox that can be knocked out. This is mainly to keep kids occupied, and motivated to practice throwing.&lt;/p&gt;
&lt;h2 id=&#34;features&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#features&#34;&gt;
        #
    &lt;/a&gt;
    Features
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Glowing ⚡ with simple animations and color changes (start-up, alarm, sparks)&lt;/li&gt;
&lt;li&gt;Laser triggered alarm, which can&amp;rsquo;t be fooled by using a separate laser or flash light. This is done by pulsing the laser and making sure photo resistor is relatively dark when laser is off.&lt;/li&gt;
&lt;li&gt;Motion activated &amp;ldquo;play dead&amp;rdquo; (throw somehting on the fuse box, and it will black out for 10 seconds).&lt;/li&gt;
&lt;li&gt;Play sounds for alarm, sparks, start-up&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;demo&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#demo&#34;&gt;
        #
    &lt;/a&gt;
    Demo
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;demo.jpg&#34; alt=&#34;Demo setup&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://falkp.no/blog/_static/knockout.m4v&#34;&gt;Knocking out the alarm&lt;/a&gt; (~3MB).&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://falkp.no/blog/_static/foolalarm.m4v&#34;&gt;Attempting to fool the alarm&lt;/a&gt; (~2MB).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;inside.jpg&#34; alt=&#34;Inside&#34;&gt;&lt;/p&gt;
&lt;p&gt;Not shown here: speaker and tiltsensor.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&#34;https://gitlab.com/larsfp/ninjabox&#34;&gt;gitlab&lt;/a&gt; for build instructions and code.&lt;/p&gt;
</description>
    </item>
    
    <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>Volumio based radio with NFC</title>
      <link>/blog/posts/volumio_nfc_build/</link>
      <pubDate>Tue, 19 Dec 2017 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/volumio_nfc_build/</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;&lt;a href=&#34;https://volumio.org&#34;&gt;Volumio&lt;/a&gt; based internet radio, controlled by &lt;a href=&#34;https://en.wikipedia.org/wiki/Near-field_communication&#34;&gt;NFC&lt;/a&gt;, built in an old speaker.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;speaker1.jpg&#34; alt=&#34;Complete speaker&#34;&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;Inspired by the extreemly good looking &lt;a href=&#34;http://blog.zenona.com/&#34;&gt;Spotify Box&lt;/a&gt; and QR based systems like &lt;a href=&#34;http://tilman.de/projekte/audiosphere/&#34;&gt;Audiosphere&lt;/a&gt;, I wanted to make something similar for my kids. I&amp;rsquo;ve earlier built a few radios based on small, cheap bluetooth speakers like music angel, but wanted something with better sound this time.&lt;/p&gt;
&lt;h2 id=&#34;prototype&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#prototype&#34;&gt;
        #
    &lt;/a&gt;
    Prototype
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;QR are fast and cheap, so I made a quick prototype. It turned out they are unreliable when there&amp;rsquo;s no display to give feedback on how the camera sees them. Both lighting and focus was a problem.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;qr1.jpg&#34; alt=&#34;QR reader&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;qr2.jpg&#34; alt=&#34;QR view&#34;&gt;&lt;/p&gt;
&lt;p&gt;Next up, NFC. I decided on a PN532 NFC reader, simply because I had one around. They&amp;rsquo;re about $8 / 70 NOK on ebay. It communicates via i2c, and there&amp;rsquo;s a python library for it. I decided to make it easy for myself and allow for any kind of NFC tag I could get hold of, so the plan was to read and use what ever data or ID the tags contain, and make a list to match IDs and URLs.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;nfcreader1.jpg&#34; alt=&#34;NFC reader&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;volumio&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#volumio&#34;&gt;
        #
    &lt;/a&gt;
    Volumio
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://volumio.org&#34;&gt;Volumio&lt;/a&gt; is a general music player for small devices like the &lt;a href=&#34;http://raspberrypi.org/&#34;&gt;Pi&lt;/a&gt;. Due to &lt;a href=&#34;https://www.mopidy.com/&#34;&gt;Mopidy&lt;/a&gt; it supports playing music from lots of sources. The two I&amp;rsquo;m interessted in are internet radios and Spotify, but this will work for anything Mopidy can play.&lt;/p&gt;
&lt;p&gt;Volumio also has &lt;a href=&#34;https://volumio.org/forum/volumio-plugins-collection-t6251.html&#34;&gt;plugins&lt;/a&gt; for other stuff, like mono output, being a Spotify Connect speaker and button controls connected via GPIO like I will use here.&lt;/p&gt;
&lt;h2 id=&#34;setup&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#setup&#34;&gt;
        #
    &lt;/a&gt;
    Setup
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;As mentioned in the &lt;a href=&#34;https://github.com/ways/volumio-nfc&#34;&gt;readme&lt;/a&gt;, there are a few steps to install NFC support. You have to &lt;a href=&#34;https://volumio.github.io/docs/User_Manual/SSH.html&#34;&gt;enable SSH&lt;/a&gt; first. Then install packages, check that the i2c connection to the reader is working, enable services.&lt;/p&gt;
&lt;p&gt;Reading a tag looks like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ ./readnfc.py
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Reading tag list readnfc.list
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ff9f43&#34;&gt;6&lt;/span&gt; tags in store. Ready to read.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Card data: bytearray&lt;span style=&#34;color:#ff6ac1&#34;&gt;(&lt;/span&gt;b&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#39;K\x01\x01\x00D\x00\x07\x04!T\xcao?\x81&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;)&lt;/span&gt; / 4b010100440007042154ca6f3f81
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Stoping any music currently playing
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Play audio feedback.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;webradio http://nrk-mms-live.telenorcdn.net:80/nrk_radio_alltid_nyheter_aac_h
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Play selected &lt;span style=&#34;color:#ff5c57&#34;&gt;source&lt;/span&gt; webradio http://nrk-mms-live.telenorcdn.net:80/nrk_radio_alltid_nyheter_aac_h
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then you add that tag to your list, readnfc.list, in the same directory. There are lots of examples for radios and spotify playlists in it already. Restart the service and you should be done.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://falkp.no/blog/_static/demo.m4v&#34;&gt;See demo video&lt;/a&gt; (~4MB).&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;For sound I connected a &lt;a href=&#34;https://www.ebay.com/itm/Mini-USB-2-0-3D-Virtual-480Mbps-External-7-1-Channel-Audio-Sound-Card-Adapter/162432421351?epid=11004887919&amp;amp;hash=item25d1ba0de7:g:~JQAAOSwWxNYyV1A&#34;&gt;cheap USB soundcard&lt;/a&gt; (first hit on ebay), via a &lt;a href=&#34;https://www.ebay.com/itm/Ground-Loop-Noise-Filter-Isolator-3-5mm-Cable-For-Home-Stereo-Car-Audio-GW/282776792501?hash=item41d6cf6db5:g:9fQAAOSwhsBaN1Pj&#34;&gt;ground loop filter&lt;/a&gt; to a &lt;a href=&#34;https://www.adafruit.com/product/1752&#34;&gt;Class D amplifier&lt;/a&gt;, to the terminals of the speaker.&lt;/p&gt;
&lt;p&gt;A 1k potmeter for volume, and two push-buttons for play/pause and next.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;hardware1.jpg&#34; alt=&#34;Hardware&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;hardware2.jpg&#34; alt=&#34;Hardware&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;tags&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#tags&#34;&gt;
        #
    &lt;/a&gt;
    Tags
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Any tags works, but they need to look attractive, so I created some business card sized pictures to hold them.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;tags1.jpg&#34; alt=&#34;Assorted tags&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;tags2.jpg&#34; alt=&#34;Tags&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;tags3.jpg&#34; alt=&#34;A sheet of tags&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;tags4.jpg&#34; alt=&#34;Scanning tag&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>RadiOS part 2</title>
      <link>/blog/posts/radios_part_2/</link>
      <pubDate>Wed, 17 Aug 2016 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/radios_part_2/</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;See &lt;a href=&#34;http://0p.no/2014/05/09/radios_part_1.html&#34;&gt;RadiOS part 1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So I started making a prototype to figure out if I could &amp;ldquo;sense&amp;rdquo; both selections with GPIO pins, while the designer started modeling and rendering suggestions for the physical design. The solution chosen was to first set all volume control pins to high, and check which channel control points registered as on, then reverse (control points high, check volumes).&lt;/p&gt;
&lt;h2 id=&#34;sound&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#sound&#34;&gt;
        #
    &lt;/a&gt;
    Sound
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;For sound we tore down a &lt;a href=&#34;http://musicangel.no/speakers/&#34;&gt;Music Angel&lt;/a&gt; portable speaker. It gave us two speakers, an amplifier running on 5V and a battery which we threw away. The built in soundcard gave horrible sound under certain conditions, so a cheap USB soundcard was used instead.&lt;/p&gt;
&lt;h2 id=&#34;case&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#case&#34;&gt;
        #
    &lt;/a&gt;
    Case
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;We wanted to try both a 3D-printed version and a &lt;a href=&#34;https://en.wikipedia.org/wiki/CNC_wood_router&#34;&gt;CNC&amp;rsquo;ed&lt;/a&gt; one. A print at &lt;a href=&#34;http://shapeways.com&#34;&gt;Shapeways&lt;/a&gt; would cost us ~$200, plus shiping and tax. We got one printed localy for ~$80. It&amp;rsquo;s has yet to be used. A local CNC person wanted ~$270. The case we&amp;rsquo;ve used in the final build is hand made of wood.&lt;/p&gt;
&lt;h3 id=&#34;plastic-case&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#plastic-case&#34;&gt;
        ##
    &lt;/a&gt;
    Plastic case
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;11.JPG&#34; alt=&#34;rendering back&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;12.JPG&#34; alt=&#34;rendering inside&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;13.JPG&#34; alt=&#34;rendering empty&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;14.JPG&#34; alt=&#34;rendering outside&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;plastic.png&#34; alt=&#34;actual case&#34;&gt;&lt;/p&gt;
&lt;h3 id=&#34;renderings-of-other-variations&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#renderings-of-other-variations&#34;&gt;
        ##
    &lt;/a&gt;
    Renderings of other variations
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;17.JPG&#34; alt=&#34;rendering ceramic&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;15.JPG&#34; alt=&#34;rendering standing&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;prototype&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#prototype&#34;&gt;
        #
    &lt;/a&gt;
    Prototype
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;rpi_gpio.jpg&#34; alt=&#34;GPIO connected.&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;testing.png&#34; alt=&#34;testing&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;build-1&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#build-1&#34;&gt;
        #
    &lt;/a&gt;
    Build 1
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;We chose to paint the front in black board paint, to allow easy change of channel labels and a personal touch.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;blank.png&#34; alt=&#34;blank front&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;shelf.png&#34; alt=&#34;finished model on shelf&#34;&gt;&lt;/p&gt;
&lt;p&gt;Other builds may have a white board front, or be something very different.&lt;/p&gt;
&lt;h2 id=&#34;conclution-so-far&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#conclution-so-far&#34;&gt;
        #
    &lt;/a&gt;
    Conclution so far
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s an interessting UI, and people want to touch it. However programming the channels and first time setup is hard. Also the Pi or musicbox is very slow to start streaming. This kind of breaks the fun of it.&lt;/p&gt;
&lt;p&gt;To be continued&amp;hellip;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Your own Ruter.no realtime monitor</title>
      <link>/blog/posts/your_own_ruter_no_realtime_monitor/</link>
      <pubDate>Mon, 23 May 2016 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/your_own_ruter_no_realtime_monitor/</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;By request, a quick how-to on setting up your own realtime monitor for &lt;a href=&#34;http://ruter.no&#34;&gt;ruter.no&lt;/a&gt;, Oslos public transit.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;mon.png&#34; alt=&#34;Ruter realtime example&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;as-simple-as-possible&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#as-simple-as-possible&#34;&gt;
        #
    &lt;/a&gt;
    As simple as possible
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Get an old laptop&lt;/li&gt;
&lt;li&gt;Set it to start a web browser at boot&lt;/li&gt;
&lt;li&gt;Make the browser start to i.e. &lt;a href=&#34;http://mon.ruter.no/monitor/3010314/Adamstuen/2190090&#34;&gt;http://mon.ruter.no/monitor/3010314/Adamstuen/2190090&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Done!&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;Ruter has an &lt;a href=&#34;https://ruter.no/labs/&#34;&gt;API&lt;/a&gt;, so you can go crazy and implement your own client easily, like I&amp;rsquo;ve done with &lt;a href=&#34;https://github.com/ways/rutercli&#34;&gt;rutercli&lt;/a&gt;. But there&amp;rsquo;s a much simpler solution. They&amp;rsquo;ve got a website in the same style as their public monitors, mon.ruter.no. You can start with the link above, and find the numbers and names you need from a normal ruter.no search. You&amp;rsquo;ll also find &lt;a href=&#34;http://nsb.no&#34;&gt;NSB&lt;/a&gt; stuff there. See &lt;a href=&#34;https://ruter.no/reiseplanlegger/sanntid/egen-sanntidsskjerm/&#34;&gt;ruter.no/reiseplanlegger/sanntid/egen-sanntidsskjerm&lt;/a&gt; for more info.&lt;/p&gt;
&lt;h2 id=&#34;in-a-white-wooden-frame&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#in-a-white-wooden-frame&#34;&gt;
        #
    &lt;/a&gt;
    In a white wooden frame
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Here&amp;rsquo;s a basic example in a photo frame:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;front.jpg&#34; alt=&#34;Front view&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;back.jpg&#34; alt=&#34;Back view&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;wall.jpg&#34; alt=&#34;On wall&#34;&gt;&lt;/p&gt;
&lt;p&gt;This one is run by a &lt;a href=&#34;http://www.digitalimpuls.no/PC-komponenter/Enkortsdata/Raspberry-Pi/Hovedkort/Raspberry-Pi-Modell-B-512MB-Ram-Oppdatert-versjon-av-Model-B129545-p0000087985&#34;&gt;Raspberry Pi&lt;/a&gt; model B, but any model will do. The screen is from &lt;a href=&#34;http://www.chalk-elec.com/?page_id=1280#!/10-LCD-LVDS-bundle-RaspberryPi/p/39527161/category=3094859&#34;&gt;Chalk-elec&lt;/a&gt;, but any display will do. The frame is a normal photo frame. Then there&amp;rsquo;s some glue and plastics on the back to hold it all together.&lt;/p&gt;
&lt;p&gt;To align two different transits use something like this HTML:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#78787e&#34;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;html&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;head&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;TITLE&lt;/span&gt;&amp;gt;Info Screen&amp;lt;/&lt;span style=&#34;color:#ff6ac1&#34;&gt;TITLE&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;http-equiv&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;refresh&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;6000&amp;#34;&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;charset&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;utf-8&amp;#34;&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;/&lt;span style=&#34;color:#ff6ac1&#34;&gt;HEAD&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;body&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;style&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;background-color:#2a2a2a&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;scroll&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;no&amp;#34;&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &amp;lt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;iframe&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;src&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;http://mon.ruter.no/monitor/2190090/Østerås [T-bane] (Bærum)?rows=4 &amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;align&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;left&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;width&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;100%&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;height&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;550&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;scrolling&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;no&amp;#34;&lt;/span&gt;  &lt;span style=&#34;color:#57c7ff&#34;&gt;frameborder&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;0&amp;#34;&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &amp;lt;/&lt;span style=&#34;color:#ff6ac1&#34;&gt;iframe&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &amp;lt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;iframe&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;src&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;http://mon.ruter.no/monitor/2190090/Østerås [T-bane] (Bærum)?rows=4 &amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;align&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;left&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;width&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;100%&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;height&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;550&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;scrolling&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;no&amp;#34;&lt;/span&gt;  &lt;span style=&#34;color:#57c7ff&#34;&gt;frameborder&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;0&amp;#34;&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &amp;lt;/&lt;span style=&#34;color:#ff6ac1&#34;&gt;iframe&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;/&lt;span style=&#34;color:#ff6ac1&#34;&gt;body&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;/&lt;span style=&#34;color:#ff6ac1&#34;&gt;HTML&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And to have it start automatically at boot, edit /etc/xdg/lxsession/LXDE/autostart to look like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;@xset s off
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;@xset -dpms
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;@xset s noblank
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;@unclutter
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;My crontab:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;@daily /sbin/reboot
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;@reboot sleep 10; /root/browser.sh
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And /root/browser.sh contains:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#78787e&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;killall midori
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;midori &lt;span style=&#34;color:#5af78e&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  --app&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;rutyr.html &lt;span style=&#34;color:#5af78e&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  --display&lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt;:0 &lt;span style=&#34;color:#5af78e&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  --execute Fullscreen
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Cheap DIY babycam with night vision</title>
      <link>/blog/posts/cheap_diy_babycam_with_nightvision/</link>
      <pubDate>Tue, 30 Sep 2014 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/cheap_diy_babycam_with_nightvision/</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;When I did this project in 2012 babycams cost from NOK 2000 and up, so I decided to see if I could build one using a Raspberry Pi, an IR light and a very cheap webcam.&lt;/p&gt;
&lt;p&gt;This will of course only be a level 0 night vision (active).&lt;/p&gt;
&lt;h2 id=&#34;parts&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#parts&#34;&gt;
        #
    &lt;/a&gt;
    Parts
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.dx.com/p/ir-48-led-infrared-illumination-light-for-night-vision-dc-12v-500ma-15235&#34;&gt;IR LEDs&lt;/a&gt; with a 12V PSU.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.raspberrypi.org/&#34;&gt;Raspberry Pi&lt;/a&gt; with a 5V PSU.&lt;/li&gt;
&lt;li&gt;Webcam. I don&amp;rsquo;t have a link to it, but pretty much any webcam will do.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;sku_15235_1.jpg&#34; alt=&#34;IR LED&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;Raspberry_Pi_-_Model_A.jpg&#34; alt=&#34;Raspberry Pi, from Wikipedia.org&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;hardware-setup&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#hardware-setup&#34;&gt;
        #
    &lt;/a&gt;
    Hardware setup
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I set up a test and was disappointed that the IR setup hardly gave any visible picture at all, so I threw it in the trash. Then I rememberd that all digital cameras have an IR filter to sharpen daylight pictures. To remove it I did this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Unscrew any lense or cover.&lt;/li&gt;
&lt;li&gt;Look for a small, slightly colored piece of glass covering the CMOS chip, and remove it by force.&lt;/li&gt;
&lt;li&gt;Reassemble.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now the IR seemed to light up objects several meters away. As IR light can hurt eyes, I have the light pointed towards the ceiling, so only reflected light is ever hitting people.&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;ul&gt;
&lt;li&gt;Installed raspbian.&lt;/li&gt;
&lt;li&gt;Installed motion.&lt;/li&gt;
&lt;li&gt;Webcam is now available to local network for PCs (browser, VLC) and phones (VLC, video streaming apps).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;result&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#result&#34;&gt;
        #
    &lt;/a&gt;
    Result
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;irled.png&#34; alt=&#34;IR LED&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;webcam.png&#34; alt=&#34;Webcam, stripped and attached to wall.&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;babyphone.png&#34; alt=&#34;Baby in nightvision viewed on a phone.&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>RadiOS part 1</title>
      <link>/blog/posts/radios_part_1/</link>
      <pubDate>Fri, 09 May 2014 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/radios_part_1/</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;In my opinion most radios, especially internet radios, have horrible interfaces. Small buttons, small displays, often touch, often several functions for each button.&lt;/p&gt;
&lt;p&gt;So &lt;a href=&#34;http://no.linkedin.com/pub/erik-falk-petersen/b/286/a07&#34;&gt;Erik&lt;/a&gt; and I set out to design a new, better radio for ourselves. Our main requirements were ease of use and a very physical UI. Something you&amp;rsquo;d want to touch and play with.&lt;/p&gt;
&lt;h2 id=&#34;platform&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#platform&#34;&gt;
        #
    &lt;/a&gt;
    Platform
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;The Raspberry Pi is our platform of choice at the moment, so we have some physical restrictions and long boot time.&lt;/p&gt;
&lt;h2 id=&#34;physical-designs&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#physical-designs&#34;&gt;
        #
    &lt;/a&gt;
    Physical designs
&lt;/div&gt;
&lt;/h2&gt;
&lt;h3 id=&#34;the-cone&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#the-cone&#34;&gt;
        ##
    &lt;/a&gt;
    The cone
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;cone.jpg&#34; alt=&#34;The cone radio.&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;cone2.jpg&#34; alt=&#34;The cone sketch.&#34;&gt;&lt;/p&gt;
&lt;p&gt;Our first idea was a cone that would rotate for volume and press down for on, next channel, off. A very basic look, and extreamly easy to use. What killed this was the size it would need to be to accomodate an rPi and the mechanical complexity of making the twist and click switch.&lt;/p&gt;
&lt;h3 id=&#34;brainstorming&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#brainstorming&#34;&gt;
        ##
    &lt;/a&gt;
    Brainstorming
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;brainstorm.jpg&#34; alt=&#34;Brainstorming.&#34;&gt;&lt;/p&gt;
&lt;p&gt;So we hit the whiteboard. Some of the designs from our brainstorming:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A vertical rod with the radio sliding up/down for volume.&lt;/li&gt;
&lt;li&gt;A body-like shape hanging from the wall.&lt;/li&gt;
&lt;li&gt;A horizontal rod, where you pick up the radio and hang it on the position of the channel you want.&lt;/li&gt;
&lt;li&gt;Magnets! Anything with magnets!&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;the-chosen-design&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#the-chosen-design&#34;&gt;
        ##
    &lt;/a&gt;
    The chosen design
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;Inspired by the switch boards of early phone systems, we chose to make rows of connections where you&amp;rsquo;d short two rows to make two selections at once. One row for the channels, one for the volumes.&lt;/p&gt;
&lt;p&gt;We went with magnets instead of jacks to make it look more modern and be quick to use.&lt;/p&gt;
&lt;h3 id=&#34;software&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#software&#34;&gt;
        ##
    &lt;/a&gt;
    Software
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;Netradio functionality can be solved in so many ways on the command line. From the most basic:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;cvlc url / aplay url / mplayer url&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The medium:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.musicpd.org/&#34;&gt;Music Player Daemon&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;screen0.jpg&#34; alt=&#34;A cli frontend to MPD.&#34;&gt;&lt;/p&gt;
&lt;p&gt;The advanced:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.woutervanwijk.nl/pimusicbox/&#34;&gt;Musicbox&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;browse-desktop.png&#34; alt=&#34;Musicbox. Image from woutervanwijk.nl.&#34;&gt;&lt;/p&gt;
&lt;p&gt;The latter one is a brilliant use of the rPi. In short it includes out of the box support for &lt;a href=&#34;https://www.spotify.com/&#34;&gt;Spotify&lt;/a&gt;, &lt;a href=&#34;https://music.google.com/&#34;&gt;Google Music&lt;/a&gt;, &lt;a href=&#34;http://www.last.fm/&#34;&gt;Last.fm&lt;/a&gt;, internet radio, &lt;a href=&#34;https://soundcloud.com/&#34;&gt;SoundCloud&lt;/a&gt;, local files, files from network shares. Controlled by a webUI or any existing MPD app.&lt;/p&gt;
&lt;p&gt;We chose Musicbox.&lt;/p&gt;
&lt;p&gt;To be continued&amp;hellip;&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
