These are chat archives for esp8266/Arduino

20th
Oct 2015
Victor Aprea
@vicatcu
Oct 20 2015 14:45
hi
anybody home?
xbary
@xbary
Oct 20 2015 14:46
Hi, Yes .... working
patjazz
@patjazz
Oct 20 2015 16:34
esp12.svg
Markus
@Links2004
Oct 20 2015 17:04
@kathir51 have you wifi_station_connect(); in your code?
kathir51
@kathir51
Oct 20 2015 20:38

@Links2004 yes .But to the surprise the same code using extern "C" works in arduino ide extern "C" {

include "osapi.h"

include "ets_sys.h"

include "mem.h"

include "os_type.h"

include "user_interface.h"

include "gpio.h"

include "espconn.h"

include "c_types.h"

}

struct ip_info ipconfig,ip;

enum status { WL_DISCONNECTED = 0, WL_CONNECTED = 1, WL_NO_SSID_AVAIL = 2, WL_CONNECT_FAILED = 3 , WL_IDLE_STATUS =5 };

uint8 status()
{
int status = wifi_station_get_connect_status();

if (status == STATION_GOT_IP)
  return WL_CONNECTED;
else if (status == STATION_NO_AP_FOUND)
  return WL_NO_SSID_AVAIL;
else if (status == STATION_CONNECT_FAIL || status == STATION_WRONG_PASSWORD)
  return WL_CONNECT_FAILED;
else if (status == STATION_IDLE)
  return WL_IDLE_STATUS;
else
  return WL_DISCONNECTED;

}
void ICACHE_FLASH_ATTR
user_init(void)
{
Serial.begin(115200);
Serial.print("wifi connecting\r\n");
os_printf("wifi connecting\r\n");
char ssid[32] = "Benjamin";
char password[64] ="4522641400abc";
struct station_config stationConf;
stationConf.bssid_set = 0; //need not check MAC address of AP
os_memcpy(&stationConf.ssid, ssid, 32);
os_memcpy(&stationConf.password, password, 64);
ETS_UART_INTR_DISABLE();
wifi_station_set_config(&stationConf);
wifi_station_connect();
ETS_UART_INTR_ENABLE();
wifi_station_dhcpc_start();
while (status() != WL_CONNECTED) {
//for(int i=0;i<10;i++)
delay(500);
Serial.printf(".");
}
os_printf("wifi connected\r\n");
Serial.print("wifi connected\r\n");
char kat[40];
wifi_get_ip_info(STATION_IF, &ipconfig);
sprintf(kat,"IPaddress: %u %u %u %u",IP2STR(ipconfig.ip.addr);
Serial.print(kat);

}

//Do nothing function

void setup() {
// put your setup code here, to run once:
user_init();
}

void loop() {
// put your main code here, to run repeatedly:
// user_init();
}

sticilface
@sticilface
Oct 20 2015 21:27
Is anyone willing to share a web server example with a SPIFFS file manager viewer, and file uploader? not wanting to re-invent the wheel. playing with the SD example, but there is no web front end for it?
Me No Dev
@me-no-dev
Oct 20 2015 22:27
there is
:)
it's in the folder were the sketch is
iggr recently shared a rework of my SPIFFS sketch that we had back ago
but you need to get the contents to the spiffs
has a file browser/uploader/editor in one located at http://ip-of-esp/edit
Me No Dev
@me-no-dev
Oct 20 2015 23:17
listing files seem to not be working and starting "/" needs to be removed from the path in handleFileRead
the rest seems working
Me No Dev
@me-no-dev
Oct 20 2015 23:54
here is a fixed version with instructions on how to upload the contects
should maybe go into the examples