ESP8266[NodeMCU] LittleFS Library Problem - c++

I'm working on Arduino IDE to implement LittleFS file system.However I get the error message as "src\LITTLEFS.cpp:17:21: fatal error: vfs_api.h: No such file or directory
#include "vfs_api.h" when I try to compile my program.
Code :
#include <Arduino.h>
#include "FS.h"
#include <LITTLEFS.h>
#define FORMAT_LITTLEFS_IF_FAILED true
void setup(){
}
void loop(){
}
Arduino version : 1.8.13
Board : NodeMCU v3(ESP12-E Module 1.0)
Flash Size : 4MB(1 MB SPIFFS)

Seems like you've chosen the ESP32 version of this project, which doesn't run on ESP8266. Try the ESP8266 version instead.

Related

Arduino / esp8266: error: section attribute not allowed for 'Pchr

My Arduino program had compiled and worked correctly but something happen or I did something because now when I compile it, I get an compiler error. I have tried upgrading esp8266 v2.4.1 to 2.5.2 but then I get another error in the random.tcc header file. I am compiling my code with Visual Studio 2017 with Visual Micro. I have seen this error on the web but upgrading didn't seem to help.
Any suggestions?
OUTPUT
Adafruit_ESP8266.cpp:17: In file included from
Adafruit_ESP8266.h: 28:35: error: section attribute not allowed for 'Pchr
typedef const PROGMEM char Pchr; \\ Ditto, kindasorta
SOURCE
#include <Adafruit_ESP8266.h>
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
//needed for library
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
// the setup function runs once when you press reset or power the board
void setup()
{
Serial.println("Begin Setup");
Serial.println("End Setup");
}
// the loop function runs over and over again until power down or reset
void loop()
{
Serial.println("Begin Loop");
Serial.println("End Loop");
}
I fixed my error by removing the header file Adafruit_ESP8266.h. I must of clicked on something that included it.

Platformio Linker Error When Including <functional>

I'm using PlatformIO (with the VS Code extension), on Windows 10, and am compiling for the Teensy 3.5 board.
I've reduced a linker error in one of my projects to the following piece of code:
#include <Arduino.h>
#include <functional>
void setup()
{
// Serial.println();
std::function<void()> func;
func();
}
void loop() {}
When I try to compile and link this, it compiles fine, but fails to link. If i uncomment the Serial.println(), then it links and compiles.
I am using the following settings in the platformio.ini file:
[env:teensy35]
platform = teensy
board = teensy35
framework = arduino
The error it gives when failing to link is:
c:/users/zackh/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-writer.o): In function _write_r':
writer.c:(.text._write_r+0x12): undefined reference to_write'
collect2.exe: error: ld returned 1 exit status
Any idea what's happening here?
The solution I found was to include the following line in the platformio.ini project.
build_flags = -llibc -lc

Mbed Ethernet with serial port error Nucleo F746ZG

I am trying to use the ethernet connection on the Nucleo F746ZG,
But whenever i use the official include of mbed my pins aren't recognized anymore.
Besides that some of the standard commands dont work either like digitalout.
All help is welcome and thanks in advance.
#include "EthernetInterface.h"
#include "mbed.h" //Includes a diffent map.
#include <string>
Serial pc(USBTX, USBRX);//Selects the type of serial and assigns a name to it.
DigitalOut led1(LED1);//Selects the led.
CAN can1(PD_0, PD_1); <---- // CAN isnt recognized anymore //Sets the pins for the CAN.
this is the error i receive:
Error: Identifier "CAN" is undefined in "Nucleo_F746ZG_Ethernet/main.cpp", Line: 7, Col: 2
I'd suggest updating to the latest Mbed OS version, I've tested this on Mbed OS 5.10 against the Nucleo-F746ZG and it compiles fine.

Can't compile dll from C++ project - Visual Studio

I'm trying to play a RTSP stream in Unity 5.
For that I found a RTSP-plugin for Unity on Github that I want to try, but unfortunatelly it comes with no Readme or installation guide whatsoever.
So far I found out that I'm dealing with a C++ Visual Studio project that needs to be compiled into a DLL in order to add it to Unity. But when I try to build the project I get the following Error for the header file "ffmpegenv.h":
Error C1083 Cannot open include file: 'libavutil\opt.h': No such file or directory - (Screenshot)
Here's the code from the header file
#pragma once
//=============================
// Includes
//-----------------------------
// FFMPEG is writen in C so we need to use extern "C"
//-----------------------------
extern "C" {
//#define INT64_C(x) (x ## LL)
//#define UINT64_C(x) (x ## ULL)
#include <libavutil\opt.h>
#include <libavutil/mathematics.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libswresample/swresample.h>
#include <libavutil/imgutils.h>
#include <libavcodec/avcodec.h>
}
I'm aware that the header includes source code from the FFmpeg libraries which doesn't come with the plugin I'm trying to compile. So I downloaded the FFmpeg source code from their GitHub page and copied all the code files (with its original folder structure) inside the plugin's project folder.
However when I then try to compile the plugin, it still doesn't find the #includes an shows the same error as mentioned above.
How I can I get the plugin to compile? What am I missing?
Thanks in advance
P.S.: I'm using Visual Studio Community 2017 with C++ support and Win 10 SDK as well as Win 8.1 SDK.

ESP8266WebServer.h, "functional: No such file or directory"

I tried to install library ESP8266WebServer into platformio IDE.
I got this error "functional: No such file or directory". A bit of research of "functional", http://www.cplusplus.com/reference/functional/
In file included from configMode.cpp:13:0:
.pioenvs/uno/ESP8266WebServer/ESP8266WebServer.h:27:22: fatal error: functional: No such file or directory
#include <functional>
^
compilation terminated.
In my case the very same error happened when I was trying to
#include <ESP8266WebServer.h>
in a .c file.
It should be .cpp in order to compile without errors.
I had this problem, but realised I had the wrong board set in the Arduino IDE. If you haven't installed the Arduino core for ESP8266 (https://github.com/esp8266/Arduino#installing-with-boards-manager) do so, then select the correct board from the Arduino IDE Tools menu.
I now have other compiler errors though.