LoRa_E32.h with ESP32

Viewing 9 reply threads
  • Author
    Posts
    • #12147
      Liam

        Hi Renzo,

        Firstly thank you for all your work putting this library together.

        I have just ordered two E32 modules, however I am unable to compile the example sketches for the ESP32 Dev V1, I get the error ‘SoftwareSerial.h no such file or directory’, however I am able to compile for Arduino boards.

        I would appreciate any assistance or advice.

      • #12148
        Renzo Mischianti
        Keymaster

          Hi Liam,
          esp32 not use SoftwareSerial, but redefine the pin for the hardware serial, check the constructor on this article

          Ebyte LoRa E32 device for Arduino, esp32 or esp8266: WOR (wake on radio) and new ESP32 shield – 8

          
          LoRa_E32 e32ttl(&Serial2, 15, 21, 19); //  RX AUX M0 M1
           
          //LoRa_E32 e32ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); //  esp32 RX <-- e22 TX, esp32 TX --> e22 RX AUX M0 M1
          // -------------------------------------
          

          You can get more information to configure the parameter here

          Ebyte LoRa E32 device for Arduino, esp32 or esp8266: library – Part 2

          If you have other difficult write here.

          Bye Renzo

        • #12150
          Liam

            Thanks for the help!

          • #12764
            liam

              Hi Renzo.

              I have been experimenting with your library, I have a question about ‘Get configuration’.

              I am using an E32-868T30D with ESP32 Devkit, constructor

              LoRa_E32 e32ttl100(&Serial2, 15, 21, 19); // RX AUX M0 M

              In the documentation you say “To get the correct information I add some #define to change the device type (same #define manage more other device, I create only one for type for simplicity).”

              So for my modules it would be #define E32_TTL_1W and #define FREQUENCY_868.

              Where do I define the device and frequency? I have tried at the beginning of the Get Configuration code but I still get the output for 433MHz module. I’m sure I am making a mistake.

              Thanks in advance
              Liam

            • #12765
              Renzo Mischianti
              Keymaster

                Hi,
                You must define It before the include of library.
                Or inside h file.
                Bye Renzo

              • #13041
                Asmi Romli

                  Hello. I tried to compile the example given under LoRa_E32 buat all of them failed almost at the same point, during initiating:

                  LoRa_E32 e32ttl100(2, 3); // e32 TX e32 RX

                  The error message like this:

                  Arduino: 1.8.13 (Windows 7), Board: “AI Thinker ESP32-CAM, 240MHz (WiFi/BT), QIO, 80MHz”

                  sendReceiveTransparentTransmissionMessage:30:24: error: invalid conversion from ‘int’ to ‘HardwareSerial*’ [-fpermissive]
                  LoRa_E32 e32ttl100(2, 3); // Config without connect AUX and M0 M1
                  ^
                  In file included from D:\Users\user\Documents\Arduino\libraries\LoRa_E32\examples\sendReceiveTransparentTransmissionMessage\sendReceiveTransparentTransmissionMessage.ino:17:0:
                  D:\Users\user\Documents\Arduino\libraries\LoRa_E32/LoRa_E32.h:192:3: note: initializing argument 1 of ‘LoRa_E32::LoRa_E32(HardwareSerial*, byte, UART_BPS_RATE)’
                  LoRa_E32(HardwareSerial* serial, byte auxPin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);
                  ^
                  exit status 1
                  invalid conversion from ‘int’ to ‘HardwareSerial*’ [-fpermissive]

                  This report would have more information with
                  “Show verbose output during compilation”
                  option enabled in File -> Preferences.

                  • #13042
                    Renzo Mischianti
                    Keymaster

                      Hi Asmi,
                      you select Arduino conf for esp32.

                      Please check the tutorial.

                      Ebyte LoRa E32 device for Arduino, esp32 or esp8266: WOR (wake on radio) and new ESP32 shield – 8

                      Bye Renzo

                    • #13118
                      Asmi Romli

                        Thanks for your response. I can compile when I use hardware serial &Serial1, &Serial2 and &Serial3. A bit confuse since normally we note Serial0 (U0RX, U0TX), Serial1 (U1RX, U1TX) and Serial2 (U2RX, U2TX). Another thing is how to configure if I want to used GPIO12 for RX and GPIO13 for TX (thru SoftwareSerial I guess).

                      • #13121
                        Renzo Mischianti
                        Keymaster

                          Hi,
                          you can refer this article to learn all the constructors

                          Ebyte LoRa E32 device for Arduino, esp32 or esp8266: library – Part 2

                          The second constructor is what you need. SoftwareSerial is not needed for esp32.

                          LoRa_E32(byte txE32pin, byte rxE32pin, HardwareSerial* serial, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600, uint32_t serialConfig = SERIAL_8N1);
                          LoRa_E32(byte txE32pin, byte rxE32pin, HardwareSerial* serial, byte auxPin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600, uint32_t serialConfig = SERIAL_8N1);
                          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);
                          Breaking change on esp32 constructor

                          Bye Renzo

                        • #13220
                          Asmi Romli

                            I use U0RXD and U0TXD on ESP32-CAM as serial channel. GPIO15 as AUX. I want to use GPIO12 & 13 as M0 and M1 respectively. Both this GPIOs already pulled to high using 47K resistor. Will it affect the communication with LoRa? Does I have to set them as Output or not?

                          • #13222
                            Renzo Mischianti
                            Keymaster

                              Hi Asmi,
                              if you use standard Serial to comunicate you must configure the E32 like so:

                              
                              // ---------- esp32 pins --------------
                              LoRa_E32 e32ttl(&Serial, 15, 12, 13); //  RX AUX M0 M1
                              

                              and after you must test if the pull-up resistor create problems.

                              You can take every examples on library, you must only change the constructor.

                              Bye Renzo

                          • #13280
                            Asmi Romli

                              I found that one of M1 or M0 make the system unstable when connected. Not sure why only one. Maybe can try to connect thru transistor.

                              I found that even thou M0 and M1 not connected (or  they are tied to GND or 3V3) changing parameters like address and channel still successful. Now I wonder whats the function of M0 and M1? I guess we have to set both to HIGH (mode 3) in order to program it.

                              Thanks for your kind respond.

                            • #13281
                              Renzo Mischianti
                              Keymaster

                                Hi Asmi,
                                try to remove the resistor, or change the value of these.
                                M0 and M1 are connected together with a little resistor, so if pull-up are too hight ot too low the device doesn’t go low or hight.
                                Bye Renzo

                              • #13364
                                Asmi Romli

                                  The soldered 47K resistor is so small. Not sure which one. No label and no schematic. Maybe need to use magnifying glass.

                                  Using the above-mentioned configuration setting by Mischianti, I found that AUX pin is a must in order to make the configuration read give status of 1. Otherwise status number 12 is given, regardless of M1 and M0 connection. So I think M1 and M0 only function to set in which mode it should be. Any comment?

                                • #13376
                                  Asmi Romli

                                    Oh.. I didn’t add any additional resistors. The 47k resistor already on the esp32-cam board. 47k connected to pin gpio12, 13 and 15 which i use to connect to m0, m1 and aux. anyway, i will try to connect other free pin..

                                    • #13656
                                      Renzo Mischianti
                                      Keymaster

                                        Sorry your reply was in spam.
                                        Change pin and use pin without internal resistor.
                                        Bye Renzo

                                  Viewing 9 reply threads
                                  • You must be logged in to reply to this topic.
                                  Exit mobile version