domenica 6 settembre 2009

Beagleboard: un gruppo in lingua italiana

Nel googlegroup bb_projects parliamo in italiano (per fortuna!!)

Ci si può iscrivere in modo da ricevere una email ogni volta che qualcuno fa un "post" (come ho fatto anch'io).

Lo scopo del gruppo è discutere di progetti con la Beagleboard.

Batterie megapotenti

clipped from www.bixpower.com
clipped from www.bixpower.com
clipped from www.bixpower.com
Dunque, da BixPower finalmente si può ordinare anche in Italia. Vediamo un po':

- prime due foto: batteria portatile agli ioni di litio, dichiarata da 26 wattora, con uscita 5V USB, ricaricabile via porta USB. Costa 80$ più 43$ di spedizione in Italia. Se ne ordino due, il costo della spedizione sfonda i 53$ (porca vacca!). Se ne ordino tre, la spedizione va oltre i 77$. Se ne ordino 4, la spedizione va oltre i 90$...!

- terza foto: batteria portatile dichiarata da 73 wattora (equivalente ad una 9-cell 6600mAh); può dare in output 19V, 16V o 5.3V USB (questo "5.3" è per caricare le batterie degli iPod e affini). 130$.

- quarta foto: batteria da 153 wattora, pesantuccia (1.34 kg), anche questa con uscita USB. 300$!! E stavolta non c'è scritto "5.3V" (boh?)

E' vero che il dollaro è basso, ma quelle spese di spedizione sono esagerate e per giunta anche su quelle si pagano dazi e diritti doganali.

Fanno il 5% di sconto se si superano i 500$ di ordine (escluso spedizione)

E poi dicono che parlo bene di Linux

Sul mio potente serverino casalingo c'è attaccata la tastiera ma non il monitor. Come fare dunque per capire che il serverino sta funzionando?

Ecco un potentissimo script che funziona solo sotto Linux (chissà sul Mac e su Wintorz quanta fatica servirà per fare una cosa del genere). Accende i led della tastiera uno alla volta, così se di notte manca la corrente elettrica, vedrò i led spenti...!

Nota: lo switch "-L" indica di cambiare solo lo stato del LED, non lo stato della tastiera.


setleds -L -num -caps -scroll < /dev/tty1
while true
do
  setleds -L +scroll -num  < /dev/tty1
  sleep 1
  setleds -L +caps -scroll < /dev/tty1
  sleep 1
  setleds -L +num -caps    < /dev/tty1
  sleep 1
done

sabato 5 settembre 2009

Frecce Tricolori

Segnalazione importante:

''le mie Frecce Tricolori'', spettacolare blog con foto e video.

Da gustare con calma, pagina per pagina.

Sui Tontons Blafards e Tireurs Couchés

http://www.concertandco.com/crit2/lapositionpiscine.jpg
Gheddafi vuole cancellare la Svizzera
"Chiederà all'Onu di separare i cantoni"
Permettetemi di ricordarvi i motivi per cui deve importarci della Svizzera:
2. Produce il Toblerone.
3. Contiene soldi.
Io lo so che tanti di voi tengono i milioni dei nonnetti in Svizzera. E se da un giorno all'altro gli euri si trasformassero in dinari libici? O in vasetti di terracotta decorati a mano?
clipped from www.repubblica.it
http://www.repubblica.it/2009/09/sezioni/esteri/libia-svizzera/libia-svizzera/foto_16603250_13550.jpg
5. Tiene lontane la Francia e la Germania (e l'Austria e il Lichtenstein, d'accordo).
Vi siete mai chiesti perché alcuni generi musicali (esempio: il rap francese, il pop melodico tedesco) amati dai nostri connazionali emigrati - che ne parlano con fanatico ardore ("Non conosci i Tireurs Couchés? E i Tontons Blafards? Ma sono famosissimi!") - non riescono a passare di qua?
Ringraziate la Svizzera.
clipped from www.madore.org
http://www.madore.org/~david/images/cfmh.jpg
«Non conosci i Tireurs Couchés? E i Tontons Blafards? Ma sono famosissimi!»

Certo, quella colossale ciofeca di musica italiana non ha granché da invidiare a quella estera...

Direttissimi sperimentali, ennesima occasione sprecata

clipped from www.vesuviana.it

>>>Ferrovia Avviso treno sperimentale in partenza da Sorrento alle ore 6,55







Data di pubblicazione: 
31/08/2009

DAL 1 SETTEMBRE 2009, DAL LUNEDI’ AL VENERDI’, PROSEGUIRÀ LA SPERIMENTAZIONE DEL TRENO DD 14, IN PARTENZA DA SORRENTO ALLE ORE 6.55, CHE DA SAN GIORGIO PROSEGUIRÀ PER NAPOLI VIA POGGIOREALE CON FERMATA A SAN GIORGIO, POGGIOREALE E CENTRO DIREZIONALE ED ARRIVO A NAPOLI P. NOLANA ALLE ORE 7.54. IL SABATO E LA DOMENICA IL TRENO DD 14 RISPETTERA’ IL SUO ORARIO ORIGINALE.

AllegatoDimensione
Ferrovia Avviso treno sperimentale 14 2009.pdf65.83 KB


A metà giugno 2009 era stato sperimentato il direttissimo 1014: Sorrento 7:09, Castellammare 7:31, Napoli Centro Direzionale 8:13 - era l'ideale per tutti quei lavoratori che entrano alle 8:30-8:45.

Nonostante la brevissima sperimentazione partita in sordina e in periodo estivo, fu un successone. Dopo quindici giorni venne chiusa la sperimentazione. Vergogna!

Da luglio 2009 c'è questa interminabile "sperimentazione" sul direttissimo 14 (Sorrento 6:55, Castellammare 7:15, Napoli Centro Direzionale 7:54), che è gradita alla Vesuviana perché libera il tratto San Giorgio-Barra-Napoli di un direttissimo, alleggerendo il traffico in orario critico.

Nonostante il successo relativamente scarso (a che pro arrivare al Centro Direzionale prima delle otto? sono pochissimi i lavoratori che ne beneficerebbero), si continua purtroppo a "sperimentare"...

Lumix GF1

E ci mancava solo quest'altra tentazione... per la serie: "probabile acquisto selvaggio in arrivo a ottobre"

Viciénzo m'è pàtr' a mé!

clipped from www.zeusnews.com


La presenza di campioni di Dna di una data persona sulla scena di un crimine collegano detta persona a quanto avvenuto in quel luogo senza possibilità di errore o falsificazione. Questo, almeno, era quello che si pensava finora.


Il dottor Frumkin - fondatore della Nucleix, una società con sede a Tel Aviv - ha scoperto e mostrato come sia invece relativamente facile falsificare una prova del Dna, sostituendo al materiale genetico originale quello di un'altra persona.


Frumkin ha ideato due diverse tecniche. La prima prevede l'uso di un piccolo campione (proveniente magari da un capello, o anche da un mozzicone di sigaretta) del Dna che si vuole sostituire a quello originale.


L'altra tecnica è anche più inquietante, perché non necessita del Dna di una terza persona: è in grado di ricrearlo usando i profili del Dna contenuti nei database delle forze dell'ordine, basati sulla collezione di frammenti di Dna.

Fabbricare false prove del Dna Frumkin Nucleix
No, non guardate la bionda al microscopio; quella non è in grado nemmeno di lavare i piatti. Prenderei volentieri a pedate nel sedere i fotografi che fanno foto "artistiche" di quel genere che poi vanno a corredare (e banalizzare) notizie serie...

La notizia è che l'esame del DNA può essere falsificato. Un dottore israeliano ha esposto diverse tecniche.

Da oggi dunque ognuno potrà dire "Vincenzo m'è padre a me" (Viciénzo m'è pàtr' a mé!") ed essere preso sul serio!!

venerdì 4 settembre 2009

Alice Telecom va solo con Windows?

Un'amica che non sentivo da più di un anno mi telefona trafelata: qui abbiamo il tecnico Telecom per mettere Alice ADSL, ma non sa da che parte cominciare!

E io che c'entro? Facile: il computer era un Apple iMac bianco 17" (l'ultima serie prima dei nuovi iMac dotati con schermo "specchio glossy fastidioso"). Per la cronaca, l'iMac dell'amica mancava incredibilmente del modem e del bluetooth! (esatto: due anni e mezzo fa, la Apple ha venduto iMac da un migliaio di euro sprovvisti di Bluetooth e di modem! vegogna!)

Il tecnico Telecom: a dire il vero, io non sarei autorizzato a mettere le mani sul computer, però bisogna farlo funzionare...

E io che c'entro? Facile: sono chiamato ad assistere a gratis la costosa assistenza Telecom. In orario di lavoro (in orario di mio lavoro!)

Il tecnico Telecom mi chiede (telefonata a carico dell'amica mia): come si installa la rete su questo computer?

Gli rispondo: clicca sulla mela in alto a sinistra, scegli Preferenze di Sistema, clicca sull'icona Network, vai su Ethernet integrata...

Il tecnico Telecom mi chiede: ma che sistema è questo qui?

Faccio fatica per non ridere. Non aveva mai visto un computer Apple. Non sapeva neanche cos'era quella mela. Forse avrà sentito parlare di quella ciofeca dell'iPhone, ma sicuramente non sapeva che la ditta dell'iPhone vende anche computer.

Dopo circa un'ora di tentativi il tecnico telefona ad un suo collega tecnico esperto, lui sì che conosce i computer con la mela. Risultato: neanche il collega esperto sapeva da che parte cominciare. Mac OS X 10.4.7 Tiger, evidentemente, è un sistema troppo complicato da configurare.

Dopodiché il tecnico si rassegna: l'ADSL sul mio portatile Windows funziona, ma su questo computer bianco non funziona... non so, non capisco... dovreste farvi aiutare da qualcuno che ne capisce...

L'amica mi ritelefona trafelata: potresti venire domani ad installarmi tu internet ADSL sull'iMac?

Le rispondo: e se poi non riesco a farlo funzionare?

Il tecnico: se non funziona, potete sempre chiamare il 187 per disdire...

Conoscendo i tempi biblici degli operatori del 187 (ancor meno esperti di questo con cui ho parlato), ho consigliato all'amica di disdire immediatamente Alice.

Solo che ora sono arcisicuro che lei si troverà comunque il canone Alice sulla bolletta (se sul PC Windows funzionava allora partirà certamente l'addebito; è già successo a tanta gente), e dovrà chiamare decine di volte il servizio assistenza "187" (famoso su Google perché associato alla parola "disservizi") per convincere decine di volte decine di diversi operatori che il tecnico ADSL Telecom non è stato capace di far funzionare l'ADSL Telecom e che non si può comprare un computer Windows solo perché i tecnici ADSL Telecom non sanno nemmeno che esistono i computer Apple.


Fine della prima puntata.

Per nascondere la tua posizione al tuo capo...

Car Cigarette Anti-GPS System
clipped from gadget.brando.com

click to enlarge
click to enlarge
click to enlarge
Per soli quarantanove dollari, ecco un jammer per i sistemi GPS.

Il veicolo che l'azienda ti ha assegnato trasmette all'azienda la tua posizione e la tua velocità? In azienda ti hanno già seccato troppo per quelle due pause al bar di cinque minuti l'una lungo le otto ore di viaggio? Ecco qui la risposta!

Questo arnese disturba (rendendola impossibile) la ricezione dei segnali GPS nell'arco di dieci metri a linea di vista (dunque certamente all'interno di tutto l'abitacolo).

Comprare un camper? Con questa crisi?

clipped from www.adafruit.com
http://www.adafruit.com/adablog/wp-content/uploads/2009/08/5-camperbikeride2.jpg
A quanto pare questo non ha problemi di carburante...

Se sul tetto si montasse un pannello solare, e se si reingegnerizzassero gli spazi intermedi attorno alle ruote e alla "cabina" di guida, sarebbe proprio l'ideale.

Beagleboard: setting date via GPS

My Beagleboard now sets its date/time reading them from a GPS unit. W00T!

Below, a few notes about this hack.

Please note: Beagleboard, up to revision C2, does have a real-time clock but you cannot attach any backup battery (the clock "stops" when Beagleboard is not powered). Recent Beagleboards (revision C3 and later) appear to have a place to attach one (read the Beagleboard System Reference Manual - BBSRM - for more details).

My GPS unit is an old Garmin GPS II Plus, its firmware dates back to 1997. It sports an RS232 port, talking standard NMEA at 4800 baud.

I made the cable to connect to the RS232 header of the Beagleboard - the one which we were using as /dev/ttyS2 for serial console access. I will then be able to log in the Beagleboard only using network access (ouch!) via ssh or with an external USB keyboard/mouse/hub solution.

First, I recommend compiling and installing the latest gpsd (gpsd is available in the Narcissus packaging, but if you ask for opkg install gpsd you will have a lot of possibly annoying freesmartphone.org stuff installed with it).

While you could easily parse GMT date/time from raw NMEA strings, the gpsd makes all GPS-related stuff as easy as accessing a socket, without having to deal with RS232/USB/bluetooth/etc issues and binary/text/NMEA/etc protocols and coordinate/approximation/etc calculations; also, many programs at the same time can access GPS data.

How to start gpsd at boot time, instead of the getty on the /dev/ttyS2 RS232 port?

First, you have to be sure that you can access a Linux shell without using the RS232 console (for example, using a keyboard on a USB hub connected to the Beagleboard).

Now edit /etc/inittab replacing this "S" line:
S:234:respawn:/sbin/getty 115200 ttyS2

with these two "S" and "G" lines:
S:234:respawn:/sbin/getty 115200 ttyS2
G:5:respawn:/usr/sbin/gpsd -n -N /dev/ttyS2

Note: "-n" means "don't wait for a client connection before polling GPS data (this option appears to be deprecated on latest gpsd versions); "-N" means "run in foreground" (if you forget it, it will respawn forever!); "/dev/ttyS2" is the RS232 port.

Before rebooting to apply changes, make sure you can use the Beagleboard without the serial port.

After rebooting, enter a terminal shell via ssh or using an external keyboard. Check that the gpsd is running:
ps guxa | grep gpsd

If the gpsd is running, you will see the /usr/sbin/gpsd process (and -maybe- the "grep" as well).

Now you can telnet to the gpsd socket and issue a command to watch the real time stream of gpsd "cooked" data:
telnet localhost 2947
W=1

You will see lots of output lines:
GPSD,X=1252018312.141204,I=Generic NMEA
GPSD,W=1
GPSD,O=?
GPSD,Y=GSV 1252012212.000 10:3 30 168 0...

To stop, type W=0 and then ctrl-D (or just ctrl-D).

If you want to read "raw" (non-"cooked") NMEA data, just enter the R command. Entering the R command again will stop raw data output.

Now you can execute the cgps (console gps utility); press q to exit. On the left window there are position/speed/etc data (in case of poor GPS coverage, the horiz/vert/course errors will float even to 300 feet, but I think this is a problem of my GPS unit); the right window shows satellite list and information. Sadly, cgps only knows about mph and feet...

Now start gpsmon (another console gps utility); press ^C to exit. This contains far more information - everything gpsd can parse or predict: geoid, DOP/HDOP, magnetic variation, etc.

Now I can write a Ruby program (yes, I happen to love Ruby language; I don't like Python and Perl) to fetch the GPS date (which is always GMT) from gpsd, update it to GMT+1, and then issue the system date command to update it.

My GPS unit always reports date/time on its screen, but does not emit it if unable to read it via GPS. So gpsd won't give a date/time when the GPS receiver has poor GPS coverage. Also, it appears that soon after opening the socket, the date is not available (gpsd answers "D=?"); just wait a little and retry. I will loop waiting for either 4.0 seconds total pause, or a correct timestamp is received; any other error (timeouts on socket port, or invalid timestamp) will stop the program.

require 'socket'

GMT = +1.0   # local time here is GMT + 1 hour

gpsd = TCPSocket.open("localhost", 2947)
gdat = ""
trys = 4.0   # try for 4 seconds...

while trys >= 0.0
  gpsd.puts "d"            # request date from gpsd daemon
  gdat = gpsd.gets.chomp   # read response

  break  if gdat != "GPSD,D=?"  &&  gdat != "GPSD"

  sleep 0.2                # unknown date, sleep some time...
  trys = trys -0.2         # ...and retry until timeout
end

# split "GPSD,D=2009-09-03T20:57:35.0Z" in date/time fields,
# then add GMT difference and finally issue a system set date
# using its weird syntax month/day/hour/min/year.seconds
system (Time.gm(*gdat.split(/[=Z]/)[1].split(/[-:T\.]/).
                collect { |i| eval(i.gsub(/^0/,"")) }) + GMT*3600).
       strftime("date --utc %m%d%H%M%Y.%S")

Once a GMT time is fetched via GPS, erase the header and footer part (delimited by "=" and "Z"), split the fields (separated by "-", ":", "T" or "."), collect their numeric values (erasing leading zeros), add the GMT difference (yes, you could set GMT=-9.5 to have GMT -09:30) and then build a date --utc command with reordered and striped parameters (don't complain about it: the date weird syntax dates back to 1969 or something like that...)

Yes, I happen to love Perl-style Chaotic Programming ;)

I placed it in /etc/gpsdate.rb and edited /etc/timezone to match my area (Europe/Rome). Then, if a date is available, ruby /etc/gpsdate.rb will set up the system date/time, else will fail with some error message; it won't loop forever.

Now, how to add it at the end of boot scripts?

To my surprise, there isn't any rc.local or boot.local - I had to add in mine.

I see that /etc/inittab at sysinit stage executes /etc/init.d/rcS - so I modified that rcS script to add a call to some /etc/rc.local created by me.

I see there a bug: it issues an exec (instead of a "call") to /etc/init.d/rc S (yes, "rc" script with "S" parameter - different from the above "rcS" script...) so the subsequent lines of the rcS won't be executed; I wiped out that "exec" and added soon after a call to /etc/rc.local - thus having this modified version:

#       Call all parts in order.
/etc/init.d/rc S
#
#       execute my local script
/etc/rc.local
#
#       Finish setup if needed. The comment above about
#       /sbin/unconfigured.sh applies here as well!
if [ -x /sbin/setup.sh ]
then
  /sbin/setup.sh
fi

Then I created my /etc/rc.local script containing:
# to me: better having this static IP setup here:
ifconfig usb0 192.168.5.3

ruby /etc/gpsdate.rb &> /tmp/bootdate.txt
date >> /tmp/bootdate.txt
sync

Yes, I know some of you will complain, requiring me to use the standard init.d method, build start scripts, end scripts and so on... Sorry! When in a hurry, you sometimes forget the Elegant Solution Method, and prefer the Happy Tinkering Method...! :)

Now, after the reboot, I see that the /tmp/bootdate.txt contains the output of my gpsdate.rb (either a GMT date string or some error text, and then the "current" system date).


Let's write a Ruby script to make some GPS logging; instead of logging those weird NMEA strings, just log the gpsd parsed data:

require 'socket'
gpsd = TCPSocket.open("localhost", 2947)
gpsd.puts "W=1"
while a = gpsd.gets.chomp
  puts a
end

It appears that it outputs some 140-150 lines per minute (up to 20 kilobytes per minute, or up to 1.2 megabytes per hours) can be written to disk. Mumble, mumble... I should mount Beagleboard + GPS on my bike and write a program that in real-time gives me statistics and GPS stuff and after a month gives me some large graphic diagram... = :) !!!

giovedì 3 settembre 2009

Beagleboard, AA batteries and "reboot loops"

Some notes about AA batteries and "reboot loop".

In the last months I often powered my Beagleboard C2 using groups of 4 NiMH "AA-size" cheap batteries because I found that they gave no more than 5.1V after charging - that is, under the 5.2V recommended maximum.

When my batteries are low (some 120-180 minutes after booting), the Beagleboard reboots and after a few lines "Texas... Loading... In:Serial..." reboots again and again. Maybe also Juszkiewicz has some power issue (does he have a 5V source capable of only 200-300mA?)

Some days ago I found that some other cheap NiMH batteries ("Dikom 2600"), after full charge, were showing some 1.4V each when not under load.

Since I think I've often powered my Beagleboard with them, I tried them again and read some 5.36-5.4V while under Beagleboard load (ouch!!!!!) well above te 5.2V recommended maximum.

Since then, I always checked no-load voltage before using freshly charged batteries.

My Beagleboard is still -as we say here- a roaring finch (read: "everything still working great": phew!). I was lucky to not to fry my Beagleboard, but I think Gerald will not approve to try to be lucky again... ;)

Qt è ancora vivo

Qt è ancora vivo. La versione commerciale si paga (cioè si paga il diritto di tenersela "closed source" con le eventuali modifiche che si fanno), ma per chi accetta la licenza LGPL l'utilizzo è gratis (e si possono rilasciare anche applicazioni commerciali).

E' comodo avere la stessa libreria su Windows, Mac e Linux.