Well, after a few work, i have decided to leave the last idea and try another theory:
Arduino IDE:Program your sketch and then verify/compile it. A .hex file will be created in temporary directory.
Python:Run a Python script that listens to a specific port. Then the script redirects the data from one client socket to the other and viceversa.
avrdude:Execute avrdude to program arduino with -P net:<ip>:<port of python script>
Arduino hardware:A transistor will communicate the reset pin to GND when the pin 12 is high. (a direct connection should not work due to AVR configures pins as LOW after a reset and it always should be resetting)
Arduino sketchDo normal stuff. When serial has data and a magic packet is received:
Configure the module to the correct BAUD (depending your microcontroller, you can see
upload.speed parameter in boards.txt):
AT+CIOBAUD=<board baud>
Reconfigure serial port with Serial.begin. Connect in "data mode":
AT+CIPMUX=0
AT+CIPMODE=1
AT+CIPSTART="TCP",<ip>,<port of python script>
AT+CIPSEND
Finally set pin 12 to HIGH to reset Arduino.
ExplanationFirst you run the python script. This is the source code:
http://pastebin.com/abfnBQe2Then you run avr-dude to connect to the python script (something like
avrdude -p atmega328p -c arduino -P net:<ip>:<port> -U firmware.hex)
When magic packet is received by serial (or any other event), the Arduino configures the wi07c with the correct baud of the board (i.e: Arduino UNO is 115200), then a direct connection is established to the server with the running python script . Finally the transistor join reset pin with GND and a reset is performed.
At this point, both connections act as a tunnel between arduino bootloader and avrdude with pure data (The STK500 protocol).
With this you don't need to modify the original Arduino bootloader. However you will need the ESP8266 updated to the last firmware to change baud.
This afternoon I will test it and I will say you if it works.