Home › Forums › The libraries hosted on the site › EByte LoRa e220 UART devices LLCC68 › E220-900T22D getConfiguration
- This topic has 4 replies, 2 voices, and was last updated 2 years, 9 months ago by
Renzo Mischianti.
-
AuthorPosts
-
-
16 August 2022 at 11:14 #22287
Hi,
I have started experimenting with LORA modules which I have purchased on Aliexpress.
I’m using FireBeetle 2 ESP32-E IoT as microcontroller and it is impossible to obtain configuration. from both purchased modules.
So far I have tried:
1) Different ESP32s
2) Powering module out of 5V (4.5V actually)
3) removed pull-up resistors
4) with/without AUXWiring (module – ESP)
M0 – Ground
M1 – Ground
RX – pin 17 TX + behind 4.7k ohm resistor connected to 3.3V
TX – pin 16 RX + behind 4.7k ohm resistor connected to 3.3V
AUX – pin 25 + behind 4.7k ohm resistor connected to 3.3V
VCC – 5V
Ground – GroundOn board pins I can measure specified voltages.
My code:
/* * LoRa E220 LLCC68 * Get configuration. * http://mischianti.org * * E220 ----- Arduino MKR * M0 ----- 2 (or GND) * M1 ----- 3 (or GND) * RX ----- 14 (PullUP) * TX ----- 13 (PullUP) * AUX ----- 1 (PullUP) * VCC ----- 3.3v/5v * GND ----- GND * */ #include "Arduino.h" #include "EByte_LoRa_E220_library.h" // ---------- esp32 pins -------------- LoRa_E220 e220ttl(&Serial2, 25, UART_BPS_RATE_9600); // RX AUX M0 M1 void printParameters(struct Configuration configuration); void printModuleInformation(struct ModuleInformation moduleInformation); void setup() { Serial.begin(115200); while(!Serial){}; delay(2500); Serial.println(); // Startup all pins and UART e220ttl.begin(); ResponseStructContainer c; c = e220ttl.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 = e220ttl.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(); } void loop() { } void printParameters(struct Configuration configuration) { Serial.println("----------------------------------------"); Serial.print(F("HEAD : ")); Serial.print(configuration.COMMAND, HEX);Serial.print(" ");Serial.print(configuration.STARTING_ADDRESS, HEX);Serial.print(" ");Serial.println(configuration.LENGHT, HEX); Serial.println(F(" ")); Serial.print(F("AddH : ")); Serial.println(configuration.ADDH, HEX); Serial.print(F("AddL : ")); Serial.println(configuration.ADDL, HEX); Serial.println(F(" ")); Serial.print(F("Chan : ")); Serial.print(configuration.CHAN, DEC); Serial.print(" -> "); Serial.println(configuration.getChannelDescription()); Serial.println(F(" ")); Serial.print(F("SpeedParityBit : ")); Serial.print(configuration.SPED.uartParity, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTParityDescription()); Serial.print(F("SpeedUARTDatte : ")); Serial.print(configuration.SPED.uartBaudRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTBaudRateDescription()); Serial.print(F("SpeedAirDataRate : ")); Serial.print(configuration.SPED.airDataRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getAirDataRateDescription()); Serial.println(F(" ")); Serial.print(F("OptionSubPacketSett: ")); Serial.print(configuration.OPTION.subPacketSetting, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getSubPacketSetting()); Serial.print(F("OptionTranPower : ")); Serial.print(configuration.OPTION.transmissionPower, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getTransmissionPowerDescription()); Serial.print(F("OptionRSSIAmbientNo: ")); Serial.print(configuration.OPTION.RSSIAmbientNoise, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getRSSIAmbientNoiseEnable()); Serial.println(F(" ")); Serial.print(F("TransModeWORPeriod : ")); Serial.print(configuration.TRANSMISSION_MODE.WORPeriod, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getWORPeriodByParamsDescription()); Serial.print(F("TransModeEnableLBT : ")); Serial.print(configuration.TRANSMISSION_MODE.enableLBT, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getLBTEnableByteDescription()); Serial.print(F("TransModeEnableRSSI: ")); Serial.print(configuration.TRANSMISSION_MODE.enableRSSI, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getRSSIEnableByteDescription()); Serial.print(F("TransModeFixedTrans: ")); Serial.print(configuration.TRANSMISSION_MODE.fixedTransmission, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getFixedTransmissionDescription()); Serial.println("----------------------------------------"); } void printModuleInformation(struct ModuleInformation moduleInformation) { Serial.println("----------------------------------------"); Serial.print(F("HEAD: ")); Serial.print(moduleInformation.COMMAND, HEX);Serial.print(" ");Serial.print(moduleInformation.STARTING_ADDRESS, HEX);Serial.print(" ");Serial.println(moduleInformation.LENGHT, DEC); Serial.print(F("Model no.: ")); Serial.println(moduleInformation.model, HEX); Serial.print(F("Version : ")); Serial.println(moduleInformation.version, HEX); Serial.print(F("Features : ")); Serial.println(moduleInformation.features, HEX); Serial.println("----------------------------------------"); }
Output:
No response from device! (Check wiring) 12 ---------------------------------------- HEAD : 12 D0 FC AddH : 8D AddL : EF Chan : 219 -> 629MHz SpeedParityBit : 10 -> 8E1 SpeedUARTDatte : 11 -> 9600bps (default) SpeedAirDataRate : 1 -> 2.4kbps OptionSubPacketSett: 0 -> 200bytes (default) OptionTranPower : 10 -> 13dBm OptionRSSIAmbientNo: 1 -> Enabled TransModeWORPeriod : 111 -> 4000ms TransModeEnableLBT : 0 -> Disabled (default) TransModeEnableRSSI: 0 -> Disabled (default) TransModeFixedTrans: 0 -> Transparent transmission (default) ---------------------------------------- No response from device! (Check wiring) 12 ---------------------------------------- HEAD: 54 72 97 Model no.: 6E Version : 73 Features : 70 ----------------------------------------
Attachments:
You must be logged in to view attached files. -
16 August 2022 at 11:20 #22300
Hi Matejt,
I check your code, and there is an error, M0 and M1 must be HIGH, not LOW.If you get this example from the site, please, tell me where because I must fix It.
Bye Renzo
-
16 August 2022 at 11:20 #22301
Hi Matejt,
I check your code, and there is an error, M0 and M1 must be HIGH, not LOW.If you get this example from the site, please, tell me where because I must fix It.
Bye Renzo
-
18 August 2022 at 18:29 #22346
Hi Renzo,
thank you for your quick answer!
I think it was incorrect copy paste, but I think description here is incorrect. Particularly chapter Fixed transmission “So first, we must set M0 to LOW and M1 pin to HIGH to enter on program/sleep mode and set the correct address and fixed transmission flag.” Based on documentation it should be M0 + M1 on HIGH.
As you suggested I have updated wiring for module programming. Everything was working, but afterwards I have started playing with RSSI. From response container I was just able to print out RSSI value, but not anymore rc.data (always blank).
Due to that I have started playing with modules and it seems I have somehow f*cked it up.
So I have started from scratch (transparent transmission config upload, transparent transmission example, M0 + M1 on LOW, AUX connected).Code example
#include "Arduino.h" #include "EByte_LoRa_E220_library.h" #define FREQUENCY_868 <- with our without // ---------- esp32 pins -------------- LoRa_E220 e220ttl(&Serial2, 25, UART_BPS_RATE_9600); // RX AUX M0 M1 void setup() { Serial.begin(9600); delay(5000); Serial.println("Hi, I'm going to send message!"); // Startup all pins and UART e220ttl.begin(); // Send message ResponseStatus rs = e220ttl.sendMessage("Hello, world?"); // Check If there is some problem of successfully send Serial.println(rs.getResponseDescription()); } void loop() { // If something available if (e220ttl.available()>1) { // read the String message ResponseContainer rc = e220ttl.receiveMessage(); // Is something goes wrong print error if (rc.status.code!=1){ rc.status.getResponseDescription(); }else{ // Print the data received Serial.println(rc.data); } } if (Serial.available()) { String input = Serial.readString(); ResponseStatus rs = e220ttl.sendMessage(input); Serial.println("Response :" + rs.getResponseDescription()); } }
It is running on identical ESPs with identical wiring.
I’m just curious regarding one thing. As M0 + M1 is on LOW, I assume I can not get correct configuration, right?I’m asking due to
HEAD : 2 E5 DA AddH : EB AddL : D2 Chan : 0 -> 862MHz
Thank you in advance!
-
19 August 2022 at 08:05 #22353
Hi Matejet,
yes, It’s correct; if you don’t connect all the pins (M0 and M1 in particular), you can’t switch to a different mode.
So, you can do a single operation with a single configuration of M0 and M1.
Bye Renzo
-
-
AuthorPosts
- You must be logged in to reply to this topic.