Nanodan gelen verileri eps32 ye gönderemiyorum 3n1 pcb esp 3n1 pcb nano kullanıyorum
Esp32 kodları
#include “Arduino.h”
#include “LoRa_E32.h”
LoRa_E32 e32ttl(&Serial2);
struct veriler {
float lat;
float lon;
float speed;
int crs;
} data;
#define M0 32
#define M1 33
#define RX 27
#define TX 35
void setup() {
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
digitalWrite(M0, LOW);
digitalWrite(M1, 0);
Serial.begin(9600);
e32ttl.begin();
delay(500);
}
void loop() {
while (e32ttl.available() > 1) {
// Gelen mesaj okunuyor
ResponseStructContainer rsc = e32ttl.receiveMessage(sizeof(veriler));
struct veriler data = (veriler) rsc.data;
Serial.println(“Gelen Messaj: “);
Serial.println(data.lat,6);
Serial.println(data.lon,6);
Serial.println(data.speed,2);
Serial.println(data.crs,2);
rsc.close();
}
}
Nano kodları
#include <TinyGPS.h>
#include <SoftwareSerial.h>
SoftwareSerial ss(8,9); //tx,rx
TinyGPS gps;
#include “LoRa_E32.h”
SoftwareSerial mySerial(4, 3);
LoRa_E32 e32ttl(&mySerial);
#define M0 7
#define M1 6
float speed;
int crs;
struct veriler {
float lat;
float lon;
float speed;
int crs;
}data ;
void setup() {
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
digitalWrite(M0, LOW);
digitalWrite(M1, LOW);
Serial.begin(9600);
e32ttl.begin();
delay(500);
ss.begin(9600);
delay(500);
}
void loop() {
{
smartdelay(1000);
}
float flat, flon;
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
// Serial.print(“lat: “); Serial.println(flat, 6);
// Serial.print(“lon: “); Serial.println(flon, 6);
data.lon=flon;
Serial.print(“flon: “); Serial.println(flon, 6);
data.lat=flat;
Serial.print(“flat: “); Serial.println(flat, 6);
crs= gps.f_course();
data.crs= crs;
Serial.print(“crs: “); Serial.println(crs,3);
speed= gps.f_speed_kmph();
data.speed=speed;
Serial.print(“speed: “); Serial.println(speed,2);
ResponseStatus rs = e32ttl.sendFixedMessage(0, 2, 6, &data, sizeof(veriler));
Serial.println(rs.getResponseDescription());
delay(2000);
}
static void smartdelay(unsigned long ms) {
unsigned long start = millis();
do {
while (ss.available())
gps.encode(ss.read());
} while (millis() – start < ms);
}
nanodan enlem ve boylam biligilerini alıyorum seri ekranda görüyorum fakat nano ve esp32 haberlesmesini yapamadım