domenica 30 ottobre 2011

AutHome alpha release


After the success of the LinuxDay we decided to continue to develop AutHome project.
It is a framework used to control both the home and its entertainment.
More information will be available on the web site: www.authome.it



martedì 18 ottobre 2011

LinuxDay 2011

Anche quest'anno si avvicina il LinuxDay e per la prima volta si terrà anche ad Urbino !


Vi aspetto numerosi al primo piano del Collegio Raffaello in Piazza della Repubblica 13, alle ore 11.30 per partecipare al mio talk riguardante "Linux nella Domotica":

inoltre per tutta la giornata ci saranno dimostrazioni live e installation party!

giovedì 14 luglio 2011

PHP class to manage Youtube contents

A few days ago I played with youtube API for a web application, but the official documentation seems not to be ready to use:
http://code.google.com/apis/youtube/2.0/developers_guide_php.html
so I decided to release my PHP class, maybe can be useful!

First of all you need:
- an youtube account
- a web server with Zend GData PHP library
- a google development key
- the php file with my class

This is a simple code both for direct upload or a browser upload:
require_once($site_include."/youtube_api.php");


//YouTube data, remember that developerKey is public 
$developerKey = 'your key';
$authenticationURL = 'https://www.google.com/accounts/ClientLogin';
$uploadURL = 'http://uploads.gdata.youtube.com/feeds/api/users/default/uploads';
$Username = 'youtube_account';
$Password = 'youtube password'; 
$YoutubeSource = 'YourApplicationName';
$applicationId = 'AppID:AppID';



$ytvideo = new YouTube_API($developerKey, $authenticationURL, $applicationId);
ytvideo->connect($Username, $Password, $YoutubeSource);

$title = 'Write here title';
$description = 'Write here description';
$category = 'Write here a valid YouTube category(see youtbe class for details)';
$tags = 'Write here a comma-separated string';


Now you can upload a video from your own web server to that of youtube server:
$result = $ytvideo->DirectUpload($miofile,  $applicationId, $title, $description, $category, $tags);
echo "VideoID: ".$ytvideo->newEntry->getVideoId();


Or you can upload a video from user's web browser to the server of youtube directly:
$nextUrl = 'http://your_site/upload_status.php';
$tokenArray = $ytvideo->BrowserUpload($miofile, $title, $description, $category, $tags, false, "");
$tokenValue = $tokenArray['token'];
$postUrl = $tokenArray['url'];

$form = '<div id="uploada"><form onSubmit="javascript:return checkForm();" style="position:relative; top:12px; left:35px;" action="'. $postUrl .'?nexturl='. $nextUrl .
'" method="post" enctype="multipart/form-data" name="form_upload" id="form_upload">'. 
'<input name="file" type="file" id="video_uploaded" name="video_uploaded"/>'. 
'<input name="token" type="hidden" value="'. $tokenValue .'"/>'.
'<input value="Upload Video" type="submit" />'. 
'</form>;
echo $form;
when the download is finished, youtube redirects the user's browser to : http://your_site/upload_status.php
so here you can check the operation status:

if (isset($_GET['status']))
{
$ystatus=$_GET['status'];
$id_video=$_GET['id'];
}

if ($ystatus==200)
echo "Upload succefull, id video is:".$id_video;
else
echo "Upload error";

The php class is very simple and still incomplete. You can change the visibility of a video (public or private), the video description or delete it permanently as well, ex:
$ytvideo = new YouTube_API($developerKey, $authenticationURL, $uploadURL);

$ytvideo->connect($Username, $Password, $YoutubeSource);
$ytvideo->SetVideoPrivate($id_video);
$ytvideo->SetVideoPublic($id_video);
$ytvideo->DeleteVideo($id_video);


good luck! :-)

mercoledì 11 maggio 2011

Android@home

@home will be home automation according to Google, Internet of things or maybe home of things will be a
reality! Another important element of the system will be Tungsten, to manage multiroom audio.

Watch the presentation at Google IO 2011:


I would like to integrate all my projects powered by OpenPicus, will be it possible? I need @home's specification to reply!! Google please, public release specifications soon; or send me a copy ;-)

Currently I have boards TCP/IP ready with relè, triac, temperature sensor, accelerometer and audio streaming; I need a decoder powered by android as these:

 

to controll all my house, it's amazing!

martedì 8 marzo 2011

WiFi sensors - accelerometer SPI/I2C

With OpenPicus it is very easy to build wireless sensors; in this example we are working with an 3 axes accelerometer by ST (LIS3LV02DL) connetted to FlyPort through SPI.
The idea of measure vibrations was started with my friend Massimo for the thesis of his student Andrea, in which he measured vibrations by using a LIS3LV02DL connected to an Ethernet modules running ContikiOS.This is an evolution of that project, where the ethernet connection is replaced by WiFi and collection of data is entirely web-based:


For firmware development I used OpenPicusIDE rev1.0. Steps were:
- create a new project
- copy accelerometer library on ExternalLib directory
- write code in FlyportTask()
- modify webpages and import to the project (Thanks to Andrea Mazza for his help with Flot ;-)
- write code to manage web pages request (es. HTTPPrint_acc)
- build all and download firmware
the result should be:


If you are interested, you can download code:
hg clone https://serra82@bitbucket.org/serra82/flyport_surveillance_ide1.0

domenica 6 marzo 2011

Multiroom Audio

I like music and movies as many people! More generally I like multimedia and Home Automation (called Domotica  in italian) and I have been following the development of set-top-box systems, standard bus communication and standards for streaming for several years.
Let's start from audio streaming: in 2006 I found a fantastic device by Slimdevices, now aquired by Logitech and better known as SqueezeBox, for streaming audio anywhere, so as to achieve a simple multiroom audio system.
A similar device was Roku SoundBridge, but it is no longer for sale.
Apple offers AirPort Express Base Station with AirTunes, which looks like a simple battery charger, but in addition to ethernet, wifi and usb connectivity, it provides an audio output to connect your stereo system.
Newcomer, but already very popular for its Apple style, there's Sonos, designed for multiroom audio and available in a variety of devices.

All this is not enough for me, I'd like a modular device, presenting itself as a true WiFi speaker, using open protocols and standards, as well able to reproduce music decently and that is why the choice of devices on the market shrinks dramatically!

Work began connecting OpenPicus to a VLSI MP3 decoder with excellent results:


and it's continuing testing some integrated amplifiers to achieve our WiFi loudspeaker:



Stay tuned for news!

Wifi e Microcontrollori

Per iniziare con i post di elettronica voglio segnalare un progetto veramente interessante su cui sto lavorando attivamente in questo periodo: Openpicus


Con questa piccola scheda costituita da un micro 24FJ256GA106 e un modulo wifi MRF24WB0MA; è possibile realizzare dispositivi wireless 802.11 in maniera semplice ed economica.
Per la precisione il modulo wifi vero e proprio, chiamato flyport,  è solo la parte superiore; infatti quest'ultimo va incastrato su una daughterboard, chiamata nest, che puo' essere personalizzabile e creata adhoc in base alle esigenze e ai requisiti del progetto che si vuole realizzare.

E' possibile programmare il modulo in C con l'IDE e il compilatore rilasciati da Microchip scaricando un programma di esempio dal sito di OpenPicus, ma una forte semplificazione è data utilizzando la wizard all'interno dell' IDE fatto appositamente dal progetto Openpicus:

Il progetto è molto promettente ed attivo, credo che arriverà presto alla popolarita di Arduino; inoltre le video guide stanno aumentando ogni giorno come i post del forum e nuovi utilizzatori.

Per maggiori informazioni non vi resta che visitare www.openpicus.com

PS: un caloroso ringraziamento a Claudio e Gabriele, ideatori del progetto!