Differences between revisions 2 and 50 (spanning 48 versions)
Revision 2 as of 2015-11-13 14:55:04
Size: 20045
Editor: asbesto
Comment:
Revision 50 as of 2020-01-26 16:47:43
Size: 33020
Editor: asbesto
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#acl FreaknetGroup:read,write,admin,delete,revert All:

Template di base per pagine freaknet, con acl settate in base a FreakNetGroup. -asb

h1. Milano

Per Milano abbiamo bisogno di uno SCHEDINO che mandi dei video e degli slideshow in modo automatico, che sia affidabile, si possa riavviare, sia accessibile da remoto, stia in rete e faccia anche il caffe'.

Un primo sopralluogo e' stato fatto a Milano, ed i successivi lavori dal 4 all'8 Maggio 2015, in casa Roveda etc. :)

Questo schedino e' il RASP PI, 4 core, nuovo. Puo' benissimo essere considerato il prototipo di WeBox, ottima base di partenza.

h2. Istruzioni per riproduzione video / slideshow

*I video .mp4 vanno uploadati SOLAMENTE nella directory /home/pi/video*
*Le foto DEVONO essere uploadate SOLAMENTE nella directory /home/pi/foto*

Uno script rigenerera' la lista dei video da mandare in play, leggendo la dir. /home/pi/video e creando la lista da capo ogni tot minuti / ad ogni riavvio.

Questo vuol dire che ogni video uploadato sara' aggiunto in lista agli altri.

*Se volete mandare in play UN SOLO VIDEO, allora dovete loggarvi nello schedino rasp relativo, entrare nella dir. /home/pi/video e cancellare a manina i video indesiderati.*

h2. TODO URGENTE ASBESTO, APPUNTI

*ffprobe non esiste perche' DEBIAN MERDA, SI CHIAMA avprobe. quindi dur.sh non funziona. quindi listamp4.sh non genera le liste. PORCO DIO. cambiando ffprobe in avprobe dentro dur.sh sistema tutto. da fare con ricettina di ansible per farlo su tutti i nodi.* __


h2. CARATTERISTICHE REALI (gia' realizzate)

# Sistema basato su distro Raspbian (Debian ARM per Raspberry PI) aggiornata all'ultima release.
# Tutto standard, niente repository strani o esoterici.
# Immagine disco pronto con tutto quel che serve <3GB
# Partizione di Boot in READ-ONLY ad evitare smerdamenti del FS in caso di spegnimento brutale. Pro: non si smerda il FS ed e' molto stabile. Contro: Crontab non funziona, "at" credo non funzioni nemmeno (serve ulteriore verifica)
# Rete configurata in modo SEMPLICE tramite /etc/network/interface. Non serve NIENTE ALTRO.
# Script di autoavvio bash molto semplice. Serie di script dentro /home/pi/shells/
# Rete configurabile via ETH0 o WLAN0, cavo o wifi.
# hostname configurato automaticamente come "raspamiXX" con XX = ultima parte dell'IP della scheda wlan0 (si puo fare anche con eth0)
# Schedine USB wifi gia' configurate per funzionare bene con il loro firmware gia' installato e pronto.
# Implementa un wifi scanner per capire cosa il raspberry sente attorno a se.
# Screensaver e screen blanking disabilitati
# Sistema automatico di controllo rete: se si sente "disconnesso" riavvia la rete (e non il raspberry!) ricollegandosi, facendo il controllo ogni 2 minuti.
# Accesso tramite VPN, automatico e con autocontrollo: se manca rete, quando torna, la VPN torna su senza problemi. Con mosh la connessione non cade *MAI*!
# Accesso grafico tramite VNC stile teamviewer sempre tramite VPN ;)
# Chromium installato per navigare / configurare apparati via vnc/vpn
# ansible installato e pronto all'uso
# ricette ansible per modificare automaticamente tutti i rasp in rete
# pennini wifi senza il maledetto power saving: connessione finalmente stabile! (HACK)

h2. CARATTERISTICHE DESIDERATE / IN LAVORAZIONE O STUDIO

-* underclock sistema? non necessario al momento, non serve a un cazzo-
* VPN gestita interamente dai nostri server (zaverio.com) (voyanet cmq e' affidabile ed io sono root su una macchina apposita, quindi non so quanto questo sia necessario)
* Mplayer accelerato per rasp pi: fare check su quei 2 link che sono spariti
* Test su programma in PYTHON per controllare OMXPlayer, che PARE usi addirittura OSC per fare solo POCHE cose.
* Check telecamerina del raspberry e test di streaming audio/video
## page was renamed from Museo/RaspberryMilano
## page was renamed from Museo/Webox
#acl FreaknetGroup:read,write,admin,delete,revert All:read

= Raspberry setup by Asbesto =

A solid setup for a raspberry sending videos / slideshow, can be rebooted / accessed by remote vpn, and make coffee.

This is for Rasp PI 3, quad core but there also some tricks for rasp pi 1 (drone)

pinout HERE: https://pinout.xyz/

{{attachment:nannipi.png}}

<<TableOfContents(3)>>

== WEBCAM / RTSP Video streaming from an USB camera ==

h264 need an h264 capable camera, because...

=== YUYV only cameras are a pain in the ass ===

We came, we saw... we kicked his ass!

we apply a "transcode" to convert YUYV!

As explained here: https://medium.com/@petehouston/streaming-webcam-to-http-using-vlc-dda7259176c9

{{{

 cvlc --aout=alsa --no-audio v4l2:///dev/video0 --sout '#transcode{vcodec=mjpg}:rtp{sdp=rtsp://:8554/}'

}}}

now go play it: vlc rtsp://ipaddress:8554/

More info on https://sites.google.com/view/how2raspberrypi/streaming-video-with-vlc

Notes:

{{{
 v4l2-ctl --all
}}}

gives all info about the camera, included options to be configured with v4l2-ctl -c

=== MOTION is THE NEW SHIT ===

The morons changed motion.conf syntax.

{{{

# Start in daemon (background) mode and release terminal (default: off)
daemon off

process_id_file /var/run/motion/motion.pid

# Start in Setup-Mode, daemon disabled. (default: off)
setup_mode off

# Use a file to save logs messages, if not defined stderr and syslog is used. (default: not defined)
# logfile ./log.motion

# Level of log messages [1..9] (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL). (default: 6 / NTC)
#log_level 6

# Filter to log messages by type (COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL). (default: ALL)
#log_type all

videodevice /dev/video0

# V4L2_PIX_FMT_YUYV : 15 'YUYV'
v4l2_palette 15

# The video norm to use (only for video capture and TV tuner cards)
# Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
norm 0

# Image width (pixels). Valid range: Camera dependent, default: 352
width 640

# Image height (pixels). Valid range: Camera dependent, default: 288
height 480

# Maximum number of frames to be captured per second.
# Valid range: 2-100. Default: 100 (almost no limit).
framerate 2

# Minimum time in seconds between capturing picture frames from the camera.
# Default: 0 = disabled - the capture rate is given by the camera framerate.
# This option is used when you want to capture images at a rate lower than 2 per second.
minimum_frame_time 1

############################################################
# Motion Detection Settings:
############################################################

# Threshold for number of changed pixels in an image that
# triggers motion detection (default: 1500)
threshold 331500

# Automatically tune the threshold down if possible (default: off)
threshold_tune off

# Noise threshold for the motion detection (default: 32)
noise_level 32

# Automatically tune the noise threshold (default: on)
noise_tune off

# Output 'normal' pictures when motion is detected (default: on)
# Valid values: on, off, first, best, center
# When set to 'first', only the first picture of an event is saved.
# Picture with most motion of an event is saved when set to 'best'.
# Picture with motion nearest center of picture is saved when set to 'center'.
# Can be used as preview shot for the corresponding movie.
output_pictures off

# Output pictures with only the pixels moving object (ghost images) (default: off)
output_debug_pictures off

# The quality (in percent) to be used by the jpeg compression (default: 75)
quality 75

# Type of output images
# Valid values: jpeg, ppm (default: jpeg)
picture_type jpeg

############################################################
# Snapshots (Traditional Periodic Webcam File Output)
############################################################

# Make automated snapshot every N seconds (default: 0 = disabled)
#snapshot_interval 8

############################################################
# Text Display
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second, %T = HH:MM:SS,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level, \n = new line,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event - do not use with text_event!
# You can put quotation marks around the text to allow
# leading spaces
############################################################

# Draws the timestamp using same options as C function strftime(3)
# Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
# Text is placed in lower right corner
text_right %Y-%m-%d\n%T-%q

# Draw a user defined text on the images using same options as C function strftime(3)
# Default: Not defined = no text
# Text is placed in lower left corner
text_left PETONE %t

# Draw the number of changed pixed on the images (default: off)
# Will normally be set to off except when you setup and adjust the motion settings
# Text is placed in upper right corner
text_changes off

# This option defines the value of the special event conversion specifier %C
# You can use any conversion specifier in this option except %C. Date and time
# values are from the timestamp of the first image in the current event.
# Default: %Y%m%d%H%M%S
# The idea is that %C can be used filenames and text_left/right for creating
# a unique identifier for each event.
text_event %Y%m%d%H%M%S

# Draw characters at twice normal size on images. (default: off)
text_double off

############################################################
# Target Directories and filenames For Images And Films
# For the options snapshot_, picture_, movie_ and timelapse_filename
# you can use conversion specifiers
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event
# Quotation marks round string are allowed.
############################################################

# Target base directory for pictures and films
# Recommended to use absolute path. (Default: current working directory)
target_dir /home/asbesto/public_html/

# File path for snapshots (jpeg or ppm) relative to target_dir
# Default: %v-%Y%m%d%H%M%S-snapshot
# Default value is equivalent to legacy oldlayout option
# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-snapshot
# File extension .jpg or .ppm is automatically added so do not include this.
# Note: A symbolic link called lastsnap.jpg created in the target_dir will always
# point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
# snapshot_filename snapshot

############################################################
# Live Stream Server
############################################################

# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 28081

# Quality of the jpeg (in percent) images produced (default: 50)
stream_quality 50

# Output frames at 1 fps when no motion is detected and increase to the
# rate given by stream_maxrate when motion is detected (default: off)
stream_motion off

# Maximum framerate for stream streams (default: 1)
stream_maxrate 1

# Restrict stream connections to localhost only (default: on)
stream_localhost off

# Limits the number of images per connection (default: 0 = unlimited)
# Number can be defined by multiplying actual stream rate by desired number of seconds
# Actual stream rate is the smallest of the numbers framerate and stream_maxrate
stream_limit 0

# Set the authentication method (default: 0)
# 0 = disabled
# 1 = Basic authentication
# 2 = MD5 digest (the safer authentication)
stream_auth_method 0

# Authentication for the stream. Syntax username:password
# Default: not defined (Disabled)
; stream_authentication username:password

# Percentage to scale the stream image for preview
# Default: 25
; stream_preview_scale 25

# Have stream preview image start on a new line
# Default: no
; stream_preview_newline no

# Do not sound beeps when detecting motion (default: on)
# Note: Motion never beeps when running in daemon mode.
quiet on

}}}

Here, snapshot is disabled and you will find the video stream at http://ipaddress:28081 ;)



If you want to use snapshot and html, here's "webcam.html" by Lobo made many years ago:

{{{

<HEAD>
<TITLE>= asbesto lobocam =</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="expires" CONTENT="0">
<SCRIPT language="JavaScript">
 <!--

 var klugedWidth = 640 + 150
 var klugedHeight = 480 + 150
 
var Interv = 6

function startClock2() {
 Interv = Interv - 1
 
 var now = new Date()
 var dummystr = parseInt(now.getTime() / 1000)
 delete now

 if (Interv < 0) {
  if (document.images) {
   document.refrimage.src = "snapshot.jpg" + "?" + dummystr
  } else {
   window.location.reload()
  }
  Interv = 6
 }
 document.clock.time.value = Interv
 timrID = setTimeout("startClock2()", 1000)
}

 //-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#110011" text="#CCCCCC" link="#CCCCCC" onLoad="startClock2()" vlink="#CCCCCC" alink="#CCCCCC">
<center>virus SUCHEN</center><br><br>
<div align="center">
      <img src="snapshot.jpg" name="refrimage" alt="= PETACCI webcam =">
      <FORM name="clock">
      <font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" size="2">= next update in:
      <input TYPE="text" NAME="time" SIZE="3" value="">
      s =<br>
      </font>
  </form>
</div>
</html>
}}}



== Simple webserver ==

Just install lighttpd server. It works.

In /etc/lighttpd/conf-enable you must link /etc/lighttpd/conf-available/10-userdir.conf to enable user dir pages.

If needed, add

{{{
dir-listing.activate = "enable"
}}}

into /etc/lighttpd/lighttpd.conf

== DUMP the sdcard, the correct way ==

gparted utile x resize della partizione al minimo possibile. usalo! cosi' eviti di copiare TUTTA la sdcard.

Controlla partizioni con gparted, firs sector, last sector, total sectors

total sectors dell'ultima partizione e' la dimensione del disco, in settori da 512 bytes (guarda in view - device informations)

esempio, la dimensione ultumo settore e' 3637277 blocchi da 512.

per sicurezza copiamone 3637300

per andare piu' veloci usiamo blocchi da 4K, 512*8.

quindi 3637300 / 8 sono 454662.5 blocchi

arrotondiamo in eccesso, 454663 e via

{{{
dd if=/dev/mmcblk0 of=troglos-drone-aggiornato.img bs=4k count=454663
}}}

'''FUCK THAT'''

== Rotazione del display ==

se devi ruotare il cazzo di display di 90 gradi, edita /boot/config.txt e mettici

{{{
display_rotate=1
}}}

PORCO DI DDIO


== Balestrini software ==

APPUNTI AL VOLO:

{{{

emiliano, [21.06.18 13:44]
# pip install python-uinput

# modprobe uinput

# chmod 666 /dev/uinput

Scrivi un file uinput_test.py siffatto:

import uinput
with uinput.Device([uinput.KEY_LEFTALT]) as device:
     device.emit_click(uinput.KEY_LEFTALT)

infine

# setterm -blank 1

# sleep 90 && python uinput_test.py

Dovrebbe succedere che dopo 60 secondi lo schermo si ASTUTA
e dopo altri 30 SARRIPIGGHIA

}}}


LA SCRITTA TAPE MARK 1 sta in /etc/init.d/console-setup

IL RESTO in .bashrc di utente "pi"

la pw root e' con una d. va cambiata


=== Screen blanking ===

to be connected to a movement / proximity sensor. just some notes here

Sotto X: xset dpms force off ; sleep 5 ; xset dpms force on

Console:

{{{
setterm —blank force ; sleep 1 ; setterm —blank poke
}}}

MA STA MERDA A VOLTE NON FUNZIONA PORCO MALEDETTO DIO



=== Proximity sensor ===

3 PIN, +, data, -. CHECK PINOUT!!! https://pinout.xyz/


=== LOG IN / SHUTDOWN ETC ===

Devuan default login root, pw: toor

{{{
ssh root@10.69.1.30
}}}

log in, and press YOU MUST PRESS CTRL-C WITHIN 5 SECONDS or the balestrini sw will start again creating some problems because it's still already running...

to turn the thing off:

{{{
poweroff
}}}

and wait for the led to become still RED with no activity at all.

=== HOW TO FIX IF IT DOESN'T WORK ===

Turn it off (see above), pull the sdcard out and fix the filesystem!

put the card into a pc with unix and do

fsck /dev/mmcblk0p1
fsck /dev/mmcblk0p2

and that's it!

=== Notes ===

serve libforms-dev

{{{
# maybe modprobe snd-pcm-oss to have /dev/dsp

#modprobe snd-aloop

apt-get install kbd

apt-get install console-data
}}}

note: aplay can't work together with rpitx / gpio output running

/etc/rc.local is executed at boot and activate swapfile if exist.


=== Font Configuration ===

This method involves editing a system file called “console-setup”. You just need to load it into your preferred text editor and tweak a few lines :

{{{
sudo nano /etc/default/console-setup
}}}

You will see the default setting.

Using the arrow keys position the cursor and change the FONTFACE and FONTSIZE lines to :

{{{
FONTFACE="Terminus"
FONTSIZE="16x32"
}}}

To apply these new settings to your command prompt without rebooting you can run the following command :

{{{
sudo /etc/init.d/console-setup restart
}}}


=== TAPERADIO installation: scratchpad ===

This is how to use a Raspberry PI as a RADIO TRANSMITTER, with a lot of modulations. THIS IS GREAT

{{{

root@devuan:~/tapemark# ls
bash_history lofgile.txt piam pissb rtty-output rtty_ofile slowcat tape_mark_1.py taperadio.wav tappa~
bashrc logfile.txt pifm rpitx rtty_o slo slowcat.c taperadio tappa tx.sh

}}}

{{{
#!/bin/bash
# Create file to avoid rtty_ofile error (to be fixed!)
touch rtty-output
# remove old wavefile
rm taperadio.wav tr.ft 1>/dev/null 2>/dev/null
# Begin of messages
echo "ZCZC" > taperadio
# TAPE MARK 1 generation
./tape_mark_1.py >> taperadio ;
# end of message
echo "TAPE MARK 1, NANNI BALESTRINI, 1961" >> taperadio
echo "TRASFORMATORIO 2018, QSL TAPEMARK1@YANDEX.COM" >> taperadio
echo "NNNN" >> taperadio
# creating rtty raw audio file
cat taperadio ; ./rtty_ofile 1000 1450 56 taperadio
# convert raw file in 16bit 48KHz wav needed by rpitx
echo "Converting RAW into WAV..."
sox -t raw -r 8000 -e unsigned -b 8 -c 1 rtty-output -r 48000 -b 16 -c 1 taperadio.wav
# convert wav to transmission format for rpitx
echo "Generating FM transmission format file..."
./pifm taperadio.wav tr.ft
# transmitting file on 437.000 MHz FM
echo "Transmitting on 437.000 MHz FM"
./rpitx -m RF -i tr.ft -f 436990
echo Done!
}}}

=== Automatic login for devuan raspberry (drone) ===

Note: devuan (drone) has only root account by default. so this is for root.

Edit /etc/inittab

Comment out the following line in inittab

{{{
1:2345:respawn:/sbin/getty 115200 tty1
}}}

Add the following line just below the commented line

{{{
1:2345:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1
}}}

This will run the login program with root user and without any authentication

BEWARE, THAT'S ROOT.

=== Console blanking disable (drone) ===

Consoleblank is a kernel parameter. In order to be permanently set, it needs to be defined on the kernel command line.

{{{
sudo nano /boot/cmdline.txt
}}}

Add '''consoleblank=0''' to turn screen blanking off completely, or edit it to set the number of seconds of inactivity before the console will blank. Note the kernel command line must be a single line of text.

=== note on slow boot / no network for 5 minutes (drone) ===

If there's ntpd installed and you have the wrong network gw, it will hang for 5 minutes. This block you from ssh!

So remove the gw from /etc/network/interfaces and/or remove openntpd package.

=== Force fsck at boot ===

Edit /etc/default/rcS accordingly, there's an option for that: '''FSCKFIX=yes'''

=== KBD locales etc. ===

{{{
apt-get install kbd

apt-get install console-data

loadkeys it
}}}

== Howto about video / slideshow ==

 * .mp4 files goes ONLY INTO /home/pi/video
 * Pictures goes ONLY INTO /home/pi/foto

A script generate the video list to go on play, reading that dir /home/pi/video and creating a new list every X minutes or at every reboot.

so every added video will be added to the playlist.

To play only a particular video you must remove all others.

== TODO ASBESTO, notepad ==

* ffprobe doesn't exist because DEBIAN SHIT, it was named avprobe. so dur.sh didn't worked. so listamp4.sh didn't generate any list. PORCODIO!
changing ffprobe in avprobe inside dur.sh fixed everything.

== MILANO / DRONE Features ==

 * Based on Raspbian
 * All standard repo's
 * Disk image ready with everything, <3GB
 * READ ONLY boot partition to avoid shit on the FS in case of brutal poweroff. But so, crontab doesn't work, "at" also maybe not. TO BE CHECKED
 * Simple network config in /etc/network/interface. Nothing else needed.
 * Very simple startup bash script that launch everything. Other scripts in /home/pi/shells/
 * Network config via ETH0 o WLAN0, cable o wifi.
 * Automatic hostname as "raspamiXX" where XX = last number of the wlan0 IP address (same can be done with eth0)
 * USB wifi dongles already configured with their own firmware etc.
 * Implement a wifi scanner
 * Screensaver & screen blanking disabled
 * Automatic network check: if disconnected, reboot network subsystem, checking every 2 minutes.
 * VPN access / mosh / screen
 * VNC access under VPN :)
 * Chromium installed
 * ansible and recipes to mod every rasp in the network
 * USB wifi dongles configured without the FUCKING POWERSAVING MODE.

=== IDEAS ===

 * underclock sistema? non necessario al momento, non serve a un cazzo-
 * VPN gestita interamente dai nostri server (zaverio.com) (voyanet cmq e' affidabile ed io sono root su una macchina apposita, quindi non so quanto
questo sia necessario)
 * Mplayer accelerato per rasp pi: fare check su quei 2 link che sono spariti
 * Test su programma in PYTHON per controllare OMXPlayer, che PARE usi addirittura OSC per fare solo POCHE cose.
 * Check telecamerina del raspberry e test di streaming audio/video
Line 58: Line 626:
h2. ACCESSO allo schedino

Si entra con utenza pi, pw vivabasaglia. la pw root e' la nostra solita.

Il sistema parte, e lancia /home/pi/shells/start.sh - da li parte tutto quel che serve, impostazioni e programmi.

h2. RETE sul posto

Il router e' via wireless su 10.0.0.1 ed il suo dhcp assegna indirizzi sulla classe 10.0.0.1
Per accedere al router: admin/nostrapwsolita

telecom merda ha indirizzi 192.168.1.1 router, il resto BOH.
PARE che su eth0 ci sia un dhcp che da 192.168.1.200

Noi assegnamo ai raspi 10.0.1.50 in poi, con eth0 fissa a 172.16.0.50

h2. Check automatico per rete su o giu'

Questo script controlla ogni due minuti se la rete e' su, altrimenti restarta il networking.
Viene lanciato in background con "sleep 120" perche' crontab non puo' funzionare al momento perche' il fs boot e' in Read Only (vedi sotto x dettagli).

<pre>
=== ACCESSING THE SHIT ===

USER pi, PW vivabasaglia. Root pw is "ciaras".

System boots and launch /home/pi/shells/start.sh - from there, everything starts.

=== Automagic check for network up/down ===

Every 2 minutes this piece of shit check for network and eventually put it on again.

It's in background with "sleep 120" because here NO crontab due to the RO fs.

{{{
Line 91: Line 650:
</pre>

Questo script si chiama "*netcheck*", sta in */usr/local/sbin* e viene lanciato da */etc/rc.local* cosi:

<pre>
}}}

This script is named  '''netcheck''', in '''/usr/local/sbin'''and starts from '''/etc/rc.local''':

{{{
# into
rc.local
Line 97: Line 657:
</pre>

h2. Hostname con il numero dell'ultima parte dell'indirizzo IP

L'ho fatto con uno script, "ultimo" che si trova in */usr/local/sbin/ultimo*, ed e' questo:

<pre>
}}}

=== Hostname with last IP number in it ===

The script is "ultimo" in '''/usr/local/sbin/ultimo''':

{{{
Line 111: Line 671:
</pre>

e viene lanciato dentro */etc/rc.local* con

<pre>
# cambia /etc/hostname in base all'ultimo numero dell'IP del wifi
}}}

and start from  '''/etc/rc.local''':

{{{
# change /etc/hostname adding last IP number from wifi
Line 118: Line 678:
</pre>

h2. VPN

Ci appoggiamo a infrastruttura di uno dei nostri (Voyager) in attesa di spostare su zaverio.com.

h3. Installazione VPN sui rasp

<pre>
}}}

=== VPN ===

We use Voyager's vpn :)

=== VPN install on rasp ===

{{{
Line 128: Line 688:
</pre>

poi copia il file .conf gia' pronto coi certificati, 50.conf (es. per il rasp .50)

Poi ti basta dare

<pre>
}}}

next, copy the .conf file already prepared with all certs etc. (ex. for rasp number 50 use 50.conf)

after that

{{{
Line 136: Line 696:
</pre>

oppure per automatizzare, copiare 50.conf su */etc/openvpn/client.conf* :

e lanciarlo da */etc/rc.local* inserendovi

<pre>
}}}

or copy 50.conf into '''/etc/openvpn/client.conf'''

and launch from '''/etc/rc.local'''

{{{
Line 144: Line 704:
</pre>


h3. VPN lato macchine nostre linux, portatili, etc

E' la stessa cosa solo che si usa asbesto.conf per il mio portatile e cosi' via.

h2. Installazione ed uso di VNC server/client

E' comodissimo a 'la teamviewer.

h3. Installazione VNC lato raspberry:

Vedi [[https://www.raspberrypi.org/documentation/remote-access/vnc/]]

<pre>
}}}


=== VPN on our computers ===

Same shit but using our personal certs.

== VNC server/client install and usage ==

A teamviewer-like piece of shit, very handy!

=== VNC installation on raspberry ===

Look [[https://www.raspberrypi.org/documentation/remote-access/vnc/]]

{{{
Line 161: Line 721:
</pre>

poi lancia tightvncserver per configurarlo, li' dai una pw, che servira' per accedere.

in *~/shells/start.sh* ho aggiunto

<pre>
}}}

and launch '''tightvncserver''' to configure it, here you give a password that you will need to access.

in '''~/shells/start.sh''' I added

{{{
Line 169: Line 729:
</pre>

h3. Installazione VPN lato macchine linux remote

<pre>
}}}

=== VNC installation on our computers ===

{{{
Line 175: Line 735:
</pre>

poi basta che lanci

<pre>
}}}

so just launch

{{{
Line 181: Line 741:
</pre>

metti la pw ed appare il desktop. FINE


h2. Installazione ansible, e modo d'uso

*TODO - TODO - e' stato fatto ma e' da documentare.*

h3. Ricetta ansible per configurare i vari raspberry:

Si trova in /home/pi/pi.yml

*ATTENZIONE: GLI SPAZI SONO PARTE DELLA SINTASSI, SE CAMBI L'INDENTAZIONE, NON FUNZIONA PIU UN CAZZO. IL LINGUAGGIO YAML E' UNA MERDA.*

<pre>
---
- hosts: pi
  remote_user: pi
  sudo: yes
  tasks:

  # netcheck
  #
  # files to be added
  #
  - copy: src=/usr/local/sbin/netcheck dest=/usr/local/sbin/netcheck owner=root group=staff mode=0755
  - copy: src=/usr/local/sbin/ultimo dest=/usr/local/sbin/ultimo owner=root group=root mode=0755
  - copy: src=/etc/modprobe.d/8192cu.conf dest=/etc/modprobe.d/8192cu.conf owner=root group=root mode=0644
  - copy: src=/etc/rc.altrirasp dest=/etc/rc.local owner=root group=root mode=0755

  #
  # Line to be added in /etc/rc.local
  #
  # - lineinfile: dest=/etc/rc.local state=absent regexp="exit 0"
  # - lineinfile: dest=/etc/rc.local line="nohup /usr/local/sbin/netcheck &"
  # - lineinfile: dest=/etc/rc.local line="exit 0"

  #
  # Stuff to install/remove
  #
  # - name: nmap installation
  # apt: name=nmap state=present

  - name: reboot
    command: /sbin/reboot

</pre>

*ATTENZIONE: GLI SPAZI SONO PARTE DELLA SINTASSI, SE CAMBI L'INDENTAZIONE, NON FUNZIONA PIU UN CAZZO. IL LINGUAGGIO YAML E' UNA MERDA.*

si lancia con:

<pre>
ansible-playbook --ask-pass ./pi.yml
</pre>

Se vuoi lanciarla per un singolo ip, ad es. il 10.0.1.77, dai

<pre>
ansible-playbook --ask-pass -l 10.0.1.77 ./pi.yml
</pre>

Ovviamente gli IP vanno configurati in */etc/ansible/hosts*, come segue:

<pre>
# This is the default ansible 'hosts' file.
#
# It should live in /etc/ansible/hosts
#
# - Comments begin with the '#' character
# - Blank lines are ignored
# - Groups of hosts are delimited by [header] elements
# - You can enter hostnames or ip addresses
# - A hostname/ip can be a member of multiple groups

# Ex 1: Ungrouped hosts, specify before any group headers.

[pi]
10.0.1.[51:99] ansible_ssh_user=pi
# 192.168.1.249
</pre>


h2. Impostazione del disco

Creo la schedina come fosse da 4 giga. anche se sta su una 32gb. per copiare il sistema quindi:

<pre>
}}}

put the pw and desktop appears. END OF SHIT

== Disk settings ==

I made the sdcard as a 4GB one, also if is 32gb. To copy it:

{{{
Line 271: Line 751:
</pre>

ora e' cosi:

<pre>
}}}

Now it is as follow:

{{{
Line 319: Line 799:
</pre>



h2. ACCESSI E RETE:

Ethernet: eth0, 172.16.0.50 fisso.

Login: user pi, pw vivabasaglia. sudo diventa root. pw root: la solita nostra

Wifi: wlan0 10.0.1.50 in poi, gw 10.0.0.1

h3. ATTENZIONE:

*in /etc/network/interfaces VA SETTATO UN SOLO GW, altrimenti non so perche' ma la seconda rete (wlan0) non sale!*

VEDI PIU IN BASSO

h2. Rendere la distro Raspbian compatibile arm 7 -> arm 8

<pre>
}}}

Using gparted you can resize it as you need.

== ACCESS / NETWORK ==

Ethernet: eth0, 172.16.0.50 fixed.

Login: user pi, pw vivabasaglia. sudo give root. pw root: ciaras

Wifi: wlan0 10.0.1.50 and up, gw 10.0.0.1

=== WARNING ===

'''in /etc/network/interfaces SET JUST ONE GW, OTHERWHISE 2nd network card (wlan0) won't start!'''

LOOK BELOW.

== Make our distro compatible for arm 7 -> arm 8 ==

{{{
Line 346: Line 826:
</pre>

e riavviare!

h2. Come avere lo SCHERMO NERO AL BOOT ed evitare messaggi e fragoline

Se vuoi farlo devi EDITARE */boot/cmdline.txt*

-Via il boot log: si fa mettendo come console
}}}

and reboot.

== BLACK SCREEN AT BOOT AVOIDING messages and logos ==

Edit '''/boot/cmdline.txt'''

boot log:

{{{
Line 357: Line 838:

al posto di tty1-

_NO: meglio avere dei log per capire se sta salendo o no. ho lasciato solo loglevel=3 e logo.nologo_

Via i loghini: si fa aggiungendo alla fine della riga
}}}

in
stead of tty1

''NO: better have logs to understand if it's booting or not. I left only loglevel=3 & logo.nologo''

Fuck the logo: add at the end
Line 366: Line 848:
al momento quel file e' cosi:

<pre>
{{attachment:wtf.jpg}}

Actually /boot/cmdline.txt is like that:

{{{
Line 370: Line 854:
</pre>


h2. lxde startup e quanto sono FIGLI DI PUTTANA

Sti COGLIONI di raspbian hanno cambiato LXDE in LXDE-pi dentro ~/.config/lxsession cosi' l'autostart non va piu.

*COGLIONI*
}}}


== lxde startup and HOW THEY'RE SON OF BITCHES ==

THOSE RASPBIAN BASTARDS CHANGED LXDE in LXDE-pi INTO ~/.config/lxsession so autostart didn't worked.

'''ASSHOLES'''
Line 381: Line 865:
E' da li dentro che lancio *~/shells/start.sh* ;)

h2. WIFI dongle:
It's from there that I launch  '''~/shells/start.sh''' ;)

== WIFI dongle ==
Line 387: Line 871:
Da qui scarichi lo zip e dentro c'e' il fottuto firmware.
il
.bin va copiato dentro */lib/firmware/rtlwifi*

Poi serve il
giusto drive a seconda del kernel: [[https://www.raspberrypi.org/forums/viewtopic.php?p=462982]]

Nel caso del ns kernel, Linux raspami1 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux

il firmware giusto e'
From here you download the zip file, inside is the fucking firmware.

The
.bin goes in '''/lib/firmware/rtlwifi'''

Next you need the correct dri
ver according to the kernel: [[https://www.raspberrypi.org/forums/viewtopic.php?p=462982]]

For our kernel, Linux raspami1 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux

the correct firmware is
Line 398: Line 883:
quindi da root:

<pre>
So, from root:

{{{
Line 404: Line 889:
</pre>

e riavvia
!

_Vecchi appunti:_

-wget https://dl.dropboxusercontent.com/u/80256631/8188eu-20140307.tar.gz //make sure you use the correct dropbox url for your Raspberry version
}}}

and
reboot!

== Old notes ==

{{{
wget https://dl.dropboxusercontent.com/u/80256631/8188eu-20140307.tar.gz //make sure you use the correct dropbox url for your Raspberry version
Line 417: Line 903:
-

h2. Scanner reti wifi

E' utile per capire quanto copriamo come zona, e se il raspi ci arriva.

* [[http://www.oak-wood.co.uk/oss/pifimon]] Pifimon. comodo, in perl, serve installare libterm-readkey-perl con apt-get. poi starra e lancia, funziona, fine.
* scriptino in */home/pi/shells/wifimon.sh* fatto da me al volo ;)


h2. Togliere lo SFONDO A LXDE e mettere sfondo nero.

Va tolto dal background, che poi va impostato come colore nero, lo fai da X. Poi, dalle opzioni desktop, leva l'icona trash, e cosi ora devi solo levare di mezzo il panel, killandolo.

h1. LEVARE IL PANNELLO IN BASSO

Devi killare lxpanel. Se poi ti serve, va rilanciato con lxpanel --profile LXDE-pi: lancia direttamente *~/shells/panel.sh*

h2. DISABILITA OGNI BLANK SCREEN

<pre>
}}}

== WIFI Scanner ==

 * [[http://www.oak-wood.co.uk/oss/pifimon]] Pifimon. In perl, need libterm-readkey-perl (apt-get). untar, launch, it work.
 * Script in '''/home/pi/shells/wifimon.sh''' ;)

== Get rid of LXDE background, putting a black background ==

Remove from background, and put it black. You do it from X. After that, from desktop options, remove trash icon, so now you have to just kill the panel.

== Killing the panel ==

Kill lxpanel. If you need it again, relaunch with '''lxpanel --profile LXDE-pi''' : launch directly '''~/shells/panel.sh'''

== BLANK SCREEN disabling ==

{{{
Line 441: Line 924:
</pre>

messo in *
~/shells/start.sh*


h2. Ri
solvere SSH LENTO (risolto)

_
One workaround is to edit /etc/sshd_config on the sshd server machine, not your ssh client machine to set "UseDNS" to "no". (From the way you originally wrote your question, it sounded like you may have edited that file on your client, which wouldn't make a difference.)
}}}

it's into '''
~/shells/start.sh'''


==
solve SLOW SSH ==

One workaround is to edit /etc/sshd_config on the sshd server machine, not your ssh client machine to set "UseDNS" to "no". (From the way you originally wrote your question, it sounded like you may have edited that file on your client, which wouldn't make a difference.)
Line 453: Line 936:
Sergio Corpettini come ti era gia' stato detto, sul server metti nel config di ssh UseDNS no_


h2. NASCONDERE IL CURSORE SOTTO X dopo alcuni secondi che sta fermo

<pre>
Set into ssh config: '''UseDNS no'''


== HIDE X cursor after some seconds of inactivity ==

{{{
Line 461: Line 944:
</pre>


h2. CONNESSIONE AUTOMATICA WIFI

Scheda supportata:
}}}


== Automagic wifi connection ==

Our wifi:
Line 469: Line 953:
IDEAL this DICK!!!
Line 473: Line 959:
h3. ATTENZIONE: VIA DAL CAZZO IL POWER SAVING SUI PENNINI WIFI, CHE RENDE LA CONNESSIONE INSTABILE!!!

Dando "lsmod" si vede che abbiamo il driver
=== GET RID OF POWERSAVING on wifi dongles!!! ===

With "lsmod" we see we have this driver:

{{{
Line 478: Line 965:

Devi creare il file */etc/modprobe.d/8192cu.conf* contenente:

<pre>
# Disable power saving
}}}

C
reate '''/etc/modprobe.d/8192cu.conf''' with:

{{{
# Disable power saving, FFS!
Line 484: Line 972:
</pre>

e successivamente riavviare.


h3. Configurazione di rete:


Mettere solo questo in */etc/network/interfaces*


<pre>
}}}

and reboot / reload driver.

=== Network configuration ===


Put this in '''etc/network/interfaces'''


{{{
Line 520: Line 1007:
</pre>

e cancella */etc/wpa_supplicant/wpa_supplicant.conf*


h2. SLIDESHOW

<pre>
}}}

and REMOVE '''/etc/wpa_supplicant/wpa_supplicant.conf'''


== SLIDESHOW ==

{{{
Line 530: Line 1017:
</pre>

-D delay, -F fullscreen. NON supporta le GIF

h2. Problema ipotetico documentato su web: un FLASH puo' resettare il raspberry PI 2. E non i precedenti.

Il problema e' il chip U16 che sembra fotosensibile. Dovrebbe bastare coprirlo.
}}}

-D delay, -F fullscreen. GIF not supported!

== LIGHT problem in raspberry PI 2 ==

U16 is sensible to light. Cover it!.
Line 540: Line 1027:
h2. /home separata

/home e' separata dal sistema in una partizione a parte.

h2. Sistema in READ ONLY?

BELLO sarebbe... SE FUNZIONASSE.

Solo /boot al momento si puo' mettere in read only, /tmp e' su tmpfs in ram, con dentro alcuni link di /var. Questo significa che crontab e' volatile e non resta memorizzato perche' sta su ram.

_FORSE ha senso mettere i link di crontab su /boot in modo che resti un crontab con delle cose immutabili, ma modificabili rendendo scrivibile /boot quando serve. DA PROVARE_

[[http://k3a.me/how-to-make-raspberrypi-truly-read-only-reliable-and-trouble-free/]]
[[https://www.raspberrypi.org/forums/viewtopic.php?p=213440]]
[[http://blog.pi3g.com/2014/04/make-raspbian-system-read-only/]] sembra il sistema migliore! provare

h2. USCITA HDMI sempre attiva

Va settata, altrimenti se il tv si accende dopo il rasp, automaticamente quest'ultimo switcha sul connettore video out.
== Sistema in READ ONLY? ==

NICE TO DO.

Only /boot for now is read only, /tmp is in tmpfs ramdisk, with some /var links. So crontab is volatile.

MAYBE we can put crontab symlinks on /boot so we can have a fixed crontab to be modified into /boot.

 * [[http://k3a.me/how-to-make-raspberrypi-truly-read-only-reliable-and-trouble-free/]]
 * [[https://www.raspberrypi.org/forums/viewtopic.php?p=213440]]
 * [[http://blog.pi3g.com/2014/04/make-raspbian-system-read-only/]] sembra il sistema migliore! provare

== HDMI port always ON ==

WE NEED THIS Because if we don't have hdmi active, the raspberry switches itself on the crappy video out connector.
Line 562: Line 1045:
<pre> {{{
Line 565: Line 1048:
</pre>


h2. DUPLICAZIONE DELLE SCHEDINE

L'immagine e' milano2.img

* Metti la schedina
* sudo dd if=milano2.img of=/dev/sdb bs=4096
* togli e rimetti la schedina
* sudo gparted /dev/sdb
* espandi la partizione /home al massimo
* esci da gparted
* sudo joe /mountpoint/schedina/etc/network/interfaces e cambia l'ip della WLAN, NON TOCCARE eth0 ne' nient'altro.
* sync, umount

h1. LINK VARI

[[http://www.element14.com/community/thread/40489/l/new-raspberry-pi-b-wont-boot?displayFullThread=true]]

[[http://thepihut.com/blogs/raspberry-pi-tutorials/16982376-upd4t1ng-raspbian-on-your-microsd-for-the-raspberry-pi-2]] porcodio

[[http://raspberrypi.stackexchange.com/questions/7978/how-can-i-prevent-my-pis-sd-card-from-getting-corrupted-so-often]]

[[https://github.com/raspberrypi/firmware/issues/397]]
}}}

== Installazione ansible: UFFICIO COMPLICAZIONE AFFARI SEMPLICI ==

*TODO - TODO - e' stato fatto ma e' da documentare.*

E CMQ FANCULO ANSIBLE PORCODIO

=== Ansible recipe to configure all raspberry, L'inutilita' totale ===

that's is /home/pi/pi.yml

'''WARNING, SPACES ARE PART OF THE SYNTAX. IF YOU MOVE THEM, NOTHING WILL WORK. YAML IS A FUCKING PIECE OF SHIT.'''

{{{
---
- hosts: pi
  remote_user: pi
  sudo: yes
  tasks:

  # netcheck
  #
  # files to be added
  #
  - copy: src=/usr/local/sbin/netcheck dest=/usr/local/sbin/netcheck owner=root group=staff mode=0755
  - copy: src=/usr/local/sbin/ultimo dest=/usr/local/sbin/ultimo owner=root group=root mode=0755
  - copy: src=/etc/modprobe.d/8192cu.conf dest=/etc/modprobe.d/8192cu.conf owner=root group=root mode=0644
  - copy: src=/etc/rc.altrirasp dest=/etc/rc.local owner=root group=root mode=0755

  #
  # Line to be added in /etc/rc.local
  #
  # - lineinfile: dest=/etc/rc.local state=absent regexp="exit 0"
  # - lineinfile: dest=/etc/rc.local line="nohup /usr/local/sbin/netcheck &"
  # - lineinfile: dest=/etc/rc.local line="exit 0"

  #
  # Stuff to install/remove
  #
  # - name: nmap installation
  # apt: name=nmap state=present

  - name: reboot
    command: /sbin/reboot

}}}

'''WARNING, SPACES ARE PART OF THE SYNTAX. IF YOU MOVE THEM, NOTHING WILL WORK. YAML IS A FUCKING PIECE OF SHIT.'''

LAUNCH with:

{{{
ansible-playbook --ask-pass ./pi.yml
}}}

For a single ip, ex. il 10.0.1.77, use

{{{
ansible-playbook --ask-pass -l 10.0.1.77 ./pi.yml
}}}

IP must be configured into '''/etc/ansible/hosts''', as follow:

{{{
# This is the default ansible 'hosts' file.
#
# It should live in /etc/ansible/hosts
#
# - Comments begin with the '#' character
# - Blank lines are ignored
# - Groups of hosts are delimited by [header] elements
# - You can enter hostnames or ip addresses
# - A hostname/ip can be a member of multiple groups

# Ex 1: Ungrouped hosts, specify before any group headers.

[pi]
10.0.1.[51:99] ansible_ssh_user=pi
# 192.168.1.249
}}}



== Some links ==

 * [[http://www.element14.com/community/thread/40489/l/new-raspberry-pi-b-wont-boot?displayFullThread=true]]
 * [[http://thepihut.com/blogs/raspberry-pi-tutorials/16982376-upd4t1ng-raspbian-on-your-microsd-for-the-raspberry-pi-2]] porcodio
 * [[http://raspberrypi.stackexchange.com/questions/7978/how-can-i-prevent-my-pis-sd-card-from-getting-corrupted-so-often]]
 * [[https://github.com/raspberrypi/firmware/issues/397]]
Line 592: Line 1141:


----
CategoryMuseo

Raspberry setup by Asbesto

A solid setup for a raspberry sending videos / slideshow, can be rebooted / accessed by remote vpn, and make coffee.

This is for Rasp PI 3, quad core but there also some tricks for rasp pi 1 (drone)

pinout HERE: https://pinout.xyz/

nannipi.png

Contents

  1. Raspberry setup by Asbesto
    1. WEBCAM / RTSP Video streaming from an USB camera
      1. YUYV only cameras are a pain in the ass
      2. MOTION is THE NEW SHIT
    2. Simple webserver
    3. DUMP the sdcard, the correct way
    4. Rotazione del display
    5. Balestrini software
      1. Screen blanking
      2. Proximity sensor
      3. LOG IN / SHUTDOWN ETC
      4. HOW TO FIX IF IT DOESN'T WORK
      5. Notes
      6. Font Configuration
      7. TAPERADIO installation: scratchpad
      8. Automatic login for devuan raspberry (drone)
      9. Console blanking disable (drone)
      10. note on slow boot / no network for 5 minutes (drone)
      11. Force fsck at boot
      12. KBD locales etc.
    6. Howto about video / slideshow
    7. TODO ASBESTO, notepad
    8. MILANO / DRONE Features
      1. IDEAS
      2. ACCESSING THE SHIT
      3. Automagic check for network up/down
      4. Hostname with last IP number in it
      5. VPN
      6. VPN install on rasp
      7. VPN on our computers
    9. VNC server/client install and usage
      1. VNC installation on raspberry
      2. VNC installation on our computers
    10. Disk settings
    11. ACCESS / NETWORK
      1. WARNING
    12. Make our distro compatible for arm 7 -> arm 8
    13. BLACK SCREEN AT BOOT AVOIDING messages and logos
    14. lxde startup and HOW THEY'RE SON OF BITCHES
    15. WIFI dongle
    16. Old notes
    17. WIFI Scanner
    18. Get rid of LXDE background, putting a black background
    19. Killing the panel
    20. BLANK SCREEN disabling
    21. solve SLOW SSH
    22. HIDE X cursor after some seconds of inactivity
    23. Automagic wifi connection
      1. GET RID OF POWERSAVING on wifi dongles!!!
      2. Network configuration
    24. SLIDESHOW
    25. LIGHT problem in raspberry PI 2
    26. Sistema in READ ONLY?
    27. HDMI port always ON
    28. Installazione ansible: UFFICIO COMPLICAZIONE AFFARI SEMPLICI
      1. Ansible recipe to configure all raspberry, L'inutilita' totale
    29. Some links

WEBCAM / RTSP Video streaming from an USB camera

h264 need an h264 capable camera, because...

YUYV only cameras are a pain in the ass

We came, we saw... we kicked his ass!

we apply a "transcode" to convert YUYV!

As explained here: https://medium.com/@petehouston/streaming-webcam-to-http-using-vlc-dda7259176c9

 cvlc --aout=alsa --no-audio v4l2:///dev/video0 --sout '#transcode{vcodec=mjpg}:rtp{sdp=rtsp://:8554/}'

now go play it: vlc rtsp://ipaddress:8554/

More info on https://sites.google.com/view/how2raspberrypi/streaming-video-with-vlc

Notes:

 v4l2-ctl  --all

gives all info about the camera, included options to be configured with v4l2-ctl -c

MOTION is THE NEW SHIT

The morons changed motion.conf syntax.

# Start in daemon (background) mode and release terminal (default: off)
daemon off

process_id_file /var/run/motion/motion.pid

# Start in Setup-Mode, daemon disabled. (default: off)
setup_mode off

# Use a file to save logs messages, if not defined stderr and syslog is used. (default: not defined)
# logfile ./log.motion

# Level of log messages [1..9] (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL). (default: 6 / NTC)
#log_level 6

# Filter to log messages by type (COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL). (default: ALL)
#log_type all

videodevice /dev/video0

# V4L2_PIX_FMT_YUYV    : 15 'YUYV'
v4l2_palette 15

# The video norm to use (only for video capture and TV tuner cards)
# Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
norm 0

# Image width (pixels). Valid range: Camera dependent, default: 352
width 640

# Image height (pixels). Valid range: Camera dependent, default: 288
height 480

# Maximum number of frames to be captured per second.
# Valid range: 2-100. Default: 100 (almost no limit).
framerate 2

# Minimum time in seconds between capturing picture frames from the camera.
# Default: 0 = disabled - the capture rate is given by the camera framerate.
# This option is used when you want to capture images at a rate lower than 2 per second.
minimum_frame_time 1

############################################################
# Motion Detection Settings:
############################################################

# Threshold for number of changed pixels in an image that
# triggers motion detection (default: 1500)
threshold 331500

# Automatically tune the threshold down if possible (default: off)
threshold_tune off

# Noise threshold for the motion detection (default: 32)
noise_level 32

# Automatically tune the noise threshold (default: on)
noise_tune off

# Output 'normal' pictures when motion is detected (default: on)
# Valid values: on, off, first, best, center
# When set to 'first', only the first picture of an event is saved.
# Picture with most motion of an event is saved when set to 'best'.
# Picture with motion nearest center of picture is saved when set to 'center'.
# Can be used as preview shot for the corresponding movie.
output_pictures off

# Output pictures with only the pixels moving object (ghost images) (default: off)
output_debug_pictures off

# The quality (in percent) to be used by the jpeg compression (default: 75)
quality 75

# Type of output images
# Valid values: jpeg, ppm (default: jpeg)
picture_type jpeg

############################################################
# Snapshots (Traditional Periodic Webcam File Output)
############################################################

# Make automated snapshot every N seconds (default: 0 = disabled)
#snapshot_interval 8

############################################################
# Text Display
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second, %T = HH:MM:SS,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level, \n = new line,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event - do not use with text_event!
# You can put quotation marks around the text to allow
# leading spaces
############################################################

# Draws the timestamp using same options as C function strftime(3)
# Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
# Text is placed in lower right corner
text_right %Y-%m-%d\n%T-%q

# Draw a user defined text on the images using same options as C function strftime(3)
# Default: Not defined = no text
# Text is placed in lower left corner
text_left PETONE %t

# Draw the number of changed pixed on the images (default: off)
# Will normally be set to off except when you setup and adjust the motion settings
# Text is placed in upper right corner
text_changes off

# This option defines the value of the special event conversion specifier %C
# You can use any conversion specifier in this option except %C. Date and time
# values are from the timestamp of the first image in the current event.
# Default: %Y%m%d%H%M%S
# The idea is that %C can be used filenames and text_left/right for creating
# a unique identifier for each event.
text_event %Y%m%d%H%M%S

# Draw characters at twice normal size on images. (default: off)
text_double off

############################################################
# Target Directories and filenames For Images And Films
# For the options snapshot_, picture_, movie_ and timelapse_filename
# you can use conversion specifiers
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event
# Quotation marks round string are allowed.
############################################################

# Target base directory for pictures and films
# Recommended to use absolute path. (Default: current working directory)
target_dir /home/asbesto/public_html/

# File path for snapshots (jpeg or ppm) relative to target_dir
# Default: %v-%Y%m%d%H%M%S-snapshot
# Default value is equivalent to legacy oldlayout option
# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-snapshot
# File extension .jpg or .ppm is automatically added so do not include this.
# Note: A symbolic link called lastsnap.jpg created in the target_dir will always
# point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
# snapshot_filename snapshot

############################################################
# Live Stream Server
############################################################

# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 28081

# Quality of the jpeg (in percent) images produced (default: 50)
stream_quality 50

# Output frames at 1 fps when no motion is detected and increase to the
# rate given by stream_maxrate when motion is detected (default: off)
stream_motion off

# Maximum framerate for stream streams (default: 1)
stream_maxrate 1

# Restrict stream connections to localhost only (default: on)
stream_localhost off

# Limits the number of images per connection (default: 0 = unlimited)
# Number can be defined by multiplying actual stream rate by desired number of seconds
# Actual stream rate is the smallest of the numbers framerate and stream_maxrate
stream_limit 0

# Set the authentication method (default: 0)
# 0 = disabled
# 1 = Basic authentication
# 2 = MD5 digest (the safer authentication)
stream_auth_method 0

# Authentication for the stream. Syntax username:password
# Default: not defined (Disabled)
; stream_authentication username:password

# Percentage to scale the stream image for preview
# Default: 25
; stream_preview_scale 25

# Have stream preview image start on a new line
# Default: no
; stream_preview_newline no

# Do not sound beeps when detecting motion (default: on)
# Note: Motion never beeps when running in daemon mode.
quiet on

Here, snapshot is disabled and you will find the video stream at http://ipaddress:28081 ;)

If you want to use snapshot and html, here's "webcam.html" by Lobo made many years ago:

<HEAD>
<TITLE>=  asbesto lobocam  =</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="expires" CONTENT="0">
<SCRIPT language="JavaScript">
        <!--

        var klugedWidth = 640 + 150
        var klugedHeight = 480 + 150
        
var Interv = 6

function startClock2() {
        Interv = Interv - 1
        
        var now = new Date()
        var dummystr = parseInt(now.getTime() / 1000)
        delete now

        if (Interv < 0) {
                if (document.images) {
                        document.refrimage.src = "snapshot.jpg" + "?" + dummystr
                } else {
                        window.location.reload()
                }
                Interv = 6
        }
        document.clock.time.value = Interv
        timrID = setTimeout("startClock2()", 1000)
}

        //-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#110011" text="#CCCCCC" link="#CCCCCC" onLoad="startClock2()" vlink="#CCCCCC" alink="#CCCCCC">
<center>virus SUCHEN</center><br><br>
<div align="center"> 
      <img src="snapshot.jpg" name="refrimage" alt="= PETACCI webcam =">
      <FORM name="clock">
      <font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" size="2">=    next update in: 
      <input TYPE="text" NAME="time" SIZE="3" value="">
      s    =<br>
      </font>
  </form>
</div>
</html>

Simple webserver

Just install lighttpd server. It works.

In /etc/lighttpd/conf-enable you must link /etc/lighttpd/conf-available/10-userdir.conf to enable user dir pages.

If needed, add

dir-listing.activate = "enable" 

into /etc/lighttpd/lighttpd.conf

DUMP the sdcard, the correct way

gparted utile x resize della partizione al minimo possibile. usalo! cosi' eviti di copiare TUTTA la sdcard.

Controlla partizioni con gparted, firs sector, last sector, total sectors

total sectors dell'ultima partizione e' la dimensione del disco, in settori da 512 bytes (guarda in view - device informations)

esempio, la dimensione ultumo settore e' 3637277 blocchi da 512.

per sicurezza copiamone 3637300

per andare piu' veloci usiamo blocchi da 4K, 512*8.

quindi 3637300 / 8 sono 454662.5 blocchi

arrotondiamo in eccesso, 454663 e via

dd if=/dev/mmcblk0 of=troglos-drone-aggiornato.img bs=4k count=454663

FUCK THAT

Rotazione del display

se devi ruotare il cazzo di display di 90 gradi, edita /boot/config.txt e mettici

display_rotate=1

PORCO DI DDIO

Balestrini software

APPUNTI AL VOLO:

emiliano, [21.06.18 13:44]
# pip install python-uinput

# modprobe uinput

# chmod 666 /dev/uinput

Scrivi un file uinput_test.py siffatto:

import uinput
with uinput.Device([uinput.KEY_LEFTALT]) as device: 
     device.emit_click(uinput.KEY_LEFTALT)

infine

# setterm -blank 1

# sleep 90 && python uinput_test.py

Dovrebbe succedere che dopo 60 secondi lo schermo si ASTUTA
e dopo altri 30 SARRIPIGGHIA

LA SCRITTA TAPE MARK 1 sta in /etc/init.d/console-setup

IL RESTO in .bashrc di utente "pi"

la pw root e' con una d. va cambiata

Screen blanking

to be connected to a movement / proximity sensor. just some notes here

Sotto X: xset dpms force off ; sleep 5 ; xset dpms force on

Console:

setterm —blank force ; sleep 1 ; setterm —blank poke

MA STA MERDA A VOLTE NON FUNZIONA PORCO MALEDETTO DIO

Proximity sensor

3 PIN, +, data, -. CHECK PINOUT!!! https://pinout.xyz/

LOG IN / SHUTDOWN ETC

Devuan default login root, pw: toor

ssh root@10.69.1.30 

log in, and press YOU MUST PRESS CTRL-C WITHIN 5 SECONDS or the balestrini sw will start again creating some problems because it's still already running...

to turn the thing off:

poweroff

and wait for the led to become still RED with no activity at all.

HOW TO FIX IF IT DOESN'T WORK

Turn it off (see above), pull the sdcard out and fix the filesystem!

put the card into a pc with unix and do

fsck /dev/mmcblk0p1 fsck /dev/mmcblk0p2

and that's it!

Notes

serve libforms-dev

# maybe modprobe snd-pcm-oss to have /dev/dsp

#modprobe snd-aloop

apt-get install kbd

apt-get install console-data

note: aplay can't work together with rpitx / gpio output running

/etc/rc.local is executed at boot and activate swapfile if exist.

Font Configuration

This method involves editing a system file called “console-setup”. You just need to load it into your preferred text editor and tweak a few lines :

sudo nano /etc/default/console-setup

You will see the default setting.

Using the arrow keys position the cursor and change the FONTFACE and FONTSIZE lines to :

FONTFACE="Terminus"
FONTSIZE="16x32"

To apply these new settings to your command prompt without rebooting you can run the following command :

sudo /etc/init.d/console-setup restart

TAPERADIO installation: scratchpad

This is how to use a Raspberry PI as a RADIO TRANSMITTER, with a lot of modulations. THIS IS GREAT

root@devuan:~/tapemark# ls
bash_history  lofgile.txt  piam  pissb  rtty-output  rtty_ofile  slowcat    tape_mark_1.py  taperadio.wav  tappa~
bashrc        logfile.txt  pifm  rpitx  rtty_o       slo         slowcat.c  taperadio       tappa          tx.sh

# Create file to avoid rtty_ofile error (to be fixed!)
touch rtty-output
# remove old wavefile
rm taperadio.wav tr.ft 1>/dev/null 2>/dev/null
# Begin of messages
echo "ZCZC" > taperadio
# TAPE MARK 1 generation
./tape_mark_1.py >> taperadio ;
# end of message
echo "TAPE MARK 1, NANNI BALESTRINI, 1961" >> taperadio
echo "TRASFORMATORIO 2018, QSL TAPEMARK1@YANDEX.COM" >> taperadio
echo "NNNN" >> taperadio
# creating rtty raw audio file
cat taperadio ; ./rtty_ofile 1000 1450 56 taperadio
# convert raw file in 16bit 48KHz wav needed by rpitx
echo "Converting RAW into WAV..."
sox -t raw -r 8000 -e unsigned -b 8 -c 1 rtty-output -r 48000 -b 16 -c 1 taperadio.wav
# convert wav to transmission format for rpitx
echo "Generating FM transmission format file..."
./pifm taperadio.wav tr.ft
# transmitting file on 437.000 MHz FM
echo "Transmitting on 437.000 MHz FM"
./rpitx -m RF -i tr.ft -f 436990
echo Done!

Automatic login for devuan raspberry (drone)

Note: devuan (drone) has only root account by default. so this is for root.

Edit /etc/inittab

Comment out the following line in inittab

1:2345:respawn:/sbin/getty 115200 tty1

Add the following line just below the commented line

1:2345:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1

This will run the login program with root user and without any authentication

BEWARE, THAT'S ROOT.

Console blanking disable (drone)

Consoleblank is a kernel parameter. In order to be permanently set, it needs to be defined on the kernel command line.

sudo nano /boot/cmdline.txt

Add consoleblank=0 to turn screen blanking off completely, or edit it to set the number of seconds of inactivity before the console will blank. Note the kernel command line must be a single line of text.

note on slow boot / no network for 5 minutes (drone)

If there's ntpd installed and you have the wrong network gw, it will hang for 5 minutes. This block you from ssh!

So remove the gw from /etc/network/interfaces and/or remove openntpd package.

Force fsck at boot

Edit /etc/default/rcS accordingly, there's an option for that: FSCKFIX=yes

KBD locales etc.

apt-get install kbd

apt-get install console-data

loadkeys it

Howto about video / slideshow

  • .mp4 files goes ONLY INTO /home/pi/video
  • Pictures goes ONLY INTO /home/pi/foto

A script generate the video list to go on play, reading that dir /home/pi/video and creating a new list every X minutes or at every reboot.

so every added video will be added to the playlist.

To play only a particular video you must remove all others.

TODO ASBESTO, notepad

* ffprobe doesn't exist because DEBIAN SHIT, it was named avprobe. so dur.sh didn't worked. so listamp4.sh didn't generate any list. PORCODIO! changing ffprobe in avprobe inside dur.sh fixed everything.

MILANO / DRONE Features

  • Based on Raspbian
  • All standard repo's
  • Disk image ready with everything, <3GB

  • READ ONLY boot partition to avoid shit on the FS in case of brutal poweroff. But so, crontab doesn't work, "at" also maybe not. TO BE CHECKED
  • Simple network config in /etc/network/interface. Nothing else needed.
  • Very simple startup bash script that launch everything. Other scripts in /home/pi/shells/
  • Network config via ETH0 o WLAN0, cable o wifi.
  • Automatic hostname as "raspamiXX" where XX = last number of the wlan0 IP address (same can be done with eth0)
  • USB wifi dongles already configured with their own firmware etc.
  • Implement a wifi scanner
  • Screensaver & screen blanking disabled

  • Automatic network check: if disconnected, reboot network subsystem, checking every 2 minutes.
  • VPN access / mosh / screen
  • VNC access under VPN :)

  • Chromium installed
  • ansible and recipes to mod every rasp in the network
  • USB wifi dongles configured without the FUCKING POWERSAVING MODE.

IDEAS

  • underclock sistema? non necessario al momento, non serve a un cazzo-
  • VPN gestita interamente dai nostri server (zaverio.com) (voyanet cmq e' affidabile ed io sono root su una macchina apposita, quindi non so quanto

questo sia necessario)

  • Mplayer accelerato per rasp pi: fare check su quei 2 link che sono spariti
  • Test su programma in PYTHON per controllare OMXPlayer, che PARE usi addirittura OSC per fare solo POCHE cose.
  • Check telecamerina del raspberry e test di streaming audio/video

ACCESSING THE SHIT

USER pi, PW vivabasaglia. Root pw is "ciaras".

System boots and launch /home/pi/shells/start.sh - from there, everything starts.

Automagic check for network up/down

Every 2 minutes this piece of shit check for network and eventually put it on again.

It's in background with "sleep 120" because here NO crontab due to the RO fs.

while (true); do
 x=`ping -c2 google.com 2>&1 | grep unknown`
 if [ ! "$x" = "" ]; then
    echo `date` >> /home/pi/netcheck.log
    echo "Line is down. restarting..." >> /home/pi/netcheck.log
    service networking restart
    echo "done" >>/home/pi/netcheck.log
 fi
sleep 120
done

This script is named netcheck, in /usr/local/sbinand starts from /etc/rc.local:

# into rc.local
nohup /usr/local/sbin/netcheck &

Hostname with last IP number in it

The script is "ultimo" in /usr/local/sbin/ultimo:

#
# in base all'ultimo numero dell'IP del wifi, crea /etc/hostname.
#
IP=`ifconfig wlan0 | grep addr: | sed 's/.*inet *//; s/ .*//'`
cn=$(awk -F. '$0=$4' <<< $IP)
echo "raspami"$cn > /etc/hostname

and start from /etc/rc.local:

# change /etc/hostname adding last IP number from wifi
/usr/local/sbin/ultimo &

VPN

We use Voyager's vpn :)

VPN install on rasp

sudo apt-get install openvpn

next, copy the .conf file already prepared with all certs etc. (ex. for rasp number 50 use 50.conf)

after that

openvpn ./50.conf

or copy 50.conf into /etc/openvpn/client.conf

and launch from /etc/rc.local

service openvpn start

VPN on our computers

Same shit but using our personal certs.

VNC server/client install and usage

A teamviewer-like piece of shit, very handy!

VNC installation on raspberry

Look https://www.raspberrypi.org/documentation/remote-access/vnc/

sudo apt-get install tightvncserver

and launch tightvncserver to configure it, here you give a password that you will need to access.

in ~/shells/start.sh I added

vncserver :1 &

VNC installation on our computers

sudo apt-get install xtightvncviewer

so just launch

vncviewer 172.16.66.9:1

put the pw and desktop appears. END OF SHIT

Disk settings

I made the sdcard as a 4GB one, also if is 32gb. To copy it:

dd if=/dev/sdb of=milano2.img bs=4096 count=1048576

Now it is as follow:

pi@raspami1 ~ $ cat /etc/fstab
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults,ro                0       2
/dev/mmcblk0p2  /               ext4    defaults,rw,noatime        0       1
/dev/mmcblk0p3  /home           ext4    rw,nosuid,nodev,relatime,data=ordered 0 0
tmpfs           /tmp            tmpfs   defaults          0       0

(parted) print all                                                        
Model: SD SL32G (sd/mmc)
Disk /dev/mmcblk0: 31.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      4194kB  62.9MB  58.7MB  primary  fat16
 2      62.9MB  2943MB  2880MB  primary  ext4
 3      2943MB  4277MB  1334MB  primary  ext4

root@raspami1:/home/pi# mount
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=470368k,nr_inodes=117592,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=94936k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=189860k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p3 on /home type ext4 (rw,nosuid,nodev,relatime,data=ordered)
tmpfs on /tmp type tmpfs (rw,relatime)
root@raspami1:/home/pi# 

root@raspami1:/home/pi# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          2.6G  2.0G  467M  82% /
/dev/root       2.6G  2.0G  467M  82% /
devtmpfs        460M     0  460M   0% /dev
tmpfs            93M  264K   93M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           186M     0  186M   0% /run/shm
/dev/mmcblk0p1   56M   15M   42M  26% /boot
/dev/mmcblk0p3  1.2G  129M  1.1G  12% /home
tmpfs           464M   12K  464M   1% /tmp

Using gparted you can resize it as you need.

ACCESS / NETWORK

Ethernet: eth0, 172.16.0.50 fixed.

Login: user pi, pw vivabasaglia. sudo give root. pw root: ciaras

Wifi: wlan0 10.0.1.50 and up, gw 10.0.0.1

WARNING

in /etc/network/interfaces SET JUST ONE GW, OTHERWHISE 2nd network card (wlan0) won't start!

LOOK BELOW.

Make our distro compatible for arm 7 -> arm 8

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install raspberrypi-ui-mods

sudo halt

and reboot.

BLACK SCREEN AT BOOT AVOIDING messages and logos

Edit /boot/cmdline.txt

boot log:

 console=tty3 

instead of tty1

NO: better have logs to understand if it's booting or not. I left only loglevel=3 & logo.nologo

Fuck the logo: add at the end

  • loglevel=3 logo.nologo

wtf.jpg

Actually /boot/cmdline.txt is like that:

 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait loglevel=3 logo.nologo

lxde startup and HOW THEY'RE SON OF BITCHES

THOSE RASPBIAN BASTARDS CHANGED LXDE in LXDE-pi INTO ~/.config/lxsession so autostart didn't worked.

ASSHOLES

http://www.raspberrypi-spy.co.uk/2014/05/how-to-autostart-apps-in-rasbian-lxde-desktop/

It's from there that I launch ~/shells/start.sh ;)

WIFI dongle

https://github.com/lwfinger/rtl8188eu

From here you download the zip file, inside is the fucking firmware.

The .bin goes in /lib/firmware/rtlwifi

Next you need the correct driver according to the kernel: https://www.raspberrypi.org/forums/viewtopic.php?p=462982

For our kernel, Linux raspami1 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux

the correct firmware is

3.18.7-v7+ #755, #756 - 8188eu-v7-20150212.tar.gz

So, from root:

wget https://dl.dropboxusercontent.com/u/80256631/8188eu-v7-20150212.tar.gz
tar xzf 8188eu-v7-20150212.tar.gz
./install.sh

and reboot!

Old notes

wget https://dl.dropboxusercontent.com/u/80256631/8188eu-20140307.tar.gz //make sure you use the correct dropbox url for your Raspberry version
tar -zxvf 8188eu-20140307.tar.gz
sudo cp rtl8188eufw.bin /lib/firmware/rtlwifi //not needed anymore if your operating system is above 3.10.33+
sudo install -p -m 644 8188eu.ko /lib/modules/3.10.33+/kernel/drivers/net/wireless
sudo insmod /lib/modules/3.10.33+/kernel/drivers/net/wireless/8188eu.ko
sudo depmod -a
sudo reboot

WIFI Scanner

Get rid of LXDE background, putting a black background

Remove from background, and put it black. You do it from X. After that, from desktop options, remove trash icon, so now you have to just kill the panel.

Killing the panel

Kill lxpanel. If you need it again, relaunch with lxpanel --profile LXDE-pi : launch directly ~/shells/panel.sh

BLANK SCREEN disabling

xset -dpms  
xset s noblank  
xset s off 

it's into ~/shells/start.sh

solve SLOW SSH

One workaround is to edit /etc/sshd_config on the sshd server machine, not your ssh client machine to set "UseDNS" to "no". (From the way you originally wrote your question, it sounded like you may have edited that file on your client, which wouldn't make a difference.)

Another solution would be to have your ISP (or whatever institution is responsible for your publicly-routable IP addresses) fix their reverse-DNS record for your IP address on their DNS name servers that are authoritative for the reverse-DNS records for that block of IP addresses. In other words, "make it so people can find your host name based on your IP address, and make sure the hostname they find maps back to your IP address". 7 mins · Unlike · 1

Set into ssh config: UseDNS no

HIDE X cursor after some seconds of inactivity

sudo apt-get install unclutter
unclutter -display :0 -noevents -grab

Automagic wifi connection

Our wifi:

Edimax EW-7811Un 150Mbps 11n Wi-Fi USB Adapter, Nano Size Lets You Plug it and Forget it, Ideal for Raspberry Pi, Supports Windows, Mac OS, Linux

IDEAL this DICK!!!

http://www.amazon.com/gp/product/B003MTTJOY/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B003MTTJOY&linkCode=as2&tag=rapihq-20&linkId=7QAXDGG72H4EWYFB

https://www.raspberrypi.org/forums/viewtopic.php?f=31&t=7471

GET RID OF POWERSAVING on wifi dongles!!!

With "lsmod" we see we have this driver:

8192cu                528365  0 

Create /etc/modprobe.d/8192cu.conf with:

# Disable power saving, FFS!
options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1

and reboot / reload driver.

Network configuration

Put this in etc/network/interfaces

# ultima config testata, funziona, tira su tutto
auto lo
iface lo inet loopback

up eth0
allow-hotplug
iface eth0 inet static
        address 172.16.0.50 # ogni schedino col suo IP ovviamente
        netmask 255.255.0.0
        # non usarlo! gateway 10.10.1.1
        # nota: un solo gw per le interfacce 
        # altrimenti non sale la rete wifi!

auto wlan0
allow-hotplug
iface wlan0 inet static
        address 10.0.1.50
        netmask 255.0.0.0
        broadcast 10.255.255.255
        gateway 10.0.0.1
        dns-nameservers 8.8.8.8  8.8.4.4 
        wpa-ssid KIP01
        wpa-psk vivabasaglia

and REMOVE /etc/wpa_supplicant/wpa_supplicant.conf

SLIDESHOW

apt-get install feh
feh --recursive --randomize --auto-zoom -D 20 -F ./slideshow/

-D delay, -F fullscreen. GIF not supported!

LIGHT problem in raspberry PI 2

U16 is sensible to light. Cover it!.

http://www.pcpro.co.uk/components/1000375/why-a-camera-flash-will-reboot-your-raspberry-pi-2

Sistema in READ ONLY?

NICE TO DO.

Only /boot for now is read only, /tmp is in tmpfs ramdisk, with some /var links. So crontab is volatile.

MAYBE we can put crontab symlinks on /boot so we can have a fixed crontab to be modified into /boot.

HDMI port always ON

WE NEED THIS Because if we don't have hdmi active, the raspberry switches itself on the crappy video out connector.

Add these two lines to */boot/config.txt* and reboot Raspbmc:

hdmi_force_hotplug=1
hdmi_drive=2

Installazione ansible: UFFICIO COMPLICAZIONE AFFARI SEMPLICI

*TODO - TODO - e' stato fatto ma e' da documentare.*

E CMQ FANCULO ANSIBLE PORCODIO

Ansible recipe to configure all raspberry, L'inutilita' totale

that's is /home/pi/pi.yml

WARNING, SPACES ARE PART OF THE SYNTAX. IF YOU MOVE THEM, NOTHING WILL WORK. YAML IS A FUCKING PIECE OF SHIT.

---
- hosts: pi
  remote_user: pi
  sudo: yes
  tasks:

  # netcheck
  #
  # files to be added
  #
  - copy: src=/usr/local/sbin/netcheck dest=/usr/local/sbin/netcheck owner=root group=staff mode=0755 
  - copy: src=/usr/local/sbin/ultimo dest=/usr/local/sbin/ultimo owner=root group=root mode=0755
  - copy: src=/etc/modprobe.d/8192cu.conf dest=/etc/modprobe.d/8192cu.conf owner=root group=root mode=0644
  - copy: src=/etc/rc.altrirasp  dest=/etc/rc.local owner=root group=root mode=0755

  #
  # Line to be added in /etc/rc.local
  # 
  # - lineinfile: dest=/etc/rc.local state=absent regexp="exit 0"
  # - lineinfile: dest=/etc/rc.local line="nohup /usr/local/sbin/netcheck &"
  # - lineinfile: dest=/etc/rc.local line="exit 0" 

  #
  # Stuff to install/remove
  #
  # - name: nmap installation
  #   apt: name=nmap state=present

  - name: reboot
    command: /sbin/reboot

WARNING, SPACES ARE PART OF THE SYNTAX. IF YOU MOVE THEM, NOTHING WILL WORK. YAML IS A FUCKING PIECE OF SHIT.

LAUNCH with:

ansible-playbook --ask-pass ./pi.yml

For a single ip, ex. il 10.0.1.77, use

ansible-playbook --ask-pass -l 10.0.1.77 ./pi.yml

IP must be configured into /etc/ansible/hosts, as follow:

# This is the default ansible 'hosts' file.
#
# It should live in /etc/ansible/hosts
#
#   - Comments begin with the '#' character
#   - Blank lines are ignored
#   - Groups of hosts are delimited by [header] elements
#   - You can enter hostnames or ip addresses
#   - A hostname/ip can be a member of multiple groups

# Ex 1: Ungrouped hosts, specify before any group headers.

[pi]
10.0.1.[51:99]  ansible_ssh_user=pi
# 192.168.1.249

Asbesto


CategoryMuseo

Museo/RaspberrySetup (last edited 2020-01-26 16:47:43 by asbesto)