sabato, giugno 18, 2016

Live webcam and weather with Raspberry Pi


How did I do?

Connect DHT11 sensor:


Download Adafruit Python scripts:
git clone https://github.com/emmynet/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT
Install software:
sudo apt-get update
sudo apt-get install build-essential imagemagick
cd Adafruit_Python_DHT
sudo python setup.py install 
Test sensor:
cd examples
sudo ./AdafruitDHT.py 11 4  
28.0 38.0
Connect Raspberry Camera:

As root capture photo & add temperature/humidity/date on jpeg with imagemagick:
DATE=`TZ=Europe/Rome date`
var=`/home/pi/Adafruit_Python_DHT/examples/AdafruitDHT.py 11 4`
temperature=$(echo $var | cut -d' ' -f1)°C
humidity=$(echo $var | cut -d' ' -f2)%

raspistill -n -w 640 -h 480 -q 90 -o capture.jpg
convert -pointsize 15 -fill '#CDCDCD88' -draw "rectangle 0,0 640,20" -fill black -draw "text 90,16 'Casapulla OnLine Live Webcam - Temperatura:'" -fill black -draw "text 402,16 '$temperature'"  -fill black -draw "text 450,16 ' - Umidità:'" -fill black -draw "text 517,16 '$humidity'" -fill '#CDCDCD88' -draw "rectangle 0,460 640,480" -fill black -draw "text 215,475 '$DATE'" capture.jpg webcam.jpg
Upload on the site:
scp webcam.jpg ubuntu@ssh.server.com:/var/www/html/
ssh -x ubuntu@ssh.server.com cp /var/www/html/webcam.jpg /var/www/html/last_frame.jpg
Html page:
<html>
<head> <title>Live Webcam</title>
</head>
<body>
<img src="last_frame.jpg?1466267480856" id="myImage">
<script>
setInterval(function() {
var myImageElement = document.getElementById('myImage');
myImageElement.src = 'last_frame.jpg?' + new Date().getTime(); },60000); </script>
</body>
</html>
Result 

venerdì, aprile 22, 2016

Meter Bus - interesting links






M-Bus (Meter-Bus) is a European standard (EN 13757-2 physical and link layer, EN 13757-3 application layer) for the remote reading of gas or electricity meters. M-Bus is also usable for other types of consumption meters. The M-Bus interface is made for communication on two wires, making it very cost effective. A radio variant of M-Bus (Wireless M-Bus) is also specified in EN 13757-4. (from Wikipedia)

Documentation:
Master Devices:
Slave Devices:
Forums:
Hardware:

Software:
More:

lunedì, aprile 04, 2016

Hack a Drone [Notes]

Airborne Cargo

Test Parrot MiniDrones on Linux environment

Simple steps:


Interesting sites:



martedì, marzo 15, 2016

Build FreeDV from source on Ubuntu 16.04

FreeDV is a Digital Voice mode for HF radio. You can run FreeDV using a free GUI application for Windows, Linux and OSX that allows any SSB radio to be used for low bit rate digital voice.
source: freedv.org


Build FreeDV from source:

  1. sudo apt-get install subversion cmake libwxgtk3.0-dev portaudio19-dev libsamplerate0-dev libsox-dev  libsndfile1-dev libwxbase3.0-dev libwxgtk3.0-dev build-essential libhamlib-dev
  2. svn checkout https://svn.code.sf.net/p/freetel/code/freedv-dev/ 
  3. cd freedv-dev
  4. mkdir build
  5. cd build
  6. vi ../src/CMakeLists.txt
    1. search the line with: 'target_link_libraries(freedv ${FREEDV_LINK_LIBS})'
    2. add -ldl at the end: 'target_link_libraries(freedv ${FREEDV_LINK_LIBS} -ldl)'
  7. cmake ..
  8. make
  9. cd src
  10. ./freedv
svn checkout https://svn.code.sf.net/p/freetel/code/freedv-dev/ 

follow the README.txt

martedì, febbraio 16, 2016