我在python中尝试蓝牙编程.它一直工作到昨天.今天早上有停电,由于某种原因,蓝牙模块被禁用,无法打开.所以,我做了一个sudo hciconfig hci0 reset,然后打开它.从那时起,最简单的程序无法执行.就拿这一次的例子.它卡在advertise_service中bluetooth模块中并抛出以下错误(仅供参考:virtualenv在这里不是问题.系统范围的python也做同样的事情).
Traceback (most recent call last):
File "bt.py", line 17, in <module>
advertise_service( server_sock, "SampleServer", service_id = uuid, service_classes = [ uuid, SERIAL_PORT_CLASS ], profiles = [ SERIAL_PORT_PROFILE ])
File "/home/machinename/.virtualenvs/py27/local/lib/python2.7/site-packages/bluetooth/bluez.py", line 242, in advertise_service
raise BluetoothError (str (e))
bluetooth.btcommon.BluetoothError: (2, 'No such file or directory')
Run Code Online (Sandbox Code Playgroud)
有时在编译和重新安装Bluez驱动程序时出现了不同的错误:
Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/bluetooth/bluez.py", line 268, in advertise_service
bluetooth.btcommon.BluetoothError: error no advertisable device.
Run Code Online (Sandbox Code Playgroud)
但所有这些在这台机器之前就像一个魅力; 事实上,当我写这篇文章的时候,所有的程序都可以和我的其他ubuntu(14.04LTS)机器一起工作.我检查了源代码,并追溯到一个_bluetooth.so文件 …
我安装nodejs然后node使用aptitude.从那以后,我清洗node,创造从链接/usr/bin/nodejs到/usr/bin/node.现在,当我输入时node,由于某种未知的原因,它一直在寻找,sbin而不是bin.要检查我是否已清除nodejs并输入两者node,nodejs然后输出.
(mvenv)username@mymachine:~$ node
-bash: /usr/sbin/node: No such file or directory
(mvenv)username@mymachine:~$ nodejs
-bash: /usr/bin/nodejs: No such file or directory
Run Code Online (Sandbox Code Playgroud)
任何解释为什么键入node使bash看起来sbin而不是bin对于nodejs它看起来类似的命令bin?我怎么可能打破这个sbin链接并恢复到bin?