Home › Forums › The libraries hosted on the site › EByte LoRa e32 UART devices sx1262/sx1268 › Configuration for transparent transmission
- This topic has 7 replies, 2 voices, and was last updated 3 years, 11 months ago by
Renzo Mischianti.
-
AuthorPosts
-
-
25 May 2021 at 12:06 #12357
Hello there (I’m new on the forum), I’m having a bad time with the Lora Module right there…
I desperately tries to configure them but nothing works.Here is the configuration code :
/* * LoRa E32-TTL-100 * Set configuration. * http://mischianti.org/lora-e32-device-for-arduino-esp32-or-esp8266-configuration-part-3/ * * E32-TTL-100----- Arduino UNO * M0 ----- 3.3v * M1 ----- 3.3v * TX ----- PIN 2 (PullUP) * RX ----- PIN 3 (PullUP & Voltage divider) * AUX ----- Not connected * VCC ----- 3.3v/5v * GND ----- GND * */ #include "Arduino.h" #include "LoRa_E32.h" LoRa_E32 e32ttl100(2, 3); // e32 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); configuration.ADDL = 0x0; configuration.ADDH = 0x0; configuration.CHAN = 0x17; configuration.OPTION.fec = FEC_0_OFF; configuration.OPTION.fixedTransmission = FT_TRANSPARENT_TRANSMISSION; configuration.OPTION.ioDriveMode = IO_D_MODE_PUSH_PULLS_PULL_UPS; configuration.OPTION.transmissionPower = POWER_17; configuration.OPTION.wirelessWakeupTime = WAKE_UP_1250; configuration.SPED.airDataRate = AIR_DATA_RATE_011_48; configuration.SPED.uartBaudRate = UART_BPS_115200; configuration.SPED.uartParity = MODE_00_8N1; // Set configuration changed and set to not hold the configuration ResponseStatus rs = e32ttl100.setConfiguration(configuration, WRITE_CFG_PWR_DWN_LOSE); Serial.println(rs.getResponseDescription()); Serial.println(rs.code); printParameters(configuration); c.close(); } void loop() { } void printParameters(struct Configuration configuration) { Serial.println("----------------------------------------"); Serial.print(F("HEAD : ")); 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 : ")); Serial.println(configuration.ADDH, BIN); Serial.print(F("AddL : ")); Serial.println(configuration.ADDL, BIN); 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.getUARTBaudRate()); Serial.print(F("SpeedAirDataRate : ")); Serial.print(configuration.SPED.airDataRate, BIN); Serial.print(" -> "); Serial.println(configuration.SPED.getAirDataRate()); Serial.print(F("OptionTrans : ")); Serial.print(configuration.OPTION.fixedTransmission, BIN); Serial.print(" -> "); Serial.println(configuration.OPTION.getFixedTransmissionDescription()); Serial.print(F("OptionPullup : ")); Serial.print(configuration.OPTION.ioDriveMode, BIN); Serial.print(" -> "); Serial.println(configuration.OPTION.getIODroveModeDescription()); Serial.print(F("OptionWakeup : ")); Serial.print(configuration.OPTION.wirelessWakeupTime, BIN); Serial.print(" -> "); Serial.println(configuration.OPTION.getWirelessWakeUPTimeDescription()); Serial.print(F("OptionFEC : ")); Serial.print(configuration.OPTION.fec, BIN); Serial.print(" -> "); Serial.println(configuration.OPTION.getFECDescription()); Serial.print(F("OptionPower : ")); Serial.print(configuration.OPTION.transmissionPower, BIN); Serial.print(" -> "); Serial.println(configuration.OPTION.getTransmissionPowerDescription()); Serial.println("----------------------------------------"); }
Here is the sender code :
#include "Arduino.h" #include "LoRa_E32.h" #define LoRa_E32_DEBUG LoRa_E32 e32ttl(2, 3); void setup() { // put your setup code here, to run once: Serial.begin(19200); e32ttl.begin(); } void loop() { // put your main code here, to run repeatedly: char frame[59] = "test\n"; ResponseStatus rs = e32ttl.sendMessage(frame); Serial.println(frame); Serial.println(rs.getResponseDescription()); }
Here is the receiver code:
#include "Arduino.h" #include "LoRa_E32.h" #define LoRa_E32_DEBUG LoRa_E32 e32ttl(2, 3); void setup() { // put your setup code here, to run once: e32ttl.begin(); Serial.begin(19200); } void loop() { // put your main code here, to run repeatedly: Serial.println(millis()); ResponseContainer rs = e32ttl.receiveMessageUntil('\n'); Serial.println(rs.data); Serial.println(rs.status.getResponseDescription()); }
If the sender is active the receiver stop without displaying the message:<
If the sender is inactive it continues without stopping:
I don’t understand…
-
This topic was modified 1 year, 9 months ago by
Renzo Mischianti.
-
This topic was modified 1 year, 9 months ago by
-
25 May 2021 at 12:10 #12361
Hi Flowmikos,
Try to put a value on ADDL or ADDH, then you must set a delay, the device can’t send message at 8Mhz (8000 msg per secs).
Retry and tell me the result.
Bye Renzo-
27 May 2021 at 16:01 #12426
Flowmikos
Hi Renzo,
I put a delay(60); and I set the ADDL value to 0x01 with the sender and the receiver !
Here is the sender code :
#include "Arduino.h"
#include "LoRa_E32.h"
#define LoRa_E32_DEBUG
LoRa_E32 e32ttl(2, 3);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
e32ttl.begin();
}
void loop() {
// put your main code here, to run repeatedly:
delay(60);
char frame[59]="test\n";
ResponseStatus rs = e32ttl.sendMessage(frame);
Serial.println(frame);
Serial.println(rs.getResponseDescription());
}
The reveicer code :
#include "Arduino.h"
#include "LoRa_E32.h"
#define LoRa_E32_DEBUG
LoRa_E32 e32ttl(2, 3);
void setup() {
// put your setup code here, to run once:
e32ttl.begin();
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(millis());
ResponseContainer rs = e32ttl.receiveMessageUntil('\n');
Serial.println(rs.data);
Serial.println(rs.status.getResponseDescription());
}
The same result is shown, if the sender si activated the receiver will just stop…
-
-
27 May 2021 at 17:02 #12427
Hi Flowmikos,
I don’t know if the problem was only that but 60millis can be managed by this devices, try a test with 3000 millis or more.
If you don’t receive response, try to enable DEBUG and send the result.Bye Renzo
-
27 May 2021 at 23:39 #12428
Flowmikos
I tested it down to 45 ms without problem (before this configuration problem),
I found that the problem is that the Lora Module lose the configuration when the module is powered down, do you know how to configure it so that it keep it’s configuration ?
ResponseStatus rs = e32ttl100.setConfiguration(configuration, WRITE_CFG_PWR_DWN_LOSE);
Something to change here ?
-
28 May 2021 at 07:56 #12431
Damn, It’s surely that, I had not noticed the parameter.
ResponseStatus rs = e32ttl.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
For the speed, you had try to bid distance at 45ms if some package comes after others.
But you
-
28 May 2021 at 08:11 #12432
Flowmikos
But I ? bit distance ?
Also I have to switch to the “ioDriveMode” : “IO_D_MODE_OPEN_COLLECTOR”.
I followed your diagrams It is normal ? (the driagram confuse me because the PIN 3 and 2 is inverted for the arduino but I followed this configuration :
* E32-TTL-100—– Arduino UNO
* M0 —– 3.3v
* M1 —– 3.3v
* TX —– PIN 2 (PullUP)
* RX —– PIN 3 (PullUP & Voltage divider)
* AUX —– Not connected
* VCC —– 3.3v/5v
* GND —– GND).
Thanks for the replies. -
30 May 2021 at 23:10 #12452
Hi Flowmikos,
thanks for reporting, I will immediately fix the scheme, could you tell me the exact article.
Thanks again Renzo
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.