jgillula / rpi-rfm69

Python RFM69 library for Raspberry Pi
GNU General Public License v3.0
30 stars 20 forks source link

Examples dont work. #20

Closed angelojaf closed 2 years ago

angelojaf commented 2 years ago

Hello my friend. How are you? Congratulations for the package of RFM69 for the rasp. This is the best of community! Can you help me, please? The example basics dont work with me. Show the follow error:

Traceback (most recent call last): File "/home/pi/.local/lib/python3.9/site-packages/rpi_rfm69-0.5.0.dist-info/TESTE1.py", line 13, in with Radio(FREQ_915MHZ, node_id, network_id, isHighPower=True, verbose=False, File "/home/pi/.local/lib/python3.9/site-packages/RFM69/radio.py", line 77, in init self._init_spi() File "/home/pi/.local/lib/python3.9/site-packages/RFM69/radio.py", line 109, in _init_spi self.spi.open(self.spiBus, self.spiDevice) FileNotFoundError: [Errno 2] No such file or directory

I will very thanks for you if you help me. Thanks a lot. Angelo.

jgillula commented 2 years ago

Can you share the full example code you're using? It looks like you're trying to run some file called TESTE1.py, but I don't know what the contents of that script are. The line where the error first starts is cut off in your post: with Radio(FREQ_915MHZ, node_id, network_id, isHighPower=True, verbose=False,

angelojaf commented 2 years ago

The code is sample tx rx in github.

jgillula commented 2 years ago

In the lines:

with Radio(FREQ_915MHZ, node_id, network_id, isHighPower=True, verbose=False,
           interruptPin=15, resetPin=22, spiDevice=1) as radio:

Try changing spiDevice=1 to spiDevice=0, and let me know if that works--thanks!

angelojaf commented 2 years ago

I tried this….and this dont work too.

jgillula commented 2 years ago

Are you sure the SPI device on your Raspberry Pi is enabled? What happens if you try the following command in the regular command line?

ls /dev/spidev*

You should get a result like:

crw-rw---- 1 root spi 153, 0 Feb 12 18:33 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 Feb 12 18:33 /dev/spidev0.1
angelojaf commented 2 years ago

Thanks....this is working now.

angelojaf commented 2 years ago

Can you help me, please? I verified all registers of RFM69 to compare another one and I dont find the error. Show the follow error:

/home/pi/.local/lib/python3.9/site-packages/RFM69/radio.py:104: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. GPIO.setup(self.rstPin, GPIO.OUT)

Thanks

jgillula commented 2 years ago

This usually just means that the library wasn't shut down cleanly--it's usually safe to ignore.

If you're looking to get an Arduino using RFM69 to communicate with a Raspberry Pi using RFM69, take a look at test-node.ino in the tests/test-node directory of this repository. That's an Arduino sketch I use to ensure that the two can communicate.

You'll have to make sure to uncomment the appropriate configuration lines to make sure you're on the same frequency/using encryption or not/using the same network ID/etc.

angelojaf commented 2 years ago

Hello my friend. I install the programam node id on Arduino. Its OK. But, now, what file I run on raspberry? I edit test_config, but when I run test_radio itś dont work. Can you help me one more time? Thanks a lot.

jgillula commented 2 years ago

If you want complete instructions on how to run the test code, they can be found in the tests/README.md file. I think that would be overkill though, since those tests are designed to test every single feature of the library. If all you're trying to do is get simple communication between the Arduino and the RPi, then using code like in the documentation should be sufficient.

angelojaf commented 2 years ago

Hello my friend ! Thanks a lot. Thats code working very well. I has a problem with my rasp......I change this and work very well....very thanks !

jgillula commented 2 years ago

Great! I'm going to go ahead and close this issue since it looks like the examples are OK after all.