0

I'm trying to use an ESP8266 Node MCU 1.0 (ESP-12E Module) as an ISP to program an Arduino Mega2560 over Wifi with no USB cable. (USB connected to ESP8266 module just for power).

I used the sketch 'Arduino_Wifi_AVRISP' from the Arduino IDE and modified the STASSID & STAPSK to match my wifi settings.

I followed the procedure found in this other post and was able to program the ESP8266 with success: ESP8266 as ISP program for ATMega16

However, when I run the command line:

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -c stk500v2 -p m2560 -P net:192.168.1.246:328 -Uflash:w:C:\Users\dom\AppData\Local\Temp\arduino_build_199262/blink.ino.hex:i

I get the following response:

avrdude: Version 6.3-20171130
     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
     Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

     Using Port                    : net:192.168.1.246:328
     Using Programmer              : arduino
avrdude: ser_drain(): read error: The parameter is incorrect.

avrdude: ser_drain(): read error: The parameter is incorrect.

avrdude: ser_drain(): read error: The parameter is incorrect.

     AVR Part                      : ATmega2560
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PA0
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
       flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : Arduino
     Description     : Arduino

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
     Hardware Version: 4744608
     Firmware Version: 0.2
     Topcard         : STK502
     Vtarget         : 1.8 V
     Varef           : 0.0 V
     Oscillator      : Off
     SCK period      : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
     Double check connections and try again, or use -F to override
     this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done.  Thank you.

Everything is connected as it is in the post previously mentioned. What could be causing me to get this issue?

Does it not use the "arduino" protocol for Arduino Mega2560? Are the 3.3v pins just not sufficient to program the 5v Arduino?

As I mentioned, I'm only using USB to power the the ESP8266, not the Arduino so I don't damage the ESP pins.

Thank you.

  • see the avrdude command used by IDE (in the console). – Juraj Feb 5 at 9:29
  • When I compile the sketch I want to upload i get this avr command in the Arduino IDE console: "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega2560 -cwiring -PCOM4 -b115200 -D -Uflash:w:C:\Users\dom\AppData\Local\Temp\arduino_build_742925/blink.ino.hex:i – Dom Feb 5 at 23:03
  • So i turned it into this to be able to program the Mega2560 thru the ESP8266 via Wifi over the CMD prompt: "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega2560 -cwiring -P net:192.168.1.246:328 -D -Uflash:w:C:\Users\dom\AppData\Local\Temp\arduino_build_742925/blink.ino.hex:i – Dom Feb 5 at 23:03
  • And it returned this now: Using Port : net:192.168.1.246:328 Using Programmer : wiring avrdude: ser_drain(): read error: The parameter is incorrect. avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_getsync(): timeout communicating with programmer – Dom Feb 5 at 23:04
  • now I remembered. the "Arduino as ISP" has only stk500v1 protocol and avrdude uses stk500v2 "wiring" configuration for Mega. – Juraj Feb 6 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.