ok I see that I should add an example in ArduinoOTA for the WiFiEspAT library
#include <WiFiEspAT.h>
#include <ArduinoOTA.h>
void setup() {
//Initialize serial:
Serial.begin(9600);
Serial1.begin(115200);
WiFi.init(Serial1);
if (WiFi.status() == WL_NO_MODULE) {
Serial.println();
Serial.println("Communication with WiFi module failed!");
// don't continue
while (true);
}
// waiting for connection to Wifi network set with the SetupWiFiConnection sketch
Serial.println("Waiting for connection to WiFi");
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print('.');
}
Serial.println();
Serial.println("Connected to WiFi network.");
// start the WiFi OTA library with internal (flash) based storage
ArduinoOTA.begin(WiFi.localIP(), "Arduino", "password", InternalStorage);
// you're connected now, so print out the status:
printWifiStatus();
}
void loop() {
// check for WiFi OTA updates
ArduinoOTA.poll();
// add your normal loop code below ...
}
void printWifiStatus() {
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your WiFi shield's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
}
if (WiFi.status() == WL_NO_MODULE) {
Serial.println();
Serial.println("Communication with WiFi module failed!");
// don't continue
while (true);
}
// waiting for connection to Wifi network set with the SetupWiFiConnection sketch
Serial.println("Waiting for connection to WiFi");
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print('.');
}
Serial.println();
Serial.println("Connected to WiFi network.");
// start the WiFi OTA library with internal (flash) based storage
ArduinoOTA.begin(WiFi.localIP(), "Arduino", "password", InternalStorage);
// you're connected now, so print out the status:
printWifiStatus();
}
void loop() {
// check for WiFi OTA updates
ArduinoOTA.poll();
// add your normal loop code below ...
}
void printWifiStatus() {
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your WiFi shield's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
}
Thank you very much for this.
After uploading this the last thing remain is password.
arduino says uploading but got this error after that
i also flashed megacode of optiboot and still got this error
processing.app.debug.RunnerException
at cc.arduino.packages.uploaders.SSHUploader.uploadUsingPreferences(SSHUploader.java:150)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$UploadHandler.run(Editor.java:2075)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.jcraft.jsch.JSchException: java.net.ConnectException: Connection timed out: connect
at com.jcraft.jsch.Util.createSocket(Util.java:389)
at com.jcraft.jsch.Session.connect(Session.java:215)
at cc.arduino.packages.uploaders.SSHUploader.uploadUsingPreferences(SSHUploader.java:122)
... 5 more
After uploading this the last thing remain is password.
Can you please provide password?
it is the third parameter in begin()
now "password"
if you use my my_boards definitions for Mega with modified Optiboot, then password is not parametrized in platform.txt. there is -password password in tools.avrdude.upload.network_pattern. you can change it to "{network.password}" to use the password entered in IDE
Juraj:
it is the third parameter in begin()
now "password"
if you use my my_boards definitions for Mega with modified Optiboot, then password is not parametrized in platform.txt. there is -password password in tools.avrdude.upload.network_pattern. you can change it to "{network.password}" to use the password entered in IDE
Kashyapkoshti:
Can you suggest it for windows 10 because i cannot see hardware folder on documents of arduino. There is only libraries folder.
Do you know about error in comment#45 ?
What should I do after this?
you can create the hardware folder in Arduino folder
With Arduino IDE (I use Eclipse Sloeber) rename the platform.txt from my_boards to platform.local.txt and copy it next to platform.txt in the official board package to have the right upload command and not ssh
Juraj:
you can create the hardware folder in Arduino folder
With Arduino IDE (I use Eclipse Sloeber) rename the platform.txt from my_boards to platform.local.txt and copy it next to platform.txt in the official board package to have the right upload command and not ssh
I copied platform.local.txt in C:\Program Files (x86)\Arduino\hardware\arduino\avr but after that still got this error and when i first time try to connect to the network port it askes for password, i typed "password" says "unable to connact, wrong password?".
Kashyapkoshti:
I copied platform.local.txt in C:\Program Files (x86)\Arduino\hardware\arduino\avr but after that still got this error and when i first time try to connect to the network port it askes for password, i typed "password" says "unable to connact, wrong password?".
thanks for your support
did you restart the IDE after placing platform.local.txt?
check %userprofile%\AppData\Local\Arduino15\packages\arduino\hardware\avr\ . The AVR package in use could be there
where should i connect reset pin of arduino mega to esp01?
in my pc at \AppData\Local\Arduino15\packages i cannot find arduino folder. i see esp8266 folder
I installed from official installler and in C: drive of pc
still getting ssh uploader error