联想ThinkPad最近推出的EM73xx系列4G调制解调器的Python包装
em73xx的Python项目详细描述
python实用程序与 Sierra Wireless EM73xx调制解调器,在联想ThinkPads中提供(在 Thinkpad X250)和其他产品。
安装
使用pip从pypi检索:
$ pip install em73xx
或者克隆此repo,并使用setup.py:
安装$ git clone https://github.com/smcl/py-em73xx $ cd py-em73xx $ python setup.py install
文档
(托多,哈哈!)
示例
使用find_device.sh script查找调制解调器的设备-此处 是/dev/ttyACM0:
$ ./find_device.sh /dev/ttyACM0 - Sierra_Wireless_Inc._Sierra_Wireless_EM7345_4G_LTE_013937006578445 /dev/input/event14 - SunplusIT_Inc_Integrated_Camera /dev/video0 - SunplusIT_Inc_Integrated_Camera
初始化调制解调器:
from em73xx import Modem em7345 = Modem("/dev/ttyACM0", pin="1234", debug=True)
接收/读取短信:
messages = em7345.getSMS()
发送短信:
em7345.sendSMS("775123456", "test message from em73xx!")
获取GPS定位(失败时返回None):
gps = em7345.getGPS() if gps: print(gps.latitude) print(gps.longitude)
待办事项
- 编写文档-方法、类型等
- 增加更多的功能,短信和全球定位系统本身不会削减它。四处闲逛 使用/docs中的at命令文本文件应该会有所帮助
- 有堆由XLCSLSR命令返回的信息, 调查我们是否能提供任何有用的信息