Fixing non-responding back and recent button on Android

After a reboot my daughter’s Motorola Moto G2 had some strange issues.
The back and recent button stopped working. She also didn’t receive any notifications.
That was an issue that I wanted to solve.

Plan A: Rebooting
Rebooting the device didn’t solve the issue.

Plan B: Google the problem and try all the reasonable solutions

  • Clear all caches and remove all the temp files.
  • Use the device as another user. This brought the recent apss button back!
  • Do a factory reset: That isn’t a reasonable solution, so I refused to do that.

The solution
I already had the Android Debug Bridge installed on my laptop (I do some Android developing).
If you haven’t, you can download it at https://developer.android.com
You don’t need to install the full Andriod Studio. The command line tools are only wat you need.

Bring your android phone in developer mode.
You do this by navigating in settings->about device->build number. Tick build number 7 times to enable the developer mode.

Connect your android to your laptop with a usb-cable.
Open a command line shell and go to the folder with the adb excecutable. (I love the smell of the command shell in the morning, it smells like victory 😉 ) On my Windows I found it at .\AppData\Local\Android\sdk\platform-tools
You can test if ADB finds your device with the following command:
adb devices

One device should show up. If not, you have to install the usb-drivers for your device!

Now, run the following command:
adb shell am start -n com.google.android.setupwizard/.SetupWizardTestActivity

Walk through the wizard and your device is again full functioning!

It seems that after an update, you need to run that wizard. You make it impossible to quit the wizard, your keys get locked. But when the wizard doesn’t show up, your keys are kept locked.

Posted in #backlog, Android, problem, software | Tagged , | Leave a comment

Windows :when ping doesn’t work but nslookup does!

I have spent some time solving the following strange puzzle.
A laptop was brought in. It made an internet connection (both wireless as wired) but it couldn’t resolve any domain name to an ipaddress.

ping www.controlaltdieliet.be gave as output:
the host www.controlaltdieliet was not found.

But ping 77.109.94.230 did work.

But using nslookup did resolve the domainname correctly.

After trying all the default steps like: checking all the network settings, resetting all the network settings, resetting the dns-cache (that was empty) updating the drivers, updating the bios (how desperate can someone be)and stuff like that, I installed a network sniffer.

I learned that nslookup did contact the dns-server but that a ping command didn’t send a dns-request. What was going on?

I started comparing the registry settings at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters. I found that hostname wasn’t there. When I checked the computers name, indeed it was empty. After setting a hostname, the problem was solved. What a simple solution for something I spent quite some time on.

Posted in Uncategorized | 1 Comment

Looking back at Zeroconf

The Zero Project organises each year their Zero Conference.

The Zero Project wants a world that has no borders for persons with a disability.
They are striving for an inclusive world.

They organise a yearly conference. This Zero Conference had 534 participants with 70 different nationalities this year.
I was lucky to attend the conference because my employer got a reward for an innovating it-practice which I programmed.
More info on the practice you can find at http://zeroproject.org/practice/belgium-vclb-gent/The conference was held at the United Nations Office in Vienna and was very well organised.

It was one of those conferences that gave me alot of new insights, ideas, energy and motivation.

I’m not that common with inclusion and the problems persons with a disability encounter and I want to share some insights I learned at the conference.

1) Inclusion is not a matter of “can we”, only a matter of “are we willing to”
Many measurments are very easy to take to get a more inclusive enviroment. I can recommend the website http://universaldesign.ie to see what you can do.
Alot of the attendees has a disability but I never heard: ‘I can’t do …’, I often heard: ‘With this adjustment, I ‘m able to’.

2) Inclusive education is better for everybody.
I learned that inclusive education is not only better for the children with a disability but for all the children. They all learn better
(maybe because what is good for a few is good for everybody?) and get better results. Also children learn to look at people with a disability as normal people.

3) The future looks bright.
I have seen some nice implementations like NFC-tags that bring audio to blind persons or a navigation app for blind people in buildings that directs them very precisely.
I saw a paralysed person flying a drone with a joystick that he controlled with his mouth. But what if we can read brainwaves in a more efficiant way, what kind of interfaces can we create with that?
Think that you till your left feet for saving this file, lifting your right feet will open a new file?

Lets build a world were we all belong!

Posted in hardware, Inclusion, software | 2 Comments

What did I learn at conferences this autumn

What did I learn from the conferences this autumn.

I spoke at the 4 previous Astricons. More then 700 people that use Asterisk (an opensource telephone/media server) gather there.  Normally I hang out with the developers at Astricon. Not that I would describe myself as a developer. I’m more the Swiss army knife at work. I solve problems quickly, i’m handy and know alot of things. But I’m not specialised. The fun part at Astricon is that I can socialise with people who are more specialised then me. I always learn a lot from them.
They like that keep finding subjects for my presentations and dangerous demos so easily. Maybe that is my talent: being creative with all kind of technologies.
I spoke about connecting 135 androids to the Asterisk PBX, but also about apps for the Digium phones or calling to a non-sip camera.

This year at Astricon it was very clear: we are in the era of API’s. If you don’t have an API, you don’t exist. It makes connecting and integrating things way much easier. But the API you are writing has to be very easy to use and well documented. Some examples in multiple programming languages are always appreciated by the developers who have to use your API.

Three weeks before Astricon I attended rejectjs, jsconf and cssconf in Berlin.
It was my first time that i went to a front-end developer conference. I do some front-end but to do it really good you have to specialise as well. I always felt discouraged because css and js needs so many hacks to make it work all browsers.
But hey, everybody is struggling with that. And I learned it doesn’t matter if it is not tot the pixel identically in every browser.
And that css-errors are normal. Sites that don’t show css-errors, are using browser specific css-sheets.

But even more interesting is comparing a telecom-conference and front-end developer conference.

The front-end developer conferences were really good organised: you had power-supplies underneath the chairs to charge your devices, I had the best conference food I can imagine, at the toilets you could find  toothbrushes and toothpaste, deodorant for those who forget theirs at home or had to leave it at the airport. They also do their very best to be open to anyone, they even provided live speech to text transcription! It is great not only for people with hearing disabilities. When I was distracted for a moment or didn’t understand something, I could look at the transcript.  There were for 40.000 euro free scholarships tickets,  there was a strict code of conduct, there were men-, women- and all gender toilets! I never saw so many women and transgenders at a tech-conference. So, yes, a code of conduct does work!

The slides that the speakers showed us, were amazing. At a telecom conference it is not uncommon to see  the default white impress slides. At the front-end the slides were spectacular and also a lot of cat pictures.
After these conferences I started using revealjs to make my slides. You can take a look at  my Astricon15-slides at http://www.controlaltdieliet.be/astricon2015

But Astricon is great because people start speaking to you way much easier than at the front-end developer conference. I don’t know why? Maybe because there are more different nationalities who are all abroad? Maybe Americans are starting a conversation easier then Europeans? I don’t know, but I noticed the difference. I’m still in touch with people I met at my first Astricon and each year I connect to more and more people. At the front-end I met some other Belgians but I don’t keep in touch with them.

One more thing about speaking at a conference. Much more people should try it! You don’t have to be an total expert. For me is speaking at a conference is often the reason to build that project or to study to subject I will to talking about.
The speakers aren’t smarter than you, they just got more nerve to stand up on the stage. But don’t be afraid, I never had a bad experience as a speaker. People appreciate that you are willing to share your knowledge, your passion and your experiences. That is my last advice: also speak about your mistakes, so others don’t make the same.

Posted in asterisk, software | 4 Comments

Upgrade to https for free with letsencrypt.org!

Be prepared!

Https is coming your way, very soon.

Firefox-nightly already marks forms with a password-field as unsecure when https is not uses (http://news.softpedia.com)

Anyway, https should be used as standard. Why? It gives some more privacy to our visitors and some more security as well. Https will become standard (just as IPv6) and http will become marked as old and unsecure.<p>

I always despited the Certification Authorities (CA) because they ask money because they claim to be trustworthy.

But now there is the free CA letsencrypt.org. They get their funds through sponsors and they want to be a free,transarent, automated CA.

It is still closed beta at this moment, at December 3th they go in public beta stage.

I already tried their service. Even this page is now served with an ssl-certificate from letsencrypt :).

Some things you have to know:

  • All modern browsers recognise their certificates.
  • They don’t provide wildcard certificates. (althoug multi-domain certificates should become possible)
  • Domain validation is done by sending a acme-request to your domain and receiving back the right response
  • You can run the lets-encrypt tool on another server as the webserver
  • Certificates are valid for 90 days (but you can automate the renewal)
  • Client-certificates are not possibleI tested it on a FreeBSD (not the actual webserver)  So I had to use the manual mode.
    letsencrypt -a manual certonly -d my.domain.be --server https://acme-v01.api.letsencrypt.org/directory
    

    My Apache webserver uses this ssl-configuration:

    <VirtualHost my.domain.be:443>
    
    #   General setup for the virtual host
    DocumentRoot "/usr/local/www/apache24/data/path_to_site"
    ServerName my.domain.be:443
     NameVirtualHost my.domain.be:443
    ServerAdmin info@controlaltdieliet.be
    ErrorLog "/var/log/httpds-error.log"
    TransferLog "/var/log/httpds-access.log"
    SSLEngine on
    SSLProtocol all -SSLV2 -SSLV3 
    SSLHonorCipherOrder On
    SSLCipherSuite ECDH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS!AESGCM:DH
    SSLCertificateFile "/usr/local/etc/apache24/ssl/my.domain.be/cert.pem"
    SSLCertificateKeyFile "/usr/local/etc/apache24/ssl/my.domain.be/privkey.pem"
    SSLCertificateChainFile "/usr/local/etc/apache24/ssl/my.domain.be/fullchain.pem
    SSLCACertificateFile "/usr/local/etc/apache24/ssl/my.domain.be/fullchain.pem"
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory "/usr/local/www/apache24/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>
    BrowserMatch ".*MSIE.*" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0
    
    CustomLog "/var/log/httpd-ssl_request.log" \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    </VirtualHost>
    
    

    I redirect all http-traffic to https with the following Apache configuration

      NameVirtualHost *:80
      <VirtualHost *:80>
      ServerName my.domain.be
      Redirect permanent / https://my.domain.com/
      </VirtualHost>
    
    

    Give it a try and have fun!

Posted in #backlog, #morecrypto, software | 3 Comments

Connecting a non-sip network camera to my asterisk

I have some Linksys WVC210 webcams at home. They were not expensive and were fitting my needs.

But then I got in the world of SIP and those WVC210 cameras don’t support SIP.

Now I found a way that I actually can connect the cams to my Asterisk.

First I created a v4l2loopback device. You can find the source at https://github.com/umlaeute/v4l2loopback

Then I let ffmpeg read the RTSP-stream from the WVC210 and send it to the loopbackdevice
ffmpeg -i rtsp://ipfrommycam/img/media.sav -f v4l2 /dev/video1

Then I use the console-based sip-phone that comes with linphone http://www.linphone.org
The linphonec is video-capable (sending) and has autoanswering. So I can now make videocalls to my cameras.

I wonder what you could do when with this when you combine it with WebRTC and mobile G4 internet. You could see on a mobile device the live videostream from the back of the building while you are still standing at the front…

Posted in asterisk, hardware, software | 1 Comment

Sending and receving fax with Asterisk

Fax is really outdated and should be replaced by just sending an email.
Fax is old, slow, unreliable and enviroment unfriendly.

But anyway, I’ll show you how to send and receive faxes with Asterisk in a userfriendly way.
You can send a fax from a pdf file through your webbrowser and incoming faxes are delivered to your email as a pdf file.

What do you need?

  • A working Asterisk configured with res_fax enabled

  • And you need to have ghostscript and libtiff-tools on your machine

Handling incoming faxes

Add the following to your dialplan

[incoming_fax]
exten=> s,1,NoOp(Incoming fax )
same => n,Set(FAXDEST=/tmp)
; put a timestamp on this call so the resulting file is unique
same => n,Set(tempfax=${STRFTIME(,,%C%y%m%d%H%M)})
same => n,ReceiveFax(${FAXDEST}/${tempfax}.tif)
same=> n,System(echo | /root/scripts/convertTif2Pdf.sh ${FAXDEST}/${tempfax}.tif ${FAXDEST}/${tempfax}.pdf)
same=> n,System(echo | /root/scripts/sendFax2Mail.php youremailadres@yourdomain.com ${CALLERID(num)} ${FAXDEST}/${tempfax}.pdf)
same=> n,Hangup()

The dialplan receives the faxmessage as a tiff-file. Every computer can open a tiff-file but many people prefer pdf for a fax-message. So the convertTif2Pdf.sh script converts the incoming message to a pdf.

#!/bin/bash
tiff2pdf -o $2 $1
exit 0

The sendFax2Mail.php (I know, ugly php) sends the pdf file to your emailadress.

#!/usr/bin/php
\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n";
$header .= "This is a multi-part message in MIME format.\r\n";
$header .= "--".$uid."\r\n";
$header .= "Content-type:text/plain; charset=iso-8859-1\r\n";
$header .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$header .= $message."\r\n\r\n";
$header .= "--".$uid."\r\n";
$header .= "Content-Type: application/octet-stream; name=\"fax.pdf\"\r\n"; // use different content types here
$header .= "Content-Transfer-Encoding: base64\r\n";
$header .= "Content-Disposition: attachment; filename=\"fax.pdf\"\r\n\r\n";
$header .= $content."\r\n\r\n";
$header .= "--".$uid."--";

//SEND THE MAIL
mail($email, "Fax received $from" , $message,$header) ;
exit(0);
?>

Now you can receive fax-messages in your mailbox!

Sending faxes

I created a small webpage that allows you to send out fax-messages from a pdf-file. It uploads your pdf-file, converts it to tiff and makes a callfile that sends out your fax. You get feedback in an email.

First the webpage


Sending a fax




Sending a faxmessage

s,n(SUCCESS),System(echo | /root/scripts/sendConfirmMailFax.php mail@yourdomain.com OK ${FAXOPT(statusstr)}) ;sends a confirmation to your email exten => s,n,Goto(HANGUP) exten => s,n(FAIL),System(echo | /root/scripts/sendConfirmMailFax.php mail@yourdomain.com FAIL "${FAXOPT(statusstr)}" ) ;sends a error report to your email exten => s,n(HANGUP),Hangup()

There is a small script that sends you a delivery report. That is sendConfirmMailFax.php

#!/usr/bin/php
\r\n";
mail($email, "Fax report" , $message,$header) ;
exit(0);
?>

Sending a fax is that easy.
Have fun!

Posted in asterisk, software | 2 Comments

Python-script for connecting to skynet.im through a websocket

My previous post handled SkyNet, a great framework for the Internet of Things.

SkyNet provides some examples in nodejes and with curl.

I’m learning Python at this moment and I wanted to create a script that can connect to SkyNet through a websocket.
So I wrote a basic example like the ones SkyNet is providing with just an overview of the functions
And I wrote a second example that allows you to send sms to any Belgian mobile number (+32 4[789]) limited to 15 messages a day.
The uuid is db1f0601-be88-11e3-a3c6-0b41aaf824e3 and the payload needs the following: {message:”the message you like to send like: Hasta la vista” number:”The destinationnumber”}
You can find the scripts at https://github.com/ctlaltdieliet/skynet.py

The socketIO-client is required by the script
You can install it like this: easyinstall socketIO-client

A little bit more information.
First you have to make a connection to Skynet.im
When you have a connection, SkyNet will send you an identify-message with the socketid you are connected trough.

Then you can send an identity with uuid and token to identify your device. If you haven’t got a uuid and token you have register your device first. You can choose your own uuid and your own token or let SkyNet generate one for you.

Once you have successfully identified yourself, you’ll get a ready-event. Now you can start quering SkyNet, sending messages, updating your device.
It is quite easy.

Have fun with it!

Posted in software | Leave a comment

Skynet.im, welcome in the world of the Internet of Things

The weekly Friday VOIP User Conference always has great guests talking about the newest topics in the world of internet-based communications. There is one central guest and a panel with specialists that asks questions, all in an informal way.
On Friday March 14th Chris Matthieu spoke about SkyNet and I was happily surprised by his presentation.

SkyNet is a machine to machine instant messaging platform for the Internet of Things You can easily connect your devices to your private SkyNet running on your own hardware or you can connect to the public SkyNet.

The internet of things? Imagine a world where your house notices that you go to sleep (last movements registered in bedroom, lights are out) and it lowers the temperature by itself and dims the light you forgot to turn out at your desk. The next day you are working overtime, you send a text to your thermostat to tell that it has to wait 2 more hours before it starts heating the house. Or that you can query where the nearest cash register is that isn’t empty. Or that your arm wrists sends data to your doctor about your blood pressure, temperature and heart rhythm because the doctor wanted to monitor you.

Connecting to SkyNet is really made easy. You can connect through a REST-interface or a websocket and then you start sending JSON-messages and you get JSON-replies. To make it as easy as possible, there is a SkyNet module for Node.js You find examples on www.skynet.im

But most sensors or controllers don’t speak JSON. The great thing is that SkyNet is the ideal middleware that facilitates talking to these devices. You can connect your controller to an Arduino or a Raspberry and let those do the translation from and to your device. So you can turn out your lights through Twitter and receive text messages from your thermostat.
But it goes further, SkyNet allows you to query the connected devices. You can find all drones in your area, or all weather stations in the area you are planning to visit. It is a feature request that you can query a node to retrieve the services it can deliver.

The project is fast moving forward. There is a long list of requests (like encryption, pull a list from the device with its available payloads, query what nodes are public and how to access them without using the token, much more examples for devices that can be connected to SkyNet …).

I’m creating an examples that is capable of sending a text-message to an Belgian mobile number. I’ll put them online when they are full functioning.

I hope that SkyNet keeps growing. It has a lot of potential and could become in my humble opinion what Google is for the internet of humans.
Have fun with it!

Posted in Uncategorized | 3 Comments

Installing software on remote clients through XMPP

I maintain a 150 laptops for people who spend more then 80% of their time at their clients.
And sometimes I have install new software on all of those laptops. The users don’t have administratror-rights so I can’t write a manual to let them install the new software.

XMPP is a nice way to send messages to devices and it fills some needs I had
1) Messages are stored when a device isn’t online,
2) You can group devices in chatrooms (Multi User Chats in XMPP). I have a general MUC where all the devices join and then I have MUCs by branch.
3) You can send messages to individual devices as well to groups as to all devices.

I use the smack libary for handling the XMPP. http://www.igniterealtime.org/projects/smack/

I have some hardcoded commands (like reboot and shutdown) but most of the installing commands I send through an url. The program downloads the url that contains a XML-file. The XML-file tells what the program has to do.

I use NSSM – the Non-Sucking Service Manager (http://www.nssm.cc) for installing the program as a Windows service. So it starts when booting the laptop and it runs with full admin-rights. Therefore I needed to have a batch-file to start the program.

You can find the source right here on Github.

Posted in Uncategorized | Leave a comment