`cpp
/*
* LoRa E32-TTL-100
* Start device or reset to send a message
* https://mischianti.org
*
* E32-TTL-100----- Wemos D1 mini
* M0 ----- GND
* M1 ----- GND
* TX ----- PIN D2 (PullUP)
* RX ----- PIN D3 (PullUP)
* AUX ----- Not connected
* VCC ----- 3.3v/5v
* GND ----- GND
*
*/
#include "Arduino.h"
#define E32_TTL_2W
#include "LoRa_E32.h"
LoRa_E32 e32ttl100(D2, D3, UART_BPS_RATE_9600); // e32 TX e32 RX
void printParameters(struct Configuration configuration);
void printModuleInformation(struct ModuleInformation moduleInformation);
void setup() {
Serial.begin(9600);
delay(1000);
// Startup all pins and UART
e32ttl100.begin();
ResponseStructContainer c;
c = e32ttl100.getConfiguration();
// It's important get configuration pointer before all other operation
Configuration configuration = *(Configuration*) c.data;
Serial.println(c.status.getResponseDescription());
Serial.println(c.status.code);
printParameters(configuration);
ResponseStructContainer cMi;
cMi = e32ttl100.getModuleInformation();
// It's important get information pointer before all other operation
ModuleInformation mi = *(ModuleInformation*)cMi.data;
Serial.println(cMi.status.getResponseDescription());
Serial.println(cMi.status.code);
printModuleInformation(mi);
}
void loop() {
}
void printParameters(struct Configuration configuration) {
Serial.println("----------------------------------------");
Serial.print(F("HEAD BIN: ")); Serial.print(configuration.HEAD, BIN);Serial.print(" ");Serial.print(configuration.HEAD, DEC);Serial.print(" ");Serial.println(configuration.HEAD, HEX);
Serial.println(F(" "));
Serial.print(F("AddH BIN: ")); Serial.println(configuration.ADDH, BIN);
Serial.print(F("AddL BIN: ")); Serial.println(configuration.ADDL, BIN);
Serial.print(F("Chan BIN: ")); Serial.print(configuration.CHAN, DEC); Serial.print(" -> "); Serial.println(configuration.getChannelDescription());
Serial.println(F(" "));
Serial.print(F("SpeedParityBit BIN : ")); Serial.print(configuration.SPED.uartParity, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTParityDescription());
Serial.print(F("SpeedUARTDataRate BIN : ")); Serial.print(configuration.SPED.uartBaudRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTBaudRate());
Serial.print(F("SpeedAirDataRate BIN : ")); Serial.print(configuration.SPED.airDataRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getAirDataRate());
Serial.print(F("OptionTrans BIN : ")); Serial.print(configuration.OPTION.fixedTransmission, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getFixedTransmissionDescription());
Serial.print(F("OptionPullup BIN : ")); Serial.print(configuration.OPTION.ioDriveMode, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getIODroveModeDescription());
Serial.print(F("OptionWakeup BIN : ")); Serial.print(configuration.OPTION.wirelessWakeupTime, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getWirelessWakeUPTimeDescription());
Serial.print(F("OptionFEC BIN : ")); Serial.print(configuration.OPTION.fec, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getFECDescription());
Serial.print(F("OptionPower BIN : ")); Serial.print(configuration.OPTION.transmissionPower, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getTransmissionPowerDescription());
Serial.println("----------------------------------------");
}
void printModuleInformation(struct ModuleInformation moduleInformation) {
Serial.println("----------------------------------------");
Serial.print(F("HEAD BIN: ")); Serial.print(moduleInformation.HEAD, BIN);Serial.print(" ");Serial.print(moduleInformation.HEAD, DEC);Serial.print(" ");Serial.println(moduleInformation.HEAD, HEX);
Serial.print(F("Freq.: ")); Serial.println(moduleInformation.frequency, HEX);
Serial.print(F("Version : ")); Serial.println(moduleInformation.version, HEX);
Serial.print(F("Features : ")); Serial.println(moduleInformation.features, HEX);
Serial.println("----------------------------------------");
}
Tuttavia mi da questo messaggio:
16:11:50.506 -> 3fffff80: 00000000 0027002f 00000000 00000000
16:11:50.539 -> 3fffff90: 0000000c 3fff001c 0000000c 00000000
16:11:50.606 -> 3fffffa0: feef0000 feefeffe feefeffe feefeffe
16:11:50.673 -> 3fffffb0: feefeffe 00000000 3ffee5b0 402037f0
16:11:50.707 -> 3fffffc0: feefeffe feefeffe 3fffdab0 4010139d
16:11:50.773 -> <<<stack<<<
16:11:50.773 ->
16:11:50.773 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
Ho controllato 200 volte il cablaggio ma nulla.....
Mi potresti aiutare a capire.
Grazie.
Ciao, m
EByte LoRa E32-433T33D problema di configurazione
Ciao Renzo,
sto' iniziando ad impratichirmi con wemos d1 mini e il LoRa e ho trovato il tuo sito interessantissimo e ti faccio i miei complimenti.
Ho per le mani il 433T33D e ho provato come prima cosa a leggere i parametri della scheda.
Ho effettuat le connessioni necessarie (ho dovuto utilizzare un alimentatorino per la scheda E32 (non ce la faceva il povero wemos) e ho provato a lancire il seguente sketch: