Today I achieved a small milestone: I have managed to run and use gsmd reliably on a host computer.
This is really important because being able to use gsmd on the desktop dramatically reduces the development cycle of phone (gsm) based applications. Rather than having to code blind, cross compile, install onto the target device and then test and debug on the target, you can now do the entire cycle on the desktop.
I first tried the gsm passthrough features in u-boot, which effectively turns the u-boot terminal into the gsm terminal. Unfortunately there appear to be bugs somewhere in this process and it would not work reliably. However, with a bit of thought, this functionality is just as easy in user space.
Here are the instructions:
- Maks sure gsmd is not running on the phone: killall gsmd
- Run netcat on the phone to export the modem serial port: nc -l -p 5000 < /dev/ttySAC0 > /dev/ttySAC0
- Compile pty.c and run on the host with: ./pty 192.168.0.202 5000
- run gsmd on the host with (replacing 0 if necessary): ./gsmd -p /dev/pts/0
- run openmoko-dialer or any other application which interacts with gsmd
If gsmd from OpenMoko SVN doesn’t appear to work correctly, try Andrew’s git repository: http://folks.o-hand.com/andrew/gsmd.git/
(Update: if you’re wondering why I didn’t use a “proper” application to export the serial port, it is because nc is built into busybox. I did originally use ser2net to export the serial port, but using nc means no cross compiling or extra set up on the phone is needed to get this working.)