Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By costycnc
#8750 I can make esp8266 by default active?
because by default i see is off.
i needed because when power i can comunicated directly via web and change proprietes.
Code: Select allelse if (strncmp(pb, "GET /C ", 6) == 0) {
          pb=pb+9;
          while(*pb!=' ')
          {
            costy +=char(*pb);
            pb++;
            }
              ESP.println(costy);

with this code can send commands to esp8266... but for time an time is blocking, and help me is by default active , and can send again settings command.
in this mode not is necessary comunicated via serial port and is hudge advantage (for me!) :)
Thanks!
I search in this forum "default active" and not returnig anything, for this open this topic.
If exist an response but not i wieving, apologise!
Thanks!
User avatar
By costycnc
#9197 I find solution myself!
Simply I insert in initialise code 3 commands :
AT+CWMODE=3
AT+CIPMUX=1
AT+CIPSERVER=1,80
in at_v0.20_on_SDKv0.9.4 project example from espressif!
Thank you espressif for your example and instalation guide, it working from first pass...
I do not know much about espressif ... but i thanks you very much for these examples and programs!
Code: Select all/*
 * File   : user_main.c
 * This file is part of Espressif's AT+ command set program.
 * Copyright (C) 2013 - 2016, Espressif Systems
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of version 3 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "ets_sys.h"
#include "driver/uart.h"
#include "osapi.h"
#include "at.h"

extern uint8_t at_wifiMode;
extern void user_esp_platform_load_param(void *param, uint16 len);

void user_init(void)
{
  uint8_t userbin;
  uint32_t upFlag;
  at_uartType tempUart;

  user_esp_platform_load_param((uint32 *)&tempUart, sizeof(at_uartType));
  if(tempUart.saved == 1)
  {
    uart_init(tempUart.baud, BIT_RATE_115200);
  }
  else
  {
    uart_init(BIT_RATE_115200, BIT_RATE_115200);
  }
  at_wifiMode = wifi_get_opmode();
  os_printf("\r\nready!!!\r\n");
  uart0_sendStr("\r\nready\r\n");
//----this is code insert... thank you espressif for your code examples----
 (costycnc small cnc machine made from plastic pipes...
I want make this machine comunicate with esp8266...
https://www.youtube.com/watch?v=aIowblAp84w)
  //AT+CWMODE=3
  at_setupCmdCwmode(5, "=3");

   //  AT+CIPMUX=1
  at_setupCmdCipmux(5, "=1");
//AT+CIPSERVER=1,80
  at_setupCmdCipserver(5, "=1,80");

  at_init();
}