Category Archives: raspberry pi

1.8″ TFT Adafruit display(ST7735) and Arduino uno

draft

Install Adafruit ST7735 Lib and the Adafruit_GFX library for Arduino.

I had to upgrade ino to 0.3.6 in order to be able to build the example srcipts:

pip install --upgrade ino

I renamed the example files to .ino (’cause .cpp & pde gave errors)

Make sure you name the directories as in the documentation.


root@tortuguita:/usr/share/arduino/libraries# ls -lh Adafruit_*
Adafruit_GFX:
total 36K
-rw-r--r-- 1 root root  13K Jul  5 23:51 Adafruit_GFX.cpp
-rw-r--r-- 1 root root 2.8K Jul  5 23:51 Adafruit_GFX.h
-rw-r--r-- 1 root root 8.0K Jul  5 23:51 glcdfont.c
-rw-r--r-- 1 root root 1.4K Jul  5 23:51 license.txt
-rw-r--r-- 1 root root  947 Jul  5 23:51 README.txt

Adafruit_ST7735:
total 40K
-rwxr-xr-x  1 root root  22K Nov  8 19:44 Adafruit_ST7735.cpp
-rwxr-xr-x  1 root root 4.7K Nov  8 19:44 Adafruit_ST7735.h
drwxr-xr-x 10 root root 4.0K Nov  8 19:44 examples
-rw-r--r--  1 root root 1.1K Nov  8 19:44 README.txt

Then I built it using inotool.

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

    comment savoir qui est connecté sur ma freebox + bonus

    Pour connaitre les IP et adresses mac des appareils qui sont connectés sur une Freebox, il suffit de faire

    wget 192.168.0.254/pub/fbx_info.txt

    et avec un petit coup de grep, ceux qui connaissent pourront avoir les infos précises.
    Pour savoir à qui appartiens une mac adresse, voici un lien: coffer ou pour les bricoleurs, un petit script qui fais pareil: github

    Bonus:

    Pour avoir la playlist qui marche bien avec VLC après:

    wget 192.168.0.254/freeboxtv/playlist.m3u