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

  • ashasingh18
    replied
    Hi,
    I was wondering if there is a way to clear the ESP8266 ssid and password using the AT commands from the Atmel?
    I have researched but cannot find a way
    Thanks,
    Asha

    Leave a comment:


  • pauleilio
    replied
    Hi Asha,

    I am so glad you managed to fix it, thank you for letting me know. It may be possible to customize the firmware in the ESP8266 to just do what you want it to do and possibly reduce the needed code to connect and communicate but maybe something for the future, at the moment you now have a working setup.

    Thanks again.

    Best regards

    Paul

    Leave a comment:


  • ashasingh18
    replied
    Hi Paul,

    Thank you. Appreciate all your help.
    I am finally able to see the new SSID on my Android phone as well as on my PC.
    I had to add below set of code and another state after the getting the MAC address:

    case WIFI_STATE_ADVERTISE_SSID :
    {
    if (*(long*)ipAddr == 0) {
    dataScan(dataScan_IP);
    ESPreplyWait(2000);
    break;
    }
    dataScan(dataScan_OK);

    ESPserial.print(F("AT+CWSAP=""));
    ESPserial.print(F(SSID));
    ESPserial.print(F("",""));
    ESPserial.print(F(PASSWORD));
    ESPserial.print(F("",1,4\r\n"));

    ESPreplyWait(5000);
    wifiState = WIFI_STATE_CONFIGURE_CONNECTION_CNT;
    }
    break;



    So, actually, in the example code "4D-PR-100-018 Server - Client", in the TCPServer.ino code,
    I added code below after calling "if (wifi.joinAP(SSID, PASSWORD))"
    " if(wifi.setSoftAPParam(SSID, PASSWORD, 1,4))
    Display.print(SSID); "

    And this also worked.
    Thank you for your support.
    Asha

    Leave a comment:


  • pauleilio
    replied
    Hi Asha,

    I have attached a 4Duino project so that AT commands can be entered directly using the serial monitor in the example. I have noticed that the AT+CWSAP=”ESP”,”password”,1,4 returns an error and I don't know why yet but the response of the failed command doesn't match what is sent.

    Best regards

    Paul


    Attached Files

    Leave a comment:


  • ashasingh18
    replied
    Hi,
    I tried
    ESPserial.print(F("",1,4\r\n")); But I still do not see the new SSID "connect_here" on my android phone and I also do not see it on my PC wifi, I always see ESP_xxxxxx I am successful in the "joinAP". I do get the AP IP address and the MAC address. But never the new SSID. I noticed on the web that the SSID password has to more than 8 characters and so I have made my password larger than 8 characters. So I do not understand. Please help. Thanks, Asha

    Leave a comment:


  • pauleilio
    replied
    Hi,

    Everything in your code looks right.

    I did follow this example which seemed to work

    https://techtutorialsx.com/2017/05/2...h-at-commands/

    Maybe it is just because of the added ",1,4" that makes this version work.

    Code:
    //ESPserial.print("AT+CWJAP=\"myNetworkSSID\",\"password\"\r\n");
                ESPserial.print(F("AT+CWJAP=\""));
                ESPserial.print(F(SSID));
                ESPserial.print(F("\",\""));
                ESPserial.print(F(PASSWORD));
                ESPserial.print(F("\",1,4\r\n"));
    Best regards

    Paul

    Leave a comment:


  • ashasingh18
    replied
    Hi Paul,
    I was wondering if you have an update?
    I was also wondering if the ESP8266's firmware is the cause of the problem? Is there another way of issuing the "joinAP" command other than

    "m_puart->print("AT+CWJAP="connect_here","12345679"\r\n");"

    Below is the ESP8266 version info

    FW Version:
    AT version:1.3.0.0(Jul 14 2016 18:54:01)
    SDK version:2.0.0(656edbf)
    compile time:Jul 19 2016 18:44:44

    Thanks,
    Asha

    Leave a comment:


  • ashasingh18
    replied
    Hi Paul,

    I also integrated the ESP8266 library and with given set of examples from 4Duino websites, TCPClient and TCPServer which I will upload.
    I tried using TCPServer on my 4Duino and I get "joinAP" failure.
    I am attaching image. Thanks for all your help.
    Thanks, Asha
    Attached Files

    Leave a comment:


  • pauleilio
    replied
    Hi Asha

    Ok, well it looks like the AP is not active for some reason. I will find or make an example using AT commands and test it here to make sure I can see it and connect to it and then send it to you.

    Best regards

    Paul

    Leave a comment:


  • ashasingh18
    replied
    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

    Leave a comment:


  • pauleilio
    replied
    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

    Leave a comment:


  • ashasingh18
    replied
    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

    Leave a comment:


  • pauleilio
    replied
    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

    Leave a comment:


  • ashasingh18
    replied
    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

    Leave a comment:


  • pauleilio
    replied
    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

    Leave a comment:

Working...
X