Chat freely about anything...

User avatar
By j0hncc
#14937 I'm trying to get a simple example of open/write/close/read/print to work. I get open and write errors:

Code: Select all11483606 <html>Hello from Spiffy</html>
open errno -10002
write errno -10010
open errno -10002
open errno -10002

11649732 content:
11651409 Goodbye
mode : softAP(1a:fe:34:a0:d6:9c)
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
add if1
bcn 100


My app is:
Code: Select all#include <SmingCore/SmingCore.h>
const void p(const String s){   Serial.println( String() + micros() + " " + s);  }

void init()
{
   Serial.begin( 115200);
   Serial.systemDebugOutput(true); // Enable debug output to serial

   delay(5000);
   String fname="test.txt";
   String content="<html>Hello from Spiffy</html>";
   p( content);

   short file = fileOpen(fname, eFO_CreateNewAlways | eFO_WriteOnly);
   fileWrite(file, content.c_str(), content.length());
   fileClose(file);

   file = fileOpen(fname, eFO_ReadOnly );
   String out= "content: " + fileGetContent( fname);
   p( out );
   p( "Goodbye");
}


Have also tried various other open flags eFO_ReadWrite etc. I saw the problem originally when trying to use HttpServer_AJAX and FtpServer.

Using Sming 1.0.5 and DevKit 2.0.2.
Thanks!
User avatar
By alonewolfx2
#14990 you must to use flashinit target in eclipse after flashing firmware. sming using dynamic spiffs offset thats why you need flashinit target.
User avatar
By j0hncc
#14994 HttpServer_AJAX project
target flash successful:
Code: Select allc:/Espressif/utils/esptool.exe -p COM3 -b 230400 write_flash 0x00000 out/firmware/eagle.flash.bin 0x10000 out/firmware/eagle.irom0text.bin

target flashinit successful:
Code: Select allFlash init data default and blank data.
c:/Espressif/utils/esptool.exe -p COM3 -b 230400 write_flash 0x7c000 c:/Espressif/ESP8266_SDK/bin/esp_init_data_default.bin 0x7e000 c:/Espressif/ESP8266_SDK/bin/blank.bin

Still create/open/write error
Code: Select allconnected with Surveillance Drone T.84, channel 11
dhcp client start...
ip:192.168.1.124,mask:255.255.255.0,gw:192.168.1.1
I'm CONNECTED
open errno -10002           <<<<<<<<<<<<
write errno -10010           <<<<<<<<<<<<
addUser: me 123
'/' registered
'/ajax/input' registered
'/ajax/frequency' registered
=== WEB SERVER STARTED ===

fileSetContent fail
Code: Select all   if (!fileExist("index.html"))
      fileSetContent("index.html", "<h3>Please connect to FTP and upload files from folder 'web/build' (details in code)</h3>");


Thanks for your help!
(Corrected title)