Error in setting configuration parameters in E22-900T30S

Home Forums The libraries hosted on the site EByte LoRa e22 UART devices sx1262/sx1268 Error in setting configuration parameters in E22-900T30S

Tagged: 

Viewing 5 reply threads
  • Author
    Posts
    • #28616
      Dark_Matter
      Participant

        Hello,
        I’m unable use the library which I downloaded from the repository here. I’m using Arduino Mega 2560 with LoRa E22-900T30S and i followed the guidelines given in this link and developed the circuit according to the first Arduino circuit mentioned.

        I tried using pins 4 and 5 of arduino mega 2560 initially but i got an error message saying “No response from device! (Check wiring)” even though my circuit was exact same as that of the one present in the link i mentioned above. Then I changed to Software serial and made connections accordingly invoking my uart 1 by Serial2 in arduino code but still got the same message saying “No response from device! (Check wiring)”. Then finally I chose to try in Hardware serial setup and used same Uart, following lines is how my serial monitor is printing messages now

        "Old parameters
        Wrong UART configuration! (BPS must be 9600 for configuration)
        13
        ----------------------------------------
        HEAD : 0 0 0
        
        AddH : 1
        AddL : 54
        NetID : A1
        
        Chan : 84 -> 494MHz
        
        SpeedParityBit : 0 -> 8N1 (Default)
        SpeedUARTDatte : 0 -> 1200bps
        SpeedAirDataRate : 111 -> 62.5kbps
        
        OptionSubPacketSett: 0 -> 240bytes (default)
        OptionTranPower : 1 -> 17dBm
        OptionRSSIAmbientNo: 0 -> Disabled (default)
        
        TransModeWORPeriod : 1 -> 1000ms
        TransModeTransContr: 0 -> WOR Receiver (default)
        TransModeEnableLBT : 0 -> Disabled (default)
        TransModeEnableRSSI: 1 -> Enabled
        TransModeEnabRepeat: 1 -> Enabled
        TransModeFixedTrans: 0 -> Transparent transmission (default)
        ----------------------------------------
        Wrong UART configuration! (BPS must be 9600 for configuration)
        13
        New parameters
        Wrong UART configuration! (BPS must be 9600 for configuration)
        13
        ----------------------------------------
        HEAD : 0 0 0
        
        AddH : 1
        AddL : 54
        NetID : A1
        
        Chan : 84 -> 494MHz
        
        SpeedParityBit : 0 -> 8N1 (Default)
        SpeedUARTDatte : 0 -> 1200bps
        SpeedAirDataRate : 111 -> 62.5kbps
        
        OptionSubPacketSett: 0 -> 240bytes (default)
        OptionTranPower : 1 -> 17dBm
        OptionRSSIAmbientNo: 0 -> Disabled (default)
        
        TransModeWORPeriod : 1 -> 1000ms
        TransModeTransContr: 0 -> WOR Receiver (default)
        TransModeEnableLBT : 0 -> Disabled (default)
        TransModeEnableRSSI: 1 -> Enabled
        TransModeEnabRepeat: 1 -> Enabled
        TransModeFixedTrans: 0 -> Transparent transmission (default)
        ----------------------------------------
        "

        Following is the modified code I used to get the above messages

        
        #include "Arduino.h"
        #include "LoRa_E22.h"
        
        #define ACTIVATE_SOFTWARE_SERIAL
        #define HARDWARE_SERIAL_SELECTABLE_PIN
        LoRa_E22 e22ttl(19, 18, Serial1, 3, 7, 6);
        
        void printParameters(struct Configuration configuration);
        void printModuleInformation(struct ModuleInformation moduleInformation);
        
        void setup() {
        	Serial.begin(9600);
        	while(!Serial){};
        	delay(500);
        
        	Serial.println();
        
        	// Startup all pins and UART
        	e22ttl.begin();
        
        	ResponseStructContainer c;
        	c = e22ttl.getConfiguration();
        	// It's important get configuration pointer before all other operation
        	Configuration configuration = *(Configuration*) c.data;
                Serial.println("Old parameters");
        	Serial.println(c.status.getResponseDescription());
        	Serial.println(c.status.code);
        
        	printParameters(configuration);
        
        	configuration.ADDL = 0x03;
        	configuration.ADDH = 0x00;
        	configuration.NETID = 0x00;
        
        	configuration.CHAN = 23;
          //	----------------------- FIXED SENDER RSSI -----------------------
        	configuration.ADDL = 0x02;
        	configuration.ADDH = 0x00;
        	configuration.NETID = 0x00;
        
        	configuration.CHAN = 23;
        
        	configuration.SPED.uartBaudRate = UART_BPS_9600;
        	configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
        	configuration.SPED.uartParity = MODE_00_8N1;
        
        	configuration.OPTION.subPacketSetting = SPS_240_00;
        	configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
        	configuration.OPTION.transmissionPower = POWER_22;
        
        	configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
        	configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
        	configuration.TRANSMISSION_MODE.enableRepeater = REPEATER_DISABLED;
        	configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
        	configuration.TRANSMISSION_MODE.WORTransceiverControl = WOR_TRANSMITTER;
        	configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
                
                	// Set configuration changed and set to not hold the configuration
        	ResponseStatus rs = e22ttl.setConfiguration(configuration, WRITE_CFG_PWR_DWN_LOSE);
        	Serial.println(rs.getResponseDescription());
        	Serial.println(rs.code);
        
        	c = e22ttl.getConfiguration();
        	// It's important get configuration pointer before all other operation
        	configuration = *(Configuration*) c.data;
          Serial.println("New parameters");
        	Serial.println(c.status.getResponseDescription());
        	Serial.println(c.status.code);
        
        	printParameters(configuration);
        }
        
        void loop() {
        
        }
        void printParameters(struct Configuration configuration) {
        	Serial.println("----------------------------------------");
        
        	Serial.print(F("HEAD : "));  Serial.print(configuration.COMMAND, HEX);Serial.print(" ");Serial.print(configuration.STARTING_ADDRESS, HEX);Serial.print(" ");Serial.println(configuration.LENGHT, HEX);
        	Serial.println(F(" "));
        	Serial.print(F("AddH : "));  Serial.println(configuration.ADDH, HEX);
        	Serial.print(F("AddL : "));  Serial.println(configuration.ADDL, HEX);
        	Serial.print(F("NetID : "));  Serial.println(configuration.NETID, HEX);
        	Serial.println(F(" "));
        	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.getUARTBaudRateDescription());
        	Serial.print(F("SpeedAirDataRate   : "));  Serial.print(configuration.SPED.airDataRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getAirDataRateDescription());
        	Serial.println(F(" "));
        	Serial.print(F("OptionSubPacketSett: "));  Serial.print(configuration.OPTION.subPacketSetting, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getSubPacketSetting());
        	Serial.print(F("OptionTranPower    : "));  Serial.print(configuration.OPTION.transmissionPower, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getTransmissionPowerDescription());
        	Serial.print(F("OptionRSSIAmbientNo: "));  Serial.print(configuration.OPTION.RSSIAmbientNoise, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getRSSIAmbientNoiseEnable());
        	Serial.println(F(" "));
        	Serial.print(F("TransModeWORPeriod : "));  Serial.print(configuration.TRANSMISSION_MODE.WORPeriod, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getWORPeriodByParamsDescription());
        	Serial.print(F("TransModeTransContr: "));  Serial.print(configuration.TRANSMISSION_MODE.WORTransceiverControl, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getWORTransceiverControlDescription());
        	Serial.print(F("TransModeEnableLBT : "));  Serial.print(configuration.TRANSMISSION_MODE.enableLBT, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getLBTEnableByteDescription());
        	Serial.print(F("TransModeEnableRSSI: "));  Serial.print(configuration.TRANSMISSION_MODE.enableRSSI, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getRSSIEnableByteDescription());
        	Serial.print(F("TransModeEnabRepeat: "));  Serial.print(configuration.TRANSMISSION_MODE.enableRepeater, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getRepeaterModeEnableByteDescription());
        	Serial.print(F("TransModeFixedTrans: "));  Serial.print(configuration.TRANSMISSION_MODE.fixedTransmission, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getFixedTransmissionDescription());
        
        	Serial.println("----------------------------------------");
        }
        void printModuleInformation(struct ModuleInformation moduleInformation) {
        	Serial.println("----------------------------------------");
        	Serial.print(F("HEAD: "));  Serial.print(moduleInformation.COMMAND, HEX);Serial.print(" ");Serial.print(moduleInformation.STARTING_ADDRESS, HEX);Serial.print(" ");Serial.println(moduleInformation.LENGHT, DEC);
        
        	Serial.print(F("Model no.: "));  Serial.println(moduleInformation.model, HEX);
        	Serial.print(F("Version  : "));  Serial.println(moduleInformation.version, HEX);
        	Serial.print(F("Features : "));  Serial.println(moduleInformation.features, HEX);
        	Serial.println("----------------------------------------");
        
        }
        
        

        Thanks in advance

      • #28623
        Renzo Mischianti
        Keymaster

          Hi Dark,
          scroll up from your link of the guideline, and check the constructor, you set It like an ESP32, but Arduino Mega doesn’t have the possibility to do that.
          Bye Renzo

        • #28625
          Dark_Matter
          Participant

            Hello Renzo,

            The circuit connection with respect to Arduino Uno board according to the schema is

            E22 -> Arduino
            Tx -> 2
            Rx -> 3
            AUX -> 4
            M1 -> 5
            M0 -> 6

            But the corresponding table has different details and the code present in library i have tagged has different default pin definitions. I will all possibilities and check

          • #28627
            Dark_Matter
            Participant

              Again i made connections according to the new schema present in the guideline link i have provided and tried running the set configuration code under 3 different cases one with Arduino mode as defined in the schema (not as per the corresponding table), then i tried compiling in Software serial mode in which i considered two cases one being same pins as what schema said and the other using serial 1 of arduino mega in all these modes i could read the serial monitor saying “No response from device! (Check wiring)” and when i switched to hardware serial mode with serial1 as Uart pins serial monitor is showing me “Wrong UART configuration! (BPS must be 9600 for configuration)”.

              One more thing i’m using E22-900T30S whereas the serial monitor displays the channel frequency in range 410 to 900 and channel from 0 to 250. I assume these values are taken from the Arduino memory since i’m getting the message “No response from device! (Check wiring)”.

            • #28628
              Dark_Matter
              Participant

                Hello there Renzo,

                Any help would be appreciated!!!

              • #28630
                Renzo Mischianti
                Keymaster

                  Hi,
                  the message “Wrong UART configuration” signifies that you didn’t create the constructor correctly and that you probably set a pin on the UART configuration.
                  Use the examples shared with the library with the constructor created for Arduino.

                  Arduino UNO like
                  LoRa_E22 e22ttl(4, 5, 3, 7, 6);
                  Arduino Mega
                  LoRa_E32 e32ttl100(&Serial2, 3, 7, 6);

                  You can find other info here
                  Mega 2560 e32 EByte frozen in example sendReceiveTransparentTransmissionMessage

                  Bye Renzo

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