Announcement

Collapse
No announcement yet.

Trying to setup my 4duino With ESP8266 WIFI as a server

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trying to setup my 4duino With ESP8266 WIFI as a server

    Hi,
    My system consists of a 4Duino (has ATmega32U4, AVR) which has ESP8266

    I have set up the code within my ino file to talk to the ESP8266 via ATmega32U4
    If I set my SSID to my company's guest SSID and its associated pass word, I can cannect to my 4Duino with my PC application.

    But I am trying to setup my 4Duino as a hotspot so that an app on my andriod phone can connect to this 4Duino using temporary SSID and password.
    After the app n my andriod phone is connected, it will send the the my company's guest SSID and its associated pass word.

    On my 4Duino, I setup the SSID as "abcdefg" and password as "123456789"
    I can see that the 4Duino successfully goes into station mode via "AT+CWMODE" and then joins the AP mode via "AT+CWJAP" command using this SSID "abcdefg" and password as "123456789"
    And the I try to get the soft IP via "AT+CIFSR", I get an IP address of 0.0.0.0
    Question is, is this correct?
    What is my 4Duino WIFI's ip address? and it's mac address? Or, how can I get it?

    Also, when I look on my app on my andriod phone, I see "ESP_D445E6" -- this is also appearing on my WIFI display is this from my 4Duino?

    Any help/suggestion is appreciated.
    Thank you,
    Asha


    Starts
    18th September 2018
    Ends
    18th September 2018

  • #2
    Hello,

    Usually the IP address when set in AP mode is 192.168.4.1 so it looks like your change to AP Mode is unsuccessful. I have just tried it on another ESP8266 device and confirmed the same however it is without AT commands. ESP_D445E6 does very much look like a default ESP wifi id.

    Would it be possible to send me your code and I will try to see if I can get it setup as an access point.

    Best regards

    Paul

    Comment


    • #3
      Hi Paul,
      I am to know that "ESP_D445E6" was not my imagination. I have been debugging this for sometime.


      Anyway, I am attaching my 4Duino project could. You have to kinda strip out stuff. Becuase its has code to communicate with my PIC18F along with PICASO. Not very clean code. But the code is partly in the "setup" and then in the loop at the end. Look for
      "//////// handle wifi over ESP8266 //////////"

      Thank you,
      Asha

      Comment


      • #4
        Sorry forgot to attach file.
        Attached Files

        Comment


        • #5
          Hi,
          I was wondering if you could share your code that runs in ATmega32U4 in 4Duino to talk to the ESP8266? That does the same thing I am trying?
          Also, are you using ESP8266 library? Or which library to use?
          Thanks, Asha

          Comment


          • #6
            Hi,

            I used a different platform to test and get the IP address so it wouldn't really work on the 4Duino. Here is the link to the library that we use for the ESP8266 attached to the 4Duino.

            https://github.com/itead/ITEADLIB_Arduino_WeeESP8266

            and in your code if you wanted to use it.

            #define ESPRESET 17
            #include <SoftwareSerial.h>
            #define ESPserial SerialS
            SoftwareSerial SerialS(8, 9) ;
            #include "ESP8266.h"
            ESP8266 wifi(SerialS,19200);

            I will examine your code to see if I can get it as an AP using AT commands.

            Best regards

            Paul

            Comment


            • #7
              Hi,

              Thank you for your help.
              I did look at this library, but it only supports
              I looked at this website, http://www.4duino.com/getting-started-with-wi-fi/, that talks about 4Duino WIFI and it also uses this library which is misleading. I could not locate the code that this website is talking about along with the library.

              Thanks,
              Asha

              Comment


              • #8
                Hi Asha

                As the ESP8266 attaches serially, the library should be compatible with many Arduino platforms. It does work very well on the 4Duino and removes the need to use AT commands. There are some examples within the library. I am still looking through your code and hope to have solved the issue soon.

                Best regards

                Paul

                Comment


                • #9
                  Hi,
                  I was able to get the ESP8266 AC's IP address as well as the mac address: 192.168.4.1,
                  I was able to "joinAP"
                  I had to change the AT+CWMODE to be set to 3 (station plus AP)

                  I have the SSID to set as "connect_here" and password as "123456789"

                  When I look at my Android phone, I never see "connect_here", I am seeing couple of "ESP_D445E6" -- not exactly same but "ESP_xxxxxx"
                  I was wondering if I should see "connect_here"

                  Thanks,
                  Asha

                  Comment


                  • #10
                    Hi Asha

                    Yes you should be seeing the connect_here. It looks like the SSID is not being set. Is there anyway to determine which one of the ESP_xxxxxx is your device so that you can try to connect to it to see if the password has been set.

                    Best regards

                    Paul

                    Comment


                    • #11
                      Hi Paul,
                      I get "joinAP" to 192.168.4.1
                      But all the ESP_xxxxxs seem to be 192.168.4.2

                      So, not sure why I am not able to override it.
                      I was wondering if the station's ip is 192.168.4.2?

                      Thanks,
                      Asha

                      Comment


                      • #12
                        Hi Asha,

                        It isn't normal for the ip address to be 192.168.4.2. Is that the ip address that you are given when connected to one of the ESP_xxxxxx devices which would probably be right. Are you using the library or using AT commands still ?

                        I will try to find an example that sets the ESP8266 as an access point with SSID and password to se if we can get show up right out of your main sketch.

                        Best regards

                        Paul

                        Comment


                        • #13
                          Hi Paul,

                          My device shows ip address of 192.168.4.1 whose SSID is connect_here which I never see on the android phone.

                          I do see at least 2 ESP_xxxxxx devices on the android phone. And when I connect to one of these ESP_xxxxx, I see 192.168.4.2 as you mention above.

                          I am attaching some snap shots of what I see on my device as well as on the android phone.

                          In my code I am using AT commands and not the library.

                          Thanks, Asha
                          Attached Files

                          Comment


                          • #14
                            Hi Asha,

                            Yes that is correct, the ip address that you get on the phone is the ip address that is given to the phone from the ESP device that you are connected to. I have just tried it here also. The ip address of my ESP8266 is 192.168.4.1 and the ip address of my phone is 192.168.4.2 so you are connected to some ESP device but we can't confirm it is the 4Duino as the SSID doesn't match the set SSID. I guess if you powered down the 4Duino, then if it was connected it would then lose the connection to your phone.

                            Best regards

                            Paul

                            Comment


                            • #15
                              Hi Paul,

                              I have my 4Duino systems powered down but I still l see at least 2 of these ESP_xxxxx on my android phones.
                              Why do I see these?

                              Anyway, I need help as to why I never see my SSID connect_here.
                              Thanks,
                              Asha

                              Comment

                              Working...
                              X