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

      
    

    
    <lastBuildDate>Sat, 13 Dec 2014 00:00:00 +0000</lastBuildDate>
    
    <atom:link href="/blog/tags/project/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>graph.no - Weather forecast via finger</title>
      <link>/blog/posts/graph_no___weather_forecast_via_finger/</link>
      <pubDate>Sat, 13 Dec 2014 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/graph_no___weather_forecast_via_finger/</guid>
      <description>&lt;h2 id=&#34;the-idea&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#the-idea&#34;&gt;
        #
    &lt;/a&gt;
    The idea
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;http://yr.no&#34;&gt;Yr.no&lt;/a&gt; has a brilliant &lt;a href=&#34;http://www.yr.no/place/Norway/Oslo/Oslo/Oslo/hour_by_hour.html&#34;&gt;hour by hour&lt;/a&gt; view. A simple picture where you get all info you need for planning your next 48 hours.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;meteogram.png&#34; alt=&#34;Yr.no&#34;&gt;&lt;/p&gt;
&lt;p&gt;They also give out all their &lt;a href=&#34;http://om.yr.no/verdata/free-weather-data/&#34;&gt;weather data for free&lt;/a&gt;! Having a special fascination for the command line, I wondered if I could represent the same information in a basic, ASCII, 80x22 terminal.&lt;/p&gt;
&lt;h2 id=&#34;development&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#development&#34;&gt;
        #
    &lt;/a&gt;
    Development
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Earlier I&amp;rsquo;d made my first telnet service for keeping an eye on the status of the office coffee pot (&lt;a href=&#34;http://coffee.graph.no&#34;&gt;coffee.graph.no&lt;/a&gt; / telnet graph.no). After that, I pondered for a while on how to allow for choosing location via such a limited protocol. I did not want to make a service that had to be used by hand, like &lt;a href=&#34;http://www.thelinuxblog.com/quickly-checking-the-weather-with-telnet/&#34;&gt;wunderground&lt;/a&gt;, which I discovered later, but one that could be used in an automated sense.&lt;/p&gt;
&lt;p&gt;I considered running one instance at each port for a subset of the Norwegian postal codes, like 1000, 2000, 3000, etc. Or even for each hundred. I was stopped in pursuing this by two limitations in xinitd: no support for responding to several ports with one config file, and trouble of passing on which port was used to the daemon.&lt;/p&gt;
&lt;p&gt;I also tried to allow for passing an input so that one could run echo &amp;ldquo;oslo&amp;rdquo; | nc graph.no telnet. Can&amp;rsquo;t remember why that didn&amp;rsquo;t work.&lt;/p&gt;
&lt;p&gt;Then I discovered the &lt;a href=&#34;https://en.wikipedia.org/wiki/Finger_protocol&#34;&gt;finger protocol&lt;/a&gt;. Or rather how it actually worked. It&amp;rsquo;s simply telnet with one input, the user name. Perfect.&lt;/p&gt;
&lt;p&gt;The solution then became a python daemon, listening at the standard finger port, making a call to YR&amp;rsquo;s free API and caching the results. I found a &lt;a href=&#34;https://github.com/ways/pyyrlib&#34;&gt;python lib for using the API&lt;/a&gt;, so I could get right on to presenting the data.&lt;/p&gt;
&lt;p&gt;The first working code gave:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;finger1.jpg&#34; alt=&#34;Graph.no v.1&#34;&gt;&lt;/p&gt;
&lt;p&gt;After a few long nights it became more or less how it is today:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;finger2.png&#34; alt=&#34;Current graph.no&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;press&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#press&#34;&gt;
        #
    &lt;/a&gt;
    Press
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I announced it at &lt;a href=&#34;http://tillegg.yr.no/application/pyyrascii/&#34;&gt;tillegg.yr.no&lt;/a&gt; (first runner up for top rated), and at &lt;a href=&#34;http://www.reddit.com/r/linux/comments/ouday/retro_weather_forecast_finger/&#34;&gt;reddit.com/r/linux&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After that the part owner of YR, &lt;a href=&#34;http://nrk.no&#34;&gt;NRK&lt;/a&gt;, which has a blog discussing new media, the tech behind what they do, etc. called &lt;a href=&#34;http://nrkbeta.no&#34;&gt;NRK Beta&lt;/a&gt;, wrote an article about it: &lt;a href=&#34;http://nrkbeta.no/2012/04/06/old-skool-vaervarsling/&#34;&gt;Old Skool-værvarsling&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s also been used in a hackathon for littleprinter, see &lt;a href=&#34;http://twitpic.com/a298vv&#34;&gt;twitpic&lt;/a&gt; and &lt;a href=&#34;http://www.flickr.com/photos/knolleary/7473137758/in/photostream/&#34;&gt;flickr&lt;/a&gt;, and in various screenshot threads in forums.&lt;/p&gt;
&lt;h2 id=&#34;my-use&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#my-use&#34;&gt;
        #
    &lt;/a&gt;
    My use
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I mainly made it for personal use. I have it at home on a monitor above the door and on a monitor at work. There are also options for small, one-liner outputs, which I&amp;rsquo;ve used in tmux/screen status bars.&lt;/p&gt;
&lt;h2 id=&#34;improving-on-tech-from-the-seventies&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#improving-on-tech-from-the-seventies&#34;&gt;
        #
    &lt;/a&gt;
    Improving on tech from the seventies
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I can&amp;rsquo;t use unicode, colors, a larger display, as that would make it incompatible with the original goal of the project. But I&amp;rsquo;m fond of icons, so I made a client. Yes, a client for a finger weather service. It consists of some messy bash code to fetch, present and refresh the forecast using unicode and colors. You can find it in the git repo of the project, called &lt;a href=&#34;https://github.com/ways/pyyrascii/blob/master/graph.sh&#34;&gt;graph.sh&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;finger3.png&#34; alt=&#34;Client graph.sh&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;stats&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#stats&#34;&gt;
        #
    &lt;/a&gt;
    Stats
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I do get that there isn&amp;rsquo;t a big market for this. Especially when it&amp;rsquo;s so hard to use on a phone (with for example &lt;a href=&#34;https://play.google.com/store/apps/details?id=ca.lotuspond.finger&#34;&gt;Unix Finger Client&lt;/a&gt;), and there are such beautiful alternatives as i.e. &lt;a href=&#34;http://forecast.io/&#34;&gt;forecast.io&lt;/a&gt;. Oh, yes, not everyone uses terminals anymore either.&lt;/p&gt;
&lt;p&gt;Still I do seem to have gathered a few loyal followers. I even had to block a user once, for hammering the service at about every second.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s an excerpt from my logs the day before I wrote this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Date: 2014-12-12
Total hits today: 377
Unique IPs today: 11
Top 10 users with hitcount:
 230 85.89.x.x
 36 77.179.x.x
 25 176.68.x.x
 24 77.179.x.x
 21 138.246.x.x
 16 176.11.x.x
 12 217.186.x.x
  4 93.93.x.x
  4 176.11.x.x
  3 46.212.x.x

Top 10 locations:
 230 katowice,
  72 dresden,
  24 oslo,
  21 munich,
  14 karlskrona,
   4 4730,
   2 hurdal,
   2 help,
   1 trondheim,
   1 time,
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;give-it-a-try&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#give-it-a-try&#34;&gt;
        #
    &lt;/a&gt;
    Give it a try
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Now it&amp;rsquo;s time for you to try.&lt;/p&gt;
&lt;h3 id=&#34;linux&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#linux&#34;&gt;
        ##
    &lt;/a&gt;
    Linux
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;On Linux you probably have one of these installed:&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;telnet
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;netcat / nc
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;finger
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If not, it&amp;rsquo;s usually a simple &lt;code&gt;sudo apt-get install finger&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;os-x&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#os-x&#34;&gt;
        ##
    &lt;/a&gt;
    OS X
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;Look for the commands above.&lt;/p&gt;
&lt;h3 id=&#34;windows&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#windows&#34;&gt;
        ##
    &lt;/a&gt;
    Windows
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;On Windows 7 you can &lt;a href=&#34;http://social.technet.microsoft.com/wiki/contents/articles/910.windows-7-enabling-telnet-client.aspx&#34;&gt;activate telnet&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;for-all-oses&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#for-all-oses&#34;&gt;
        ##
    &lt;/a&gt;
    For all OSes
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;Try one of the following:&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;finger newyork@graph.no
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ff5c57&#34;&gt;echo&lt;/span&gt; newyork | telnet@graph.no finger
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ff5c57&#34;&gt;echo&lt;/span&gt; newyork | netcat graph.no finger
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If those won&amp;rsquo;t work, try:&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;telnet graph.no &lt;span style=&#34;color:#ff9f43&#34;&gt;79&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And then type &amp;ldquo;newyork&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Have a look at the help section for more info:&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;finger @graph.no
&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>
    
  </channel>
</rss>
