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

Too many changes #3

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Too many changes #3

wants to merge 13 commits into from

Conversation

MyrikLD
Copy link

@MyrikLD MyrikLD commented Mar 2, 2017

Full project refactoring

MyrikLD added 10 commits February 8, 2017 16:08
PEP8, myo_dicts rename, find_mac function updated, small bugfixes
1. Rewrited myo_dicts
2. Integrated Quaternion
3. Find function rewrited
Too many changes
@GermanAndresVargasTorres

Kind greetings @MyrikLD , I want to try out your code since all the refactoring makes it MUCH EASIER to understand.

When I tried to use the project as indicated in readme.md (calling dongleless.run from my own file), the error says with your modifications, that run function no longer receives parameters:

pi@raspberrypi:~/NewDongleless $ python mi_codigo.py
Traceback (most recent call last):
File "mi_codigo.py", line 19, in <module>
dongleless.run(function_dict)
TypeError: run() takes no arguments (1 given)

When I try to execute dongleless.py, I get the following error:

pi@raspberrypi:~/NewDongleless $ python dongleless.py
Traceback (most recent call last):
File "dongleless.py", line 405, in <module>
run()
File "dongleless.py", line 370, in run
myo = MyoDevice()
File "dongleless.py", line 223, in __init__
self.connection = Connection(mac=getMyo(mac))
File "dongleless.py", line 359, in getMyo
for i in btle.Scanner(0).scan(1):
File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 631, in scan
self.start()
File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 569, in start
self._mgmtCmd("le on")
File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 240, in _mgmtCmd
"Failed to execute mgmt cmd '%s'" % (cmd))
bluepy.btle.BTLEException: Failed to execute mgmt cmd 'le on'

I'd be extremely grateful if you can tell me how to use your code or how to fix this error. Thank you for your kind attention and patience. Sincerely,

Germán Andrés Vargas
Research assistant - Nueva Granada Military University - Bogotá, Colombia

@MyrikLD
Copy link
Author

MyrikLD commented Apr 29, 2017

Hello.
Yes, I removed function_dict method. You need to use function overloading. An example is showed in dongless.py, function run().
The second exeption rised because you need to run this code with root privilegies. It is the problem of bluepy library.
IanHarvey/bluepy#94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants