GUI-O Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    ESP8266 & Arduino & GUI-O automatic pairing

    Scheduled Pinned Locked Moved
    Frequently Asked Questions (FAQ)
    2
    31
    4.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Bernard @kl3m3n
      last edited by

      @kl3m3n
      After GIO wifi password => I activate the GUIO_xxxx network, my phone does not prompt me to change network but asks me if I want to keep the guio_xxxxxx wifi connection. I answer yes, I go back, a window with a big green V invites me to reconnect to my wifi router => continue, I select my wifi router, I press back and after 1 second my phone tells me that You have to start the procedure again! if I leave it in this state, a window tells me "Iot connection error. Connection refused, retry in 5 seconds. I think that's the procedure? Before this procedure, is there any other reason to TO DO ? Bernard

      B 1 Reply Last reply Reply Quote 0
      • B
        Bernard @Bernard
        last edited by

        @kl3m3n
        small clarification: after being asked to reconnect to my wifi router, I see the blue led of the wifi module light up for about 300 msec.

        K 1 Reply Last reply Reply Quote 0
        • K
          kl3m3n @Bernard
          last edited by kl3m3n

          @Bernard Hi.

          Can you please take a look at this video and tell me where do you encounter the problem?

          If I understand correctly, the pairing data is exchanged OK. The problem occurs after you reconnect to your router and press back button (at time 0:55 in video above)? You get "Please retry pairing" error?

          Also, this error you are describing (Iot connection error. Connection refused, retry in 5 seconds) is raising alarms for me... Can you check IoT settings from the settings menu... Can you connect to IoT (Settings -> Connections -> IoT -> Connect)? It seems there is something wrong with your credentials. Did you by chance modify anything?

          Best regards
          kl3m3n

          B 1 Reply Last reply Reply Quote 0
          • B
            Bernard @kl3m3n
            last edited by

            @kl3m3n
            it is precisely at second 58 of the video, when I return from my reconnection to my wifi. Regarding IoT parameters:
            Autoconnect is ON (in blue), Server Name = No set, SSL port Number =50000, User-name=gui-o-mqtt-generic, User password = Hidden from user, If I click on it, 9 black dots appear! ! which looks like a password , ,Client id_ No set, Enable IoT notification= disable, Open IoT notification= nothing, Notification to show = nothing
            PS: I removed the password in Hidden from user, and tried a connection again, without success!
            Bernard

            K B 2 Replies Last reply Reply Quote 0
            • K
              kl3m3n @Bernard
              last edited by kl3m3n

              @Bernard Yes, you have wrong credentials. This is what's causing the problem. You have changed the settings somehow...

              I advise you to clear application data or uninstall and reinstall the application. This will reset the settings to default. Alternatively, you could input the correct settings, but I recommend reinstall... It will be easier for you. Then retry pairing.

              Note that you must keep the default settings if you want to connect to GUI-O server!

              Best regards,
              kl3m3n

              B 1 Reply Last reply Reply Quote -1
              • B
                Bernard @Bernard
                last edited by

                @Bernard said in ESP8266 & Arduino & GUI-O automatic pairing:

                @kl3m3n
                I forgot 2 parameters in IoT: Connect: Disconnected , New: Add new device: nothing, but after trying to connect I find the name I put in "Pairing device name"

                1 Reply Last reply Reply Quote 0
                • B
                  Bernard @kl3m3n
                  last edited by

                  @kl3m3n

                  We are progressing! I uninstalled GUI-O and reinstalled. a new connection attempt and now I arrive at "waiting for peraid device" the blue bar advances for 2 minutes and after that it invites me to start the procedure again. This could be a bad configuration of the wifi module?!
                  it's a wemos D1 mini ESP8266, in the arduino IDE I used the Lolin(Wemos) D1 mini pro.
                  Bernard

                  K 1 Reply Last reply Reply Quote 0
                  • K
                    kl3m3n @Bernard
                    last edited by

                    @Bernard how do you put Esp8266 into pairing mode? Once the pairing data is stored on Esp8266, it will boot directly into stationary (working) mode. Do you clear the parameters with !CLEAR_PARAMS command?

                    You must make sure that the WiFi password you input during pairing is correct, otherwise Esp8266 cannot connect. When Esp8266 is connected to the server successfully, the LED should be permanently ON! Please check that the built-in LED configuration is correct for your board (see config.h).

                    Best regards
                    kl3m3n

                    B 1 Reply Last reply Reply Quote 0
                    • B
                      Bernard @kl3m3n
                      last edited by

                      @kl3m3n
                      I see in config.h the following parameters: // Serial communication baud rate
                      #define _GUIO_SERIAL_BAUDRATE 9600

                      // LED used for main signaling tasks (e.g., built-in LED)
                      #define _GUIO_LED_MAIN LED_BUILTIN

                      // Pin that serves as AP/reset button
                      #define _GUIO_AP_BUTTON D4, the password is 12345678, after flashing the module if I press the reset key I have the following text in the serial monitor of the IDE:
                      "ets Jan 8 2013,rst cause:2, bootmode:(3,7)
                      load 0x4010f000, len 3424, room 16
                      tail 0
                      chksum 0x2e
                      load 0x3fff20b8, len 40, room 8
                      tail 0
                      chksum 0x2b
                      csum 0x2b
                      v00051370
                      ~ld ".
                      I note that at the end of the pairing attempt, as described yesterday, the blue led flach ~ 300 msec . I also specify that during the pairing phase, the wifi module is connected to my PC for l power and that I have not changed any parameters in config.h or elsewhere. Before starting the procedure in IoT there is: Autoconnect: Automatic (re)connect, Connect: "connected", New: "Add a new device ". After the procedure in New, I find the device associated with the device ( Bernard or GUIO or Test.
                      Bernard

                      B 1 Reply Last reply Reply Quote 0
                      • B
                        Bernard @Bernard
                        last edited by

                        @kl3m3n

                        If I'm not mistaken, normally after the initialization phase with Arduino IDE, if I press the reset button of the Wifi module I should see on the serial monitor something like:

                        GUI-O ESP8266
                        AP mode
                        ssid: guio_xxxxxxxx
                        password:12345678
                        AP status 1.
                        It's just no ?

                        K 1 Reply Last reply Reply Quote 0
                        • K
                          kl3m3n @Bernard
                          last edited by

                          @Bernard please uncomment

                          #define _GUIO_DEBUG
                          

                          in config.h to output more information on uart. Recompile and reupload the code to Esp8266. This will give us more information to work with.

                          It is definitely some problem on Esp8266 side (not on the GUI-O app side).

                          Regards,
                          kl3m3n

                          B 1 Reply Last reply Reply Quote 0
                          • B
                            Bernard @kl3m3n
                            last edited by

                            @kl3m3n
                            Here is what I see on the IDE terminal:
                            Pairing request: {
                            "mqttHostName": "mqtt.gui-o.com",
                            "mqttUserName": "gui-o-mqtt-generic",
                            "mqttUserPassword": "lqXeZpv5VJyv0XBT",
                            "networkPassword": "---------",
                            "networkSsid": "-----",
                            "publishTopic": "95fb4171-2024-42de-978e-fcbb6c6caf10",
                            "subscribeTopic": "b1126463-4511-45b0-84fa-350ad2a41751"
                            }
                            Pairing response: {
                            "pairingResponse": 0,
                            "pairingDeviceName": "guio_ea9f6d93b119",
                            "networkSsid": "------",
                            "networkPassword": "---------",
                            "mqttHostName": "mqtt.gui-o.com",
                            "mqttUserName": "gui-o-mqtt-generic",
                            "mqttUserPassword": "lqXeZpv5VJyv0XBT",
                            "subscribeTopic": "b1126463-4511-45b0-84fa-350ad2a41751",
                            "publishTopic": "95fb4171-2024-42de-978e-fcbb6c6caf10"
                            }
                            Pairing succeeded! Copying parameters and scheduling restart...
                            b
                            gC))k%
                            H
                            I a 0gf) X ʎ t N
                            y )1% 9o)C C9
                            E )/
                            **** ESP8266 GUI-O ****

                            GUI-O parameters not found... initializing...
                            AP Mode
                            ssid: guio_ea9f6d93b119
                            password: 12345678
                            AP status: 1
                            I deliberately erased password and ssid but they are correct.
                            Bernard

                            K 1 Reply Last reply Reply Quote 0
                            • K
                              kl3m3n @Bernard
                              last edited by

                              @Bernard It seems that the pairing parameters are not saved into Esp8266 EEPROM successfully... This triggers booting into AP (pairing) mode...

                              I am wondering if your board selection is ok?

                              @Bernard said in ESP8266 & Arduino & GUI-O automatic pairing:

                              This could be a bad configuration of the wifi module?!
                              it's a wemos D1 mini ESP8266, in the arduino IDE I used the Lolin(Wemos) D1 mini pro.

                              Best regards,
                              kl3m3n

                              B 1 Reply Last reply Reply Quote 0
                              • B
                                Bernard @kl3m3n
                                last edited by

                                @kl3m3n
                                Good morning,
                                actually i think the wifi modul is faulty. I tried to flash it with 5 different combinations but it's always the same result. I will therefore recommend one and I will keep you informed of the evolution of things. In any case, thank you very much for your patience and valuable advice! maybe these exchanges will be useful to others, but I think it's bad luck.
                                Kind regards Bernard

                                K 1 Reply Last reply Reply Quote 0
                                • K
                                  kl3m3n @Bernard
                                  last edited by

                                  @Bernard Hi.

                                  I suggest you try a simple EEPROM write / read example for ESP8266.
                                  Does this work?

                                  Best regards,
                                  kl3m3n

                                  B 1 Reply Last reply Reply Quote 0
                                  • B
                                    Bernard @kl3m3n
                                    last edited by

                                    @kl3m3n
                                    Hello kl3m3n
                                    As explained at the beginning of our discussions, I do not know the C language at all. I will therefore be unable to write this procedure!
                                    But on my last pairing attempt, I got to "IoT connection successful" but the blue bar advances for 2 minutes then prompts me to start the process again and what I read on the serial interface of L' IDE and always the same thing as quoted on 09.02.at.9:23 p.m. There is indeed a read-write problem in the ESP! have a good week-end. Bernard

                                    B 1 Reply Last reply Reply Quote 0
                                    • B
                                      Bernard @Bernard
                                      last edited by

                                      @kl3m3n
                                      What I have trouble understanding is that the "Pairing request: { process seems to work since there is a "Pairing response: { , then Pairing succeeded! Copying parameters and scheduling restart . so why " GUI-O parameters not found... initializing...

                                      K 1 Reply Last reply Reply Quote 0
                                      • K
                                        kl3m3n @Bernard
                                        last edited by

                                        @Bernard Hi!

                                        There are numerous examples for EEPROM usage online, e.g.:
                                        https://www.aranacorp.com/en/using-the-eeprom-with-the-esp8266/

                                        @Bernard said in ESP8266 & Arduino & GUI-O automatic pairing:

                                        What I have trouble understanding is that the "Pairing request: { process seems to work since there is a "Pairing response: { , then Pairing succeeded! Copying parameters and scheduling restart . so why " GUI-O parameters not found... initializing...

                                        The pairing parameters are exchanged successfully, but this does not mean that the actual EEPROM write was done successfully... Yes, I agree that this part of the code is a bit awkwardly written. I will see if I can fix this in a timely manner...

                                        Best regards,
                                        kl3m3n

                                        B 1 Reply Last reply Reply Quote 0
                                        • B
                                          Bernard @kl3m3n
                                          last edited by

                                          @kl3m3n
                                          I used the example and I get the same answer:
                                          Read ID = 18
                                          Read param = 26.50
                                          it seems to work...
                                          in the pairing procedure with GUI-O I don't know how many parameters are exchanged with the ESP but if the LED flashes ~300msec, at 9600 baud they have time to exchange around 950 characters, should that be enough?
                                          Bernard

                                          B 1 Reply Last reply Reply Quote 0
                                          • B
                                            Bernard @Bernard
                                            last edited by

                                            @kl3m3n
                                            No, its ~250 characteres ......

                                            B 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post