Bonjour
J'ai un TTGO ESP32 Paxcounter LoRa32 (ESP32 LoRa32 T3 V2.1 1.6 )
https://fr.aliexpress.com/item/4000329729312.htm est un Heltec Wireless Stick Lite Wireless Stick Lite (Phaseout) – Heltec Automation
quelle configuration #define j'ai essayé de nombreuses façons mais aucune ne fonctionne
#define SCK 5 // GPIO5 - SCK
#define MISO 19 // GPIO19 - MISO
#define MOSI 34 // GPIO27 - MOSI
#define SS 18 // GPIO18 - CS
#define RST 14 // GPIO14 - RESET (Si Lora ne fonctionne pas, remplacez-le par GPIO14)
#define DI0 26 // GPIO26 - IRQ (demande d'interruption)
#define BAND 868E6
l'OLED_LoRa_Sender et le LoRaReceiver
#include <SPI.h>
#include <LoRa.h>
#include <Wire.h>
#include "SSD1306.h"
#include "images.h"
#define SCK 5 // GPIO5 -- SCK
#define MISO 35 // GPIO19 -- MISO
#define MOSI 34 // GPIO27 -- MOSI
#define SS 18 // GPIO18 -- CS
#define RST 14 // GPIO14 -- RESET (If Lora does not work, replace it with GPIO14)
#define DI0 26 // GPIO26 -- IRQ(Interrupt Request)
#define BAND 868E6
unsigned int counter = 0;
SSD1306 display(0x3c, 21, 22);
String rssi = "RSSI --";
String packSize = "--";
String packet ;
void setup() {
pinMode(16,OUTPUT);
pinMode(2,OUTPUT);
digitalWrite(16, LOW); // set GPIO16 low to reset OLED
delay(50);
digitalWrite(16, HIGH); // while OLED is running, must set GPIO16 in high
Serial.begin(115200);
while (!Serial);
Serial.println();
Serial.println("LoRa Sender Test");
SPI.begin(SCK,MISO,MOSI,SS);
LoRa.setPins(SS,RST,DI0);
if (!LoRa.begin(868E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
//LoRa.onReceive(cbk);
// LoRa.receive();
Serial.println("init ok");
display.init();
display.flipScreenVertically();
display.setFont(ArialMT_Plain_10);
delay(1500);
}
void loop() {
display.clear();
display.setTextAlignment(TEXT_ALIGN_LEFT);
display.setFont(ArialMT_Plain_10);
display.drawString(0, 0, "Sending packet: ");
display.drawString(90, 0, String(counter));
Serial.println(String(counter));
display.display();
// send packet
LoRa.beginPacket();
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();
counter++;
digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(2, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
/*
Check the new incoming messages, and print via serialin 115200 baud rate.
by Aaron.Lee from HelTec AutoMation, ChengDu, China
成都惠利特自动化科技有限公司
www.heltec.cn
this project also realess in GitHub:
https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series
*/
#include "heltec.h"
#define BAND 868E6 //you can set band here directly,e.g. 868E6,915E6
void setup() {
pinMode(LED_1,OUTPUT);
digitalWrite(LED_1, LOW); // set GPIO16 low to reset OLED
delay(50);
digitalWrite(LED_1, HIGH); // while OLED is running, must set GPIO16 in high
digitalWrite(LED_1, LOW); // set GPIO16 low to reset OLED
delay(50);
//WIFI Kit series V1 not support Vext control
Heltec.begin(false /*DisplayEnable Enable*/, true /*Heltec.LoRa Disable*/, true /*Serial Enable*/, true /*PABOOST Enable*/, BAND /*long BAND*/);
}
void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// received a packet
Serial.print("Received packet '");
// read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read());
}
// print RSSI of packet
Serial.print("' with RSSI ");
Serial.println(LoRa.packetRssi());
digitalWrite(LED_1, led); // turn the LED on (HIGH is the voltage level)
led = !led;
}
}
côté réception il n'y a pas 2 messages entrant
09:36:45.202 -> Serial initial done
09:36:45.202 -> The Wireless Stick Lite not have an on board display, Display option must be FALSE!!!
09:36:45.271 -> LoRa Initial success!
rien de d'autres
le problème les #define sont pas bon ou autre chose ????
merci