Sensors to meshtastic

I have an esp32 with gps, pressure and temp sensor and an anemometer with 3.3v output running on an esp32. I want to send this info to the heltec lora32 and display and send on the meshtastic network. How do i send this info the Heltec lora 32 and have it broadcast to the mesh network

That’s a pretty open-ended question…

You should probably start by looking at the Heltec LoRa example sketches. They provide the basics for LoRa point-to-point communications. One solution for the LoRa point-to-point communication of sensor data is provided here but you don’t everything described there for a single, simple application.

I’ve not used Meshtastic, so I’m not sure what the limitations might be there, but if you can sort out the LoRa basics first, and come back with more specific questions, there may be people here who can help.

Once you’ve done the ESP32 weather station to Heltec LoRa32 part of the project, you’ll find that Meshtastic has a whole pile of sensor support built in as example on how to send sensor data to Meshtastic.

You haven’t said how you are going to transmit from the ESP32 to this Heltec and if you plan on getting LoRa point to point running on a Meshtastic device you will need to really get in to MT code base to be able to run two protocols at the same time.

Before anyone else points it out, why not just transmit MT from the weather station?

i was planning on sending the data over direct line to the heltec. where do i find the meshtastic info on sensor support.

using mymesh to transmit to heltec heres the sketch
#include <Wire.h>
#include <TinyGPSPlus.h>
#include <Adafruit_BMP280.h>

Adafruit_BMP280 bmp;
TinyGPSPlus gps;

#define WIND_SENSOR_PIN 32

// GPS UART
#define GPS_RX 34
#define GPS_TX 35

// Meshtastic/Heltec UART
#define MESH_RX 6 // Heltec TX
#define MESH_TX 5 // Heltec RX

HardwareSerial MyGPS(1); // Serial1 for GPS
HardwareSerial MyMesh(2); // Serial2 for Meshtastic

void setup() {
// Initialize GPS serial
MyGPS.begin(9600, SERIAL_8N1, GPS_RX, GPS_TX);

// Initialize Meshtastic serial
MyMesh.begin(115200, SERIAL_8N1, MESH_RX, MESH_TX);

// Initialize BMP280
if (!bmp.begin(0x76)) {
MyMesh.println(“BMP280 not found!”);
while (1);
}

// Optional: set I2C clock speed
Wire.setClock(100000);
}

void loop() {
// Read wind sensor (0-3.3V analog)
int raw = analogRead(WIND_SENSOR_PIN);
float windVoltage = (raw / 4095.0) * 3.3;

// Read GPS data
while (MyGPS.available()) {
gps.encode(MyGPS.read());
}

// Read BMP280 data
float temperature = bmp.readTemperature();
float pressure = bmp.readPressure() / 100.0; // in hPa

// Build output string
String data = “!wind:” + String(windVoltage, 2) +
“;temp:” + String(temperature, 1) +
“;press:” + String(pressure, 1);

if (gps.location.isValid()) {
data += “;lat:” + String(gps.location.lat(), 6);
data += “;lon:” + String(gps.location.lng(), 6);
}

// Send to Heltec / Meshtastic
MyMesh.println(data);

// Debug log (optional)
Serial.println("Sent: " + data);

delay(5000); // Adjust as needed
}