Home › Forum › Le librerie ospitate nel sito › EBYTE E32 dispositivi LoRa UART sx1278/sx1276. › Problema con la seriale su esp8266
-
AutorePost
-
-
2 Aprile 2022 alle 08:09 #19973
Ciao Renzo,
prima di tutto ti volevo ringraziare per l’ottimo lavoro che hai fatto con queste librerie.
Ho collegato un E32 ad un arduino pro mini praticamente senza problemi grazie a te.
Sto riscontrando delle difficoltà invece cercando di collegare l’E32 ad un esp8266 (un nodeMCU che ho qui in casa).
per quanto riguarda il cablaggio mi sembra tutto apposto come da tua guida, ti posto una foto:
cablaggio
sto provando ad usare l’esempio della GetConfiguration ma credo di sbagliare qualcosa con le porte seriali.
quando provo a caricare lo sketch tramite arduino ide mi va in timeout cercando di collegarsi alla seriale.
Se scollego i pin 7 e 8 riesce caricare lo sketch.
Da quel (poco) che so la scheda ha sui pin 7 e 8 rx2 e tx2.
Dove sto sbagliando?
ti allego anche il codice.#include "Arduino.h" #include "LoRa_E32.h" //HardwareSerial Serial2(2); //LoRa_E32 e32ttl100(&Serial2); LoRa_E32 e32ttl100(D8,D7); // Arduino RX <-- e32 TX, Arduino TX --> e32 RX void printParameters(struct Configuration configuration); void printModuleInformation(struct ModuleInformation moduleInformation); void setup() { Serial.begin(9600); delay(500); // 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); c.close(); cMi.close(); } 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("----------------------------------------"); Grazie mille per l'aiuto
Attachments:
You must be logged in to view attached files. -
2 Aprile 2022 alle 09:41 #19974
credo che il problema dipenda da questo:
Pin D8 is esp8266 pin 15. This pin is one of the boot configuration pins and for use on a dev board, it must be pulled down at boot. So the NodeMcu has a pull down circuit on this pin and internal pullup is weaker then this external pulldown.Ho provato anche con una SoftwareSerial su D0,D1 (rx,tx)
#include <SoftwareSerial.h> SoftwareSerial mySerial(D0, D1); // RX, TX arduino //HardwareSerial Serial2(2); LoRa_E32 e32ttl100(&mySerial);
ma restituisce questo error:
Data size not match! 09:39:11.760 -> 7 09:39:11.760 -> —————————————- 09:39:11.809 -> HEAD BIN: 11100 28 1C 09:39:11.854 -> 09:39:11.854 -> AddH BIN: 10 09:39:11.854 -> AddL BIN: 11100000 09:39:11.854 -> Chan BIN: 12 -> 422MHz 09:39:11.901 -> 09:39:11.901 -> SpeedParityBit BIN : 0 -> 8N1 (Default) 09:39:11.947 -> SpeedUARTDataRate BIN : 0 -> 1200bps 09:39:11.994 -> SpeedAirDataRate BIN : 1 -> 1.2kbps 09:39:12.040 -> OptionTrans BIN : 1 -> Fixed transmission (first three bytes can be used as high/low address and channel) 09:39:12.134 -> OptionPullup BIN : 1 -> TXD, RXD, AUX are push-pulls/pull-ups 09:39:12.227 -> OptionWakeup BIN : 111 -> 2000ms 09:39:12.274 -> OptionFEC BIN : 0 -> Turn off Forward Error Correction Switch 09:39:12.321 -> OptionPower BIN : 11 -> 10dBm 09:39:12.368 -> —————————————- 09:39:12.740 -> 09:39:12.740 -> Exception (28): 09:39:12.740 -> epc1=0x40201865 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000001 depc=0x00000000 09:39:12.836 -> 09:39:12.836 -> >>>stack>>> 09:39:12.836 -> 09:39:12.836 -> ctx: cont 09:39:12.882 -> sp: 3ffffdc0 end: 3fffffc0 offset: 01a0 09:39:12.882 -> 3fffff60: 3ffefa00 0014001f 80efeffe 00000000 09:39:12.976 -> 3fffff70: 00000007 3ffef71c 00000007 01e0021c 09:39:13.022 -> 3fffff80: feeffb0c feefeffe feefeffe feefeffe 09:39:13.068 -> 3fffff90: feefeffe feefeffe feefeffe 3ffee4dc 09:39:13.115 -> 3fffffa0: 3fffdad0 00000000 3ffee49c 40203704 09:39:13.162 -> 3fffffb0: feefeffe feefeffe 3ffe84e4 40101289 09:39:13.209 -> <<<stack<<<
-
2 Aprile 2022 alle 10:45 #19976
Ciao Taribo,
mi dovresti dare anche il modello esatto del modulo LoRa, e prova a rimuovere le resistenze.Prova a seguire il cablaggio del WeMos D1 mini che c’è sull’articolo (i pin sono gli stessi):
Ed oltre all’RX e TX collega anche l’AUX.Ebyte LoRa E32 per Arduino, esp32 o esp8266: configurazione – Parte 3
Comunque così a prima vista mi pare che hai messo M0 e M1 ad 3v invece che a GND.
Ciao Renzo
-
2 Aprile 2022 alle 11:10 #19986
ho provato sia con un E32-900T30D che un E32-900T20D (testati con arduino funzionano).
Effettivamente M0 e M1 erano sul 3v3 ora li ho messi su GND, ho provato con e senza resistenze.
adesso ho messo L’E32-900T30D levato le resistenze e:
se cablo D7 e D8 non si carica lo skatch mentre con la SoftwareSerial su D0,D1 mi da:
11:02:12.286 -> 7
11:02:12.286 -> —————————————-
11:02:12.333 -> HEAD BIN: 11100 28 1C
11:02:12.333 ->
11:02:12.333 -> AddH BIN: 10
11:02:12.380 -> AddL BIN: 11100000
11:02:12.380 -> Chan BIN: 12 -> 422MHz
11:02:12.426 ->
11:02:12.426 -> SpeedParityBit BIN : 0 -> 8N1 (Default)
11:02:12.472 -> SpeedUARTDataRate BIN : 0 -> 1200bps
11:02:12.472 -> SpeedAirDataRate BIN : 1 -> 1.2kbps
11:02:12.519 -> OptionTrans BIN : 1 -> Fixed transmission (first three bytes can be used as high/low address and channel)
11:02:12.659 -> OptionPullup BIN : 1 -> TXD, RXD, AUX are push-pulls/pull-ups
11:02:12.707 -> OptionWakeup BIN : 111 -> 2000ms
11:02:12.753 -> OptionFEC BIN : 0 -> Turn off Forward Error Correction Switch
11:02:12.847 -> OptionPower BIN : 11 -> 10dBm
11:02:12.894 -> —————————————-
11:02:13.220 ->
11:02:13.220 -> Exception (28):
11:02:13.267 -> epc1=0x40201865 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000001 depc=0x00000000
11:02:13.360 ->
11:02:13.360 -> >>>stack>>>
11:02:13.360 ->
11:02:13.360 -> ctx: cont
11:02:13.360 -> sp: 3ffffdc0 end: 3fffffc0 offset: 01a0
11:02:13.407 -> 3fffff60: 3ffefa00 0014001f 80efeffe 00000000
11:02:13.453 -> 3fffff70: 00000007 3ffef71c 00000007 01e0021c
11:02:13.500 -> 3fffff80: feeffb0c feefeffe feefeffe feefeffe
11:02:13.547 -> 3fffff90: feefeffe feefeffe feefeffe 3ffee4dc
11:02:13.594 -> 3fffffa0: 3fffdad0 00000000 3ffee49c 40203704
11:02:13.686 -> 3fffffb0: feefeffe feefeffe 3ffe84e4 40101289
11:02:13.734 -> <<<stack<<< -
2 Aprile 2022 alle 11:20 #19994
-
2 Aprile 2022 alle 16:12 #20002
provato lo schema del wemos
sia alimentato co in il vin ma niente.
come si abilita il debug? -
2 Aprile 2022 alle 19:04 #20004
You must uncomment the LoRa_E32_DEBUG define.
But connect the AUX pin also, or better do a complete connection, so we trust about the HIGH and LOW of M0 and M1.
Bye Renzo
-
2 Aprile 2022 alle 22:37 #19995
provato lo schema del wemos
sia alimentato co in il vin
cablaggioche alimentato esternamente
cablaggio
alimentatoreniente:
Data size not match! 7 —————————————- HEAD BIN: 11101111 239 EF AddH BIN: 1 AddL BIN: 0 Chan BIN: 111 -> 521MHz SpeedParityBit BIN : 0 -> 8N1 (Default) SpeedUARTDataRate BIN : 0 -> 1200bps SpeedAirDataRate BIN : 0 -> 0.3kbps OptionTrans BIN : 0 -> Transparent transmission (default) OptionPullup BIN : 0 -> TXD, RXD, AUX are open-collectors OptionWakeup BIN : 0 -> 250ms (default) OptionFEC BIN : 0 -> Turn off Forward Error Correction Switch OptionPower BIN : 1 -> 17dBm —————————————- Exception (28): epc1=0x40201865 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000001 depc=0x00000000 >>>stack>>> ctx: cont sp: 3ffffdc0 end: 3fffffc0 offset: 01a0 3fffff60: 3ffefa00 0014001f 80efeffe 00000000 3fffff70: 00000007 3ffef6b4 00000007 000001ef 3fffff80: feef016f feefeffe feefeffe feefeffe 3fffff90: feefeffe feefeffe feefeffe 3ffee474 3fffffa0: 3fffdad0 00000000 3ffee434 4020371c 3fffffb0: feefeffe feefeffe 3ffe84e4 40101289 <<<stack<<<
perdona l’ignoranza ma per la modalità debug cosa devo fare oltre che collegare l’AUX? c’è qualche script da usare?
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.