gieemek / rfm69_softspi Goto Github PK
View Code? Open in Web Editor NEWArduino driver for RFM69 module using software SPI
Arduino driver for RFM69 module using software SPI
Hello,
I have implemented your lib to use RFM69 with Arduino MEGA. I will use your lib on this device because I will use this with Ethernet shield. All incoming Data will be OK, but when is send an Text, that will donβt be receive on the partner.
When I change the lib to the standard lib of Felix and change the wiring to the hardware pins 50 β 53, all is fine.
My wiring is:
RFM69 <-> Arduino MEGA
GND <-> GND
3,3 <-> 3,3V
DIO0 <-> Pin2
SCK <-> Pin 14
MOSI <-> Pin 15
MISO <-> Pin 16
NSS <-> Pin 17
The Pin 2, 14, 15, 16, 17 are all connected with an level-shifter module.
Lib from Felix with this code: send works fine, receive works fine
Lib from you with this code: send won`t work, receive works fine
So what`s wrong?
Here is the code:___________________________________________________________
#define NODEID 47
#define NETWORKID 100 //the same on all nodes that talk to each other (range up to 255)
#define GATEWAYID 1
#define FREQUENCY RF69_868MHZ
#define ENCRYPTKEY "unyu2x5b2rwx2nj4"
#define IS_RFM69HW
#include <RFM69.h>
#include <SPI.h>
#include <SimpleDHT.h>
unsigned long current_uptime, last_loop;
int loop_time = 1000; //100 Millisekunden
RFM69 radio;
//----------------------------------------------------------------------------------------------------------
// SETUP
//----------------------------------------------------------------------------------------------------------
void setup() {
Serial.begin(9600);
radio.initialize(FREQUENCY, NODEID, NETWORKID);
radio.setHighPower(); //uncomment only for RFM69HW!
radio.encrypt(ENCRYPTKEY);
Serial.println(F("Setup finished T47->0.2"));
}
//----------------------------------------------------------------------------------------------------------
// LOOP
//----------------------------------------------------------------------------------------------------------
void loop() {
current_uptime = millis();
// RFM69 check permanently
if (radio.receiveDone())
{
Serial.println(F("receiveDone---------------------------------------------------"));
Serial.print('['); Serial.print(radio.SENDERID, DEC); Serial.print("] ");
for (byte i = 0; i < radio.DATALEN; i++)
Serial.print((char)radio.DATA[i]);
Serial.print(" [RX_RSSI:"); Serial.print(radio.RSSI); Serial.println("]");
}
// Every sec.-----------------------------------------------------------
if ((current_uptime > last_loop) || (last_loop > current_uptime && last_loop > 9999999999999))
{
radio.send(255, "Hello", 6);
last_loop = current_uptime + loop_time;
}
}
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.