You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm using PlatformIO in its latest version.
I have now updated to use the Arduino 2.5.1 core to use ESP8266 12-F and now my code does not compile anymore!
Accuses error in FS.
I do not understand why. It worked before updating.
I can not find the problem.
Can someone help me?
FS::File never had a File::write(char) method, but it did have a File::write(uint8_t) method. Print(the superclass of File) never supported Print::write(char).
So in the old versions you were getting silent conversions of char->uint8_t (I think you'll get a warning if you go strict enough).
Now, since your call doesn't match any exactly, it is using the template which is for writing Stream children, only.
FS::File never had a File::write(char) method, but it did have a File::write(uint8_t) method. Print(the superclass of File) never supported Print::write(char).
So in the old versions you were getting silent conversions of char->uint8_t (I think you'll get a warning if you go strict enough).
Now, since your call doesn't match any exactly, it is using the template which is for writing Stream children, only.
Got it, so if I switch char to uint8_t it should work the same, right?
I'll try.
FS::File never had a File::write(char) method, but it did have a File::write(uint8_t) method. Print(the superclass of File) never supported Print::write(char).
So in the old versions you were getting silent conversions of char->uint8_t (I think you'll get a warning if you go strict enough).
Now, since your call doesn't match any exactly, it is using the template which is for writing Stream children, only.
Activity
lucasromeiro commentedon May 15, 2019
core 2.4.2 work fine:
platform = espressif8266@1.8.0
core 2.5.1 don't work:
platform = espressif8266
why??
ivankravets commentedon May 15, 2019
See esp8266/Arduino#5525
@earlephilhower do you have any migrating guide?
earlephilhower commentedon May 15, 2019
There is no migration. They are compatible AFAIK and per many other users and the original SD.h examples, even.
ivankravets commentedon May 15, 2019
@lucasromeiro could you share a simple project to reproduce this issue?
lucasromeiro commentedon May 15, 2019
Sure!
#include "Arduino.h"
#include <ESP8266WiFi.h>
#include <FS.h> //Biblioteca responsável por criar o Sistema de manipulação de arquivos
void setup() {
SPIFFS.begin(); //Inicializa sistema de arquivos
}
void loop() {
File carregaArquivos = SPIFFS.open("/log.txt", "a");
char charState = '1';
carregaArquivos.write(charState);
carregaArquivos.close();
}
earlephilhower commentedon May 15, 2019
fs::write takes a pointer and length, or a c-string, or a String, not a char.
lucasromeiro commentedon May 15, 2019
If I use String it also does not work!
String charState = "1";
lucasromeiro commentedon May 15, 2019
I do not understand why this worked in the previous version and now it does not work.
earlephilhower commentedon May 15, 2019
Actually, I think I see the issue.
FS::File never had a File::write(char) method, but it did have a File::write(uint8_t) method. Print(the superclass of File) never supported Print::write(char).
So in the old versions you were getting silent conversions of char->uint8_t (I think you'll get a warning if you go strict enough).
Now, since your call doesn't match any exactly, it is using the template which is for writing Stream children, only.
earlephilhower commentedon May 15, 2019
Try the change in esp8266/Arduino#6101 . I'm not sure if it will break anything else, but it re-enabled the usage.
lucasromeiro commentedon May 15, 2019
Got it, so if I switch char to uint8_t it should work the same, right?
I'll try.
lucasromeiro commentedon May 16, 2019
Its work!
uint8_t charState = '1';
Thanks!