Mostrando postagens com marcador freesoftware. Mostrar todas as postagens
Mostrando postagens com marcador freesoftware. Mostrar todas as postagens

segunda-feira, 8 de junho de 2015

GSM bridge between two raspbx hosts

Disclaimer: I know there's a lot of options on the market for free long distance calls like Skype, Viber, WhatsApp and so on. The goal of this personal project was all along to come up with a proof of concept that actually works, study something different other than my actual job and, why not, have some fun :) BUT, yes, there's one single use case that this setup will be useful: You're in the middle of nowhere, no internet connection and you need to call someone in the other side of the planet but you don't want to pay a long distance call: BINGO!

Disclaimer2: For this tutorial you'll have to be prepared for Asterisk terminologies like trunks and channels. If you're not familiar with this vocabulary, please take a quick look at this documentation.

Description of the environment: The server1 is placed on the Brazilian side. It's a Raspberry Pi model B that runs an asterisk-modded-for-raspberry-pi distro called raspbx. Attached to it there's an USB GSM dongle with a SIM card for the local Brazilian operator. In the same network of my server1 there's a Cisco PAP2t Internet Phone Adapter and, attached to it, a regular land line telephone. The same setup is duplicated on the German side, except that the Raspberry Pi is model B+.

5VpNk+MmEP01rkouqZFky7PHzGZ2ctmqVPmwyRFLjESNJFQIf82v30ZqJNBHxh47yFXxxaIFNLzmPRrsRfA1P74IUqbfeUyzhf8QHxfBHwvf95bBF/hSllNjeVyvGkMiWIyVOsOGvVM0PqB1x2JaWRUl55lkpW2MeFHQSFo2IgQ/2NVeeWZ7LUmiPXaGTUSyofUHi2WKs/DDzv4nZUmqPXshTnhLordE8F2B/hZ+8Fp/mtc50X3hRI8PTXGJ7U9YXi+1p8Ia0TvnuWUQtGrRwz5fGQ4Ly1suYioak7ZlrHgzMQqeIZyCc2ipnvLjV5qpkOpoNc2+Tbxt4RK0sHxPNgiaFpU8achpDBHAIhcy5QkvSPbcWZ9qWKnqAUB6SmWewaMHj/TI5N/G8z+qym8rKFWSCPm7WhCq1z2BFo3tG4PxYIsi7tUAi/E+2ol97VUVmmGrsU7OHE0V34kIa+FswXFCsVbNBwTnhfKcSnGqw5kRyfZ27wQjlbT1OmjhAdEdRxpdw8R22KkgVbmlonZXsoUfZjCkp5jt4TFRjyOmXyoKIAjvV/0O3I606Ft7IT6kTNJNSWpYDqAcdhhxpFRIqoVkAt0hbthAywzKTvCA5YNBYmRAavBX264BGglrAL2rtmB42XxXQsiLBGAYQTYH8cyngZ0bQt8bQrgegfDLDSDUri5SBYueM0nE51QBZ2uqQr2/OFAFdG2qAt9J2CTcr7c26pqzK3ecxe3cgIEVgEIB4XAPRLB6tIEIh0B4ev82kQhvQT29Pm+zIX/Al3M49zlOrYecqlF1wCkPdwCn6gVYiJN6pVrUhXtQtpEouMp30LVB6ZKU9VGBVREfrnLnG+rSYU6CgmKAIWlGy5QXdA4k9JQQidWZqYW2XYOEXhf/ITlrBt5JauGNMNCrj5guhHDIwSvOHP69nzlCvT5nOHR4Q4ZfcOqYhtY9iD1tcHns8PHuxak2tBt3IwJ3snE3GjHPmUT7vodDySqY71CiU/y7T8XNhaMM/YWj754uSJX0/a/OlR4R9qvwRI38n2z9Y5FwtvVr5xPpN76ddXt2mX+P3L62Cfg8WNiy5jIDD7APA4utIO8sY/ATh05Y4OblwMXbkLBZBj/9KGI60H57veh18NEtzC3WS4CDNTAaQtGpRpSRqmKRjYClPF2Nz16vDGEygNBQmTho29nagh7+4nD31kXB620F7baou2g0D1uZPzV90JHXvy5rhHLQUR2rdtrnhW+ofgkVuVrfIcnVSi22lfqqF/sgKW8X/1k5uUtKhD1OaBlxwomhht4fJybyF28kbfw3zpxPj76n9rx0KT0mh3w1PaDY/aDcVO/+LBA8/wQ=
What it does: This is the list of features that this project performs right now:
  1. Someone in Brazil calls my Brazilian number, the dongle1 answers the call, redirects to an IAX2 trunk directly to server2. The server2 takes this incoming call and uses the dongle2 to place a new call to my german cellphone. The other way is still pinned to a single phone -- like, call my dongle2 to reach a single number in Brazilian side -- but improvements are coming.
  2. Someone uses phone1 on Brazilian side to call extension phone2 on German side (and vice-versa) like a regular landline phone.
  3. Someone uses phone1 or phone2 to reach my german cellphone.

Ok, so LET'S DO IT!!

I'm gonna skip the PAP2t configuration because I think it's too much. This is only needed if you want to use land line telephones, it's not required for the GSM bridge. If anyone is interested in doing that, please leave a comment and I'll write a new post only for that configuration.

Important note: All the configuration explained from now on is identical on both servers.
  1. Install raspbx on your RPi's SD card. Also take a time to read through the raspbx documentation, which is very useful
  2. Use the script install-dongle (built-in inside raspbx) to install your dongle on your RPi. Important notes regarding problems I got:
    1. There's a list of GSM dongles that are tested with voice, SMS and USSD. I bought the Huawei E160;
    2. I had to unlock the voice feature with DC-Unlocker for Windows;
    3. Plug your dongle and only after that plug your RPi power. If you try to plug your dongle while the RPi turned on, you may experience your RPi to reboot due to power consumption failures;
    4. If your RPi starts rebooting it's because it can't handle the gsm dongle power consumption, in this case, use a proper powered USB hub. I bought the D-Link Dub-H7
    5. Find out the IMEI and the IMSI code of your dongle and set the correct values under /etc/asterisk/dongle.conf because /dev/ttyUSB1 or /dev/ttyUSB2 may change;
  3. Before you start configuring raspbx itself, it's important that you have both sides with network configured properly with static IPs and (in my case) DynDNS. I didn't want to open too many ports on the routers on both sides so I just setup an OpenVPN vpn; 
  4. Setup a new custom trunk for your dongle under Connectivity  Trunks  Add Custom Trunk and set these values:

    Trunk Name: to-my-cellphone
    Outbound CallerID: Your SIM card number with country code (with a plus sign at the beginning)
    Custom Dial String: dongle/dongle0/$OUTNUM$

    Note: This is the trunk that will actually place the inbound calls to your personal telephone.

  5. Setup a new IAX2 trunk under Connectivity  Trunks  Add IAX2 Trunk and set these values:

    General Settings:
    Trunk Name: Something that would remember the incoming connection from the other server
    Outbound CallerID: Your personal phone number

    Outgoing Settings:
    Trunk Name: (same as above, I also used the same name and it's ok)

    host=static IP under vpn of the remote server
    username=any username
    secret=any password
    type=friend
    trunk=yes
    qualify=yes
    qualifyfreqok=25000
    tos=0x18

    Note: The IAX2 trunk is responsible for redirecting calls from this server to the other.

  6. Setup a new inbound route under Connectivity  Inbound Routes → Add Incoming Route:

    DID Number: Your SIM card number with country code (with a plus sign at the beginning)
    CallerID Number: Your personal cell phone number
    Set Destinations: Trunk and your recently created IAX2 trunk.

    Note: This is the route responsible to redirect an inbound call on your local dongle over the IAX2 trunk and then to your remote server.
If you noticed any omitted fields in the above configurations, it's because I didn't fill with anything or it's not important. I also did some extra work on Claning the SIM card memory for SMS every once in a while, I set a static IP for the OpenVPN so each server can always see each other, an additional service to check my credit balance every month and so and so forth. If you also want details like that please let me know in the comments :-) 

That's it! You did it! If you need more help setting up anything else please let me know in the comments of this post. Good luck and have fun! :-)

terça-feira, 16 de agosto de 2011

Contribute code to an Ubuntu defect with Launchpad and bzr in the RIGHT way

I am writing this post because I had to read some manuals and (wrongly) send a patch email to a mailing list to learn how to actually be able to contribute with code to an Ubuntu package. If you need detailed information, please google some official documentation. But if you just want to start coding, this is your place, here you'll find the cake recipe to do it.
  1. Sign up to a Launchpad account.
    1. The only really needed information is your username and your ssh key
  2. Choose a project. Ensemble, for example.
  3. Download the source code:
    1. mkdir ensemble
    2. cd ensemble
    3. bzr init
    4. bzr branch lp:ensemble master
    5. bzr branch master bug-whatever
    6. cd bug-whatever
    7. CODE! Those bugs won't get fixed itself!
    8. bzr commit #goto step 6, if needed
    9. bzr push
  4. Make your branch public
  5. Make a merge proposal
  6. Done!
Now go for it!

[update] another interesting documentation shared by rsalveti today: Ubuntu Packaging Guide

terça-feira, 9 de agosto de 2011

Enjoy old SNES games on your Xoom using PS3 controller

(image from eu, android)

Yes, that exactly what you read. Now you can play SNES games on your Motorola Xoom using your PS3 controller over bluetooth. Also, this tutorial is an adaptation from an article at Eu, Android and it's intended to be used on Ubuntu only, if you need to use the other OS, please check the original. The Linux specific information is from a cached ubuntu wiki, so I'll copy & paste the relevant part here in case it expire in the future. Right, so cut the crap and let's play! :-)


Needless to say, you must have proper root access on your device - details for brazilians here.

  1. Install Sixaxis Compatibility Checker, open the application, give root permissions and then a popup message will be shown telling you if your device is supported or not (hopefully yes).

  2. Install required libs:
    $ sudo apt-get install libusb-dev libusb-0.1-4

  3. Download sixpair.c (original also hosted at the ubuntu wiki, I did a copy on my github)

  4. Compile it:
    $ gcc -o sixpair sixpair.c -lusb

    Before running sixpair, you'll need the bluetooth mac addr of your Xoom. The easy way to get it is installing Sixaxis Controller - don't worry, you'll need the app anyway to use the controller. The app will display a message "Local Bluetooth Adderss" with the bluetooth mac addr you'll need.

  5. Run sixpair with the Motorola Xoom bluetooth mac addrs you just got as a parameter:
    $ ./sixpair 41:f4:89:6d:41:73

  6. Open the Sixaxis Controller and follow the onscreen instructions - important note: You'll might need to reboot your Xoom to make it work (I had to)
 NOW I WANNA PLAY!
easy... almost there

Install a neat SNES emulator, I choosed Snes9x EX. Now you have to configure your controller to map the keys the emulator uses: Go to Sixaxis Controller -> Menu -> Preferences -> Input Mapping -> 1st Controller mappings. Since I am using Snes9x EX, I set my mapping like this:
  • square: A
  • triangle: S
  • circle: X
  • cross: Z
  • left: Q
  • right: W
  • select: SPACE
  • start: ENTER
  • power: HOME
This way, for example, Snes9x EX will understand that when you press square you're actually pressing A which means the Y button on a normal SNES controller. Yes, I know, confusing as hell, but works.

Now go and have fun :-D

sábado, 11 de dezembro de 2010

GasFinder hits Android Market

GasFinder, o pequeno embrião que nasceu no Yahoo! Open Hack Day deste ano, passou pelo Conip e com versão até pro o Maemo agora ganha uma versão oficial pro Android. Sim meu caro! Duas semanas de intenso trabalho num projeto que está completamente fora do meu universo: Java, Android, JSON e telas em XML. Cá estamos e é com orgulho que apresento o GasFinder. Ainda em sua primeira versão super alfa, mas já é oficial para Android Market. Você pode procurar por GasFinder no Android Market ou pode scanear o código ao lado :-)


Tela inicial: lista de postos e tipos de ordenação


Segunda tela: Endereço do posto, preços dos combustĩveis e possibilidade de ligar, ver no mapa e compartilhar nas redes sociais.

O que é, pra que serve e como funciona? Muito simples comissário! GasFinder é um aplicativo que utiliza de seu local de GPS (ou informação de Wifi) para pesquisar os postos de combustível mais perto de você. O aplicativo é separado em duas partes: A primeira é o back-end (bot) que raspa os dados do site da ANP e transfere para um banco de dados, obra prima do Luciano Camilo (ninja e parceiro do projeto) - então, teoricamente, temos as informações de todos os postos de combustível do Brasil. How cool is that!? :-D A outra parte é a aplicação, eu chamo uma URL com parâmetros de latitude e longitude e recebo um JSON com todas as informações dos postos da região. Da pra ordenar por preço, por distância, ver no mapa, compartilhar e ligar pro posto.


Um dos objetivos de lançar esta versão *agora* era para participar do concurso Android Lab da Huawei que encerrou as inscrições dia 10/dez. Bem, nem precisa dizer, aplicativo open source, ainda bastante bugado, então... Reportem bugs, mandem emails, dêem sugestões e feedbacks! :-)

Special thanks to: Luciano (partner no projeto, cuidou de toda a parte de back-end e garimpagem de dados), namorada (que me aguentou por algumas semanas sem dormir direito), PradoG (que teve saco pra me ajudar com Java) e Felipe Fedel (que tem as manhas de integrar Java e JSON). Thank you all, bros :-)

[update] Para quem estranhamente não está conseguindo instalar do Android Market, aqui vai o link direto para GasFinder no meu Public do DropBox. Qualquer problema, por favor, me avisem nos comentários.

quinta-feira, 22 de julho de 2010

FISL11 lectures presented, time to enjoy the party

Two lectures, two days, hard work and my nerves eating me alive. Not easy to speak on a such huge event like FISL. A lot of experience acquired but I am not planning to return to stage soon :) But of course, very happy to spread the word of two projects I like so much: Libvirt, which I've been working on for about two years, and DeltaCloud so young and so promissing! Here I post both of presentations. Thanks for all the comunity for the help :-)








And now time for a little fun. Watch some good lectures, get some free coffee and enjoy the cold weather :-)

sábado, 26 de junho de 2010

Otubo at FISL 11: DeltaCloud and Libvirt on the way!

Great news from the south, my two lectures were approved for the next version of FISL, International Forum of Free Software (acronym is in pt_BR). Hoooray! \o/


I've submitted two papers for the congress. One lecture is about DeltaCloud: Many Clouds. One API. No Problem. And the other one will be about Libvirt: The virtualization library. I am counting with the help of both projects maintainers in order to get a great work for the projects.

Wish me luck, hope I can make a great presentation for you all.

See you there! :-)

quarta-feira, 26 de maio de 2010

GasFinder no CONIP 2010

Gas Finder esteve no CONIP 2010 esta tarde. Agradeço novamente o convite da Daniela e do Pedro Markun :-) CONIP é um dos miores eventos sobre uso de tecnologia na gestão pública, muitas pessoas engravatadas do governo ou não. É estranho estar em um evento técnico-não-técnico.
Foram 10 os desenvolvedores convidados, aqueles que tiveram projetos premiados no Yahoo! Open Hack Day. Fui representando o Gas Finder, gostaria de ter falado mais, 5 minutos é crueldade. Eu sei que não tinha muito o que explicar mas acho que pelo menos uns 10 minutos já estaria de bom tamanho.

O saldo positivo é o de sempre: Social network. Bons contatos (técnicos ou não), sempre são bem vindos. Re-conhecer aqueles que você só conhecia de twitter ou de IRC é bem legal.

quarta-feira, 14 de abril de 2010

Ethernet over USB with N900 and Gentoo

Meta: It's been a while since I got my new N900. I sold my old device to Kleber and I acquired the new N900 from Etrunko, hell I wanted this gadget. This tutorial is for gentooers only, ubuntuers can connect and use it right away without any changes.


Since that date, I've been playing and hacking around this incredible device. Yesterday I was trying to debug why in hell my bloody bastard wifi connection keeps on dropping so often. Opening a terminal and checking dmesg or /var/log/messages on that tiny little screen was a pain, so I decided to try out the ethernet over usb.

You can follow all the above tutorial on a Gentoo box. The only problem I found was to find the correct modules in my kernel to load - as Gentoo doesn't behave as Ubuntu and loads the whole world in the memory. :P

So, here it is:

otubo@minivader ~ $ lsmod|grep usb
usbnet 17188 1 cdc_ether
mii 5212 1 usbnet

Find, compile (if not yet) and load these modules. These modules, with the correct udev rules will create a usb0 interface on both devices. Make sure the interfaces are configured properly to be on the same network.

That's it. Now you're able to plug you USB cable and have a full operational network with it. Enjoy! :-D

[update] DO NOT set a static mac add as said in the original tutorial. In my case, the module g_nokia didn't load just because of this.

terça-feira, 16 de março de 2010

otubo no Yahoo! Open Hack Day Brasil 2010

Este final de semana, 20 e 21 de março, vou participar do Yahoo! Open Hack Day. E neste eu nunca fui. O que já me agradou de primeira é o nome combinar direitinho com o clima do evento. Hack no sentido de pegar um projeto existente (ou algum que seja pensado na hora) e programar. Simples assim. Hackear o final de semana inteiro ao redor dele.


Sim, eventualmente haverão palestras e ... AH! WHO CARES? Palestra a gente baixa ou vê no youtube, juntar computeiros pessoalmente pra trocar idéias e programar não.

Nos vemos lá?
Happy hacking!

quarta-feira, 16 de dezembro de 2009

VIVO 3G using Huawei e1756 on Ubuntu 9.10 Karmic

Quick and fast tip to show a way to connect to 3G using Hawei e1756 modem on Ubuntu 9.10 Karmic.

The problem: The modem itself has a little micro-SD card reader inside and guess what? The kernel identifies it as card reader and not as a 3G modem. Good. ¬¬"

The fix: To solve this minor issue, first you have to install a tool that helps you to switch between storage device and usb serial device, the usb_modeswitch. For this just apt-install the usb-modeswitch package.

Then, modify its config file (/etc/usb_modeswitch.conf) adding the lines below:
# Huawei E1692/E1756
DefaultVendor= 0x12d1
DefaultProduct= 0x1446

TargetVendor= 0x12d1
TargetProduct= 0x140c

MessageContent="55534243000000000000000000000011060000000000000000000000000000"

CheckSuccess=5

These lines tells your usb_modeswitch that if the vendor id 0x12d1 and the product id 0x1446 are found on your usb devices, then it will be switched to product id 0x140c. It means that the usb_modeswitch will switch from storage device to 3G modem. So far so good. :)

Then we have to write a udev rule that tells the system to ignore the card reader and identify it as a 3G modem as we plug it in. Write a file named /etc/udev/rules.d/15-hauwei.rules containing these lines:

SUBSYSTEM=="block", \
ACTION=="add", \
SYSFS{idVendor}=="12d1", \
SYSFS{idProduct}=="1446", \
OPTIONS="ignore_device"

SUBSYSTEM=="usb", SYSFS{idProduct}=="1446", SYSFS{idVendor}=="12d1", RUN+="/usr/sbin/usb_modeswitch"

Your udev now will run usb_modeseitch every time you plug in an usb stick with product id and vendor id matching those values.

Restart your udev:
$ service udev restart

And now, your system should be able to identify your 3G modem. After all these done, you have to configure your NetworkManager. This last step is pretty simple and strightforward, so, I will let you handle this by yourself :)

Any problems please feedback!

[update] I wrote this post drinking wine (long story) and I completely forgot to thank Ursinha for the usb_modeswitch tip. Soooorry and thank you bro! :-)

[update 2] And it seems that NetworkManager doesn't like 3G modems, at least not now. So I had to configure some extra lines on /etc/wvdial.conf and /etc/ppp/options in order to use wvdial and connect using /dev/nail (yeah, that was a joke, there is no such a device):

otubo@minivader ~ $ cat /etc/wvdial.conf

[Dialer 3g]
; Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
; Phone =
ISDN = 0
; Username =
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
; Init3 = AT+CGDCONT=1,"IP","zap.vivo.com.br"
; Password =
Modem = /dev/ttyUSB0
Baud = 921600
DialCommand = ATDT
Check Def Route = on
FlowControl = Hardware(CRTSCTS)
; Username = 1997848815@vivozap.com.br
Username = vivo
Password = vivo
Phone = *99#
Stupid mode = 1
Auto Reconnect = on
Auto DNS = on

otubo@minivader ~ $ egrep -v '#|^ *$' /etc/ppp/options
asyncmap 0
noauth
crtscts
lock
hide-password
modem
proxyarp
lcp-echo-interval 30
lcp-echo-failure 4
noipx
asyncmap 0xa0000
mru 1500
refuse-chap
ipcp-max-failure 30


Then, to connect to internet using your 3G modem you just have to run:

root@minivader:~# wvdial 3g
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
ATQ0 V1 E1 S0=0 &C1 &D2
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Thu Dec 17 20:38:52 2009
--> Pid of pppd: 3488
--> Using interface ppp0
--> local IP address 187.88.116.150
--> remote IP address 10.64.64.64
--> primary DNS address 200.142.130.202
--> secondary DNS address 200.220.227.100

And this time, special thanks to Kleber that helped me debugging that shit :-)

sexta-feira, 16 de outubro de 2009

How to connect a GPS phone to a Computer via bluetooth

A very quick post to show how these things work togheter. I connected a Nokia E71 GPS to my ThinkPad T61 running Ubuntu 9.04 Janty Jackalope using bluetooth connection. The initial idea was to use Google Earth as my main GPS screen while driving, but unfortunately I couldn't make it work *yet*.

Step 1) Going right to the point: First you need to be sure that you mobile phone exports the GPS service via bluetooth. And that's simple to get. First you must edit yout /etc/bluetooth/hcid.conf to look like this:

root@phoenix:/etc/bluetooth# cat hcid.conf
#
# HCI daemon configuration file.
#

# HCId options
options {
# Automatically initialize new devices
autoinit yes;

# Security Manager mode
# none - Security manager disabled
# auto - Use local PIN for incoming connections
# user - Always ask user for a PIN
#
security none;

# Pairing mode
# none - Pairing disabled
# multi - Allow pairing with already paired devices
# once - Pair once and deny successive attempts
pairing multi;

# PIN helper
#pin_helper /usr/bin/bluepin;

# D-Bus PIN helper
#dbus_pin_helper;
}

# Default settings for HCI devices
device {
# Local device name
# %d - device id
# %h - host name
name "otubotp";

# Local device class
class 0x3e0100;

# Default packet type
#pkt_type DH1,DM1,HV1;

# Inquiry and Page scan
iscan enable; pscan enable;

# Default link mode
# none - no specific policy
# accept - always accept incoming connections
# master - become master on incoming connections,
# deny role switch on outgoing connections
lm accept;

# Default link policy
# none - no specific policy
# rswitch - allow role switch
# hold - allow hold mode
# sniff - allow sniff mode
# park - allow park mode
lp rswitch,hold,sniff,park;

# Authentication and Encryption (Security Mode 3)
#auth enable;
#encrypt enable;
}


Step 2)
Restart you bluetooth daemon:

root@phoenix:~# /etc/init.d/bluetooth restart
* Stopping bluetooth [ OK ]
* Starting bluetooth [ OK ]


Step 3) Turn on the bluetooth on your phone and get ready to scan devices:

root@phoenix:~# hcitool scan
Scanning ...
00:21:FE:xx:xx:xx mycellphone


Step 4) Then, check if your phone exports GPS data via bluetooth running sdptool. In this step you need to pay attention to the Service Names and to the channel they use. We're gonna use these informations later on.

root@phoenix:~# sdptool browse 00:21:FE:F8:2F:E2
Browsing 00:21:FE:F8:2F:E2 ...
Service Name: AVRCP Target
Service Description: Audio Video Remote Control
Service Provider: Symbian Software Ltd.
Service RecHandle: 0x10000
Service Class ID List:
"AV Remote Target" (0x110c)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 23
"AVCTP" (0x0017)
uint16: 0x100
Profile Descriptor List:
"AV Remote" (0x110e)
Version: 0x0100

Service Name: Hands-Free Audio Gateway
Service RecHandle: 0x10004
Service Class ID List:
"Handsfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Handsfree" (0x111e)
Version: 0x0105

Service Name: Headset Audio Gateway
Service RecHandle: 0x10005
Service Class ID List:
"Headset Audio Gateway" (0x1112)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Headset" (0x1108)
Version: 0x0100

Service Name: Audio Source
Service RecHandle: 0x10027
Service Class ID List:
"Audio Source" (0x110a)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 25
"AVDTP" (0x0019)
uint16: 0x100
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Advanced Audio" (0x110d)
Version: 0x0100

Service Name: AVRCP Controller
Service Description: Audio Video Remote Control
Service Provider: Symbian Software Ltd.
Service RecHandle: 0x10028
Service Class ID List:
"AV Remote" (0x110e)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 23
"AVCTP" (0x0017)
uint16: 0x100
Profile Descriptor List:
"AV Remote" (0x110e)
Version: 0x0100

Service Name: SyncMLClient
Service RecHandle: 0x10029
Service Class ID List:
UUID 128: 00000002-0000-1000-8000-0002ee000002
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 10
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"" (0x00000002-0000-1000-8000-0002ee000002)
Version: 0x0100

Service Name: OBEX File Transfer
Service RecHandle: 0x1002a
Service Class ID List:
"OBEX File Transfer" (0x1106)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 11
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"OBEX File Transfer" (0x1106)
Version: 0x0100

Service Name: Nokia OBEX PC Suite Services
Service RecHandle: 0x1002b
Service Class ID List:
UUID 128: 00005005-0000-1000-8000-0002ee000001
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 12
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"" (0x00005005-0000-1000-8000-0002ee000001)
Version: 0x0100

Service Name: SyncML DM Client
Service RecHandle: 0x1002c
Service Class ID List:
UUID 128: 00000004-0000-1000-8000-0002ee000002
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 13
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"" (0x00000004-0000-1000-8000-0002ee000002)
Version: 0x0100

Service Name: Nokia SyncML Server
Service RecHandle: 0x1002e
Service Class ID List:
UUID 128: 00005601-0000-1000-8000-0002ee000001
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 14
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"" (0x00005601-0000-1000-8000-0002ee000001)
Version: 0x0100

Service RecHandle: 0x1002f
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 3

Service Name: Dial-Up Networking
Service RecHandle: 0x10030
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 4
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100

Service Name: OBEX Object Push
Service RecHandle: 0x10031
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 9
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100

Service Name: Imaging
Service RecHandle: 0x10032
Service Class ID List:
"Imaging Responder" (0x111b)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 15
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Imaging" (0x111a)
Version: 0x0100

Service Name: SIM Access
Service RecHandle: 0x10033
Service Class ID List:
"SIM Access" (0x112d)
"Generic Telephony" (0x1204)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 8
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"SIM Access" (0x112d)
Version: 0x0101

All you need to check on this huge amount of data is something telling that you phone exports the GPS information. In the above example there is no such thing. If your phone DOES support this information go to step 5. Otherwise, install this strategic application for Symbian: ExtGSP. This little tricky app will do all the messy thing for you exporting all the GPS data over the bluetooth connection. Then re-run the sdptool command again to check. In the end you will find additional information about ExtGPS:

Service Name: Symarctic ExtGPS
Service Description: Share phone's built-in GPS module via Bluetooth
Service Provider: Symarctic Solutions
Service RecHandle: 0x10034
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 5
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100


Step 5) Then, edit your /etc/bluetooth/rfcomm.conf and make it look like this:

root@phoenix:~# cat /etc/bluetooth/rfcomm.conf
rfcomm4 {
bind yes;
device 00:21:FE:F8:2F:E2;
channel 5;
comment "Serial Port";
}


Step 6) Once configured (and ExtGPS running on your phone) you will now open a communication channel and bind it to a local device like this:

root@phoenix:~# rfcomm connect 4
Connected /dev/rfcomm4 to 00:21:FE:F8:2F:E2 on channel 5
Press CTRL-C for hangup


Step 7) Now there's a bunch of GPS information being written on /dev/rfcomm4. In order to make a good use of it, we should grad all these information, and parse it with gpsd:

root@phoenix:~# gpsd -N /dev/rfcomm4
(-N means not to daemonize it, to see all the debug info.)



What's next? Now we have all the setup ready: Cellphone with GPS up and running, exporting information via bluetooth (using ExtGPS), connected and writing information on a local device, and a daemon grabing and parsing all the information. Good! We just need a client program to enjoy the show:

Step 8) You can use a bunch of client programs, I've tested two of them: Xgps and GpsDrive.
Xpgs is a very simple program just to make sure things are working fine. It shows the position of satelites, the current position and so on. Here is a print screen:


GPSDrive is more Google-Earth-like, you may track you path during a travel, check the map and so on:


Well, that's it. Hope you enjoy :)

terça-feira, 6 de outubro de 2009

Primeiro Festival de Software Livre de Belo Horizonte

Impressionante, quase mais de uma semana depois e cá estou eu mineirando[1] um tempo livre pra conseguir escrever algumas linhas sobre o assunto.

o primeiro de muitos
(cartaz do evento)

Organização e Infra:
A organização foi bastante competente, não houve nenhum gap - ou pelo menos nenhum que eu tenha percebido. Wifi funcionando em quase 100% do evento e horários de palestras ok - exceto por uns palestrantes furões. Falando em palestrantes...

Palestras:
Ok, confesso que acordei tarde e que cheguei quase na hora do almoço no evento. Ok, *na hora do almoço*. Gastei boa parte da tarde revisando e corrigindo a minha própria palestra.

Mas uma palestra em especial merece algumas linhas a mais: Deixo aqui os parabéns ao Lamarque pela sua palestra-história-de-vida. Passou quase uma hora e meia falando de suas experiências pessoais em escrever driver de kernel, postar na LKML, ser tratorado, resolver bugs postar patches e por ai vai. Gostei disso por dois motivos claros: 1) Isso representa fortemente o espírito de nerd && computeiro - fazer a coisa funcionar por que *pode* e não por que quer provar alguma coisa ou por que alguém mandou. Pelo simples fato de estar interessado e querer resolver. 2) O conteúdo técnico pouco importava, a idéia era que "contribuir com SL não é um bixo de 9 cabeças". Vai lá, leia a documentação, fale com a galera no canal, poste e por ai vai. No fear.

(minha palestra do vimbook - crédito: Djavan)

Falando em palestras, a minha sobre vimbook foi bem divertida. O público era bastante interessado, os exemplos funcionaram na hora e o mais importante: As minhas piadas sem graça mantiveram as pessoas acordadas mesmo depois do devastador almoço de comida mineira. Great! Piadas a parte, o que gostei mesmo foi que as pessoas ficaram interessadas no vimbook, muitos anotaram a URL, perguntaram sobre o projeto e tal. Mission accomplished feelings.



E uma coisa que eu não canso de repetir: Em eventos desse tipo, a coisa que menos importa é ficar na sala prestando atenção na palestra. O networking no boteco pós evento é sempre mais importante. Conhecer pessoas novas, em que trabalham, trocar idéias, links, conexões em redes sociais e por ai vai :-)

o baile todo
(pessoas de belzônte, porto alegre-tchê e bahia, networking é isso aí ó)

Parabéns a todos da orgzanização, palestrantes e amigos. E que venha o próximo! :-)
Algumas fotos do evento no meu flickr, no flickr do Tuliom e no picasa do Djavan.

[update] os slides da minha palestra estão aqui:


[1] - Ahn?! Ahn?! Entendeu?!

sexta-feira, 29 de maio de 2009

FISL is not as it used to be

meta: I started posting in english and I did not loose any readers, thank you guys ;)

Here in Brazil we have a worldwide free software conference called FISL - Forum Internacional de Software Livre (Free Software International Forum, in english). This is the first time I will be able to attend this conference and I am already facing some bad news. It's all about the way lectures were aproved, too may questions surrounding the methods on how topics were choosed (link in pt_br). Some complaining about the lack of technical lectures and other claiming for more political ones. So, here is what I think:
  • Technical stuff we may learn at home freaking out night away at the computer.
  • Nerd events like this are just great to improve your social skills - yes we need this! Meeting new people, new free softwares iniciatives and so on.
But, int he other hand...
  • There is no reson to talk about "Why free software is good" or "Why Python?". Comon guys, we can do better! Let's think a bit ahead.
While we don't find a way to put these things together in equilibrium we could just avoid some topics that had already been presented in the past. This could be a good start :)