Tag Archives: raspberry pi

raspberry pi & telescope

Ingredients:

  • Raspberry Pi model 2
  • TFT touchscreen
  • Adafruit TFT/camera Soft
  • Raspberry Pi camera module
  • Celestron First Scope
  • USB tablet charger
  • Disclaimer

     This is a _really_ low cost astrophotography device implementation, simple to build and not intended to do complicated (i.e. long exposition, tracking) photography. My main inspiration to build it was my nephew ;) ) 

    What we got is:

    rpi and celestron

    And what we see is:

    IMG_0031

    IMG_0030

    IMG_0029

    IMG_0028

    IMG_0027

    IMG_0026

    IMG_0025

    IMG_0024

    IMG_0023

    IMG_0022

    IMG_0021

    IMG_0020

    IMG_0019

    IMG_0018

    IMG_0017

    source for TFT
    source for Adafruit software

    TODO
    ====

  • how to fix the USB chager to the telescope (Hint: velcro)
  • how to fix the R-Pi to the telescope (Hint: see the rubber bands in the picture?)
  • how to fix the Pi Noir to the eyepiece (Hint: look too previous methods) DONE
  • I found this article that gave me the idea.

    Adafruit’s TFT + raspberrypi + camera

    I finally managed to have a working camera + touchscreen using a raspberry pi
    All I did was assembling the hardware and some copy/paste to have a working configuration.

    Youtube video of the boot

    TODO
    ====
    put this contraption and the telescope together 😉

    unboxing the TFT
    preparing the stuff
    assembling
    bad soldering
    bad soldering
    mounting

    console on TFT

    lxde on r-pi
    lxde on r-pi

    Sources:

    to build
    to make X start as youwant to
    to make the camera work as you’d expect

    raspberrypi + lots of external USB drives

    I used two different USB hubs, one from The Pi Hut and another (sexier) one from pimoroni plugged to each of the USB ports of a rapsberry pi model B.
    I was able to plug 7 500G hard drives: 3 to the 7 port USB Hub (which also powers the Raspberry Pi) and 4 to the Pi Hub. This gave me about 3.5 Gb of storage.
    Don’t expect high speed data transfers 😉

      • software
        • blkid

    If, for instance, you reboot the raspberry, disk may “appear” in a different order at boot, sdX1 will not be the same disk it was prior to the reboot, this will fuck mess your mount points. Use blkid to get the UUID for each device (see example). Use it as root.

        • fstab

    The options defaults,user allow any user to mount the disk and gives read/write access.

      • hardware
        • Pi Hub
        • 7 port Hub
        • USB external hard drives
      • code
     blikd example:
    /dev/sda1: LABEL="My Passport" UUID="EA6854D268549F5F" TYPE="ntfs"
    /dev/sdb1: LABEL="My Passport" UUID="9C64D17064D14DA0" TYPE="ntfs"
    /dev/sdc1: UUID="788889661CDB8DC8" TYPE="ntfs"
    /dev/sdd1: LABEL="KINGSTON" UUID="423A-9647" TYPE="vfat"
    /dev/sr0: LABEL="WD SmartWare" TYPE="udf"
     fstab example:
    
    UUID=9C64D17064D14DA0 	/media/wdblack1 auto	defaults,user 	0	0
    UUID=EA6854D268549F5F	/media/wdblack2	auto	defaults,user	0	0
    UUID=788889661CDB8DC8	/media/wdred	auto	defaults,user	0	0

    Pictures:

    pi usb hub
    pi usb hub
    pi usb hub unboxing
    pi usb hub unboxing
    pi hut usb hub
    pi hut usb hub

    Temperature and humidity graph with raspberry pi

    Top posted update:
    Now it looks like this
    pre-requisites:

    • a pinch of pygal
    • 1 raspberry pi (I used model B)
    • breadboard + accessories
    • DHT22 (or equivalent)

    I just followed Adafruit’s tutorial for the wiring and the software
    Then I did a slight modification to the script provided by Adafruit to write the data to a log file (temp-hum.log) instead of google drive spreadsheet.

    Actual work
    Updated code on Github
    To generate the log file that will be parsed by pygal on github
    Adafruit’s code for the sensor forked on github

    A short python script to generate the graphic using Pygal:

    #!/usr/bin/env python
    
    import pygal
    
    temp = []
    hum  = []
    
    logdata = open('temp-hum.log','r')
    for line in logdata.readlines():
      line = line.split()[1:]
      temp.append(float(line[0]))
      hum.append(float(line[1]))
    
    print(temp)
    print(hum)
    
    line_chart = pygal.Line(width=1200)
    line_chart.title = 'Temperature Humidity'
    line_chart.add('Temperature *C', temp)
    line_chart.add('Humidity %', hum) 
    line_chart.render_to_file('temp-hum.svg')
    
    breadboard and flat cable
    breadboard and flat cable
    DHT22 and cables
    DHT22 and cables
    r-pi and all
    r-pi and all
    Adafruit_DHT
    Adafruit_DHT
    DHT22 sensor
    DHT22 sensor
    breadboard
    breadboard
    r-pi with sensor
    r-pi with sensor

    And the graphic looks like:
    this

    Sources: Adafruit DHT22 tutorial

    setting up a DNS server for my local network

    root@raspberrypi-1:/home/pi# cat  /etc/powerdns/bind/home.zone
    $ORIGIN home     ; base for unqualified names
    $TTL 1h                 ; default time-to-live
    @                       IN      SOA ns.home hostmaster.home (
                                    1; serial
                                    1d; refresh
                                    2h; retry
                                    4w; expire
                                    1h; minimum time-to-live
                            )
                            IN      NS      ns
                            IN      A       192.168.1.6
    ns                      IN      A       192.168.1.6
    raspberrypi-1           IN      A       192.168.1.6
    raspberrypi-2           IN      A       192.168.1.26
    
    root@raspberrypi-1:/home/pi# cat /etc/powerdns/bindbackend.conf 
    zone "home" {
            type master;
            file "/etc/powerdns/bind/home.zone";
            allow-update { none; };
    };
    

    Source here

    installing inotool on the Raspberry Pi

    For the basic install and configuration example, see my previous post inotool for busy people

    When installing on a R-pi, few tools will not be installed by default on Raspbian, proceed to install all of them *before* attempting to clone the git repository.


    apt-get install python-configobj python-setuptools git python-jinja2 python-serial

    Enjoy!

    raspberry pi GPIO project

    The idea is to plot temperature, light an humidity inside my house.

    2013-02-24 00.51.50

    source of inspiration

    Raspberry pi: installing lighttpd + php


    root@raspberrypi-2:/home/pi# apt-get install lighttpd php5-cgi
    [...]
    root@raspberrypi-2:/home/pi# lighty-enable-mod fastcgi-php
    Met dependency: fastcgi
    Enabling fastcgi-php: ok
    Enabling fastcgi: ok
    Run /etc/init.d/lighttpd force-reload to enable changes
    root@raspberrypi-2:/home/pi# invoke-rc.d lighttpd force-reload
    [ ok ] Reloading web server configuration: lighttpd.

    playing with geoip in the raspberry


    apt-get install php5-cli
    apt-get install php5-geoip

    get geoip datbase


    zgrep Fail /var/log/{auth*,secure*} >fail.log
    cat fail.log | sed 's/.*from\(.*\)port.*/\1/g' | sort -n | uniq > failIP.text

    php code is available here