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

setMode query #2

Open
PClough opened this issue May 31, 2017 · 1 comment
Open

setMode query #2

PClough opened this issue May 31, 2017 · 1 comment

Comments

@PClough
Copy link

PClough commented May 31, 2017

Hi,
Thank you for this library wrapper, took me a while to realise I couldn't just hit F5 in Geany programmer and instead had to use sudo ./server.py in the terminal after changing the directory to the folder above.
I also noticed that your __init__.py file had 3 underscores after init instead of 2.

Anyway, I would like to add the ability to use the setModeIdle(), setModeTx() and setModeRx() functions.
I can see they are built into the RH_NRF24.cpp and RH_NRF24.h so I tried adding

def setModeIdle(self):
	radiohead.setModeIdle()
def setModeTx(self):
	radiohead.setModeTx()
def setModeRx(self):
	radiohead.setModeRx()	

to pyRadioHeadNRF24.py.

However I am getting this error, could you help please?

Traceback (most recent call last):
  File "./Control_Node111_v3.py", line 20, in <module>
    nrf24.setModeIdle()
  File "/home/pi/pyRadioHeadNRF24/pyRadioHeadNRF24.py", line 148, in setModeIdle
    radiohead.setModeIdle()
  File "/usr/lib/python2.7/dist-packages/cffi/api.py", line 718, in __getattr__
    make_accessor(name)
  File "/usr/lib/python2.7/dist-packages/cffi/api.py", line 713, in make_accessor
    raise AttributeError(name)
AttributeError: setModeIdle

btw I am utilising the nrf24L01 (https://www.amazon.co.uk/gp/product/B010N32SGM/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1) on my Pi3.

Thanks!

@exmorse
Copy link
Owner

exmorse commented Jun 1, 2017

Thanks for reporting.
The problem was that the setMode functions were not implemented in adapter.cpp.

It should be fixed with the last commit.
Unfortunately at the moment I am not able to test it on nrf24 modules.

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

No branches or pull requests

2 participants