E220-900T22D receiver module restarts itself after 1000 bytes of transmission

Home Forums The libraries hosted on the site EByte LoRa e22 UART devices sx1262/sx1268 E220-900T22D receiver module restarts itself after 1000 bytes of transmission

Tagged: , ,

Viewing 3 reply threads
  • Author
    Posts
    • #19103
      sup_arman22
      Participant

        Hello Renzo,

        First, thank you for the library that you have published for E220. That helped us a lot. We’re coding a project that requires sending audio data from one Arduino that is connected to a LoRa module to other. We’re using E220-900T22D modules along with your E220 library.

        Problem that we’re currently facing is, when we try to send packets with a size of 100 bytes continously, receiving module restarts itself after it received 10 packets. That causes loss of sended data because restart takes 3-4 seconds and it means a lot for continuous audio stream. I think it’s about buffer problem but i don’t know how to fix. Maybe module fails to free itself? We need to continously send audio data between modules so this restart problem seems to cause problems during development. I’ve attached fixed sender and fixed receiver files. This project is our undergrad end project so any help will be appreciated. Thank you in advance.

      • #19106
        Renzo Mischianti
        Keymaster

          Hi sup_arman,
          you forget to close (and free) the structure container with rc.close() command.

          
          	// If something available
            if (e220ttl.available()>1) {
          	  // read the String message
          #ifdef ENABLE_RSSI
          	ResponseStructContainer rc = e220ttl.receiveMessageRSSI(sizeof(Deneme));
            struct Deneme d = *(Deneme*) rc.data;
            Serial.println(d.type);
            //e220ttl.flush();
            //e220ttl.receiveMessageRSSI(sizeof(Deneme));
            //e220ttl.cleanUARTBuffer();
            //Serial.println(d.msg);
            //Serial.println(d.arman);
          #else
          	ResponseStructContainer rc = e220ttl.receiveMessage(sizeof(Deneme));
            struct Deneme d = *(Deneme*) rc.data;
            Serial.println(d.type);
            //e220ttl.flush();
            //rc = e220ttl.receiveMessage(sizeof(Deneme));
            //e220ttl.cleanUARTBuffer();
            //Serial.println(d.msg);
            //Serial.println(d.arman);
          #endif
          	// Is something goes wrong print error
          	if (rc.status.code!=1){
          		Serial.println(rc.status.getResponseDescription());
          	}else{
          		// Print the data received
          		Serial.println(rc.status.getResponseDescription());
          		//Serial.println(rc.data); //this was for string transmission only 
          #ifdef ENABLE_RSSI
          		Serial.print("RSSI: "); Serial.println(rc.rssi, DEC);
          #endif
          	}
                  rc.close();
            }
          
        • #19107
          sup_arman22
          Participant

            That was simple and good info, thanks for your fast reply. Another question, i use 2 Arduino UNO’s. When i set bps to 115200 in both modules in setConfiguration, packets don’t transmit. Also other bps rates are failing too. Transmission is only possible in 9600 bps at the moment. What is the reason for this?

            • #19108
              Renzo Mischianti
              Keymaster

                It’s strange, try to re-read the configuration stored, anche check if It’s correctly stored.

              • #19116
                sup_arman22
                Participant

                  I checked multiple times. Yes config was saved correctly. I think problem is on Arduino side. When i look into E220.h, I see bpsRate is hardcoded to value 9600. When I change it to 115200, it simply doesn’t transmit packets. Also giving constructor UART_BPS_RATE_115200 doesn’t work. Because we will transmit voice data, it’s crucial not to be bottlenecked by UART rate (given that with bps of 9600 effective rate will be 1.2 kb/s).

                  Ps: I fixed the problem in your library. Problem is in begin() function parameters of NeedsStream() function. Instead of taking int baud, uint32_t baud should be given as input parameter. This way, Baud rates higher than 19200 become available.

              • #19120
                Renzo Mischianti
                Keymaster

                  Azzzz!!! This is a giant bug.
                  Thanks, I’m going to fix it in all my libraries.

                  Would you like to share your work? It seems very, very interesting and helpful for the people.

                  Bye Renzo

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