So I was trying to get this to work using Little Fs because it would not work as printed in your publication and I was using VS/Platform Io ,I had to us LittleFs instead of what you had. After figuring out all the code changes I en up with this final error. I have tried to load it to my 8266 12E and it would not connect, tried toehold the reset button while it connects and same issue.Not sure if its just I need toehold it longer or there is another issue.
#include <Arduino.h>
#include <LittleFS.h>
void setup() {
// put your setup code here, to run once:
Serial.begin (115200);
if (LittleFS.begin()){
Serial.println(“An error has occuredwhile mounting SPIFFS”);
return;
}
Filefile= LittleFS.open(“/test example.txt”, “r”);
if (file){
Serial.println(“Failed to open file for reading”);
return;
}
Serial.println();
Serial.println(“File Content:”);
while (file.available()){;
Serial.write(file.read());
}
file.close();
}
void loop() {
// put your main code here, to run repeatedly:
}
esptool.py v3.0
Serial port /dev/cu.Bluetooth-Incoming-Port
Connecting…….._____….._____….._____….._____….._____….._____….._____
A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
*** [upload] Error 2
Hi.
What project exactly are you referring to?
That error is because the board is not in flashing mode (maybe you need to hold the boot button longer), or the serial connection is not properly established (bad USB cable, wrong COM port, etc.).
Regards,
Sara
Will investigate further, loads just fine in Arduino Ide , now when I use my MacBook it has an issue. Don’t know how to verifi port being used when using PlatformIO
Will investigate further, loads just fine in Arduino Ide , now when I use my MacBook it has an issue. Don’t know how to verifi port being used when using PlatformIO
VS Code should detect the com port automatically. Unless you have multiple boards connected to your computer, it might get confused.
You can also select the COM port manually. Go to the PIO Home (house icon on the bottom bar), then select DEvices at the left sidebar.
If you have a message as shown below:PlatformIO automatically detects upload port by default. You can configure a custom port using upload_port
option in platformio.ini.
Follow the “More Details” link and see if you can get useful information to troubleshoot whats going on with the ports.
Can you upload code to the board using Arduino IDE on your MacBook?
Regards,
Sara
/dev/cu.Bluetooth-Incoming-Port
n/a
n/a
Don’t have it on my Mac but will get it and try it.
It really seems an issue with the port.
Maybe you don’t have the CH340 or CP2101 drivers installed.
Regards,
Sara
I gave up and just used Arduino IDE on Windows 10 pro , it just wasn’t worth it anymore. I have in the past used this same board on my MacBook and was able to load example blink on it so I am at a loss . I may just do a fresh install of VS platform IO and try again. I have been trying to figure out how to delete a project in this Mac using platform but unable to do that and may have done something to the main program.
I have been on the net trying to see how to delete a project I. Platform IO but so far not able to do that so my installation looks messy. In Windows I pick the project and then remove works but on my Mac , I don’t see that option. My guess is I I may have done something to the program but doubtful. When I picked the project and went to the pull down menu, remove work space isn’t there.
I’m sorry. But I don’t think I can help here.
I usually use Windows. Maybe the installation on MAC OS is slightly different?
If you share a screenshot of your menu, maybe I can try to figure our what’s wrong with it…
Regards,
Sara
Sorry , don’t know how to do that in Mac shift command 4 to copy a section but couldn’t get it to attach .Maybe I should just stick to Arduino id for now, thanks
Ok.
I’ll mark this issue as resolved for now. If you need further help, you just need to open a new question in our forum.
Regards,
Sara