FSO Palm Pre Modem Status Report

Through my last three weeks on holiday I got implemented a lot of stuff in msmcomm. We have now the following features:

  • call support: dial, answer and end calls (only call forwarding and call conference stuff is missing)
  • various network information: networklist, rssi, current nework, network time, mode preference (GSM/UMTS/auto) …
  • various system stuff: set system time, modem audio tuning parameters, audio profiles,  charging, …
  • SIM: Read/write/delete phonebooks, verify pin, enable/disable pin, change pin,  sim info (imsi, misdn), phonebook properties

This is already a lot of stuff we can work with. For all messages we already have simple error handling like checking the received message for an error code and reporting the error upstream. Only on some response messages left for which we have to find out the right offset of the error return code. But thats just a matter of time :)

The next step will be SMS support. I already started with this and can receive an incomming SMS. Luckily the msmcomm protocol is using the same PDU format for reporting SMS t as it is defined in TS 23.040 – makes it easy for us to implement it beside our already existing SMS implementation in fsogsmd. But there is one thing I am curious about: It seems that Palm does not implemented some functionality to read/write sms from/to the SIM card. Maybe I miss something, but it would fit into Palm’s way of doing SMS handling in webOS. They are just receiving the SMS and do not save them on the SIM card. All SMS messages are directly copied to a internal userspace database. So if you put your SIM card into another phone you will miss all your SMS messages (btw. it’s the same approach for SIM contacts. They are never saved on the SIM card by webOS …).

Next step will be sending SMS. I already dumped the messages webOS is sending and receiving for this. I just have to look deeper into them and implement all important messages, responses and events in libmsmcomm.

If you want to try everything to can do the following:

WARNING: Before you do any of the steps below just backup all our data from the device! The Freesmartphone team provides this as is without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of this program is with you. Should this program prove defective, you assume the cost of all necessary servicing, repair or correction. In no event will the Freesmartphone team or any other party be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use this program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of this program to operate with any other programs)

1. Compile the serial_forward utility (http://git.freesmartphone.org/?p=cornucopia.git;a=tree;f=tools/serial_forward) for the Palm Pre (use OpenEmbedded or you favourite toolchain) and copy it on the Palm Pre

2. Take care that you enabled usbnet on your Pre

3. Connect to your Pre with novaterm

4. Stop the TelephonyInterfaceLayer: # stop TelephonyInterfaceLayer

5. Reset the modem: # pmmodempower cycle

6. Run serial_forward with: # ./serial_forward -n /dev/modemuart -p 3001 -t hsuart

7. On your local PC configure the usbnet interface: # ifconfig usb0 192.168.0.1

8. Install msmcommd on your local PC

9. Edit /etc/msmcomm.conf to look like this:

source_type network
source_path 192.168.0.202:3001
log_target stderr

10. Start msmcommd: ./msmcommd

11. You will see msmcommd doing the initial low level setup

12. Compile msmvterm and launch it: # ./msmvterm

13. Type ‘help’ withing msmvterm to see all available commands

14. To do a simple setup of the modem, type the following commands:

# change_operation_mode reset
# test_alive
# verify_pin pin1
# change_operation_mode online

NOTE: Only after you have done ‘change_operation_mode reset’ and ‘test_alive’ the modem can received any other command!

FSO on the Palm Pre – Short Status Update

For a long time we’re now hacking on the Palm Pre device to get FSO working: Time for a short summary were we are and what has do be done in the near future (mickey already pointed out which components are working and which not).

Modem

The modem was the big show stopper when we initial began with hacking on the Palm Pre. The protocol Palm uses to communicate with the modem is nothing already known in the FOSS community. Yes, there is even an AT-Port you can use but there are missing some commands we need to make calls or register for so called unsolicited responses.  So the only way to bring FSO to the Palm Pre was reverse engineering the protocol.

Most of the basic reverse engineering is already done. We know how the protocol works and how we could use it. We wrote already an implementation of the protocol and it is used in FSO’s fsogsmd to interact with the modem (checkout msmcommd and libmsmcomm in the msmcomm repository). We can make calls and see when a call is comming in.

Currently we are using both ports (the AT and the binary one) to communicate with the modem. So we have all functionality you want have to on a basic phone (Call, SMS, …) but no GPRS/EDGE/HSDPA connection. Normally webOS uses the AT port to setup up a PPP connection and as we are using it to do some other stuff we cannot create a PPP connection anymore. When we are ready with the msmcomm protocol to support most of the GSM stuff we can disable the AT port in fsogsmd and use it for creating a PPP connection. So you see, this is no real show stopper anymore, just a matter of time :)

What have to be done on the modem level? I assume that we currently have about 10% disassembled from the msmcomm protocol. There is many stuff missing (SIM API, Network related stuff,  …). To improve this I am currently writing a little tool called msmsh to improve the reverse engineering of the protocol.

Suspend/Resume

Suspend/Resume works out of the box with the kernel from webOS without any modification. You can do a simple echo mem > /sys/power/state and the device suspends. To resume there are several wakup sources defined in the kernel (Power Button, Volume Keys, Slider, Headphone …). I already wrote a plugin for FSO’s fsodeviced to support suspend/resume within FSO.

Touchscreen

This is our currently show stopper. Palm implemented a driver in the Linux kernel which only does low level communication with the touchscreen. It only forwards all data from the touchscreen to the device node /dev/touchscreen. Actually some people are trying to find out how this data is structured to use it without requiring any of Palm’s tools. But no real progress here.

rootfs

Currently we are building an uImage with integrated rootfs and then boot it from our local PC on the Pre device to leave everything else on the Pre as it is. When we are ready with basis telephony stuff and touchscreen we will release this uImage so everyone can test it on their device. It will include zhone2 (a rewrite of zhone in vala) to have a simple UI to test FSO’s telephony stuff. Later we want to integrate a bootloader into the device so you can easily switch between webOS and a FSO based linux.

So you may see, many stuff is already done and we so close to have a full featured FSO framework running the Palm Pre device. If you are interested in running your Pre without webOS and with a only-FOSS userland then get in contact with us: Use smartphone-userland mailinglist or #openmoko-cdevel/#opemoko-dev on irc.freenode.net.

FSO Palm Pre Code-Sprint

Tomorrow I will meet with Mickey to work with him on the FSO support for the Palm Pre. In the last month I worked mostly on the implementation of the protocol between userland and modem in the Palm Pre and we are now able to react on incomming calls and only one step away from doing our own calls.

Most part of our work tomorrow will be the integration of libmsmcomm into FSO. We need to rework some of the basic interfaces in fsogsmd to be able to run the AT interpreter beside the libmsmcomm stuff. So we should be able for the first time to do most stuff which is actually not implemented in libmsmcomm with normal AT commands only with the loss of creating data connections over GPRS/EDGE/UMTS. But I hope we can replace nearly all of the important AT commands in the near future with their equivalent in libmsmcomm.

So stay tuned! FSO will be on our Palm Pre, very soon.