Help Moving from a wired W5500 to a wifi ESP8266 #170
Replies: 29 comments 12 replies
-
does ArduinoOTA work for you over W5500 Ethernet? |
Beta Was this translation helpful? Give feedback.
-
Hi, Sorry, me again. I think I am missing some thing fundamental in what I am doing. My guess I have the pin's wired incorrectly. Currently I have pins 19/18 on my Mega wired to D1 and D3 on the Nodemcu If I use this code on the Mega:
and this on the nodemcu
I can see NODEMCU being displayed via the IDE Serial monitor on the nodemcu. I've flashed the node mcu with the 1.7 firmware and the 1.5.4 that come with it. However when I run your CheckFirmware sketch from WiFiEspAT/Tools section in IDE Examples menu. It does ends with "Communication with WiFi module failed!". I've check my wiring and As the above example works. I'm slightly as a loss. My guess is I'm connected to the wrong pins on the Nodemcu. DO you know which ones I should use? Thanks again for your patience. Adam |
Beta Was this translation helpful? Give feedback.
-
if OTA worked with Ethernet, you have the right Optiboot. |
Beta Was this translation helpful? Give feedback.
-
Using your chanegserial sketch I can successfully change the baud rate of the nodemcu. Using the serial monitor on the Arduino IDE I can successfully send and AT command on the new baud rate and receive an OK. The mega on the other hand seems not to be able to do so. All i get is wifi module not found on the mega serial output and garbage on the node mcu out put. Only a 112500 baud rate seems to work from the mega to the node mcu. SO I'm still stuck with the same error message as above. At the bottom is the full output. Is there any debugging you can suggest to see where it is going wrong? If I have the wrong ip/password then I see those messages it's just this last section. I thought I would look back at your wifilink firm ware to try, but I see it is only set to upload for the mega328 rather than the 2560 I have. If I can't get this working in the next couple of days I'm going to go back to the ws5500 and a wired connection. Thank you so much for your help. output: Using board 'mega' from platform in folder: C:\Users\Adam\Documents\Arduino\hardware\my_boards\avr Using library WiFiEspAT at version 1.4.1 in folder: C:\Users\Adam\Documents\Arduino\libraries\WiFiEspAT |
Beta Was this translation helpful? Give feedback.
-
first the WiFiEspAT library must work. as I understand it works for your setup if baud rate is 115200. the WiFiClient example shows the Arduino logo? |
Beta Was this translation helpful? Give feedback.
-
Right, after some messing about. I configured the nodemcu to accept incoming serial at 500000 and the mega to the same on serial1. i can set persistent settings from the Mega to the nodemcu and the Serial Monitor on the Mega confirms this. Using SerialWiFiOTA.ino as I base, I initially flash this to the mega using usb so ArduinoOTA is polling. Flashing sketch ... done This looks good! However, the board resets, but the sketch is not actually updated. No leds blink. The config seems correct as if I change the Ip it fails, if I remove the ArduinoOTA.poll the upload fails. I'm soooo close. Any ideas on this one? |
Beta Was this translation helpful? Give feedback.
-
It looks like this, but I've sure I have the right version: For AVR InternalStorage upload the final loading is done by the Optiboot with copy_flash_pages function. Optiboot 8 without copy_flash_pages will successfully store the binary to upper half of the flash but will not copy it to run location in flash. will reflash optiboot and see.... |
Beta Was this translation helpful? Give feedback.
-
then I'm a bit stuck as to what to do next... Any ideas? It looks like it is all working but the sketch doesn't change. |
Beta Was this translation helpful? Give feedback.
-
It doesn't work when the nodemcu is powered from the usb, 3.3v or 5v. same message but the sketch doesn't actually change: "C:\Users\Adam\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0/bin/arduinoOTA" -address 192.168.1.184 -port 65280 -username arduino -password password -sketch "C:\Users\Adam\AppData\Local\Temp\arduino-sketch-5C58B9C990AF9DEAA1EB6654FC941CFE/OTATEST.ino.bin" -upload /sketch -b |
Beta Was this translation helpful? Give feedback.
-
I think I had that problem too sometimes so I try to investigate it on weekend. |
Beta Was this translation helpful? Give feedback.
-
Thank you. |
Beta Was this translation helpful? Give feedback.
-
I am at a bit of a loss for words. If I run the ArdinoOTA.exe from the command line the sketch is actually updated!?!?!? I get the same messages as when it runs it from Arduino IDE though, with Connecting to board etc... Command line: C:\Users\Adam\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0\bin>arduinoOTA -address 192.168.1.183 -port 65280 -username arduino -password password -sketch "C:\Users\Adam\AppData\Local\Temp\arduino-sketch-601F0C58A8B848D0890BFD4053A8DD4F/SerialWiFiOTA_Hello.ino.bin" -upload /sketch -b C:\Users\Adam\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0\bin> Last lines of the Output from IDE: "C:\Users\Adam\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0/bin/arduinoOTA" -address 192.168.1.183 -port 65280 -username arduino -password password -sketch "C:\Users\Adam\AppData\Local\Temp\arduino-sketch-601F0C58A8B848D0890BFD4053A8DD4F/SerialWiFiOTA_Hello.ino.bin" -upload /sketch -b As far as I can see it's exactly the same... Not sure if this helps at all, I suppose it could be an IDE 2.0 issue. This is the version I am running: Version: 2.0.0 Copyright © 2022 Arduino SA On Windows 10: OS Name Microsoft Windows 10 Enterprise Again, thank you for all of your help, |
Beta Was this translation helpful? Give feedback.
-
Hi Juraj, I hope you are well. I was just wondering if during your own investigations you have found out what the issue I'm seeing is or related to. Kind Regards, Adam |
Beta Was this translation helpful? Give feedback.
-
Hi Juraj, I'm still having major problems flashing my Arduino Mega OTA. Some times it works, some times it reports that it works, but doesn't. IDE 1.8.9 or using the command line works more often but not with any regularity. I borrowed an UNO and using you WIFILink library (The mDNS only seems to work with v2.4.2 or 3.x of the ESP8266 libraries) with the MCU_OTA turned on I can get this to upload sketches OTA. though it reports as the reset failing, it does actually reset and the sketch it updated. I was thinking of using your WIFILink firmware with SPI turned on and trying to flash my mega OTA that way. Is that going towork or should I use a different set of libraries? Thank you again for your patience. Adam |
Beta Was this translation helpful? Give feedback.
-
cool, thanks. WIll Try! I'm kinda tempted to mail you my Mega and the nodemcu with the code and see if you can get it working. :-) |
Beta Was this translation helpful? Give feedback.
-
Hi, I've tried 960, 57600, 115200, 230400 and 500000. It's much of a muchness, 500000 did seem to give me the best results but not by much. |
Beta Was this translation helpful? Give feedback.
-
I found my problem with OTA upload to my test setup with Mega. It was related to Eclipse Sloeber IDE I use. If I had Serial Monitor connected, the IDE reset the Mega after the upload tool finished. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have the avrdude telnet sketch uploaded to my nodemcu. I can telnet to it and have the characters I type in telnet printed in the serial monitor or the mcu. I have set the serial baud rate of the nodemcu to 115200 as I understand this is the default sketch upload speed of a MEGA. I have D1 (GPIO5) of the nodemcu connected to the reset pin of the MEGA. The mega is powered through the barrel connector and the nodemcu from the 5v/grd of the mega. No IDE is involved. I get these messages: avrdude: stk500_recv(): programmer is not responding if I connect the serial monitor and USB cable to the MEGA I can see these messages appear 0 0 0 0 0 0 0 Am I missing some thing blindingly obvious or am I just destined to go back to the w5500 as so far that's the only way I seem to be able to connect OTA. I even tried a bluetooth module and setting it up as a comm port but I seem to have bought a fake one so that doesn't work either... |
Beta Was this translation helpful? Give feedback.
-
did you try ArduinoOTA library upload with Serial Monitor closed? for the telnet upload, can you paste here the command executed and complete output of avrdude? |
Beta Was this translation helpful? Give feedback.
-
Yes, that seems to make no difference. Will send the telnet command and output a bit later today. |
Beta Was this translation helpful? Give feedback.
-
how large is you bin file? was the esp8266 powered separately for the ArduinoOTA test too? |
Beta Was this translation helpful? Give feedback.
-
Sketch uses 48642 bytes (18%) of program storage space. Maximum is 261120 bytes. - out put from IDE and, yes the esp8266 was powered separately for the ArduinoOTA test too. |
Beta Was this translation helpful? Give feedback.
-
C:\Users\Adam\Documents\Arduino\japan>avrdude -Cavrdude.conf -v -patmega328p -carduino -Pnet:192.168.1.184:23 -D -Uflash:w:Blink.ino.hex:i avrdude: Version 6.3.1.1-windows-netfix
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you. |
Beta Was this translation helpful? Give feedback.
-
I think there is some thing up with my Mega's reset pin. I've been trying to use a HC-05 to upload code, I have an led set when the pin is pulled to low, I can see the led drop and return but only half the time does the upload start. With the avrdude telnet I can see the reset pin pulled low but it never seems to enter the upload mode... I've also tried setting the baud to 250000 for the serial arduinoOTA from the nodemcu to my mega and that is flakey too. sometime works, sometimes doesn't. |
Beta Was this translation helpful? Give feedback.
-
so now I tested with my 90 kB sketch binary of Regulator project. I have Mega with Wemos D1 mini on Serial1. It worked. |
Beta Was this translation helpful? Give feedback.
-
Hi Juraj, Thank you for testing and your help. I have a HC-05 connected that (finally) consistently works uploading sketches. Though I've had to use different resistors in the reset circuit compared to those I've found in the tutorial. So for the moment I'm going to use that to upload to the Mega in my project. For my next project I have an UNO and I can upload to that via a nodemcu using your WifiLink library. Will see if I can get telnet upload working on that when I have some more time. Again, thank you for all your help and for building these libraries that we can use! |
Beta Was this translation helpful? Give feedback.
-
the upload to Uno with WiFiLink firmware doesn't require the WiFiLink library. you could use EspLink firmware on which the WiFiLink firmware is based |
Beta Was this translation helpful? Give feedback.
-
does your sketch use Watchdog? |
Beta Was this translation helpful? Give feedback.
-
No, it doesn't. |
Beta Was this translation helpful? Give feedback.
-
Hi Juraj,
Thank you so much, this is a brilliant library. I have been able to send sketches to my Arduino (Mega) from another room!
I am moving and will no longer have a wired connection near my Arduino, however, a friend has kindly given me a LoLin NodeMCU v3 ESP8266 wifi board.
I has been a while since I set up the wired connection and I'm looking for help in how to move from uploading via the w5500 to the ESP8266.
I have a Arduino Mega 2560. I used an USBASP programmer to flash the Mega with the Optiboot bootloader, and updated my programmer boards file as per you instructions. So now I select upload using programmer and hey presto my arduino is re-sketched.
I am currently using the Ethernet.h library for the w5500.
A couple of questions, which library do you suggest using for the ESP8266 and do I need to use the USBASP to reflash in the mega in any way or can I just alter my sketch adding the wifi library and SSID/password, flash it using the ethernet, then disconect and add teh esp8266.
My appologies if this is a little vague, as I said it had been a while since I set it up originally.
Thank you again for this amazing piece of work!
Adam
Beta Was this translation helpful? Give feedback.
All reactions