I have tried the example of transparent transmission between two modules. One has this example program that I attached and is configured and wired as shown in the readme of the library and the other is simply connected in transparent mode to the USB port of my PC.
The two E32 modules are connected to arduino mega 2560.
In the code example that I have passed you, the arduino is frozen in the code line:
Serial.println (rs.getResponseDescription ());
If I comment on this line, the program continues and freezes again on this line.
ResponseContainer rc = e32ttl100.receiveMessage ();
I don’t know if you can give me a hand, because I’m sure I have something wrong but I don’t know where to take it.
Regards, and thank you very much.
#include "Arduino.h"
#include "LoRa_E32.h"
SoftwareSerial mySerial(11, 10);
LoRa_E32 e32ttl100(&mySerial,5, 7, 6);
void setup() {
Serial.begin(9600);
delay(500);
// Startup all pins and UART
e32ttl100.begin();
Serial.println("Hi, I'm going to send message!");
// Send message
ResponseStatus rs = e32ttl100.sendMessage("Hello, world?"); // OK The message is received on the other device
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
void loop() {
// If something available
Serial.println("continuity test point"); //This instruction is not executed unless you comment on the previous line "Serial.println(rs.getResponseDescription());"
if (e32ttl100.available()>1) {
ResponseContainer rc = e32ttl100.receiveMessage();
Serial.println(rc.data);
// 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();
e32ttl100.sendMessage(input);
}
}
Hi, I can’t check the sketch now, but please refer to my site, i update all the schema.
In the next few days I check all with my Arduino mega.
Thanks to write, and please wait.
Bye Renzo
Hi fransolomon,
I tested your sketch with 2 Arduino UNO, and It’s work correctly, I only add the correct configuration, please try It.
#include "Arduino.h"
#include "LoRa_E32.h"
// SoftwareSerial mySerial(11, 10);
// LoRa_E32 e32ttl100(&mySerial,5, 7, 6);
SoftwareSerial mySerial(4, 5);
LoRa_E32 e32ttl100(&mySerial, 3, 7, 6);
//LoRa_E32 e32ttl100(4, 5, 3, 7, 6);
void printParameters(struct Configuration configuration) ;
void setup() {
Serial.begin(9600);
delay(500);
// Startup all pins and UART
e32ttl100.begin();
ResponseStructContainer c;
c = e32ttl100.getConfiguration();
Configuration configuration = *(Configuration*) c.data;
configuration.ADDL = 3;
configuration.ADDH = 0;
configuration.CHAN = 0x04;
configuration.OPTION.fixedTransmission = FT_TRANSPARENT_TRANSMISSION;
configuration.OPTION.wirelessWakeupTime = WAKE_UP_250;
configuration.OPTION.fec = FEC_1_ON;
configuration.OPTION.ioDriveMode = IO_D_MODE_PUSH_PULLS_PULL_UPS;
configuration.OPTION.transmissionPower = POWER_20;
configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
configuration.SPED.uartBaudRate = UART_BPS_9600;
configuration.SPED.uartParity = MODE_00_8N1;
e32ttl100.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
printParameters(configuration);
Serial.println("Hi, I'm going to send message!");
// Send message
ResponseStatus rs = e32ttl100.sendMessage("Hello, world?"); // OK The message is received on the other device
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
void loop() {
// If something available
// Serial.println("continuity test point"); //This instruction is not executed unless you comment on the previous line "Serial.println(rs.getResponseDescription());"
if (e32ttl100.available() > 1) {
ResponseContainer rc = e32ttl100.receiveMessage();
Serial.println(rc.data);
// 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();
e32ttl100.sendMessage(input);
}
}
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, DEC);
Serial.print(F("AddL : ")); Serial.println(configuration.ADDL, DEC);
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("----------------------------------------");
}
And please recheck your connection schema with the schema on the article not on Github library, and check that you have the last version of the library, I fix sometings 2 days ago.
In the program it freezes in this line: ResponseStatus rs = e32ttl100.sendMessage (" Hello, world? "); // OK The message is received on the other device
If I comment the line the program continues and does not freeze at this point. But I still have some problems.
b) I have reviewed all the placement of the components and even the M0 and M1 pins I have put them directly to ground. This does not seem to have changed much.
c) I have also isolated the module power supplies, feeding this apart to a good 5 volt power supply and joining all the masses.
d) I changed the pins before using (& mySerial, 5, 7, 6); and now I use (& mySerial, 12, 14, 13). You know if the M0, M1 and AUX pins used by your library require something special. Have interruptions for example.
I begin to think that the problem comes through the mega arduino itself, in a couple of weeks I will have a pair of arduino UNO and try to test your library with them.
Another detail that has caught my attention. I have always had to use your library to work well, serial ports by SOFTWARE. The arduino Mega has 4 serial ports per hardware and when I configure them directly I cannot send messages. Maybe I’m doing it wrong ?:
a.1) Once the line mentioned by the program has been commented, send the message “Hello, world?” and is received by the other LORA module (module B). Then from module B I start sending another message “for example 12345”. Then module A receives the message but when I change the message to a shorter one, the program freezes.
Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).
Now I can send without problem and receive without problem on my Mega without any freeze.
Sorry, I owe you an apology. A few days ago you asked me: “and check that you have the last version of the library, I fix sometings 2 days ago.” This morning have become aware that i didn’t have the updated library. I had two ZIP files with your git repository and I confused the versions. The old library was installed all the time and not the new one. This morning I noticed and updated the library. And it’s going great, I’ve compiled all my arduino sketch and your examples and I’m really sorry for the mistake I made. Everything is correct, if later I can help you with tests I will be happy to help you.
Thanks for your feedback, I’m happy that you have resolved your issue, in the next time I publish my shield, but I already worked on Arduino Mega one and surely I need to test It. If you like I need help on my site too.
Keep in touch Renzo
Maintaining a repository (or site or forum) is a lot like tending to a garden - it requires constant care and attention to keep it thriving. If you're a skilled gardener (or coder!) and want to help keep our repository blooming, we'd love to have you on board! We're also looking for talented writers and forum moderators to help us grow our community. Interested in joining our team? Don't hesitate to reach out and let us know how you can contribute!
Are you a fan of electronics or programming? Share your knowledge with others, write a simple tutorial or how to make a great project Contact me: share_your_ideas@mischianti.org
The content displayed on this website is protected under a CC BY-NC-ND license. Visitors are prohibited from using, redistributing, or altering any content from this website for commercial purposes, including generating revenue through advertising. Any unauthorized use is a violation of the license terms and legal action may be taken against individuals or entities found to be in violation.
You must also provide the link to the source.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.