You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
467 B

#define LORA_SOCKET_IP "2.2.2.2"
#include "lora-mqtt.h"
LoRaMQTT mqtt;
void msg(String subject, String msg){
Serial.println(subject);
Serial.println(msg);
}
void setup(){
Serial.begin(115200);
if(!LoRa.begin(433E6) ){
Serial.println("LoRa Failuer");
while(1);
}
LoRa.receive();
mqtt.ini();
mqtt.subscribe("lalala");
mqtt.onReceived(msg);
//mqtt.publish("lalala", "aaaaa");
}
void loop(){
mqtt.core();
}