2007年4月12日星期四

Fixing MotoVision on A1200

Introduction 介绍

Motovision is an application that can run on some Motorola mobile phones, such as A780, but failed to run on A1200. However, it is not too difficult to fix this issue. I fixed it by writing a TCL script acting as a middle-man between linux-side part and windows-side part of MotoVision. This is a quick and dirty fix, as a temporary solution.

MotoVision可以运行在摩托罗拉的一些手机上,比如A780,但是在A1200上却不行。解决这个问题不是很困难。我写了一个TCL脚本来插在MotoVision的linux端程序和Windows端程序之间,从而给出了一个临时的解决方案。
1. Downloading 1. 下载

You need to download the following:

  • MotoVision, which could be downloaded from various sources.
  • USBLAN driver. I recommend latest official version which could be downloaded from here after register and login.
  • Modified MVDS.exe. You can do it yourself, just replace "169.254.142.2" with "127.000.000.1" in any editor with binary editing mode, then save it as MVDS_a1200.exe. I prepared an already modified one which can be downloaded from here.
  • TCL environment, which will be used to run the TCL script. You may download it from here or other places.
  • The TCL script (mv_a1200.tcl) I wrote could be downloaded from here.

需要下载这些东西:

  • MotoVision本身可以从很多地方下载到。
  • USBLAN的驱动程序可以从很多地方下载到。建议使用Motorola的最新官方版本,下载地址在摩托罗拉网站上,需要注册并登录。
  • 修改后的MVDS.exe。你可以自己修改,用支持二进制格式的编辑器把其中的"169.254.142.2"替换成"127.000.000.1"就行了,改好之后可以改名为MVDS_a1200.exe。我准备了一个已经修改好的,可以从这里下载。
  • 用来执行TCL脚本的TCL运行环境。可以从这里 或者其它地方下载到。
  • 我写的TCL脚本mv_a1200.tcl可以从这里下载。
2. Install 2. 安装

Installation is easy, but there are a few things you may be careful:

  • It is better to install latest official version of USBLAN driver, rather than install other versions descripted in MotoVision installation steps.
  • I recommend installing inetd on you mobile phone, installation steps could be found in my previous blogs. So you can telnet into the phone and terminate motovision process whenever needed, by issueing ps -e and kill commands.
  • mv_a1200.tcl could be saved in any place after downloading. You may use any text editor to open this file and modify these two variable settings: phoneIpAddress and frameInterval. The former is the IP address of your A1200. The latter is an interval in mille-seconds, greater value makes the refreshing of video slower, and at the same time consums less CPU cycle.

安装是很简单的。有几点值得注意:

  • 安装最新官方版本的USBLAN驱动比安装很多MotoVision安装说明中讲的其它版本更好。
  • 建议根据我之前的博客文章在手机上安装inetd。从而可以在需要的时候telnet进手机来用ps -ekill终止掉不需要的motovision进程。
  • 下载的mv_a1200.tcl可以保存在任意地址,可以用文本编辑器打开来修改其中的两个参数:phoneIpAddressframeInterval。前者是手机的IP地址,后者是以毫秒为单位的间隔时间,值越大则画面更新越慢,同时对机器CPU的占用也越小。
3. Usage 3. 使用

To start, follow these steps:

  1. Connect your phone to your computer, make sure that you can ping to your phone.
  2. Run motovision on your phone.
  3. Open a command prompt window, and run: tclsh mv_a1200.tcl. tclsh.exe is located in the bin directory of your TCL installation.
  4. Double click to run MVDS_a1200.exe.
  5. Minimize MVDS_a1200.exe window.

To pause, follow these steps:

  1. Switch to the command prompt window running mv_a1200.tcl, press Ctrl-C.
  2. If the program does not respond to Ctrl-C, open task manager and end the task named tclsh.

You don't need to terminate MVDS_a1200.exe.

To resume, follow these steps:

  1. Switch to the command prompt window running mv_a1200.tcl, run tclsh mv_a1200.tcl again.

You don't need to restart MVDS_a1200.exe or motovision.

To terminate motovision process running in your phone, follow these steps:

  1. Telnet into your phone.
  2. run ps -e and find out the PID of motovision process
  3. run kill <PID>. Replace the <PID> here with the real PID of motovision process.

按这个步骤启动:

  1. 把手机连接到电脑,确保能ping通手机。
  2. 在手机上启动motovision。
  3. 在电脑上打开一个命令行窗口,执行:tclsh mv_a1200.tcltclsh.exe在你安装好的TCL环境的bin目录下。
  4. 双击执行MVDS_a1200.exe
  5. 最小化MVDS_a1200.exe的窗口。

按这个步骤暂停:

  1. 在运行mv_a1200.tcl的窗口中,按Ctrl-C。
  2. 如果按Ctrl-C没反应,打开任务管理窗口,终止掉名为tclsh的进程。

不需要终止MVDS_a1200.exe

按这个步骤继续:

  1. 在运行mv_a1200.tcl的窗口中,再次执行tclsh mv_a1200.tcl

不需要重新启动MVDS_a1200.exe或者motovision

按这个步骤可以终止手机中的motovision进程:

  1. Telnet进你的手机
  2. 运行ps -e找出motovision进程的PID号码
  3. 运行kill <PID>。这里的<PID>motovision的实际PID号码代替。
4. Known Issues 4. 已知问题
  • 1/3 of the video area is black.
  • Consumes a lot of CPU.
  • Video refreshing is slow.
  • mv_a1200.tcl will report error messages if motovision or MVDS_a1200.exe terminated unexpectedly, or if network disconnected.
  • 大约1/3的视频区域是全黑的。
  • 占用CPU比较多,毕竟是TCL脚本语言写的。
  • 画面刷新慢,毕竟是TCL脚本语言写的。
  • motovisionMVDS_a1200.exe意外停止时,或者当网络中断时,mv_a1200.tcl会报错。
5. Your feedback and help are welcome 5. 欢迎反馈和帮助
  • Welcome your feedback.
  • Welcome your modification to mv_a1200.tcl to make it better.
  • Welcome your help to provide or modify or re-write the source code of MotoVision itslef. I don't have the source code, and I don't have compiling environment (yet). But I believe that the solution I described here is just a temporary one.
  • 欢迎反馈。
  • 欢迎修改mv_a1200.tcl让它更好用。
  • 欢迎提供、修改、重写MotoVision的源代码。我自己没有源代码,(目前)也没有编译环境。但是我相信,我提供的这个方案只是临时的。

1 条评论:

匿名 说...

请问老师,有没有这个新的进展。我想用1200做webcam 。但是没有做好,您做好了吗,有后续的吗?我的QQ124717230希望得到您的帮助