Forum Replies Created
-
AuthorPosts
-
9 July 2020 at 07:57 in reply to: EByte LoRa e32 not working on esp32: sends a random number, the other reads #5017
Hehehehehhe… Keep calmp….
The sketch I send you is fully working and tested (I do it with an esp32 devkit v1 and WeMos, I try It with an Arduino also and 2 e32 433, that you can see on photo).
Pay attention I comment the first 2 define anche change power to adapt to my devices.
We can go by step, send me your connection schema, I’m going to do the same connection, and tell me what kind of pull-up resistor you have used.
than if It’s ok I ask you to resend all the code.
Hold on, we’ll find the problem: P.
Bye Renzo
Attachments:
You must be logged in to view attached files.8 July 2020 at 23:39 in reply to: EByte LoRa e32 not working on esp32: sends a random number, the other reads #5003Hi Alejandro,
I check your code, and there are some issue, first is the type of communication setted to TRANSPARENT
But I have found an issue/problem in the library and I change It, two constructor of esp32 is ambiguous, so I change the disposition of the constructor that have specifies setting of HardwareSerial,
To undestand
LoRa_E32(HardwareSerial* serial, byte txE32pin, byte rxE32pin, byte auxPin, byte m0Pin, byte m1Pin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600, uint32_t serialConfig = SERIAL_8N1);
now is
LoRa_E32(byte txE32pin, byte rxE32pin, HardwareSerial* serial, byte auxPin, byte m0Pin, byte m1Pin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600, uint32_t serialConfig = SERIAL_8N1);
but in your case the code become more simpliest with the direct usage of Serial2
Here the sending code for esp32
#include "Arduino.h" //#define E32_TTL_1W //#define FREQUENCY_915 #include "LoRa_E32.h" // Not needed Serial2 have already this pins //#define RX 16 //#define TX 17 #define AUX 18 #define M0 21 #define M1 19 //HardwareSerial serial1(2); //LoRa_E32 e32ttl1w(&serial1,RX,TX, 18, UART_BPS_RATE_9600,SERIAL_8N1); LoRa_E32 e32ttl1w(&Serial2, AUX, M0, M1); void printParameters(struct Configuration configuration); void printModuleInformation(struct ModuleInformation moduleInformation); // Variables globales unsigned long interval = 15000; // interval between sends unsigned long lastSendTime = 0; // last send time byte msgCount = 0; // count of outgoing messages long randNumber; void setup() { //Inicio comunicacion serie con monitor Serial.begin(9600); delay(500); Serial.println(); e32ttl1w.begin(); //Configuro el nodo LoRa nodeConfig(); } void loop() { // Wait a few seconds between measurements. if (millis() - lastSendTime > interval) { // print a random number from 10 to 19 randNumber = random(10, 20); String trama = String(randNumber); ResponseStatus rs = e32ttl1w.sendFixedMessage(0, 3, 0x10,trama); Serial.println("Sending " + trama); Serial.println(rs.getResponseDescription()); lastSendTime = millis(); // timestamp the message msgCount++; } delay(100); } void nodeConfig(){ ResponseStructContainer c; c = e32ttl1w.getConfiguration(); Configuration configuration = *(Configuration*) c.data; configuration.ADDH = 0x0; configuration.ADDL = 0x1; configuration.CHAN = 0x10; configuration.SPED.airDataRate = AIR_DATA_RATE_010_24; configuration.SPED.uartBaudRate = UART_BPS_9600; configuration.SPED.uartParity = MODE_00_8N1; configuration.OPTION.fec = FEC_1_ON; configuration.OPTION.fixedTransmission = FT_FIXED_TRANSMISSION; configuration.OPTION.ioDriveMode = IO_D_MODE_PUSH_PULLS_PULL_UPS; configuration.OPTION.transmissionPower = POWER_20; configuration.OPTION.wirelessWakeupTime = WAKE_UP_1250; //printParameters(configuration); // Set configuration changed and set to not hold the configuration ResponseStatus rs = e32ttl1w.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE); Serial.print("Config: "); Serial.println(rs.getResponseDescription()); }
Here the receiving code for WeMos#include "Arduino.h" //#define E32_TTL_1W //#define FREQUENCY_915 #include "LoRa_e32.h" #define RX 4 #define TX 5 #define M0 7 #define M1 6 LoRa_E32 e32ttl1w(D3, D4, D5, D7, D6); void setup() { //Inicio comunicacion serie con monitor Serial.begin(9600); delay(500); // Startup all pins and UART e32ttl1w.begin(); //Configuro el nodo LoRa nodeConfig(); } void loop() { if (e32ttl1w.available() > 0) { Serial.println("----------"); ResponseContainer rc = e32ttl1w.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); } } delay(500); } void nodeConfig(){ ResponseStructContainer c; c = e32ttl1w.getConfiguration(); Configuration configuration = *(Configuration*) c.data; configuration.ADDH = 0x0; configuration.ADDL = 0x3; configuration.CHAN = 0x10; configuration.SPED.airDataRate = AIR_DATA_RATE_010_24; configuration.SPED.uartBaudRate = UART_BPS_9600; configuration.SPED.uartParity = MODE_00_8N1; configuration.OPTION.fec = FEC_1_ON; configuration.OPTION.fixedTransmission = FT_FIXED_TRANSMISSION; configuration.OPTION.ioDriveMode = IO_D_MODE_PUSH_PULLS_PULL_UPS; configuration.OPTION.transmissionPower = POWER_20; configuration.OPTION.wirelessWakeupTime = WAKE_UP_1250; //printParameters(configuration); // Set configuration changed and set to not hold the configuration ResponseStatus rs = e32ttl1w.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE); Serial.print("Config: "); Serial.println(rs.getResponseDescription()); }
Download also the new versione of LoRa e32 library that have some fix and additional function to manage multiple string receiving.
If you need more help ask without problems.
Bye and thanks Renzo
6 July 2020 at 22:19 in reply to: EByte e32 WeMos D1 shield update layout picture “No response from device! (Check wiring)” #4958Hi Alexander,
I’m happy that now e32 working correctly, but I don’t know dragino and I’m not able to help in that comparison.
If you need more help ask without problem.
Bye Renzo
5 July 2020 at 22:14 in reply to: EByte e32 WeMos D1 shield update layout picture “No response from device! (Check wiring)” #4942Thanks Alexander,
Do you have the shield for WeMos, you get the error with that??
With 868 version sometime there Is a problem with the pull up resistor, but with Arduino.
Of you use the shield you can refer to this article LoRa E32 device for Arduino, esp32 or esp8266: WOR (wake on radio) microcontroller and new WeMos D1 mini shield – Part 7 but the configuration is
LoRa_E32 e32ttl(D3, D4, D5, D7, D6);
And yes, I must update the schema ;).
If you give me more information we try to debug your problem.
Bye Renzo
3 July 2020 at 07:51 in reply to: Send a simple mail including the value of a declared variable in the message #4885Hi Mario,
I put a piece of my Inverter monitor where I send a set of value via mail when there is a problem
EMailSender::EMailMessage message;
const String sub = F("Inverter error!"); // Here the subject
message.subject = sub;
const String mp = F("Error on inverter centraline");
const String ft = (fixedTime)?F("OK"):F("NO");
const String sd = (sdStarted)?F("OK"):F("NO");
const String wc = (wifiConnected)?F("OK"):F("NO");
const String sf = (isFileSaveOK)?F("OK"):F("NO");
// Here the message in html format
message.message = mp+
F("<br>Time fixed: ")+ft+
F("<br>SD Initialized: ")+sd+
F("<br>Wifi Connecter :P: ")+wc+
F("<br>Saving file ok: ")+sf+
F("<br>Wrong saving attempts: ")+sdWrongReadNumber
;
EMailSender::Response resp = emailSend.send(emailToSend, message);
The result isError on inverter centraline
Time fixed: OK
SD Initialized: OK
Wifi Connecter :P: OK
Saving file ok: NO
Wrong saving attempts: 10
Bye Renzo
Attachments:
You must be logged in to view attached files.Hi LottyZak,
The sensor is a DHT12, and the value -127 isn’t present.
Can you put an example of your idea.
Thanks Renzo
19 June 2020 at 09:10 in reply to: In light sleep esp8266 wemos does not respond to the GPIO wake up #4669Hi Rossic, yes D0 Reset is for wake up for deep sleep, thanks to share your experience. Bye Renzo
19 June 2020 at 09:06 in reply to: In light sleep esp8266 wemos does not respond to the GPIO wake up #4666Hi Rossic, It’s strange, do you have set the pull-up resistor?
Hi Joergen,
I think the relevant error is
501 5.5.2 <mischianti:>: Helo command rejected: Invalid name
probably you aren’t attached to the Sunrise contract line, and you can use SMTP only with Sunrise line.
For example, if you have a Sunrise cellular line and you try to access SMTP via your home line the provider reject the request.
As test (if you don’t use a mail client) you can try to configure a client like Outlook to send email from the same line.
Tell me if is this the problem.
Bye Renzo
Hi cglkr97,
as you can see in the file at line 228 I add
e32ttl.setMode(MODE_1_WAKE_UP);
than I use simple Int value to set ADDH, ADDL and CHAN (I print the HEX value to check the channel).I don’t have problem to use decimal value instead HEX.
I try to send a string value without problem, If you use ArduinoJSON pay attention the string generated isn’t clean value check this http://mischianti.org/forums/topic/how-to-send-message-use-json-format/
But if you want use a String value remember that you have only 59Byte to send message and binary data like structure is good optimized.
Bye Renzo
Hi,
I do some change (set WAKE UP mode to sent do the receiver) and I set channel to 4 (but I test It with 17 also with send 23 that in HEX is 17) and works correctly the first handshake.
---------------------------------------- HEAD : 11000000 192 C0 AddH : 0 AddL : 2 Chan : 4 -> 414MHz SpeedParityBit : 0 -> 8N1 (Default) SpeedUARTDatte : 11 -> 9600bps (default) SpeedAirDataRate : 10 -> 2.4kbps (default) OptionTrans : 1 -> Fixed transmission (first three bytes can be used as high/low address and channel) OptionPullup : 1 -> TXD, RXD, AUX are push-pulls/pull-ups OptionWakeup : 0 -> 250ms (default) OptionFEC : 1 -> Turn on Forward Error Correction Switch (Default) OptionPower : 0 -> 20dBm (Default) ---------------------------------------- Press any key to start conversation with any node at any time. Start listening! ---------------------------------------- HEAD : 11000000 192 C0 AddH : 0 AddL : 1 Chan : 4 -> 414MHz SpeedParityBit : 0 -> 8N1 (Default) SpeedUARTDatte : 11 -> 9600bps (default) SpeedAirDataRate : 10 -> 2.4kbps (default) OptionTrans : 1 -> Fixed transmission (first three bytes can be used as high/low address and channel) OptionPullup : 1 -> TXD, RXD, AUX are push-pulls/pull-ups OptionWakeup : 0 -> 250ms (default) OptionFEC : 1 -> Turn on Forward Error Correction Switch (Default) OptionPower : 0 -> 20dBm (Default) ---------------------------------------- Press any key to start conversation with any node at any time. Start listening! >>Send to COM3: "0"<< ---------------------------------------- Now you are in interrupt mode. First, tell me the node adress you want to talk to Enter the ADDH in decimal >>Send to COM3: "0"<< ADDH: 0 Enter the ADDL in decimal >>Send to COM3: "1"<< ADDL: 1 Enter the CHAN in hex >>Send to COM3: "4"<< CHAN: 4 Your adress is: 0 1 4 Press 1 if you want to wake the node up and fetch the sensor data, press 2 to see the sleep schedule.. >>Send to COM3: "1"<< Sending message to wake the node up! Success ---------------------------------------- Data is coming thru.. Coming from -> 0 1 4 Temperature -> 18.91°C Humidity -> 67.89 Pressure -> 1234 Light intensity -> 433 Current battery state -> 0 Sending confirmation info to the sender.. Success
I used 2 arduino UNO (with my shield) but no overflow.
Bye Renzo
Attachments:
You must be logged in to view attached files.Hi cglkr97,
can you send the complete code PLZ.
Thanks Renzo5 June 2020 at 07:45 in reply to: Mega 2560 e32 EByte frozen in example sendReceiveTransparentTransmissionMessage #4433Thanks 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 Renzo5 June 2020 at 07:43 in reply to: Mega 2560 e32 EByte frozen in example sendReceiveTransparentTransmissionMessage #4430I check with my Arduino Mega, and my error is that I don’t use a correct RX pin as Arduino guide describe.
https://www.arduino.cc/en/Reference/softwareSerial
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.
I use this configuration
SoftwareSerial mySerial(11, 5); LoRa_E32 e32ttl100(&mySerial, 3, 7, 6);
Now work correctly.
Please update the libray, uncomment
#define LoRa_E32_DEBUG
And send me your log, I try to understand.
If you want to use HardwareSerial you must do like so
LoRa_E32 e32ttl100(&Serial2, 3, 7, 6);
Bye Renzo
5 June 2020 at 07:42 in reply to: Mega 2560 e32 EByte frozen in example sendReceiveTransparentTransmissionMessage #4429I’m doing some test with mega and there is a problem, I’m going to discover in the next week.
Bye Renzo -
AuthorPosts