Were you able to make the esp flash the Arduino mega? I'm going at it for some time now and the only thing missing is the FLASHING process.
Can some one help?
Thank you so much
Ronen
"Share the Knowledge"
Were you able to make the esp flash the Arduino mega? I'm going at it for some time now and the only thing missing is the FLASHING process.
Can some one help?
Thank you so much
Ronen
"Share the Knowledge"
amnon18:
Were you able to make the esp flash the Arduino mega? I'm going at it for some time now and the only thing missing is the FLASHING process.Can some one help?
Thank you so much
Ronen
"Share the Knowledge"
Thanks Juraj.
But this doesn't seem to work for me.
Here is what I have:
Hardware:
Arduino Mega
LOLIN (Wemos ) D1 mini pro
Connections:
Arduino mega TX to Wemos RX (Via voltage divider)
Arduino mega RX to Wemos TX
Arduino mega RESET to Wemos PIN 2
I'm able to connect to my WEB SERVER and get the file TEST.HEX and to store it on SPIFFS as a file and to read it and to show it on the serial console.
Now.... I'm using Github Rene-win/esp_avr_programmer and I see that the Arduino goes into programming mode but just stops there.
The TX/RX lights never flash when the Wemos is programming so my guess is that the programming never occurs.
I've spent 100s of hours on this in the last 2.5 years and if you can help me it will be much appreciated.
Thank you in advance,
Ronen Tadmor
"Share the Knowledge"
amnon18:
Thanks Juraj.But this doesn't seem to work for me.
Here is what I have:
Hardware:
Arduino Mega
LOLIN (Wemos ) D1 mini proConnections:
Arduino mega TX to Wemos RX (Via voltage divider)
Arduino mega RX to Wemos TX
Arduino mega RESET to Wemos PIN 2I'm able to connect to my WEB SERVER and get the file TEST.HEX and to store it on SPIFFS as a file and to read it and to show it on the serial console.
Now.... I'm using Github Rene-win/esp_avr_programmer and I see that the Arduino goes into programming mode but just stops there.
The TX/RX lights never flash when the Wemos is programming so my guess is that the programming never occurs.
I've spent 100s of hours on this in the last 2.5 years and if you can help me it will be much appreciated.
Thank you in advance,
Ronen Tadmor
"Share the Knowledge"
ground is wired?
the code is too simple to be for Uno and Mega (or even work in all cases)
what is your goal? the Wemos should only be there to flash the Mega?
Juraj,
It is the same groud for sure.
What do you mean to simple to work in all cases?
My Goal: I've built a machine that is controlled by an ARDUINO MEGA and everything is working good. But if I have to do an update of the firmware on the Arduino I have to drive around the city.
I'm using the Wemos as the Wifi gateway to record information coming from every Arduino every 20 seconds into a DB on a web server. and I can also control the Arduino remotely from My computer at home through a web interface. So as you can see all the communications are working good. I have no problems what so ever with the Arduino and the Wemos talking to each other.
Now, as for the remote update, this is a completely different beast.
I thought maybe it needs the BIN file and not the HEX file at a moment.
I'm almost at the end of the venture and I can't get a grap on it.
Any ideas.....
Thank you
Ronen Tadmor
"Share the Knowledge"
there are libraries to flash Uno over Serial, but they don't work for Mega. I don't know why.
some ideas:
you could use SD card and SD bootloader. download update bin to file on SD and reset.
or if half of the flash is free, you can use my ArduinoOTA library with the required bootloader. fill the InternalStorage with downloaded data and call apply()
I remembered that avrdude can flash over telnet
I tested it and it worked at first attempt
#include <ESP8266WiFi.h>
const int TARGET_RESET_PIN = 12;
WiFiServer telnetServer(23);
void setup() {
Serial.begin(115200);
if (!WiFi.waitForConnectResult()) {
Serial.println("WiFi not connected");
while (1) {
delay(1000);
}
}
telnetServer.begin();
}
void loop() {
WiFiClient telnetClient = telnetServer.available();
if (telnetClient) {
pinMode(TARGET_RESET_PIN, OUTPUT);
digitalWrite(TARGET_RESET_PIN, LOW);
delay(1);
pinMode(TARGET_RESET_PIN, INPUT); // let it to reset pin's pull-up
while (telnetClient.connected() || telnetClient.available()) {
while (telnetClient.available()) {
Serial.write(telnetClient.read());
}
while (Serial.available()) {
telnetClient.write(Serial.read());
}
}
}
}
I tested with Uno so take the avrdude command for USB upload to Mega and change port to net:
example:
avrdude -Cavrdude.conf -v -patmega328p -carduino -Pnet:192.168.1.102:23 -D -Uflash:w:Blink.ino.hex:i
@ Global Moderator
Don't understand the Hijack comment but I am sorry if I didn't respect the forum rules or offended anyone.
Regards,
Ronen
I'm using Windows 10 and when I run the AVRDUDE I get a message that Net is not Implemented yet.
Thank you so much for your help.
Ronen
amnon18:
@JurajI'm using Windows 10 and when I run the AVRDUDE I get a message that Net is not Implemented yet.
Thank you so much for your help.
Ronen
what AVR boards package do you use? there could be two avrdude installed on your computer. one with IDE installation and one in C:\Users<login>\AppData\Local\Arduino15\packages\arduino\tools\avrdude
amnon18:
@JurajI'm using Windows 10 and when I run the AVRDUDE I get a message that Net is not Implemented yet.
Thank you so much for your help.
Ronen
sorry, the Windows version of avrdude doesn't support network upload