ICTC
-
-
This time I'm going to write how to make the Nokia Internet Stick CS-10 work on Linux. Two years ago I wrote about the Franklin CDU-680 which was a very good way to get online, until 5 days ago when we stop paying 800 Mexican Pesos (about $59 USD) to Iusacell.
Anyway, in the office bought this pretty "Internet Stick", and with a small googling I found that it was possible to make it run on Linux. In some blogs I read that you just need to umount the device using "eject", This is because this stick identifies itself as a "CD-ROM" and when you use "eject" it changes its behaviour and start acting like a modem.
But I have one problem, when I insert this device in my computer's usb port dmesg shows errors while reading the device. Then, it never gets mounted (the first step for umounting it :-)) and then it can't change the way it worked.
Googling a bit more, I found that we can use udev to avoid this connect-wait_for_recognition-umount-dial procedure. You just need to create this rule in /etc/udev/rules.d/90-nokia-zerocd.rules
SUBSYSTEMS=="usb", SYSFS{idVendor}=="0421", SYSFS{idProduct}=="060c", ACTION=="add", PROGRAM=="nokia-testcd %M %s{serial}", RUN+="/usr/bin/eject -s %k", OPTIONS+="last_rule"
As you can see, it depends on a program "nokia-testcd", it is just a simple bash script with this code:
Read More...
-
Cristina arrives on Sunday, after more or less 10 hours traveling making stops because she is pregnant, she is finally here with me. My parents, took her from Puebla, thanks to them, they have been supporting us in everything we need, always, so thank your so much mother, thank you so much father.. without you our lives would be impossible.
Well, Sunday is my free day, I try to woke up late, but I just can't, I was stand up at 8:30 in the morning. after the breakfast I clean the house and start playing with the acer and go out of the house by the 3 in the noon. Cristina was about to be in the Bus station by the 10 in the night. I can't wait until then. Its horrible that your free day, that day that you usually don't want to pass away I was counting the minutes... horrible.
Well, after that everything is back to the normal way.
 ICTC finally release the Juvi project. Which is a software development project where almost everybody in the office was involved, not only programmers but people that have to go to the client, document writers, analyst... everyone. The hard work that everyone put is seen by now in a product very very well done. I'm glad to be in such a great team!.
To test the desktop application for Juvi, I have to use a virtual machine, this virtual machine runs Windows XP and I have knowledge that my programs written in Python runs fine on Windows XP and WIndows 2k using py2exe but I didn't make a test under Windows Vista. We made that test yesterday and the application runs smooth!, I have to change nothing! the same installer for Windows 2K to Windows Vista that's good when you have to make the builds.
On the other way... I have been working on christine just a bit, I have fixed some small issues and there will be dbus support for christine soon garaged convince me some time ago that using dbus is good for christine, in this way, many programs can make use of christine functionality by communicating with it using dbus. Another thing that I'd like to implement is the keyboard shortcuts what allow me to use the prev, next, stop and play/pause buttons but I don't know if it's better to use the GNOME ones os allow the user to define their owns.
As an extra-time-consuming little project.. I was wondering how to make a Dialog windows appears as the Mac OS X do. Personally I think MacOS X user interface is one of the most polished UI in the world and the Dialog box are pretty and make me feel that this is not another window in the workspace but a window that is really a child of the window where I was working on. Currently I'm thinking on a window with no decoration and a gtk.Layout area making the animation with a button. Let's see if I can have time for this in the week.
-
Hi again readers!.
In this week I have been pretty busy, bugfixing the Juvi desktop application. We don't want Banana products (those that mature with the user) and the test team is doing their best to hit every bug and report it to have a very stable application.
 I have been also busy "porting" the Supramax Evo4 driver to run on windows, the port is quite easy to do since the program was written in Python and I have to fix some paths. In my tests I was doing to the driver I found a Not so funny issue with M2Crypto for MS Windows.
We have a parameter in the driver, as most Unix programs do the "-v" do a verbose run, spitting to the stdout the logs, if you don't use the verbose parameter then it saves it somewhere. Well, running on verbose mode was easy, it just run perfectly, storing the logs wasn't I had an error with OpenSSL... but wait.. we where talking about logs and not about OpenSSL.. what does OpenSSL has to be with logs?.
Well, there is an issue with M2Crypto and Python where it doesn't ship a special file and this causes OpenSSL crash if you use I/O. M2Crypto let you load a RSA key in pem format that you can use to crypt/decrypt something this method is called load_key and is part of the M2Crypto's RSA package, you only have to pass the path to the key as first argument and in the second argument a function (anything callable) that returns the password for the key (if it is private). Well, this I/O was crashing M2Crypto.
There are two workarrounds for this. The first, is to compile at least M2Crypto (I didn't do it, some blogs says that you have to compile python) against OpenSSL and include this specific file... at least Google points to blogs that says that... The other and easier way is just use RSA's function load_key_string where you pass as first argument the string that holds the key instead the path, doing this you will eliminate the I/O done by OpenSSL and then, there is no crash.
Last Thursday Cristina and I went to Maquiavelo's house to an informal meeting with xbitcarry, unfortunately Maquiavelo was too busy and the meeting wasn't really done but was nice to see xbitcarry again.
I think that's all for today my readers. Fortunately I don't have to work tomorrow and now I have to work a bit on christine
-
Another post on the blog. I know, I haven't post too regularly these days, this is because I have a lot of work, and my spare time is used to be with cristina and our growing still-in-the-belly baby.
Well, I think you just don't care abot my life, is quite boring for everyone that is not me. Why? just because this is not the blog of some kind of nerdy hacker that do lot of shiny new and amazing stuff, nor the guy that post every single fart that Apple, ubuntu nor Microsoft does.
So, what is about this blog? I think is a way to flush my mind. I wish I have all the time to write more posts, Several times I had Ideas to be written in the blog, but they didn't come to the blog because (again) there is no time.
Anyway, three paragraphs are enough for my complaints. So, what have I done since my last Post? (the christine love, the picture is not..a post) Well, let me see... let me see... Lot of work. I have been working on this project on ICTC, a desktop application using Python and PyGtk.
User interface design is a quite interesting challenge, and more if you need to design input forms, make them look good, being user friendly (mmm, user friendly... If user friendly means scratching the testicles {or your favorite scratch part of the body} of the users. This application in some forms, need to be fully functional without mouse and use only the key pad, which makes the challenge more interesting. Writing a form that makes input validation, key-press-event handling for every widget, looks good, be ultra-easy to use is... is sometimes castrating... (the more if the client want the application in this color: #FF00FF.)
Obviously I don't have to see the application in that color, but I also have to write a color chooser for this application, if I don't, then the client is going to ask me to change the colors after 15 days using the program or when it get almost blind.
Well. This is most of the work I have done, I'm trying to learn how to use django. I love python, and I want to use django (or another python based framework) to write web applications in the future. I have write some applications but nothing really functional by now. One of the first and small projects I want to do is a web page for christine.
And talking about christine, I'm still working on the new version. I'm refactoring modules. And by now is quite usefull. Just commit this night fixes for the bug #2122313 but I need people to test it to check it is working fine. I have also fixed the open remote dialog that wasn't working since I reallocate this methods.
Well, I thinks is enough for today. See you latter.
Update I forgot, If you like the season 1 of The Big Bang Theory you can the download links from Here, those rar files don't have the subtitles, I will post them there too. I have been watching this tv serie and I love it.
-
A few weeks ago, I have to write a program in PyGTK that was supposed to be all the time in the background. This application needs to run over Microsoft Windows, and hide in the notification area, wich in Windows is near to the clock.
One of challenges for me in this application is that as it must run in the background there must be a way to raise it, the most easy way to do it is by force the user to click on the small icon in the notification area, but in this case, that was impossible because the computer don't have any mouse, everything is done with the keyboard.
So, I start googling for some way to use hot keys with GTK (PyGtk) in this case, I found that Gtk does have a way to represent the Display wich a way to get to your computer display resources. I just want to grab the keyboard presses and if the right key with the right modifier where pressed then the application arises.
Unfortunely for me, Gtk+ does have a way to do this, but the implementation in PyGTK has a bug where all the display events are ignored, I mean, every time you check of a pending event for the display pygtk will return None, so, no event, no catch, no working code.
Well, in linux you can do this by using the xlib bindings for python, but I have to do this on Windows, so a workmate point me to This url. Wich shows how to register a hot key on windows.
That was easier than I thought!. But, there is a trick... As you can see in this piece of code:
try:
msg = wintypes.MSG ()
while user32.GetMessageA (byref (msg), None, 0, 0) != 0:
if msg.message == win32con.WM_HOTKEY:
action_to_take = HOTKEY_ACTIONS.get (msg.wParam)
if action_to_take:
action_to_take ()
user32.TranslateMessage (byref (msg))
user32.DispatchMessageA (byref (msg))
The method GetMessageA is the one that is listening to the messages in the system, and returns when there is a message. If you use a single threaded program, like... some text bassed application or just a "show something" application, then it will be nice, but, if you use Gtk, where the application's events are handled in the gtk main loop this is useless, why? because this method locks until it receives something, and then let your application work, but, if you have it in a while loop you will never leave that loop and then, your signals will never been emited and your handler will never do their job. Is something similar to the use of sockets. Ha... I forgot, you can't use the while gtk.events_pending(): gtk.main_iteration_do() stuff.. it doesn't work, keep reading if you wanna know why.
So, what can I do for this to work?, well, I thought: A thread, but, there is a problem. Windows documentation says that the hotkey registerd with the method RegisterHotKey will only be catched with GetMessageA if the "register" method and the "get message" are in the same thread.
So, what can I do? Put this on the same thread, and then use a flag to let the rest of your application know that the keys have been pressed, then, raise your application. But, why I can't make a gobject based class that emits a signal when this keys are pressed? Well, you should know that Gtk+ is thread aware, but not thread safe, this means, you cannot use Gtk accross the threads, and this is something inherited from gobject (AFAIK).
Here's the code that will let you register hot keys on windows and make your applications raise when you need them.
#!/usr/bin/env python
import ctypes
import thread
import win32con
import gobject
from ctypes import wintypes
class keyhandler:
def __init__(self):
self.__emit = False
thread.start_new_thread(self.__catchMsgs, tuple())
gobject.timeout_add(5,self.checkEmit)
def checkEmit(self):
if self.__emit:
self.emit('keyhandler-keypress',self,self.__emit)
print 'Emitiendo senial..'
self.__emit = False
return True
def __catchMsgs(self, *args):
byref = ctypes.byref
user32 = ctypes.windll.user32
self.HOTKEYS[1] = {'hotkey' : win32con.VK_F3,'modifiers': win32con.MOD_WIN}
if not user32.RegisterHotKey (None, 1, win32con.MOD_WIN, win32con.VK_F3):
print "Unable to register id", 1
while 1:
try:
msg = wintypes.MSG()
if user32.GetMessageA (byref (msg), None, 0, 0):
if msg.message == win32con.WM_HOTKEY:
if self.HOTKEYS.has_key(msg.wParam):
self.__emit = self.HOTKEYS[msg.wParam]
user32.TranslateMessage (byref (msg))
user32.DispatchMessageA (byref (msg))
except:
pass
-
 El dia de hoy me toco configurar una Palm Treo 700p como modem para ser usado en GNU/Linux y en una Nokia 770. Y ahora que veo las cosas me parece que todo ha sido facil.
En principio de cosas la palm, pese a que se puede conectar a la red de iusacell para poder tener video y obviamente internet, no incluye un software para poder servir como modem, lo que hice, fue descargar la version demo de USB Modem para las Treo. Este programilla nos permite usar la palm como cualquier otro modem conectado via USB en nuestro equipo. El demo incluye el controlador para windows y las instrucciones para Linux, ademas del software que se instala en la palm.
Una vez instalado el usb modem, se accede a el y se inicia el modo modem en la palm. En Windows, no dire como hacerlo, a preguntarle a los de Microsoft, en Linux, solo es cosa de que nuestro kernel tenga soporte para modems CDC ACM.
 Al momento de conectar el equipo y cambiar el modo de la palm a modem se creara el dispositivo /dev/ttyACM0, si tienen wvdial podran usar wvdialconf para ver la respuesta del modem. A partir de ahi, configuren el wvdial.conf o usen algun otro programa como kppp o el que gusten par aconectarese. Simple no?.
Para usarlo como modem para la Nokia 770, es casi igual de simple. Lo primero que hemos de hacer es obviamente, configurar el Bluetooth para que se comuniquen ambos dispositivos. La nokia 770 dira que no se puede hacer transferencia de datos, mas que algo relacionado con usar el dispositivo como medio de marcado.
Luego, hay que crear una nueva conexion, y utilizar el tipo de envio de paquetes (no de datos), en las propiedades de conexion solo necesitaran poner le numero al que se va a marcar, el cual es #777 (para iusacell).
En la palm, la configuracion del modem ahora debera de ser cambiada a conexion por bluetooth, pero, antes de hacer el cambio se debe deshabilitar el DUN (Dial Up Networking) incluido en la palm, de forma que se use solamente el de USB Modem (que ahora es Bluetooth Modem). Y luego, hacemos el marcado y si todo esta bien, estaremos navegando en 5 segundos :-).

-
Despues de crear el widget en puesto en el post anterior, hoy me lo he implementado en el sistema que estamos creando en ICT Consulting. El video esta chidin, pero Google lo hace ver horrible. En fin, es solo demostrativo.
widgetTest.ogg
|
|
|
Recent Comments On Blog
Marco Antonio Islas Cruz on
Marco Antonio Islas Cruz on
Marco Antonio Islas Cruz on
Getting ready
Marco Antonio Islas Cruz on
Python: Create win32 services using Python and py2exe
jopython@gmail.com on
Python: Create win32 services using Python and py2exe
yodenuevo on
Holy Shit!
markuz on
Holy Shit!
yo on
Holy Shit!
Gustavo on
Things that happen last week
Marco Antonio Islas Cruz on
Christine: rola_christine.py