Experimental WAV files

Here’s some experimental WAV files that I have generated.

All files are 44100Hz, stereo.

Package contains:
– 2 points (aka samples) 44100Hz stereo.wav (meaning the signal goes from low to high)
– 4 points (aka samples) 44100Hz stereo.wav (low, high, low, high)
– 440hz square 1 cycle.wav (tiniest 440hz square wave WAV file that you can generate)
– 440hz square 10 cycles.wav (similar to previous but repeats 10 times)
– 44100Hz stereo no data.wav (do data at all, no samples, basically only the WAV header)

experimental wav files

Python snippets

print formatting
print "server said %s and %s" % (content, txt)

delay / sleep
import time

HTTP get / request
import httplib2
resp, content = httplib2.Http().request("http://example.fi")
except urllib2.HTTPError, exc:
except urllib2.URLError, exc:
print "Failed because:", exc.reason

Send email
import smtplib
"""this is some test documentation in the function"""
message = textwrap.dedent("""\
From: %s
To: %s
Subject: %s
# Send the mail
server = smtplib.SMTP(SERVER)
server.sendmail(FROM, TO, message)

Raspberry Pi Zero weight & power consumption

Measured weight:

Raspberry Pi Zero + SD card 8.8 grams
Raspberry Pi Zero + SD card + pin header 11.8 grams
Raspberry Pi Zero + SD card + USB wlan adapter (Asus USB-N10 without covers) 11.9 grams

Measured power consumption at 3.3V fed directly to header:

150mA without USB devices
350mA with Asus N10 during ping in weak network connection

Raspberry Pi camera still capture & HTTP upload

Write a bash script on Raspberry Pi:

raspistill -o vattu.jpg
curl --form "fileupload=@vattu.jpg" http://domain.fi/vattu.php

and PHP at server side to process the upload:

$userfile_name = $_FILES['fileupload']['tmp_name'];

if (move_uploaded_file($_FILES['fileupload']['tmp_name'], "vattu.jpg"))
echo "ok";

Technology snippets