Inserisci qui la tua pubblicità

Raspberry - Motion-mmal

Motion-Mmal per raspberry

### Installare Motion-MMAL L'obiettivo di questa guida, per cui ringrazio e cito Embeddedday.com, è quello di installare una versione speciale del software di rilevamento di movimento compilato e e costruito dalla comunità di sviluppo del RPi con il supporto per la camera PI Noir del Raspberry. #### Primo Passo Prima di tutto dobbiamo assicurarci che la nostra pi camera noir è connessa correttamente con il nostro RPi. Il prossiamo passo è aggiornare la versione del sistema operativo di RPi, nel nostro caso utilizzeremo Raspbian:
	
- sudo apt-get update	
- sudo apt-get dist-upgrade	
- sudo rpi-update
Quindi procediamo ad attivare la nostra pi camera noir accedendo alla finestra di configurazione del nostro RPi:
	
- sudo raspi-config
Troviamo quindi la voce Enable Camera e clicchiamo su Invio; Selezionamo ora ENABLE spostandoci sul pusalnte con il testo freccia-destra della tastiera e clicchiamo Invio. Possiamo quindi ritornare al menu principale e saltando tutte le altre voci e clicchiamo su FINISH. Il nostro Raspberry PI automaticamente ci chiederà se vogliamo fare un riavvio. Selezioniamo YES e attendiamo il riavvio. #### Installare Motion-MMAL Una volta riavviato il nostro RPi, apriamo di nuovo il terminale del nostro RPi ed eseguiamo:
	
- sudo apt-get install motion
Se ci chiederà se vogliamo installare motion , scriviamo Y e confermiamo, quindi attendiamo finchè tutto sarà caricato e installato con successo. Ci impiegherà all'incirca dai 30 secondi ai 2 minuti, dipende dalla velocità della nostra connesione interne. Quando la procedura terminerà scriviamo:
	
- sudo apt-get remove motion
This command will remove motion! It sounds strange to do that when we just install it with the previous command but the truth is that will left some dependencies untouched and those are the ones that we need! Have in mind that our needed software for this guide is the Motion-MMAL and not the regular Motion. Adesso installiamo il Motion-MMAL. La miglior strada è quella di scaricare una versione pre-compilato utilizzando il comando wget.
	
- wget https://www.dropbox.com/s/0gzxtkxhvwgfocs/motion-mmal.tar.gz
E ora scompattiamo il file
	
- tar zxvf motion-mmal.tar.gz	
Apriamo ora il file di configurazione con l'editor nano:
		
- sudo nano motion-mmalcam.conf
On your screen you will have a multi pages file like this one It contains lot of settings that you are free to modify based on your needs. However you must change a few of those in order to have a usable and stable system without freezes and random resets.
	
- Turn deamon On		
- Image resolution 640×480	
- output_pictures and ffmpeg_output_movies to Off if you don’t want to store pictures/clips on your SD card	
- stream_localhost to Off in order to have access to your full network	
Press Ctrl-X, Y and finally Enter. And now its time to run the software sudo ./motion -c motion-mmalcam.conf Il led rosso della pi camera noir è acceso. Questo significa che tuttè è andato come previsto e che quindi ora è stato attivato il modulo che ne rileva il movimento e che possiamo visualizzare lo stream della camera andando sul nostro browser all'indirizzo
	
- http://Your_RPi_IP_Address:8081
Attenzione: Per visualizzare lo stream ho utilizzato il browser Safari, con Chrome e altri non funziona, per via del formato trasmesso dalla nostra pi camera. A few “bug” fixes It seems that sometimes the libjpeg.so.9 is missing and the Motion-MMAL is unable to start. You will understand that if you have something like this: error while loading shared libraries: libjpeg.so.9: cannot open shared object file: No such file or directory on your terminal screen. A quick solution to this is to install it
	
- sudo apt-get install libjpeg62
Now run again the software and everything should be OK Per eliminare e chiudere il processo eseguire:
	
- ps aux1. 
- sudo kill -9 [pid_motion]
----
[email protected]