So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By rui
#84786 Im using Ubuntu 18.04 + ESP8266 + RTOS3.2 SDK( IDF-Style), im trying compile the exsample code come wiht the SDK package for learning how esp8266 works:

smartconfig sample: compile with no error, then use EspTouch app to config ESP8266 wifi info and connet to router , done ;

MQTT sample(choose ibm-mqtt) : compile with no error , connet to my mqtt server and publish/subscribe data with no problem;

wifi scaner sample: compile with no error, scan WIFI Hostpot around and got expected result.

gpio sample: compile with no error, control 2 leds onboard with no problem.

spi sample: compile with no error , control ws2812 RGB led with no problem.

Here is the problem:
when trying spiffs sample code, i following the step from README , while compiling the sample code, the compiler show me some error:
/////////////////////////////////
****
CC build/lwip/port/esp8266/netif/ethernetif.o
CC build/lwip/port/vfs_lwip.o
AR build/main/libmain.a
CC build/mqtt/ibm-mqtt/MQTTClient-C/src/MQTTClient.o
CC build/mqtt/ibm-mqtt/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.o
/home/myid/esp8266/esp-idf/components/mqtt/ibm-mqtt/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.c: In function 'esp_disconnect':
/home/myid/esp8266/esp-idf/components/mqtt/ibm-mqtt/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.c:175:5: error: implicit declaration of function 'close' [-Werror=implicit-function-declaration]
close(n->my_socket);
^
cc1: some warnings being treated as errors
/home/myid/esp8266/esp-idf/make/component_wrapper.mk:285: recipe for target 'ibm-mqtt/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.o' failed
make[1]: *** [ibm-mqtt/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.o] Error 1
/home/myid/esp8266/esp-idf/make/project.mk:517: recipe for target 'component-mqtt-build' failed
make: *** [component-mqtt-build] Error 2
///////////////////////////////////////////////////////

Since there are several other sample packages has work fine, I dont think declaration of function 'close' is the real problem, but I still replace the 'close' function with 'closesocket' which in the MQTTFreeRTOS.c , for checking another error , and then I got the same implicit declaration of function 'close' in other file which located under /esp-idf/components folder, then I know this is a wrong way to go .
///////////////////////////////////////////////
***
CXX build/nvs_flash/src/nvs_api.o
AR build/nvs_flash/libnvs_flash.a
CC build/smartconfig_ack/smartconfig_ack.o
/home/myid/esp8266/esp-idf/components/smartconfig_ack/smartconfig_ack.c: In function 'sc_ack_send_task':
/home/myid/esp8266/esp-idf/components/smartconfig_ack/smartconfig_ack.c:172:9: error: implicit declaration of function 'close' [-Werror=implicit-function-declaration]
close(send_sock);
^
cc1: some warnings being treated as errors
/home/myid/esp8266/esp-idf/make/component_wrapper.mk:285: recipe for target 'smartconfig_ack.o' failed
make[1]: *** [smartconfig_ack.o] Error 1
/home/myid/esp8266/esp-idf/make/project.mk:517: recipe for target 'component-smartconfig_ack-build' failed
////////////////////////////////////////////////

Then I take anther shoot, Ubuntu 18.04 + ESP32-WROOM 32 + RTOS 3.3 SDK(IDF-STYLE) + spiffs sample code, these sample code(without any edit) can be comiled absolutely fine and after flash i got the positive result.

How can i use this spiffs on ESP8266 under RTOS 3.2 SDK ?
User avatar
By rui
#84790 Update

I rebuild the hole environment , including redownload the SDK and toolchain. Usually I download the gz package from release folder (https://github.com/espressif/ESP8266_RTOS_SDK/releases), cause the " git clone " was extreme slow on my machine (sometime < 2k KiB /s) . But this time I use "git clone" and pay my patience to wait .....

After new environment been rebuild , the SDK seems a little bit different than before. Spiffs sample code works now . it's seems ESP update the 3.2 SDK a bit.

Thanks for your read!