Forum Replies Created

Viewing 15 posts - 931 through 945 (of 1,012 total)
  • Author
    Posts
  • in reply to: Problem connecting of EByte E32, bad config response #8708
    Renzo Mischianti
    Keymaster

      Hi John,

      put all in DEBUG by uncommenting this line

      // #define LoRa_E32_DEBUG

      and check that the Serial is correct in this line

      #define DEBUG_PRINTER Serial

      Bye Renzo

      Renzo Mischianti
      Keymaster

        Hi windip,
        I think It’s better if you use an array of String instead of char*, in that situation you receive a warning like
        ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

        to manage this situation I use a simple String[].

        This evening or tomorrow I’m going to release a new version (2.1.4) that can take a String[] or char* [] and convert It inside the library with a converter like

        const char** toCharArray(String arr[], int num) {
            // If we ever alloc with new with have to delete
            const char** buffer = new const char*[num];
        
            for(int i = 0; i < num; i++) {
                buffer[i] = arr[i].c_str();
            }
        
            return buffer;
        }
        

        and

        const char** toCharArray(char* arr[], int num) {
            // If we ever alloc with new with have to delete
            const char** buffer = new const char*[num];
        
            for(int i = 0; i < num; i++) {
                buffer[i] = arr[i];
            }
        
            return buffer;
        }
        
        

        I think It’s what you need.

        Bye Renzo

         

        in reply to: PCF8574: Reading from multiple encoders #7976
        Renzo Mischianti
        Keymaster

          Hi Poki,
          if you have some exception on the behavior probably It’s the noise, the encoders have a lot of noise.
          Try to change the algorithm, or add some capacitor to absorb It.
          Bye Renzo

          in reply to: PCF8574: Reading from multiple encoders #7974
          Renzo Mischianti
          Keymaster

            Hi Poki,
            I checked and tested various encoder, and I have had multiple response different from different encoder.
            So my solution to cover is this:

             #define BASIC_ENCODER_ALGORITHM
            // #define MISCHIANTI_ENCODER_ALGORITHM
            // #define SEQUENCE_ENCODER_ALGORITHM_REDUCED
            // #define SEQUENCE_ENCODER_ALGORITHM
            // #define POKI_ENCODER_ALGORITHM
            
            
            

            I give the possibility to use different algorithm for different encoder like this

            void updateEncoder(){
                changed2 = pcf8574.readEncoderValueSequenceReduced(P6, P5, &encoderValue2);
                changed = pcf8574.readEncoderValue(encoderPinA, encoderPinB, &encoderValue, true);
            
            //  int vale = pcf8574.readEncoderValue(encoderPinA, encoderPinB);
            //  if (vale!=0){
            //      changed = true;
            //  }
            //  encoderValue = encoderValue + vale;
            
                bool val = pcf8574.digitalRead(P2);
                if (val!=valPrec){
                  changed = true;
                  valPrec = val;
                  encoderButtonVal = val;
                }
                bool val2 = pcf8574.digitalRead(P4);
                if (val2!=valPrec2){
                  changed2 = true;
                  valPrec2 = val2;
                  encoderButtonVal2 = val2;
                }
            }
            

            With this solution I can use different modules and different encoders with succes.

            Give me a feedbback.
            Bye Renzo

            in reply to: PCF8574: Reading from multiple encoders #7972
            Renzo Mischianti
            Keymaster

              There is another bug

              byte encoderValues = B00000000;

              must be

              volatile byte encoderValues = B00000000;

              Try It also please.
              Thanks Renzo

              in reply to: PCF8574: Reading from multiple encoders #7971
              Renzo Mischianti
              Keymaster

                Hi poki,
                I had tested with 2 encoder and BASIC_ENCODER_ALGORITHM work fine for me, but with yours first encoder only increase.

                But I’m going to to do more test.

                Bye Renzo

                in reply to: PCF8574: Reading from multiple encoders #7969
                Renzo Mischianti
                Keymaster

                  Hi Poki,
                  thanks for your solution, but your solution not work with my encoder, the first encoder only increment when rotate, the second work correctly.
                  I think there are some difference from the encoder, so I’m going to add you r algorithm to the library for all people that have your same type of encoder.
                  Now we have:

                  #define POKI_ENCODER_ALGORITHM
                  //#define BASIC_ENCODER_ALGORITHM
                  //#define MISCHIANTI_ENCODER_ALGORITHM
                  
                  
                  

                  Thanks for your support.

                  in reply to: PCF8574: Reading from multiple encoders #7947
                  Renzo Mischianti
                  Keymaster

                    Hi poki,
                    change this lines

                    // Select an algorithm to manage encoder progression
                    
                    #define BASIC_ENCODER_ALGORITHM
                    
                    //#define MISCHIANTI_ENCODER_ALGORITHM
                    

                    comment MISCHIANTI_ENCODER_ALGORITHM and decomment BASIC_ENCODER_ALGORITHM, and give me a feedback.

                    Thanks Renzo

                    in reply to: PCF8574: Reading from multiple encoders #7946
                    Renzo Mischianti
                    Keymaster

                      Hi Poky,
                      I never test the internal implementation with 2 encoder, It’s possible that there is a bug,

                      to bypass the problem you can try to implement externally the management of 2 encoder, there is an example of external implementation on the relative tutorial

                      PCF8574 i2c digital I/O expander: Arduino, esp8266 and esp32, rotary encoder

                      But I try to fix as soon as possible.

                      Bye Renzo

                      in reply to: Using DHT12 with alternate IO pins on ESP8266 #7480
                      Renzo Mischianti
                      Keymaster

                        Hehehhe,

                        no no, sorry, I did not understand, and I have not included examples that use pins different from the standard.

                        Instead of use this constructor

                        DHT12 dht12;

                        you can use this

                        DHT12 dht12(D1, D2);

                        and you can specify the alternati pins you want.

                        I think It’s what you need.

                        Bye Renzo

                        Renzo Mischianti
                        Keymaster

                          Hi Mohammed,

                          I use this declaration

                          uint8_t sdWrongReadNumber = 0;

                          You can find the complete sketch of the Power One aurora Inverter at this link.

                          GitHub repository of ABB Aurora inverter web interface.

                          If you need more info, ask.

                          Bye Renzo

                          in reply to: Using DHT12 with alternate IO pins on ESP8266 #7476
                          Renzo Mischianti
                          Keymaster

                            Hi Dave,

                            I think you don’t need to use alternate pins, you can connect more than one device to the same 2 pins, you must only put the a different address.

                            Usually there is one master and one or multiple slaves on the line, although there can be multiple masters, but we’ll talk about that later.

                            Both masters and slaves can transmit or receive data, therefore, a device can be in one of these four states: master transmit, master receive, slave transmit, slave receive.

                            You must pay attention only if you manage i2c with interrupt.

                             

                            Tell me if this can be a solution.

                            Bye Renzo

                            in reply to: Yahoo SMTP mail suitable with SSL with esp8266 and esp32 #7053
                            Renzo Mischianti
                            Keymaster

                              Hi mohammed,

                              there is a topic with the informations you need, here you are

                              Send a simple mail including the value of a declared variable in the message

                              Bye Renzo

                              Renzo Mischianti
                              Keymaster

                                Hi Martin,

                                any news?

                                Bye Renzo

                                in reply to: Yahoo SMTP mail suitable with SSL with esp8266 and esp32 #6863
                                Renzo Mischianti
                                Keymaster

                                  Hi Mohammed,

                                  to send email from your iot project you can follow this guide

                                  Send email with attachments (EMailSender v2.x library): esp32 and esp8266 – Part 2

                                Viewing 15 posts - 931 through 945 (of 1,012 total)