Go Down

Topic: Arduino uno programming over OTA with ESP8266 (Read 6775 times) previous topic - next topic

Juraj

Ok thanks, the other connections are right ? 
if the WiFiLink library works, then they must be OK
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Itsch

when i try upload ota to the arduino it comes "Error flashing the sketch"

Juraj

when i try upload ota to the arduino it comes "Error flashing the sketch"
try to disconnect the Arduino from USB. use external power or a charging USB cable without data lines
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Itsch


Juraj

#139
Jun 22, 2019, 03:15 pm Last Edit: Jun 22, 2019, 03:17 pm by Juraj
its the same Problem
sorry my error. I read the previous page now. You wired the esp to pins 6 and 7 of Arduino. Wire the Arduino to esp8266 RX to TX. the bootloader doesn't listen on SoftwareSerial pins
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Itsch

Arduino- nodemcu

RX-TX
TX-RX    ?

ore what you mean ?

Juraj

Arduino- nodemcu

RX-TX
TX-RX    ?

ore what you mean ?
yes. the esp sends the hex file over bootloader same way as avrdude
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Itsch

ok but then i must change this in the sketch ?

Juraj

ok but then i must change this in the sketch ?
for flashing not. but for WiFiLink library yes. so change it in sketch and upload it OTA :-)
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Itsch

hmm ota upload does not work the same problem "Error flashing the sketch"
or must i upload a ArduinoOTA library? or for what is this?

Juraj

hmm ota upload does not work the same problem "Error flashing the sketch"
or must i upload a ArduinoOTA library? or for what is this?
no. it has nothing to with ArduinoOTA library.

does the WiFILink library work now over the hardware Serial? try the WebServer example but change the port to 8080. port 80 would stop the WebPanel and OTA web server in firmware
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Itsch

i change
SoftwareSerial Serial1(6, 7); // RX, TX
to
SoftwareSerial Serial1(TX, RX); // RX, TX  ?

Juraj

i change
SoftwareSerial Serial1(6, 7); // RX, TX
to
SoftwareSerial Serial1(TX, RX); // RX, TX  ?
no, please

remove SoftwareSerial and change Serial1 to Serial
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Itsch


Juraj

Code: [Select]
#include <WiFiLink.h>

WiFiServer server(8080); // will stop the Web Panel web server at port 80

void setup() {
  Serial.begin(115200); // speed must match with BAUDRATE_COMMUNICATION setting in firmware config.h
  WiFi.init(&Serial);
  delay(3000); //wait while WiFiLink firmware connects to WiFi with Web Panel settings

  while (WiFi.status() != WL_CONNECTED) {
    delay(10);
  }

  server.begin();
}


void loop() {
  WiFiClient client = server.available();
  if (client) {
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println("Refresh: 5");  // refresh the page automatically every 5 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          // output the value of each analog input pin
          for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
            int sensorReading = analogRead(analogChannel);
            client.print("analog input ");
            client.print(analogChannel);
            client.print(" is ");
            client.print(sensorReading);
            client.println("<br />");
          }
          client.println("</html>");
          break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        }
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);

    // close the connection:
    client.stop();
  }
}



You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Go Up