<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>apt-blog.net   无证程序员的PT桑 &#187; Blackberry</title> <atom:link href="http://apt-blog.net/tag/blackberry/feed" rel="self" type="application/rss+xml" /><link>http://apt-blog.net</link> <description>潜逃中。</description> <lastBuildDate>Sun, 05 Feb 2012 10:35:00 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>黑莓续断膏 MDS服务器的Linux版本</title><link>http://apt-blog.net/blackberry_broken_net_fix_server_for_linux</link> <comments>http://apt-blog.net/blackberry_broken_net_fix_server_for_linux#comments</comments> <pubDate>Wed, 23 Feb 2011 10:18:43 +0000</pubDate> <dc:creator>BOYPT</dc:creator> <category><![CDATA[C/C++]]></category> <category><![CDATA[Mobile]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Unix/Linux]]></category> <category><![CDATA[Blackberry]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[mds]]></category> <category><![CDATA[黑莓]]></category> <guid
isPermaLink="false">http://apt-blog.net/blackberry_broken_net_fix_server_for_linux</guid> <description><![CDATA[黑莓系统5.0以上系统在没有购买使用黑莓网络服务的手机上的断网现象一直比较恼人。几个月前有人做出了“黑莓续断膏”，原理是自架一台服务器，程序模拟MDS服务的简单回应，可以忽悠手机继续在线。 5.0系统断网自动修复程序黑莓断续膏(AntiBrokenNet！) BrokenNetFixup断网修复工具 区别是前者后台自动修复，后者要手动运行修复。 从网友的留言看出，虽然软件虽然有效，但没有稳定的服务器，软件刚出现时候确实有一批地址提供了服务，但很快就失效了。北京小C这里提供了模拟MDS服务器的程序，是VC写的一个小UDP服务器，虽然原理很简单，但用一台Windows的服务器来跑成本太高了，当然很难稳定提供。 其实服务只是很简单的几行代码，稍微改了一下就可以在Linux下面运行。一台低端Linux VPS的费用大概一年200RMB，这个费用对大多数人来说都不是什么问题的，所以推荐想要稳定防断网服务器的人去弄一台，一台可以很多人共享了。VPS侦探 、Lowendbox上有很多这样的推荐。 Linux版本的MDS服务器代码在Google Code上，可以直接下载。 在服务器（Debian/Ubuntu系统）上编译并运行： 1 2 3 4 5 sudo apt-get install build-essential wget http://ptcoding.googlecode.com/svn/trunk/mds_server.c gcc -Wall -o mds_server mds_server.c sudo cp mds_server /usr/local/bin/ /usr/local/bin/mds_server 现在可以设置手机的续断软件使用这个服务器来连接断网测试了，手机连接的时候，会实时打印出手机的连接信息跟PIN码。 当然最好把程序加入系统自动启动： sudo touch /var/log/mds_server.log sudo chown nobody /var/log/mds_server.log sudo sed -i '/^exit 0/isu nobody -c &#34;nohup /usr/local/bin/mds_server &#62;&#62;/var/log/mds_server.log &#38;&#34;' /etc/rc.local 这样程序会在系统启动后自动在后台运行，运行的LOG会记录在/var/log/mds_server.log文件当中。 下面也无偿提供一枚MDS服务器，就是跑在我的Linux服务器上的。 [...]]]></description> <content:encoded><![CDATA[<p>黑莓系统5.0以上系统在没有购买使用黑莓网络服务的手机上的断网现象一直比较恼人。几个月前有人做出了“黑莓续断膏”，原理是自架一台服务器，程序模拟MDS服务的简单回应，可以忽悠手机继续在线。</p><ul><li><a
href="http://www.bbercn.com/auto-fix-network-problems-by-antibrokennet.html">5.0系统断网自动修复程序黑莓断续膏(AntiBrokenNet！)</a></li><li><a
href="http://www.bjxiaoc.cn/index.php/archives/11437">BrokenNetFixup断网修复工具</a></li></ul><p>区别是前者后台自动修复，后者要手动运行修复。</p><p>从网友的留言看出，虽然软件虽然有效，但没有稳定的服务器，软件刚出现时候确实有一批地址提供了服务，但很快就失效了。<a
href="http://www.bjxiaoc.cn/index.php/archives/11437">北京小C</a>这里提供了模拟MDS服务器的程序，是VC写的一个小UDP服务器，虽然原理很简单，但用一台Windows的服务器来跑成本太高了，当然很难稳定提供。</p><p>其实服务只是很简单的几行代码，稍微改了一下就可以在Linux下面运行。一台低端Linux VPS的费用大概一年200RMB，这个费用对大多数人来说都不是什么问题的，所以推荐想要稳定防断网服务器的人去弄一台，一台可以很多人共享了。<a
href="http://www.vpser.net/">VPS侦探</a> 、<a
href="http://www.lowendbox.com/">Lowendbox</a>上有很多这样的推荐。</p><p>Linux版本的MDS服务器代码在<a
href="http://code.google.com/p/ptcoding/source/browse/trunk/mds_server.c">Google Code</a>上，可以<a
href="http://ptcoding.googlecode.com/svn/trunk/mds_server.c">直接下载</a>。</p><p>在服务器（Debian/Ubuntu系统）上编译并运行：</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
</pre></td><td
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>ptcoding.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span>mds_server.c
<span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-Wall</span> <span style="color: #660033;">-o</span> mds_server mds_server.c
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> mds_server <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mds_server</pre></td></tr></table></div><p>现在可以设置手机的续断软件使用这个服务器来连接断网测试了，手机连接的时候，会实时打印出手机的连接信息跟PIN码。</p><p>当然最好把程序加入系统自动启动：</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>mds_server.log
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> nobody <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>mds_server.log
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">'/^exit 0/isu nobody -c &quot;nohup /usr/local/bin/mds_server &gt;&gt;/var/log/mds_server.log &amp;&quot;'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.local</pre></div></div><p>这样程序会在系统启动后自动在后台运行，运行的LOG会记录在<code>/var/log/mds_server.log</code>文件当中。</p><p>下面也无偿提供一枚MDS服务器，就是跑在我的Linux服务器上的。</p><div
class="wp_syntax"><div
class="code"><pre class="text" style="font-family:monospace;">地址：119.134.250.11
端口：19781</pre></div></div><p>另外服务端口可以修改源代码里面的宏：</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#define LOCAL_SERVER_PORT 19781</span></pre></td></tr></table></div> ]]></content:encoded> <wfw:commentRss>http://apt-blog.net/blackberry_broken_net_fix_server_for_linux/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Ubuntu 下使用蓝牙/USB连接黑莓8700上网</title><link>http://apt-blog.net/blackberry_as_bluetooth_and_usb_modem_for_ubuntu</link> <comments>http://apt-blog.net/blackberry_as_bluetooth_and_usb_modem_for_ubuntu#comments</comments> <pubDate>Thu, 17 Dec 2009 16:29:37 +0000</pubDate> <dc:creator>PT</dc:creator> <category><![CDATA[Unix/Linux]]></category> <category><![CDATA[Blackberry]]></category> <category><![CDATA[EDGE]]></category> <category><![CDATA[GPRS]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[蓝牙]]></category> <category><![CDATA[黑莓]]></category> <guid
isPermaLink="false">http://apt-blog.net/blackberry_as_bluetooth_and_usb_modem_for_ubuntu</guid> <description><![CDATA[黑莓8700支持EDGE网络，用来做GPRS Modem是相当理想的，标准的mini usb接口，蓝牙2.0，完全足够EDGE的网络速度； 本来以为用蓝牙连接会很简单，在blueman里面连接即可，可是实际上，不行： Failed: Modem Manager did not support the connection 之前用blueman连接Nokia的机，是没问题的，看来黑莓的Modem协议有点不同……Google了一下，找到了不少BB在Linux下的资料：How use BlackBerry device with Linux【介绍了Linux对黑莓的配置、同步、安装软件、Modem、Java开发】how to teather blackberry and linux via bluetooth【连BB蓝牙的完整过程，试验不成功】Berry4all 通过USB连接BB Modem的专用程序 测试Berry4all终于能够连接上BB的GPRS，观察Berry4all其实也是建立了串口通信后，使用pppd的协议来建立数据链接的，要连接cmnet，还得修改其conf下的att-chat，即其中的“拨号”协议； blueman虽然不能建立Modem链接，但是还是能够建立起/dev/rfcomm0，即通过蓝牙的串口链接；使用蓝牙教程，基本上都是使用hcitool等工具来配置的，使用起来真的好不方便，而blueman不是刚好帮忙搞定了蓝牙的配对连接等麻烦事情么…… 于是把Berry4all的conf目录的att跟att-chat文件复制到/etc/ppp/peers，参照别的教程的配置，修改att，在开始115200那行前，加入nodetach跟/dev/rfcomm0两行，最后的connect调用chat文件的路径改成connect "/usr/sbin/chat -f /etc/ppp/peers/att-chat"，att-chat里面修改一行：OK 'AT+CGDCONT=1,"IP","cmnet"' ，最后运行sudo pppd call att，终于用蓝牙连上了GPRS； 其实使用ppp连接modem的方法是最传统的，也是高度可定制（如连接后配置路由表、IP、DNS），不管是用Cable、USB、蓝牙还是红外，都可以这样完成，Of Linux, GPRS Phones, Serial Cable, Irda, Bluetooth and USB文章里面列举了好多这些例子；我修改了其中的三个脚本：gprs, gprs-connect-chat, gprs-disconnect-chat替代了上面Berry4all的att脚本，因为这脚本里面的注释非常详细，以防以后需要的调整； 这是我打包了修改好后（适用于移动CMNET上网的）gprs脚本，使用blueman连接了rfcomm0后，运行sudo pppd call gprs，就能连接上GPRS，ifconfig查看出现一个ppp0，可以直接上网了； 如果不使用blueman，完全使用bluez的工具的话，可以参照Blackberry [...]]]></description> <content:encoded><![CDATA[<p>黑莓8700支持EDGE网络，用来做GPRS Modem是相当理想的，标准的mini usb接口，蓝牙2.0，完全足够EDGE的网络速度；</p><p>本来以为用蓝牙连接会很简单，在blueman里面连接即可，可是实际上，不行：</p><blockquote><p><img
style="max-width: 800px; width: 332px; height: 195px;" src="http://apt-blog.net/wp-content/uploads/2009/12/blueman_fail.png" /></p><p>Failed: Modem Manager did not support the connection</p></blockquote><p>之前用blueman连接Nokia的机，是没问题的，看来黑莓的Modem协议有点不同……Google了一下，找到了不少BB在Linux下的资料：<br
/><a
target="_blank" href="http://www.progweb.com/modules/blackberry/index-en.html">How use BlackBerry device with Linux</a>【介绍了Linux对黑莓的配置、同步、安装软件、Modem、Java开发】<br
/><a
target="_blank" href="http://naraku.net/2008/08/15/how-to-teather-blackberry-and-linux-via-bluetooth/">how to teather blackberry and linux via bluetooth</a>【连BB蓝牙的完整过程，试验不成功】<br
/><a
target="_blank" href="http://www.berry4all.com/">Berry4all</a> 通过USB连接BB Modem的专用程序</p><p>测试<a
target="_blank" href="http://www.berry4all.com/">Berry4all</a>终于能够连接上BB的GPRS，观察<a
target="_blank" href="http://www.berry4all.com/">Berry4all</a>其实也是建立了串口通信后，使用pppd的协议来建立数据链接的，要连接cmnet，还得修改其conf下的att-chat，即其中的“拨号”协议；</p><p>blueman虽然不能建立Modem链接，但是还是能够建立起/dev/rfcomm0，即通过蓝牙的串口链接；使用蓝牙教程，基本上都是使用hcitool等工具来配置的，使用起来真的好不方便，而blueman不是刚好帮忙搞定了蓝牙的配对连接等麻烦事情么……</p><p>于是把<a
target="_blank" href="http://www.berry4all.com/">Berry4all</a>的conf目录的att跟att-chat文件复制到/etc/ppp/peers，参照别的教程的配置，修改att，在开始115200那行前，加入nodetach跟/dev/rfcomm0两行，最后的connect调用chat文件的路径改成connect "/usr/sbin/chat -f /etc/ppp/peers/att-chat"，att-chat里面修改一行：OK 'AT+CGDCONT=1,"IP","cmnet"' ，最后运行sudo pppd call att，终于用蓝牙连上了GPRS；</p><p>其实使用ppp连接modem的方法是最传统的，也是高度可定制（如连接后配置路由表、IP、DNS），不管是用Cable、USB、蓝牙还是红外，都可以这样完成，<a
href="http://www.iki.fi/mikko.rapeli/linux_gprs.html" target="_top">Of Linux, GPRS Phones, Serial Cable, Irda, Bluetooth and USB</a>文章里面列举了好多这些例子；我修改了其中的三个脚本：gprs, gprs-connect-chat, gprs-disconnect-chat替代了上面<a
target="_blank" href="http://www.berry4all.com/">Berry4all</a>的att脚本，因为这脚本里面的注释非常详细，以防以后需要的调整；</p><p><a
target="_blank" href="http://ptcoding.googlecode.com/files/grps.zip">这是我打包了修改好后</a>（适用于移动CMNET上网的）gprs脚本，使用blueman连接了rfcomm0后，运行sudo pppd call gprs，就能连接上GPRS，ifconfig查看出现一个ppp0，可以直接上网了；</p><blockquote><p><img
style="max-width: 800px; width: 446px; height: 295px;" src="http://apt-blog.net/wp-content/uploads/2009/12/bb_connected.png" /></p></blockquote><p>如果不使用blueman，完全使用bluez的工具的话，可以参照<a
href="http://pegelinux.wordpress.com/2008/06/11/blackberry-curve-8310-as-bluetooth-modem-on-ubuntu-hardy/" rel="bookmark" title="Permanent Link: Blackberry Curve 8310 as Bluetooth Modem on Ubuntu&nbsp;Hardy">Blackberry Curve 8310 as Bluetooth Modem on Ubuntu&nbsp;Hardy</a>，我没测试，不过按理说是可行的。</p><p>之所以这么折腾，其实可以说blueman的一个bug吧，似乎BB的Modem没啥特别，按通用的Modem都能连接到；有时间看看blueman的代码看能不能弄好……</p> ]]></content:encoded> <wfw:commentRss>http://apt-blog.net/blackberry_as_bluetooth_and_usb_modem_for_ubuntu/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
