So I tried using "RH_RF95 rf95(0,24)" and it still doesn't work.
So you mentioned that I should use attachInterrupt(pin,ISR,mode) for it to work properly.
I'm not using the ISR because RH_RF95 is just a constructor for me to use and i guess it won't be fixed until the whole thing gets sorted out?
So here's actually how the first part of my code looks like in case you're wondering how I use it:
Code:
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <Arduino.h>
#include <EEPROM.h>
#include <RHRouter.h>
#include <RHMesh.h>
#include <RH_RF95.h>
#include "Adafruit_SHT31.h"
#include <AltSoftSerial.h>
#define N_NODES 2
uint8_t nodeId;
uint8_t routes[N_NODES]; // full routing table for mesh
int16_t rssi[N_NODES]; // signal strength info
float ppm[12];
AltSoftSerial pmsSerial;
Adafruit_SHT31 sht31 = Adafruit_SHT31();
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Singleton instance of the radio driver
RH_RF95 rf95(0,24);
// Class to manage message delivery and receipt, using the driver declared above
RHMesh *manager;
// message buffer
char buf[120];
const long interval = 1000;
unsigned long previousMillis = 0;
int freeMem() {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
struct pms5003data {
uint16_t framelen;
uint16_t pm10_standard, pm25_standard, pm100_standard;
uint16_t pm10_env, pm25_env, pm100_env;
uint16_t particles_03um, particles_05um, particles_10um, particles_25um, particles_50um, particles_100um;
uint16_t unused;
uint16_t checksum;
};
struct pms5003data data;
...
void setup(
manager = new RHMesh(rf95, nodeId);
// fails initialization when rh95 cannot use pin 24 as intterupt
if (!manager->init()) {
Serial.println(F("init failed"));
} else {
Serial.println("done");
}
) {...}
void loop() {...}