Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nxt_beep.py: Figure out how to run as regular user #3

Open
gmacario opened this issue May 28, 2018 · 3 comments
Open

nxt_beep.py: Figure out how to run as regular user #3

gmacario opened this issue May 28, 2018 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@gmacario
Copy link
Member

gmacario commented May 28, 2018

See https://github.com/SOLARMA/nxt-control-mmf/blob/master/docs/test-rpi3gm28.md

See also: #5

@gmacario gmacario added the help wanted Extra attention is needed label May 28, 2018
@gmacario gmacario changed the title nxt_beep.py: Figure out how to run with the proper permissions nxt_beep.py: Figure out how to run as regular user May 28, 2018
@gmacario
Copy link
Member Author

gmacario commented May 29, 2018

After configuring udev as explained in #5 (comment) command nxt_test can be run as non-root user.

Notice that nxt_test was only attempted using the USB link (not Bluetooth)

Let us now try with python nxt_beep.py

(.nxt-venv) pi@rpi3gm26:~/github/SOLARMA/nxt-control-mmf $ python nxt_beep.py 
Traceback (most recent call last):
  File "nxt_beep.py", line 17, in <module>
    brick = sock.connect()
  File "/home/pi/.nxt-venv/src/nxt-python/nxt/bluesock.py", line 39, in connect
    sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
  File "/home/pi/.nxt-venv/lib/python3.4/site-packages/bluetooth/bluez.py", line 155, in __init__
    _sock = _bt.btsocket (proto)
_bluetooth.error: (93, 'Protocol not supported')
(.nxt-venv) pi@rpi3gm26:~/github/SOLARMA/nxt-control-mmf $

@gmacario
Copy link
Member Author

gmacario commented May 29, 2018

Command hcitool scan correctly identifies the NXT device

(.nxt-venv) pi@rpi3gm26:~/github/SOLARMA/nxt-control-mmf $ hcitool scan
Scanning ...
	C0:CB:38:CE:39:FC	dell-davi
	00:16:53:05:15:50	NXT
(.nxt-venv) pi@rpi3gm26:~/github/SOLARMA/nxt-control-mmf $

On the other hand, it looks like the distribution running on rpi3gm26 does not find the rfcomm kernel module

(.nxt-venv) pi@rpi3gm26:~/github/SOLARMA/nxt-control-mmf $ rfcomm 
Can't open RFCOMM control socket: Protocol not supported
(.nxt-venv) pi@rpi3gm26:~/github/SOLARMA/nxt-control-mmf $ sudo modprobe rfcomm
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.50-v7+/modules.dep.bin'
(.nxt-venv) pi@rpi3gm26:~/github/SOLARMA/nxt-control-mmf $

@gmacario
Copy link
Member Author

Notice that the Raspbian distribution installed on rpi3gm26 is TODO (used for the 3.5 LCD display)

  • Linux kernel is 4.4.50-v7+
(.nxt-venv) pi@rpi3gm26:~ $ uname -a
Linux rpi3gm26 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux
(.nxt-venv) pi@rpi3gm26:~ $
  • But modules are 4.9.35-v7+
(.nxt-venv) pi@rpi3gm26:~ $ ls -la /lib/modules
total 16
drwxr-xr-x  4 root root 4096 May 27 19:06 .
drwxr-xr-x 18 root root 4096 May 27 18:52 ..
drwxr-xr-x  3 root root 4096 May 27 19:06 4.9.35+
drwxr-xr-x  3 root root 4096 May 27 19:06 4.9.35-v7+
(.nxt-venv) pi@rpi3gm26:~ $

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant