I have a error with my nodemcu wifi module

Fix esptool.py PermissionError(13) NodeMCU upload error

#include <ESP8266WiFi.h>
#include <WebSocketsServer.h>
#include <WiFiClient.h>`Use code tags to format code for the forum`

const char* ssid = "xx";  
const char* password = "xx";  

WebSocketsServer webSocket(81);  

void setup() {
  Serial.begin(115200);  // Communication with Arduino
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
  }
  webSocket.begin();
  webSocket.onEvent(webSocketEvent);
}

void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) {
  if (type == WStype_TEXT) {
    Serial.println((char*)payload);  // Send data to Arduino
  }
}

void loop() {
  webSocket.loop();
}

basically its a nodemcu that sends a signal to arduino which sends a signal to motor drive which sends a signal to motor to move

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

Please post your sketch, using code tags when you do

Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination

In my experience the easiest way to tidy up the code and add the code tags is as follows

Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

It is also helpful to post error messages in code tags as it makes it easier to scroll through them and copy them for examination

Sounds to me like the error is nothing to do with your NodeMCU or your code.

Have you tried uploading the blink sketch to the NodeMCU? I expect you will get the same error.

Can you upload the blink sketch to another type of Arduino, like a Uno/Nano?

If you can't upload blink sketch to the NodeMCU but you can upload it to other Arduino, I think the problem could be the installation of your ESP8266 boards package. Maybe try uninstalling and reinstalling that.

Is there a particular reason the 8266 has to talk to an Arduino? You could do it all on the 8266 or the Arduino if it is an Arduino with WiFi.

its a arduino uno idk if it has wifi also I want to make a wifi rc car

got the same error

UNO has NO WiFi, ESP8266 does. You don't need the UNO.
Your error is a permissions error, nothing to do with programming an esp8266 or UNO.
What platform are you using, Win, Mac, Unix?

Uno R4 WiFi does.

Please try to be less terse and ambiguous in your replies. Do you mean you got the same error uploading the blink sketch to the ESP8266 or uploading blink sketch to the Uno?

If you meant the ESP failed to upload with same error, were you able to upload blink sketch to Uno or did that also give an error?

Oops, I have yet to memorize that there is a new UNO in town and he is sporting WiFi.

But we don't know if that is what @robotmaker6000 has because they have been stingy with important details. Hopefully @robotmaker6000's next post will give more details and the forum will be able to help.

All true, and does anyone see a need for two boards, either he has failed to tell us important facts or he is missing important concepts of how to do what he wants.

There may be some confusion about that because I suggested to test uploading to another board, like Uno, to understand more about the problem.

But @robotmaker6000 did mention using both Arduino and ESP in the original post, and I agree that is probably not an optimal solution.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.