ladecadence / pyrf95 Goto Github PK
View Code? Open in Web Editor NEWHopeRF RF95 (and similar LoRa modules) python library using spidev
License: GNU General Public License v2.0
HopeRF RF95 (and similar LoRa modules) python library using spidev
License: GNU General Public License v2.0
Hi David ,
Maybe you can help me and address me to a solution.
I just got two Dragino Bee board : http://wiki.dragino.com/index.php?title=Lora_BEE
and I'm trying to use them with two RaspberriPI Zero. Connection is standard : SpDev0.0 interrupt GPIO25. When I try to use your library the device is not detected :
pi@swpi ~/pyRF95 $ sudo python
Python 2.7.3 (default, Jun 22 2016, 03:14:32)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rf95
>>> lora = rf95.RF95(0, 25)
>>> print lora.init()
False
So I installed RadioHead library (from https://github.com/hallard/RadioHead) to test also with the original library :
pi@swpi ~/RadioHead/examples/raspi/spi_scan $ sudo ./spi_scan
Checking register(0x42) with CS=GPIO06 => Nothing!
Checking register(0x10) with CS=GPIO06 => Nothing!
Checking register(0x42) with CS=GPIO07 => Nothing!
Checking register(0x10) with CS=GPIO07 => Nothing!
Checking register(0x42) with CS=GPIO08 => SX1276 RF95/96 (V=0x12)
Checking register(0x10) with CS=GPIO08 => Nothing!
Checking register(0x42) with CS=GPIO26 => Nothing!
Checking register(0x10) with CS=GPIO26 => Nothing!
so the SX1276 looks to be correctly detected on CS0 and TX RX works fine.
Any idea where the problem could be ?
Thanks
Tony
Hi and thanks for your work.
I think I will use your library in my Meteo Station project but I need to use SPI port 1 there so I did this modification :
If you think is useful I can ask for a merge.
Question :
Could MAX_MESSAGE_LEN be increased or it is something related with LoRA ?
Thanks
Thank you for the wonderful library.
For some reason when I run the example code ensuring the library is in the
same directory I get the following error
Traceback (most recent call last):
File "./rf95_testing.py", line 17, in
lora.set_modem_config(Bw31_25Cr48Sf512)
NameError: name 'Bw31_25Cr48Sf512' is not defined
@ladecadence
Hello,
First of all thank you for this nice library. If tested and after a small modification, everything works smoothly.
In order to make your code running on my raspberry pi zero, I had to adjust the maximal SPI frequency. In your library it is done only once in the init() method. As it turns out, the spi.spi.max_speed_hz value is reset to its default (125MHz in my case) after spi.close() was called. I added the line
self.spi.max_speed_hz = 488000
after the line
self.spi.open(0, self.cs)
in every spi related method, i.e. spi_write(), spi_read(), spi_write_data() and spi_read_data().
Maybe you can add this changes to your next commit.
Best,
Fabian
BTW, I'm using a RFM95 module
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.