tag:blogger.com,1999:blog-55907723966830170882024-03-06T09:51:33.285+02:00Beyond bits and bytesStelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.comBlogger46125tag:blogger.com,1999:blog-5590772396683017088.post-8134920825551682552016-10-25T19:38:00.000+03:002016-10-25T19:42:21.565+03:00Long overdue update<div dir="ltr" style="text-align: left;" trbidi="on">
Its been over 4 years since my last post. Partly because i had lost the credentials to the blog, partly because i was busy running my company and my family life.<br />
In the meanwhile a lot of things have happened and among them a new hobby. Scuba Diving<br />
<br />
Following in the footsteps of<a href="https://www.youtube.com/watch?v=cbdD0OpIAww"> Linus Torvalds</a>, i started to scuba dive and have acquired an urge for diving into shipwrecks.<br />
<br />
You can see videos of my dives in a <a href="https://www.youtube.com/channel/UC9dnIa8rbOSBK7HiU7fbUGw">Youtube channel </a>i have created. Its also work in progress and there many hours of dives that i haven't found time to edit and upload.<br />
But as old habits never die, i soon realised that there are many areas in scuba diving that embedded technology can make a difference.<br />
My first take is to make a low cost wifi enabled Nitrox analyser, an instrument used by divers to <a href="https://en.wikipedia.org/wiki/Gas_blending_for_scuba_diving">measure the amount of oxygen in their tanks</a>.<br />
I though that i could use this as an opportunity to explore some of the new chips in the market like the <a href="https://en.wikipedia.org/wiki/ESP8266">ESP8266</a> that are used mainly for IoT projects and have a great user base and also happen to be dirty cheap ;)<br />
I have spend the last few weeks reading about the principals of operation of Nitrox analysers and the ESP8266 and have started building a prototype of a DIY Nitrox analyser.<br />
Its going to be an Open Source Hardware and Software project and plan to use this blog as engineering diary of all the work.<br />
So stay tune more things are coming soon.</div>
Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-39858803505182850042012-11-07T21:54:00.000+02:002012-11-07T21:54:18.159+02:00Fixing asterisk addons in Ubuntu Part 2<div dir="ltr" style="text-align: left;" trbidi="on">
In an <a href="http://skoroneos.blogspot.gr/2010/05/fix-asterisk-addons-problems-for-ubuntu.html">older post</a> i have shown a way to fix the following error<br />
<blockquote class="tr_bq">
Module 'app_addon_sql_mysql.so' was not compiled with the same compile-time options as this version of Asterisk.</blockquote>
<br />
which shows up if you try to load the mysql app in asterisk so you can store the cdr in a mysql db or access mysql from within your diaplan.<br />
<br />
There seems to be a 'nicer' way to do it, using the debian package system itself and not having to copy files around.<br />
<br />
Here is what you need to do<br />
<br />
First cd to a temporary directory as this procedure will download some files and generate several deb files<br />
As root (or use sudo) issue the following commands<br />
<br />
<blockquote class="tr_bq">
<span style="color: #201700; font-family: Verdana, Geneva, sans-serif;"><span style="line-height: 20px;">aptitude purge asterisk-mysql</span></span><span style="color: #201700; font-family: Verdana, Geneva, sans-serif;"><span style="line-height: 20px;"><br /></span></span><span style="color: #201700; font-family: Verdana, Geneva, sans-serif;"><span style="line-height: 20px;">apt-get build-dep asterisk-mysql</span></span><span style="color: #201700; font-family: Verdana, Geneva, sans-serif;"><span style="line-height: 20px;"><br /></span></span><span style="color: #201700; font-family: Verdana, Geneva, sans-serif;"><span style="line-height: 20px;">apt-get -b source asterisk-mysql</span></span></blockquote>
<br />
Once the last command finishes you will have ended up with a number of deb files.<br />
Then issue<br />
<br />
<blockquote class="tr_bq">
dpkg -i asterisk-mysql_1.6.2.0-1_i386.deb </blockquote>
<br />
The version number and architecture might be different so check yours<br />
<br />
And that's all. No copying files around<br />
<span style="color: #201700; font-family: Verdana, Geneva, sans-serif;"><span style="font-size: 12px; line-height: 20px;"><br /></span></span></div>
Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-27647390305406577102012-10-25T18:31:00.000+03:002012-10-25T18:32:17.304+03:00Debugging Asterisk AGI in Python<div dir="ltr" style="text-align: left;" trbidi="on">
Here is a one-liner that can <b>literally</b> save you days when developing a new asterisk AGI script in Python.<br />
<br />
<blockquote class="tr_bq">
sys.stderr = open('/tmp/ast_agi_err.txt', 'w')</blockquote>
<br />
What it does is that it redirects STDERR to a file in /tmp so you can see the python console output after an un-handled exception for example, that resulted in your agi script terminating early.<br />
These kind of errors are not easy to find even with agi debug on, and can have you "scratching your head" for hours if not days when debugging a new agi script</div>
Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com1tag:blogger.com,1999:blog-5590772396683017088.post-14756424671394417232012-02-05T13:44:00.003+02:002012-02-05T13:53:07.794+02:00Solving the "Re-installation failed due to different application signatures" error when debugging Android appsIf you work on an android app from multiple workstations (i.e a laptop and a desktop) you might have encountered the following error, when trying to install an app for debugging on a device that has a version of the app,that was build on the other workstation.<br /><br /><blockquote>Re-installation failed due to different application signatures.</blockquote><br /><br />Normally you have to go to Seetings->Apps and remove the application manually before adb can re-install it.<br /><br />To solve this you need to do two things.<br /><br />Copy the file debug.keystore which resides in your home_dir/.android directory to both (or all) the machines you debug from.<br /><br />and second rebuild the app, using the new key.<br /><br />Now the app will be "automagically" updated on the device without having to go over a manual uninstall.Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-72614672960457758192012-01-26T09:56:00.002+02:002012-01-26T10:26:45.988+02:00NetMos 9845 Multiserial on Ubuntu 10.04I have installed a NetMos 9845 Multiserial (8 port) card on my pc as i need several serial ports for a project.<br />Problem is Ubuntu does not recognize more than 4 ports by default.<br />To solve this you need to add a kernel boot parameter to instruct the kernel during boot to look for more serial devices.<br /><br />With Grub2 on the machine, you can no longer edit the grub kernel parameters directly as Grub2 uses a templeting system.<br />So use your favorite editor and open (as root)<br /><br /><blockquote>/etc/default/grub</blockquote><br /><br />there you will see a line<br /><br /><blockquote>GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"</blockquote><br /><br />change it to<br /><br /><blockquote>GRUB_CMDLINE_LINUX_DEFAULT="quiet splash 8250.nr_uarts=8"</blockquote><br /><br />save the file and then issue the command<br /><br /><blockquote>sudo update-grub</blockquote><br /><br />for the changes to take effect<br /><br />Reboot your machine and check dmesg for the number of serial ports you now have<br />In my case it looks like this <br /><br /><blockquote>:/etc/grub.d$ dmesg | grep ttyS<br />[ 0.709951] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A<br />[ 0.710235] 00:07: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A<br />[ 0.710400] 0000:05:01.0: ttyS4 at I/O 0xc000 (irq = 19) is a 16550A<br />[ 0.710477] 0000:05:01.0: ttyS5 at I/O 0xc100 (irq = 19) is a 16550A<br />[ 0.710551] 0000:05:01.0: ttyS6 at I/O 0xc200 (irq = 19) is a 16550A<br />[ 0.710626] 0000:05:01.0: ttyS7 at I/O 0xc300 (irq = 19) is a 16550A<br />[ 0.710700] 0000:05:01.0: ttyS1 at I/O 0xc400 (irq = 19) is a 16550A<br />[ 0.710775] 0000:05:01.0: ttyS2 at I/O 0xc500 (irq = 19) is a 16550A<br /></blockquote><br /><br />You can also check the number and setting of the serial ports using the setserial command for every port<br /><br /><blockquote>sudo setserial /dev/ttyS7 -a <br />/dev/ttyS7, Line 7, UART: 16550A, Port: 0xc300, IRQ: 19<br /> Baud_base: 115200, close_delay: 50, divisor: 0<br /> closing_wait: 3000<br /> Flags: spd_normal skip_test<br /><br /></blockquote>Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-23808807480106898652012-01-22T10:36:00.002+02:002012-01-22T11:14:05.329+02:00Getting your Android phone recognized by adb for debuggingIn an <a href="http://skoroneos.blogspot.com/2009/11/setting-up-android-sdk-on-ubuntu-for.html">older post</a> i have shown hot to get a Samsung phone "recognized" by adb for debugging.<br />These were the "early days" of Android development...<br />Since then Android got more mature (so did adb) and now there are many companies producing Android compatible phones that developers want to use for testing/debugging their apps.<br />One of the main issues people have in Ubuntu is how to get the correct udev rules for their phone, as there are many sites ans post with old info or targeting specific phones.<br />The other problem developers face is how to use the phone in debug mode without having to run adb as root.<br /><br />First thing to do is have a go at the official <a href="http://developer.android.com/guide/developing/device.html">Android dev page</a><br />It has (most of) the instruction you need to get your phone connected and recognized.<br /><br />It all boils down to creating a new udev rule file and adding something like this<br /><blockquote><br />SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev" <br /></blockquote><br /><br />Basically you have to tell udev that devices with idVendor=="0bb4" should get read/write privileges (the MODE="0666" part) for the group "plugdev"<br />In this example, the vendor ID 0bb4 is for HTC. The MODE assignment specifies read/write permissions, and GROUP defines which Unix group owns the device node.<br /><br />It also has an extensive list of vendor id's you can use to match your device.<br /><br />In case your device manufacturer is not in that list, there is an easy way to find the vendor id of your device.<br />Connect your device and issue <br /><br /><blockquote>lsusb</blockquote><br /><br />and you will get a list of connected usb devices and their associated vendor and device id's<br /><br />in my case it looks like this<br /><br /><blockquote>Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />Bus 001 Device 015: ID 12d1:1038 Huawei Technologies Co., Ltd. <br />Bus 001 Device 005: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter<br />Bus 001 Device 004: ID 05e3:0702 Genesys Logic, Inc. USB 2.0 IDE Adapter<br />Bus 001 Device 003: ID 0409:0050 NEC Corp. <br />Bus 001 Device 002: ID 03f0:4105 Hewlett-Packard ScanJet 4370<br />Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br /></blockquote><br /><br />Locate your device (in this case it's the Huawei Technologies Co., Ltd) and the first part of the ID 12d1:1038 (i.e the 12d1) is the idVendor you need you need to put in the udev rules<br /><br />Another common problem developers face is that although the udev rules are correct the phone does not connect to adb and shows up as a number of ???????????? when issuing an "adb devices" command.<br /><br />The only way to get the phone connected is to start the adb with root privileges using sudo ,which in my book is a big "NoNo"<br />To solve this you need to set the correct user and group in the udev rules<br />Here is how my udev entry looks like<br /><br /><blockquote>SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", OWNER="your-user-name" GROUP="your-group"<br />SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"</blockquote><br /><br />To get your username and group issue the command<br /><br /><blockquote>id</blockquote><br />and look for the uid and gid entries<br />in my case they look like this<br /><br />uid=1000(stelios) gid=1000(stelios)<br /><br />Use the uid name in parenthesis in the OWNER and gid name in the GROUP, restart udev and now you will be able to access the phone from adb as a normal user without having to issue sudoStelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-15907752188271977062011-06-19T22:47:00.003+03:002011-06-19T23:01:35.385+03:00Running out of inodesHere is the problem.<br />Had a gazillion of small files stored in a 1TB partition and everything was fine, then we need it to move these files to a smaller partition and guess what, we could not.<br />What happened is that we would run out of inodes in the new smaller partition when copying the data over.<br /><br />Lesson learned ?<br />If you create a small partition and have a ton of small files<span style="font-weight:bold;"> you will</span> run out of inodes, and if you use Ext4 and have flex_bg in features, then <span style="font-weight:bold;">you can't use tune2fs to increase inodes</span> in that partition.<br />So then the only option is to reformat the partition and increase the number of inodes<br /><br />Some would argue that you could use an other filesystem with dynamic inode allocation, but personally I would go with ext4 over any version of riserfs,xfs whatever as its way more mature.<br /><br />To avoid the problem do the following when formatting:<br /><blockquote><br />mkfs.ext4 -I 512 /dev/foo <br />tune2fs -i0 -c0 -o journal_data_writeback /dev/foo<br /></blockquote><br />Formatting this way will give you way more inodes than a "normal" format would as it increases the inode size from the default 256.Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-31627031736232664822011-01-14T11:39:00.004+02:002011-01-14T11:52:11.222+02:00Canon CLC 3200 Ubuntu and Debian DriversIf you are looking for the CUPS drivers of the <a href="http://www.canon-europe.com/For_Work/Products/Professional_Print/Digital_Colour_Production/CLC3200/index.asp">Canon CLC 3200</a> for Ubuntu and Debian you can get them from here for both 32 and 64 bit version.<div>
<br /></div><div><meta equiv="content-type" content="text/html; charset=utf-8"><a href="http://software.canon-europe.com/products/0010073.asp">http://software.canon-europe.com/products/0010073.asp</a></div><div>
<br /></div><div>Have tested them on Ununtu 10.04 both on 32bit and 64bit machines and works great.</div><div>
<br /></div><div>
<br /></div>Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-76247894894155193362010-10-04T10:54:00.002+03:002010-10-04T10:58:44.525+03:00Using the web2py framework on EclipseHere is a <a href="http://allisterx.multiply.com/journal/item/274/Using_the_web2py_framework_on_Eclipse">nice post</a> on getting <a href="http://www.web2py.com/">web2py</a> to work through Eclipse for faster/better debugging<div><br />web2py is one of the best Python frameworks out there are the moment and if you are into Python or looking for a framework to develop the next "killer" web app have a look at it.</div>Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-94522995349146382010-05-27T12:41:00.003+03:002012-11-07T21:55:34.282+02:00Fix asterisk addons problems for Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
UPDATE Got a new,simpler, way to do this <a href="http://skoroneos.blogspot.gr/2010/05/fix-asterisk-addons-problems-for-ubuntu.html">here</a><br />
<br />
There is a <a href="https://bugs.launchpad.net/ubuntu/+source/asterisk-addons/+bug/560656">bug</a> in the recent asterisk-addons package shipped with Ubuntu 10.04<br />
The result is that all the modules that are part of the package fail to load with a message like this<br />
<br />
<blockquote>
WARNING[13478]: loader.c:800 load_resource: Module 'app_addon_sql_mysql' could not be loaded.</blockquote>
<br />
<br />
Till this get fixed by the Ubuntu people here a quick fix<br />
<br />
<br />
<blockquote>
sudo aptitude install asterisk-dev<br />
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.2.1.tar.gz<br />
tar xvzf asterisk-addons-1.6.2.1.tar.gz<br />
cd asterisk-addons-1.6.2.1<br />
./configure<br />
make<br />
<br />
sudo su<br />
<br />
cp -a apps/*.so /usr/lib/asterisk/modules/ <br />
cp -a cdr/*.so /usr/lib/asterisk/modules/<br />
cp -a channels/*.so /usr/lib/asterisk/modules/<br />
cp -a formats/*.so /usr/lib/asterisk/modules/</blockquote>
</div>
Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com1tag:blogger.com,1999:blog-5590772396683017088.post-58336941884821975582010-05-14T08:36:00.002+03:002010-05-14T08:38:58.866+03:00Generate passwords with crypt and random saltHere is a small perl script i found sometime ago to generate crypted passwords with random salt values<br /><br /><blockquote>#!/usr/bin/perl<br /><br />$plain=$ARGV[0]; ## Read the command line argument<br /><br />if (!$plain){ ## No parameter pased<br /> print "Usage: $0 plain_text_password\n";<br /> exit;<br />}<br /><br />## Use the Process id & time to generate the salt.<br />srand($$|time); # random seed<br />@saltchars=(a..z,A..Z,0..9,'.','/'); # valid salt chars<br />$salt=$saltchars[int(rand($#saltchars+1))]; # first random salt char<br />$salt.=$saltchars[int(rand($#saltchars+1))]; # second random salt char<br />$newuser = crypt ($newuser, $salt);<br /><br />## Generate the encrypted password<br />$crypted=crypt ($plain, $salt);<br /><br />print $crypted,"\n";<br /></blockquote>Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-3639140922597159442010-03-02T08:58:00.003+02:002010-03-02T09:44:30.546+02:00Τα μαύρα χάλια μας και καλό κουράγιοΠαρακολουθώ τους τελευταίους μήνες όλα αυτά που συμβαίνουν γύρω από τα οικονομικά της χώρας και πραγματικά αναρωτιέμαι ο 2 χρόνος γιός μου σε τι κατάσταση θα ζήσει.<br /><br />Ξεκινήσαμε από το "η κρίση εμάς δεν πιάνει", ακούσα για λεφτά που υπήρχαν και μετά "εξαφανίστηκαν" και έγιναν κοψίματα μισθών, νέους έμμεσους φόρους (τη χειρότερη μορφή φορολόγησης) μέτρα εδώ, μέτρα εκεί, κομπίνες, ρεμούλες και κατασπατάληση χρημάτων αλλά πουθένα δεν άκουσα κάποιον από τους πολιτικούς μας να αναλαμβάνει ευθύνη για αυτά που έχουν γίνει στην χώρα τα τελευταία 40 χρόνια και μας έχουν οδηγήση σε αυτή τη θέση.<br /><br />Λέω μήπως, μήπως οι κύριοι βουλευτές, υπουργοί και λοιποί "παρά το ...." (συμπληρώστε το κενό με ότι καρεκλοκένταυρο θέλετε) θα έπρεπε πρώτα να κόψουν τις δικές τους *πραγματικές* αμοιβές 50% και μετά να ζητήσουν από όλους τους υπόλοιπους να "θυσιασούν" μισθούς και λοιπά άλλα ?<br />Όχι ότι θα σωθούμε έτσι, (γιατί και του χρόνου, αν δεν υπάρξει διακανονισμός τους χρέους, <a href="http://www.livepedia.gr/index.php/Σεισάχθεια">σεισάχθια</a> το είπαν οι αρχαίοι τα ίδια και περισσότερα θα χρωστάμε) άλλα το να βάζουν όλοι αυτοί που έριξαν τη χώρα στα "βράχια" με τις πολιτκές τους,τις αποφάσεις τους και τις λοπές ρεμούλες τα τελευταία 40 χρόνια, τους "άλλους" να την ξελασπώσουν *πάλι*, και αυτοί να κάνουν εξεταστικές και να τσεπώνουν τα 300άρια άνα συνδρίαση είναι λίγο...γυφτιά.<br />Από την άλλη όμως, οι γύφτοι μια χαρά άνθρωποί είναι και δεν φταίνε σε τίποτα για την σημερινή κατάσταση, οπότε μάλλον θα πρέπει να αλλάξουμε τη λέξη από γυφτιά σε "βουλεφτιά" ή "πολιτεφτιά" γιατί μόνο έτσι μπορούμε να καταλάβουμε το πραγματικό νόημα του τι συμβαίνει.<br /><br />Και για να μην παρεξηγούμαστε, όχι ότι είμαι αντίθετος στη μείωση της σπατάλης στο Δημόσιο, το κόψιμο των "επιδομάτων" στους αργόσχολους του Δημοσίου (έδω καταντήσαμε να παίρνουν επίδομα για να μην παίρνουν 'φακελάκι'και καλά) από τους οποίους οι μισοί τουλάχιστον θα έπρεπε να πάρουν πόδι και να πάνε σπίτια τους.<br /><br />Δυστηχώς το μόνο που θα καταφέρουν οι πολιτικοί μας θα είναι μια τρύπα στο νερό, τα νούμερα δεν κάνουν λάθος.<br />Αν χρωστάς παραπάνω από αυτά που παράγεις δεν υπάρχει περίπτωση ποτέ να μπορέσεις να μειώσεις το χρέος.<br />Στην καλύτερη περίπτωση μπορείς να το μετατοπίσεις για "λίγο αργότερα" (όπως γίνονταν συστηματικά μέχρι τώρα) αλλά το τέλος θα είναι πάντα το ίδιο. Θα πτωχεύσης.<br /><br />Είμαστε σαν το ασθενή που είναι στην εντατική και οι "συγγενείς και φίλοι" τον κρατάνε στη ζωή για να μπορέσει να τους γράψει το "οικοπεδάκι" και να πάρουν ότι μπρορούν πριν το "μοιραίο", και το "μοιραίο" ίσως είναι πιο κοντά από όσο εμείς νομίζουμε.<br /><br />Οπότε, καλό κουράγιο Έλληνες.Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-23130542318794195202010-02-16T16:20:00.004+02:002010-02-16T16:28:04.005+02:00Creating OpenOffice Horizontal LinesFollowing is a 'shortcut' for OpenOffice to create horizontal lines<br /><br />Horizontal lines can be created in Writer by typing a specific symbol three times on a line by itself and then pressing Enter. <br />The choice of symbol * - = # ~ _ decides the type of line that is created.<br /><br />You can find more shortcuts and other OpenOfice related stuff <a href="http://dotancohen.com/eng/openoffice_tricks.html">here</a>Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-13775135387601478082010-02-08T18:57:00.006+02:002010-02-12T09:36:24.846+02:00Solving fax issues in Asterisk"Asterisk","fax" and "problem" are three words you find often in forums and threads of people looking for help.<br />In the age of email,and pdf there are still large number of companies relying in fax to transmit documents.<br />The reasons are many, but the problems implementors face are common.<br /><br />Bad quality of faxes with "missing" or malformed lines, large number of failed faxes etc.<br />Most of this issues come from two facts.<br />The first is that we are trying to use a medium that was primarily designed for human voice to carry high speed analog modem signals and second,that fax standards are <a href="http://www.soft-switch.org/ramblings/?p=11">not so "standard".</a><br /><br />Putting asterisk to handle faxes can be both a blessing and a curse for those two reasons.<br /><br />Asterisk has the ability to detect if an incoming (or outgoing) call is a fax and do a number of things, depending if its acting as a "pass-through" or receive the fax.<br /><br />The first thing Asterisk does is try to detect if the call is a fax call and shutdown the echo canceler on that channel.<br />For this to work, asterisk listens for the CNG tone emitted by the calling fax and if found, disables the echo canceler in zaptel.<br /><br />The CNG is in the CCITT (ITU-T) Recommendation T.30 and describes how FAX calls are established.<br /><br />During the call setup/establishment process, there are two tone signals that are send:<br /><br />CNG and CED<br /><br />The CNG signal *may* be sent from the Originating FAX machine after dialing is complete. <br />The CNG signal consists of the transmission of 1100 Hz for 1/2 second, followed by a 3 second silent (2100 Hz OFF) period.<br /><br />The CED signal *may* be sent by the Terminating FAX machine anywhere between 1.8 to 2.5 seconds AFTER answering the call. The CED signal consists of a 2100 Hz tone that is from 2.6 to 4 seconds in duration. The CED tone is useful for disabling any echo cancellers on the line.<br /><br />(notice the *may*, don't you love clearly defined standards ;)<br /><br />Asterisk then tries to redirect the call flow to the 'fax' extension, if its present in the context that is currently executing in the dialplan.<br />There you can use an asterisk application to receive faxes or redirect to another port etc.<br /><br />Recently we faced a problem with one of our clients that is using an E1 for voice and fax calls.<br />The calls come in through the E1 and the faxes are connected to an 8 port analog card <br />Some of the faxes received had quality issues and we tried to figure out what the problem was.<br /><br />After a lot of head scratching and countless tries we realized two things.<br />The PRI card was somehow "loosing" some frames and that the echo canceler, <a href="http://www.rowetel.com/ucasterisk/oslec.html">OSLEC</a> in this case, was not shutting down when a fax was received.<br />The first issue was easy to solve, as we discovered that the PRI card was sharing the same IRQ as the network card, so switching the pci slot and making sure that the PRI did not share IRQ's with any other device.<br /><br />The tricky part was to figure out why the echo canceler was not shutting down when the call was a fax call.<br />The problem with an E1 (or T1) is that the calls don't use "fixed" channel numbers as in a pstn card for example, where you know that number X is on channel Y.<br />The provider is sending the call to the first available channel and its up to the dialplan to determine where the call would be routed.<br />Shutting down the echo canceler manually for all of the E1 channels, solved the issue of the faxes but created 'random' problems of echo to the voice channels.<br /><br />So i started looking in detail (i.e the code) how asterisk detects faxes.<br /><br />What i realized is that asterisk needs a 3-5 seconds *after* the call is answered to determine if this is a fax call,shutdown the echo canceler and then jump to the 'fax' priority.<br />If you "bridge" the call to another zap channel (or to sip channel of an ATA for example) before that, then the EC stays on.<br />And this was exactly what we were doing in our case.<br />As soon as the call come in, we bridged it to the analog card, not giving enough time to asterisk to shutdown the EC.<br /><br />So the problem can be solved by adding a delay of 5 seconds and let asterisk plenty of time to determine is this is a fax call or if your extension is a fax only extension (i.e you don't expect to receive any voice calls on that number) explicitly disable the echo canceller using the zapec(off) command in the dialplan.<br /><br /><blockquote>[PRI_INCOMING]<br /><br />exten => _XXXX,1,NoOP(Incoming call)<br />exten => _XXXX,n,answer()<br />;give the caller something to hear while we wait.<br />exten => _XXXX,n,Ringing<br />exten => _XXXX,n,Wait(5)<br /><br />This was not a fax but a normal call so let's answer it<br />exten => _XXXX,n,Dial(SIP/<your-sip-phone>,30,r)<br />exten => _XXXX,n,Hangup()<br /><br />;This is were we land if asterisk detects a fax call<br />exten => fax,1,Goto(in_fax,s,1)<br /><br />;FAX<br />[in_fax]<br />;turn the echo canceler off for this channel<br />exten => s,1,ZapEC(off)<br />;call the zap channel the fax is connected to<br />exten => s,n,Dial(ZAP<your-fax-line>,60,r,tT)<br />exten => s,n,Hangup<br /><br /><br /><br /></blockquote><br /><br />One drawback of having a single line handling both fax and voice is that detection can not be 100% accurate.<br />This can be either because Asterisk did not detect correctly the CNG or the that calling fax was not sending a CNG at all.<br /><br />A quick note here is that all of the above are true for zaptel based channels (pri and pstn cards) plus bristuffed (bri) zaptel.<br />I am not 100% sure how other channels (Sangoma for example) handle this.<br /><br />And one last advice.<br />To make the quality of of faxes even better make sure that you have the <a href="http://en.wikipedia.org/wiki/Error_correction_mode">ECM mode</a> of the fax turned on both for transmition and reception.Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-35477235388302361952010-02-04T16:18:00.003+02:002010-02-04T16:24:01.595+02:00Get the md5 hash of a file from PythonPython has a module called <a href="http://docs.python.org/library/hashlib.html">haslib</a> that provides secure hashes and message digests.<br />To get the md5 hash of a file all you have to do is this<br /><br /><blockquote>import hashlib<br /><br />in_file=open('path/to/file','rb').read()<br />hashlib.md5(in_file).hexdigest()</blockquote>Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-63672340584026072172010-02-01T11:07:00.001+02:002010-02-01T11:09:17.919+02:00Life imitating art ?With the pending financial crisis in Greece, and with the recognition that our poticians have the *MAJOR* blame for what's coming, i still could not figure out why there are so many negative reports about the Greek economy that makes borrowing even more expensive and thus hindering even more the efforts for a recovery.<br />Then i remembered one of the dialogs from the movie "Sneakers"<br /><br />Cosmo: Posit: People think a bank might be financially shaky.<br />Martin Bishop: Consequence: People start to withdraw their money.<br />Cosmo: Result: Pretty soon it is financially shaky.<br />Martin Bishop: Conclusion: You can make banks fail.<br />Cosmo: Bzzt. I've already done that. Maybe you've heard about a few? Think bigger.<br />Martin Bishop: Stock market?<br />Cosmo: Yes.<br />Martin Bishop: Currency market?<br />Cosmo: Yes.<br />Martin Bishop: Commodities market?<br />Cosmo: Yes.<br />Martin Bishop: Small countries?<br /><br />And these come out of movie script back in 1992...<br />Life imitating art ?Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-45987575455978136882010-01-25T19:05:00.004+02:002010-01-25T19:15:29.559+02:00Reverting an SVN commitHere is a one liner that helps a lot when trying to revert to an old commit after you realized that you have foobared your repository.<br /><br /><blockquote>svn merge -c -R repository </blockquote><br /><br />where -R is the revision number you want to revert to.<br />What happens is that if R is negative it will be regarded as an inverse merge and the commit will be removed instead of added.<br /><br />so<br /><br /><blockquote>svn -c -99 http://svn.somewhere.com/trunk</blockquote><br /><br />will revert you trunk to revision 99<br /><br />P.S Don't forget to commit after the merge if you want the reversal to be permanentStelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-50727040255588871552010-01-23T14:30:00.003+02:002010-01-23T15:33:07.831+02:00Using SAPI 4/5 voices with text to speech in AsteriskFor a while now i have been working on TTS (text to speech) on Asterisk for a startup i am running with two friends. <br />One of my biggest problems was that the available voices for Greek in linux are very limited,sounding like robots with a laryngitis problem in some cases. <br />And from what i understood (or actually hear) with the exception of English most of the other languages had similar problems.<br />Windows has a large number of commercial "voices" that use the SAPI interface like the AT&T natural voices, Nuance, and Loqundo, but i could not find any solution that would allow me to use them with Asterisk.<br />Plus i wanted something that could easily scale to hundreds of channels and be low costs or free as in beer.<br /><br />So i used pyTTS and web2py to create, in essence, a web service that given a string returns a file with the spoken text.<br />This service runs on a Windows machine and provides a very simple API to allow selection of the language,voice and fine tuning that might be required.<br />Once the service is invoked it returns a wav file with the spoken text.<br /><br />A simple python script on the asterisk side provides a library, called ast-SAPI, that handles the communication with the web service and returns a wav file.<br />it pretty much works the same way as flite when its told to create wav files.<br /><br />At the moment the ast-sapi gets called by a Python AGI script.<br />The Python AGI receives the text and settings from the Asterisk dialplan, calls the library and then streams the resulting wav.<br />Also got an asterisk app build using flite's asterisk app as a template,to do the same from the dialplan and avoid the AGI. It works but there are some issues that need to be addressed.<br /><br />The benefits of this solution are many.<br /><br />I get good quality voices to use with asterisk and since this is similar to a web service is easy to scale and spread the load to many machines.<br /><br />Its still in a prototype stage, needs more work and i already spotted some places where things need to be changed, but overall seems to work.Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-25458760876404851782010-01-18T16:56:00.004+02:002010-01-18T17:25:57.665+02:00web2py - Getting the admin panel to work remotelyI have spend sometime looking at the web2py framework the past few days, as i was looking for a python based framework for a project.<br />My first impression is that it has some nice features but as with all "frameworks" the learning curve can be steep.<br /><br />After going through the manual over the weekend i decided to take the plunge and install it in a dev machine.<br />This is a vm machine running Ubuntu server, so there is no local browsing capabilities everything is done over the network.<br />Got web2py installed, run the server and then tried to access the admin interface from my remote workstation and got this.<br /><br /><blockquote>Admin is disabled because unsecure channel</blockquote><br /><br />According to the documentation the admin and appadmin only work from localhost and remotely via ssl (ssh tunnel or https)<br />Looking at what it takes to config Apache to test-run web2py i decided i need another simpler solution.<br /><br />I found this <a href="http://blog.i4pace.net/frog/user/Teru/article/2009-04-06/72">blog post</a> that had instructions on how to get web2py going with a self-signed certificate and gave it go.<br />(Note that there are some typos in instructions given in the blog, but its easy to figure them out)<br /><br />So i created the certificates and tried to access web2py from https this time.<br />No i was getting a strange error in Firefox<br /><br /><blockquote>SSL received a record that exceeded the maximum permissible length.<br /><br />(Error code: ssl_error_rx_record_too_long)<br /></blockquote><br /><br />The problem was that web2py was still sending http and not https to the browser, so probably the https was not working<br /><br />I used the command line switches of web2py and provided the exact path to the certificates <br /><br /><blockquote>python web2py.py -a pass -i 192.168.1.3 -p 8000 -c /etc/ssl/self_signed/server.crt -k /etc/ssl/self_signed/server.key<br /></blockquote><br /><br />and got a new message form web2py<br /><br /><blockquote>WARNING:root:OpenSSL libraries unavailable. SSL is OFF</blockquote><br /><br />It turned out that Openssl was installed on the dev machine but the python bindings were not.<br />so issuing a <br /><br /><blockquote>sudo aptitude install python-openssl</blockquote><br /><br />solved this and remote access to web2py's admin console was available over https.Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com2tag:blogger.com,1999:blog-5590772396683017088.post-650966701813387512009-12-30T00:36:00.014+02:002010-01-02T23:59:32.294+02:00Solving Asterisk DTMF callerid issues - or why i love Open SourceI have been busy the last few days with an issue that has come up, with a new batch of GSM FCT's we need to interface with some of our deployed <a href="http://www.digital-opsis.com/?ID=4&SUBID=4">Hermes e-IPBX </a>units.<br /><br /><a href="http://www.digital-opsis.com/?ID=4&SUBID=4">Hermes e-IPBX </a>is a solution we have worked on for sometime now and basically is a build-from-scratch linux distro tailored for use with Asterisk as a PBX.<br />It's a "compact" solution, requiring around 32MB of flash for the entire system including a custom web based UI we have developed.<br /><br />For a number of reasons that would take a lot of time to explain (and make excellent material for another blog post) our current version of Hermes e-ipbx uses Asterisk 1.2 and not the latest stable 1.4 or 1.6<br /><br />The problem we faced, was that we could not get callerid working with these new FCT units.<br />As it turned out these units were using dtmf and not fsk to pass the callerid info between the first and second ring.<br /><br />So at the begging we though, "hey that's not a problem, asterisk supports dtmf for callerid, all we have to do is change the cidsignalling variable in zapata.conf to use dtmf."<br />We could not be more wrong...<br /><br />No matter what configuration we tried in zapata.conf, asterisk was throughing errors and we could not get the callerid info.<br /><br /><blockquote> <br /> -- Starting simple switch on 'Zap/1-1'<br /> Dec 28 00:07:29 ERROR[3896]: callerid.c:276 callerid_feed: fsk_serie<br /> made mylen < 0 (-1)<br /> Dec 28 00:07:29 WARNING[3896]: chan_zap.c:6627 ss_thread: CallerID feed<br /> failed: Success<br /> Dec 28 00:07:29 WARNING[3896]: chan_zap.c:6671 ss_thread: CallerID<br /> returned with error on channel 'Zap/1-1'<br /> -- Executing Wait("Zap/1-1", "5") in new stack<br /> Dec 28 00:07:29 DEBUG[3896]: chan_zap.c:4001 zt_handle_dtmfup: DTMF<br /> digit: 9 on Zap/1-1<br /> Dec 28 00:07:29 DEBUG[3896]: chan_zap.c:4001 zt_handle_dtmfup: DTMF<br /> digit: 1 on Zap/1-1<br /> Dec 28 00:07:29 DEBUG[3896]: chan_zap.c:4001 zt_handle_dtmfup: DTMF<br /> digit: 0 on Zap/1-1<br /> Dec 28 00:07:29 DEBUG[3896]: chan_zap.c:4001 zt_handle_dtmfup: DTMF<br /> digit: 5 on Zap/1-1<br /> Dec 28 00:07:31 DEBUG[3896]: chan_zap.c:4907 __zt_exception: Exception<br /> on 14, channel 1<br /> Dec 28 00:07:31 DEBUG[3896]: chan_zap.c:4092 zt_handle_event: Got event<br /> Ring Begin(18) on channel 1 (index 0)<br /> Dec 28 00:07:32 DEBUG[3896]: chan_zap.c:4907 __zt_exception: Exception<br /> on 14, channel 1<br /> Dec 28 00:07:32 DEBUG[3896]: chan_zap.c:4092 zt_handle_event: Got event<br /> Ring/Answered(2) on channel 1 (index 0)<br /> Dec 28 00:07:32 DEBUG[3896]: chan_zap.c:4441 zt_handle_event: Setting<br /> IDLE polarity due to ring. Old polarity was 0<br /> Dec 28 00:07:34 DEBUG[3896]: pbx.c:1548<br /> pbx_substitute_variables_helper_full: Function result is '"" <>'<br /> -- Executing NoOp("Zap/1-1", "CALLERID="" <>") in new stack<br /> Dec 28 00:07:36 DEBUG[3896]: chan_zap.c:4907 __zt_exception: Exception<br /> on 14, channel 1<br /> Dec 28 00:07:36 DEBUG[3896]: chan_zap.c:4092 zt_handle_event: Got event<br /> Ring Begin(18) on channel 1 (index 0)<br /><br /></blockquote><br /><br />As you can see asterisk does capture part of the callerid (which is 2114019105 in this case) *after* the initial first ring, but misses the rest of it (last 4 digits).<br /><br />Trying to figure out what the issue was, the first though was that the dtmf send by the device was somehow distorted,<br />What was need it, was a way to capture what the device was sending and check it.<br />So i decided to used one of what i call, asterisk's hidden super-weapons, ztmonitor.<br />ztmonitor is a utility that comes with asterisk and allows you to monitor a Zap (aka Dahdi) channel for signal level and also save a 'raw' image of what comes in or goes out through that interface.<br />It has proven a valuable tool in the past when we were trying to solve some echo issues a customer had.<br /><br />The following command can be used to record any given zap channel, mixing input and output streams in a single file<br /><br /><blockquote>ztmonitor "channel number" -f "file_name.raw" </channel></blockquote><br /><br />ztmonitor has also options to capture input and output streams in different files and also get the stream without echo canceling applied.<br /><br />Once you have captured the data, you can convert them to a wav file for further processing using sox.<br /><br /><blockquote>sox -r 8000 -s -w -c 1 "file_name.raw" "file_name.wav"></blockquote><br /><br />What that gives you is a wav file of both streams ready for further processing and investigation.<br /><br />First thing to do is to have a visual view of the captured signal.<br /><br />There are several open source tools but i use Audacity for this task, as it provides several interesting features.<br /><br />Following is what the captured streams looked like when loaded in Audacity.<br /><br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://twitxl.com/storage/aaaato/view-15304865542172019340.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 1024px; height: 689px;" src="http://twitxl.com/storage/aaaato/view-15304865542172019340.png" alt="" border="0" /></a><br /><br /><br />By measuring the different parts of the stream the following info was gathered.<br /><br />After the 1st ring ends, there is a 640ms delay before the dtmf starts.<br />Dtmf pulses have a length of 84ms and there is inter-digit delay of 120ms.<br /><br />Things looked "normal",there are a few glitches in the captured stream but nothing too big and the level of noise was not big, so next we had to test if the dtmf pulses were valid.<br /><br />And the tool of choice for this kind of work is none other than <a href="http://www.baycom.org/~tom/ham/linux/multimon.html">multimon</a>.<br /><br />Multimon can decode a variety of digital transmission modes commonly found on UHF radio using the soundcard or a wav file as input and DTMF is one of the supported.<br /><br />It's also pretty straight forward to use<br /><br /><blockquote>multimon -a DTMF -t wav ./streamtx.raw.wav</blockquote><br /><br />would produce an output like that.<br /><br /><blockquote>multimod (C) 1996/1997 by Tom Sailer HB9JNX/AE4WA<br />available demodulators: POCSAG512 POCSAG1200 POCSAG2400 EAS AFSK1200 AFSK2400 AFSK2400_2 HAPN4800 FSK9600 DTMF ZVEI SCOPE<br />Enabled demodulators: DTMF<br />DTMF: 2<br />DTMF: 1<br />DTMF: 1<br />DTMF: 4<br />DTMF: 0<br />DTMF: 1<br />DTMF: 9<br />DTMF: 1<br />DTMF: 0<br />DTMF: 5<br /></blockquote><br /><br /><br />That proved that the dtmf send by the device was OK, so where is the problem ?<br /><br />After looking at source code and searching for people with similar problems, it was clear that dtmf callerid in asterisk 1.2 is "partially" working.<br />What partially means, is that there are basically 3 ways callerid is send.<br />One is between the gap of the first and second ring, second is by signaling a polarity reversal before the first ring and as i found out in some countries callerid is send before the ring without any signalling (i.e polarity reversal)<br />Also in the case dtmf is used to send the callerid a start-of-callerid is send before the number in the means of a letter (which is different depending on country)<br /><br />In Asterisk 1.2 when the callerid is send with dtmf there is only support for the polarity reversal method and not the other two.<br />The good thing was, that a lot of Indian telcos where using dtmf between the first and second ring so there was a <a href="https://issues.asterisk.org/view.php?id=6683">patch available</a> for 1.2 that never made it in the svn, but got incorporated in 1.4 and 1.6.<br /><br />So i got the patch,removed some of the debug lines and rebuilded chan_zap.<br /><br />Now i could get the last 8 digits of the callerid the FCT send, but some reason i was missing the initial two...<br />It looked like the dtmf detection routine was kicking-in a bit too late, missing the first 2 dtmf digits.<br />After a bit more of head-scratching i remembered there was definition in the zaptel card driver (wctdm.c) that was defining the time the line would take to settle after the ring.<br /><br /><blockquote>#define DEFAULT_RING_DEBOUNCE 64 /* Ringer Debounce (64 ms) */</blockquote><br /><br />Setting this to 32 ms solved the issue of the two first missing digits.<br /><br />The whole procedure took several days, till we managed to solve the issue, but consider the alternative if this was a closed source system, where we would have to file a bug report to the company supplying the software.<br />We would probably had to wait for an answer for much longer provided they had enough interest (and resources) to fix the issue.Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com6tag:blogger.com,1999:blog-5590772396683017088.post-43545500084144326862009-11-01T10:48:00.008+02:002009-11-01T16:23:34.326+02:00Setting up Android SDK on Ubuntu for the Samsung GalaxyOn my quest to get the Samsung Galaxy a new "ROM" to fix the issues mentioned in my last post, i installed the GalaxyHero ROM which is a custom (or "cooked") ROM.<br />The GalaxyHero does offer solutions to many of the issues i mentioned with the original Galaxy firmware and even the IIE update.<br />As usual when dealing with new devices, firmware updates of this nature,are a good way to "brick" your device so i took my time Googling, reading and taking notes of the actions required for the update, which among other things give you root access to the phone.<br /><br />The first problem i encountered after downloading and installing the Android SDK and the Eclipse plugin on my 64bit Ubuntu desktop is that the phone was not recognized by the SDK.<br />Typing in the SDK tools dir <br /><br /><blockquote>adb devices </blockquote><br /><br />came up with an empty list.<br /><br />After a bit more search here is what you need to do to get your Samsung Galaxy to connect with adb on Ubuntu and allow debugging on the phone.<br /><br /><br />On the phone, in Settings/Applications/Development, check the box "USB debugging".<br /><br />Then add a new udev rule for the phone <br />Create a file using your favorite text editor in /etc/udev/rules.d/11-android.rules<br />and add the following line<br /><br /><blockquote>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="04e8", MODE="0666"</blockquote><br /><br />Please note that the USB vendor ID <span style="font-weight:bold;">is not the same</span> for Samsung and other Android phones (aka HTC) and most of the documentation i found refers to HTC's id.<br /><br />Then type this:<br /><br /><blockquote>sudo chmod a+rx /etc/udev/rules.d/11-android.rules<br />sudo /etc/init.d/udev restart<br />./adb kill-server<br /></blockquote><br /><br />The above will make the phone "recognizable" by Ubuntu,but still if you try connect with adb it does not work.<br />The problem is that the adb shipped with the Android SDK up to this writting (Nov 1st 2009) does not work with the Galaxy.<br /><br />To overcome this you need a patched version of adb <br />More details and the source to build the adb yourself can be found in the <a href="http://www.android-hilfe.de/o2-samsung-galaxy-i7500-forum/4021-adb-jetzt-auch-auf-dem-galaxy.html#post38582">German Galaxy forum</a><br /><br />cd to your Android SDK tools dir<br /><br />rename the original adb<br /><br /><blockquote>mv adb orig-adb</blockquote><br /><br />download,unzip and make executable the patched adb <br /><br /><blockquote>wget http://floe.butterbrot.org/external/adb.gz<br />gunzip adb.gz<br />chmod +x adb<br /></blockquote><br /><br />then start the adb server<br /><br /><blockquote>./adb start-server</blockquote><br /><br /><br />see if the phone is recognized<br /><br /><blockquote>./adb devices<br />List of devices attached <br />I7500c0xVS8PQ4H device</blockquote><br /><br />Next i will post a few simple steps to get the GalaxyHero ROM installed even without the adbStelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com5tag:blogger.com,1999:blog-5590772396683017088.post-3586106889105594512009-10-25T11:40:00.008+02:002009-10-26T08:13:24.445+02:00My first week with an Android phone - Samsung Galaxy i7500It's almost a week since I got my first Android based phone a Samsung Galaxy i7500 and so I decided to write a few things of what has happened these last few days.<br />But before the “dirty” tech details a few words about the process that got me there.<br /><br />For a few months now I have been looking for a new phone,partly because my (t)rusty Qtek 9000, Windows Mobile 6.1 phone has started showing its age,partly because I was interested in looking into mobile phone development in the new platforms that have been around for a while.<br />As you expect the candidates were 2. <br />iPhone 3G(S) from Apple and an Android based phone with the iPhone having some advantage.<br /><br />So I started looking around the net to see what is need it to get into programming these 2 platforms and what the dev communities say.<br />(I had some experience in mobile device programming both in the Microsoft Mobile and Linux, on the Neo Freerunner phone sometime in the past, but not with the new technologies that have come up since.)<br /><br />To my “surprise” I realized that in order to get into iPhone development you had to be on a Mac platform (at least when I was doing my Googling, things change fast) and you had to have Apple's “blessing” if you wanted to get your application in the Apple store... Hmmm<br /><br />No one can deny that Apple has some really good products and technologies but after I have “seen the light” with Open Source I really dislike the vendor lock-in.<br />Don't get me wrong Apple fans, as I said, the products are great but if another company (say Microsoft) had pulled the same “tricks” Apple is pulling on Palm for example, people with pitchforks would be camped outside the Microsoft HQ asking for heads to roll...<br /><br />So after deciding not to go the Apple way, the next question was... “which Android based phone ?”<br /><br />A lot more Googling and visits to the local wireless operator shops (I am in Greece) to find the phone.<br />The result. <br />Most of the Android phones in the (Greek) market were HTC based and hovering in the 500 Euro range, but what caught my eye was the Samsung i7500.<br />The AMOLED screen looked fantastic and the specs were great, (although the RAM was a bit on the “low side”) and had all the bits and pieces to use it both as a dev platform and “normal” phone.<br />The only thing I missed (at that time) was the keyboard, which was a great additions and the main reason I have kept my Qtek for so long.<br /><br />So I got the phone, and started my journey into the world of Android and Samsung i7500.<br /><br />The good stuff first...<br /><br />The AMOLED screen is really great :)<br />The Android Market (Thank you Apple for the idea ) is really cool. I wondered how we lived without “application stores” so long :)<br />The design of the phone was great although "plastic" in finish.<br /><br />And the bad stuff...<br /><br />Power management with the default firmware sucks, big time...<br />There is no VPN support (at least with the Cupcake version the phone was shipped)<br />Tethering is not supported<br />The 5 MPixel camera has some serious lag issues<br />The default browser has file uploads disabled for “security reasons” <br />If you try to sync your Outlook contacts you need...Google (mail,calendar etc)<br />The control software (Samsung New PC Studio) shipped with the phone runs only on Windows and DOES NOT support firmware updates of the phone (what the Samsung people were thinking ???!!!)<br /><br />Let's see them in more detail<br /><br />After charging overnight and started using the phone, with all systems up (wifi,3G,bluetooth,GPS) I noticed that the battery was draining fast. At the beginning I thought it was because it was a new battery and LiIon batteries need a few charging cycles before the “settle” to their peak.<br /><br />After a couple more days and several charging cycles I decided to shutdown all the wireless and leave only the GSM part of the phone on. Same thing.<br />Did more Googling, found out that others had the same problem and the problem was the firmware and it had to be updated..<br />But wait... The Samsung New PC Studio says I have the latest firmware (and does not even recognize the phone when going for an update)<br />More Googling... <br />The version of the PC Studio Samsung ships with the phone.... can not updated it.... need newer from the German Samsung side...<br />Download, install, reboot,phone recognized this time, but no new firmware....Dito again.<br />More Googling....<br />Need a 3rd party program and a firmware image people have literally hacked out of the Samsung site.<br />Done it, and phone works as it should (3 days now with no re-charge)<br />/me Thanks Samsung for having to spend a day looking for all these.<br /><br />Next task....<br /><br />Move my contacts from the Windows Mobile based phone to the Android one...<br />(Still trying to)<br />Well it looks that unless you use Google services and upload all your contacts and calendar data there, you are in for the long ride...<br /><br />Tried to take some photos with the 5 Mpixel camera the phone has...<br />Disappointed... The camera lag is such that you have to press the shutter button a couple of seconds in advance... Forget those fast moving fotos...<br /><br />Ok managed to take some pictures, let's try to upload them to Twitter using the web application of TwitXL...<br />The Upload button of the page was disabled by the buildin browser, Hmmm so I need an application like the iPhone does ? At least they have an 'explanation' that their system does not have a “filesystem” , what about Android ? (Must be the first Linux based filesystem-less system)<br /><br />Wanted to do a VPN with the office, (free wifi access points are nice, but do you want all our data unencrypted over wifi ? I don't.) no luck either...<br />Android 1.5 (Capcake) does not have VPN support, 1.6 (Donut) has.<br />There is no “official” Samsung image with Donut for the moment, but the good people of the dev community have came up with solutions of their own (this is were Open Source makes all the difference)<br /><br /><br />What's the verdict after all these ?<br />The phone was not ready for the market... I think Samsung has pushed it out the door, to get into the “Google Wave” with little or no QC<br />If a non technical inclined person gets his/her hands on this phone they will return it for service in the next few days... not good, unless of course the market you are after are the “techies” like me, that can swift through pages and pages of forums and blogs looking for the little piece of info to fix it...<br /><br />Android has potential, but still needs a lot of work and refinement if its going to be in “peoples” phones and not just for the techies.<br /><br />BTW if you are new to the Galaxy i7500 and strangling with the same issues, this <a href="http://wiki.dandascalescu.com/reviews/gadgets/pda_phones/samsung_i7500_galaxy">link</a> can help (at least it did in my case)Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com3tag:blogger.com,1999:blog-5590772396683017088.post-75341195163630624222009-09-12T21:28:00.002+03:002009-09-12T21:55:32.936+03:00Installing compact fluorecent lamps - A year laterLast November i decided to remove all incandescent lamps from the house and replace them with low power compact fluorescent one's.<br />I replaced 35 100 Watt lamps with the Osram EL Dulux 20W.<br />http://www.osram.com/osram_com/News/General_Interest_Press/2007/Press616042.jsp<br /><br />I chose those because mainly i liked the type of light they produced and decided to pay the extra cost to save some CO2 from the planet and go "green" on lighting.<br /><br />A compact fluorescent lamp is much more expensive to buy than a standard incandescent one, but you save on the long run from the lower electricity consumption and the *longer* working life its supposed to have.<br /><br />The Osram El Dulux 20W was rated at 10.000h which would replace 10 normal lamps, according to what is printed on the box.<br />Assuming an average of 6h of working time for the lamp per day , it should last for approx 1666 days or 4.5 years before it fails.<br /><br />Well i can report that in less than a year, 8 from the 35 lamps have failed and need it to be replaced.<br />That's almost 1 in 4 (or close to 25%) loss and sure is not what i had hoped for.<br /><br />I am not sure why the lamps failed, as they failed in random intervals and random places in the house, with the first staring 3-4 months after it was installed.<br /><br />I don't believe that anyone from Osram will read this blog post but in the case it does, i have kept most of the failed lamps,as i was looking for a place that would accept them for recycling (yes lamps get recycled and need to be recycled as they contain some "serious" metals and not so good chemicals) and if you want i can send them back for you to test with all expenses paid.<br /><br />In any case, Osram, you should check your quality as you have a really dissatisfied customer.Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-18420261896763714122009-06-13T17:51:00.002+03:002009-06-13T18:00:14.200+03:00European Commission pushes for software patents via a trusted courtFirst of all a warning. If part of the following text looks Greek to you,it's because it is. :)<br />It's part of a message i received from Konstantina Zoehrer regarding the new "initiative" to get software patents in EU, through the backdoor by use of a "trusted court".<br />For more info check this <a href="http://press.ffii.org/Press_releases/European_Commission_pushes_for_software_patents_via_a_trusted_court">link</a>.<br />There is a <a href="http://petition.stopsoftwarepatents.eu/stats/">petition</a>also you can sign.<br /><br />Well it looks like "special interests" follow the good old saying "if you fail once, try again"<br />So, let's try and stop them one more time.<br /><br />Greek text follows<br /><br />Προτρέπουμε τους νομοθέτες μας<br /><br />* να περάσουν εθνικές νομικές διευκρινίσεις για το δίκαιο ευρεσιτεχνίας για να αποκλείσουν οποιοδήποτε πατέντα λογισμικού,<br />* να ακυρώσουν όλους τους εγκεκριμένους ισχυρισμούς για πατέντες που μπορεί να παραβιάζονται από λογισμικό το οποίο τρέχει σε προγραμματιζόμενες συσκευές,<br />* επίσης να αγωνιστούν για τη διάδοση των εν λόγω κανόνων σε Ευρωπαϊκό επίπεδο, συμπεριλαμβανομένης της Ευρωπαϊκής Σύμβασης Διπλωμάτων Ευρεσιτεχνίας.<br /><br />ΥΠΟΓΡΑΨΤΕ ΤΗΝ ΑΙΤΗΣΗhttp://petition.stopsoftwarepatents.eu/stats/<br /><br />Διαβάστε περισσότερα εδώ http://press.ffii.org/Press_releases/European_Commission_pushes_for_software_patents_via_a_trusted_courtStelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0tag:blogger.com,1999:blog-5590772396683017088.post-53415519802318912112009-06-02T10:51:00.003+03:002009-06-02T11:19:29.523+03:00First results on a WiFi security surveyFor the past few weeks i am working on a paper for the security of the wifi networks.<br />Part of my research was to look at the state of security of deployed wifi AP all over Athens.<br />Athens is a rather large city (4+ million people leave here) and i believe that a sample of that size could be indicative of the general state if wifi all over.<br /><br />The first results are rather mixed.<br /><br />The good news is that the number of wifi ap's deployed is really large. <br />By driving through some of th main streets crossing Athens, and some of the business areas i found more that 10.000 unique MAC's of AP.<br />Considering that i only covered a very small portion of the Athens metropolitan area and was only driving on main roads, i estimate that the number of deployed AP will be over 200.000 to 250.000 and this is a really a very conservative estimate.<br /><br />The bad news now.<br /><br />More than 50% of the AP's surveyed,are using no encryption or WEP and from those using WPA 70% is using the default ESSID's set by the ISP's that provided the unit,making them easy targets for rainbow table attacks.<br /><br />It looks like that most people trust the settings their ISP provides when they get their adsl IAD, or don't how to change them or simply are unaware of how wifi works and the dangers.<br />One ISP in particular seems to be the "king of unprotected wifi AP" in Athens as 3/4 of all the AP's with their ESSID is either open or using WEP.<br /><br />I am still collecting data and working on the paper, but given the rather large number of samples i allready got i don't think the results will change much,but this is something to see.<br /><br />On the funny side of things, if people do decide to change their ESSID they can be very creative :)Stelios S. Koroneoshttp://www.blogger.com/profile/02742743346345518922noreply@blogger.com0