[Solved] Arduino.org Uno WiFi board with Firmware 1.0.0 and WiFiLink.h Librairies

Tracked by https://github.com/blynkkk/blynk-library/issues/353

Hi dear,
i have tried to follow your procedure,

but what is the correct espRecovery sketch?

is this:

/*
 * EspRecovery.ino
 *
 * This example works as a serial bridge between microntroller and wifi module
 * (esp8266). It's very useful when upload firmware updates to the wifi module.
 * It must be used only on boards where the connection between micontroller and
 * wifi module is over serial, not spi.
 *
 * Note: this is a port of EspRecovery of the Arduino Uno WiFi Dev Ed Library.
 *
 * Circuit:
 * - Arduino STAR OTTO or Uno WiFi Developer Edition
 *
 * Modified 15 March 2017 by Andrea CannistrĂĄ and Sergio Tomasello
 *
 */

 /*
  Define Baud Rate between esp8266 and the microntroller
 */

#if defined(ARDUINO_STM32_STAR_OTTO) // Arduino STAR OTTO
#define BR 230400
#define Serial SerialUSB
#elif defined(ARDUINO_AVR_UNO_WIFI_DEV_ED) // Arduino UNO WiFi Developer Edition
#define BR 9600
#endif

#include <WiFiLink.h>

void setup()
{

  #if defined(ARDUINO_STM32_STAR_OTTO)
    pinMode(WIFI_PWR, OUTPUT);
    digitalWrite(WIFI_PWR, LOW);    //turn OFF ESP
    delay(100);
    digitalWrite(WIFI_PWR, HIGH);   //turn ON ESP
  #endif

  Serial.begin(BR);
  SerialWiFi.begin(BR);
}

void loop()
{

  while (Serial.available()) {
    char inChar = Serial.read();
    SerialWiFi.write(inChar);
  }

  while (SerialWiFi.available()) {
    char inChar = SerialWiFi.read();
    Serial.write(inChar);
  }

}

How can install your firmware 1.0.0? by the normal procedure i have not your version choice, and i can not upload it.

kind regards

Niki

hey, sorry for the delay, i’m in vacation.
Be sure you’re doing all command line with Administrator rigth.

Step 1 install Python
Step 2 install the Wifilink Library in arduino
Step 3 only this way

Burn the firmware using EspRecovery

This procedure is reccomended for all Operating System and it is usable only via Serial.

  1. First you must upload the EspRecovery sketch on your Arduino UNO WiFi:
  • Plug in the Arduino UNO WiFi to PC.
  • Open the Arduino.org IDE, you can download it here.
  • Select the correspondent port and board.
  • Upload the ESPRecovery sketch from File>Examples>Arduino UNO WiFI> Tools menu of Arduino IDE:
  1. Enter the board in bootloader mode:
  • Unplug the Arduino UNO WiFi.
  • Plug again the board to PC pressing the ESP B/L button.
  1. Open your terminal as Administrator.
  2. Download the ESPtool, you can download from here or you can use the command:
    sudo pip install esptool
    or pip install esptool in windows
  1. Test the esptool, for example, inserting the below command to read the MAC address:
  • python esptool.py -p your port -b baudrate read_mac
  • Set the baudrate at 9600.

For linux user, for example, the port will be /dev/ttyACM0:

 sudo python esptool.py -p /dev/ttyACM0 -b 9600  read_mac_

> For Mac user, for example, the port will be /dev/tty.usbmodem1411:

sudo python esptool.py -p /dev/tty.usbmodem1411 -b 9600 read_mac

For Windows user:

esptool.py -p COM30 -b 9600 read_mac

  1. If it will appear on terminal your MAC, then continue the procedure:

Connecting…
MAC: 18:fe:34:10:e2:85

> 7) Use this command to write the firmware but PAY ATTENTION to set the correct path and insert your correspondent port:

sudo python esptool.py -p /dev/ttyACM0 -b 9600 write_flash -ff 80m -fm qio -fs 32m 0x00000 20151223/boot_v1.4.bin_rep 0x1000 20151223/user1.bin 0x3FC000 20151223/esp_init_data_default.bin_rep 0x3FE000 20151223/blank.bin
For Windows user:
for example in case that the tools is in \Users\XXXX\Desktop\esptool\esptool\ folder and the COM is 30:

esptool.py -p COM30 -b 9600 write_flash -ff 80m -fm qio -fs 32m 0x00000 Windows example:
C:\Users\XXXX\Documents\Arduino\tools\ArduinoFirmwareWiFiLink\UnoWiFi\tool\bin\esptool-windows -p COM4: -b 9600 write_flash -ff 80m -fm qio -fs 32m 0x000000 C:\Users\XXXX\Documents\Arduino\tools\ArduinoFirmwareWiFiLink\ArduinoFirmwareWiFiLink-UNO_WIFI_DEV_ED-1.0.0.bin 0x300000 C:\Users\XXXX\Documents\Arduino\tools\ArduinoFirmwareWiFiLink\ArduinoFirmwareWiFiLink-WEB_PANEL-1.0.0.bin
8) Wait some minutes that the process ends.

:wink:

1 Like

Thank you for your explanation. I have no experience with MacOSX but its the only computer I have for now, so I have this problem:

I installed Python, I open terminal, I download EspTool over PIP but when I try to run its, it doesn’t find it. I get this error:

Gonzalos-MacBook-Pro:~ espagnol01$ sudo python esptool.py -p /dev/cu.usbmodem1441 -b 9600 read_mac
python: can't open file 'esptool.py': [Errno 2] No such file or directory

But if I do sudo esptool.py -h I get this:

Gonzalos-MacBook-Pro:~ espagnol01$ sudo esptool.py -h
usage: esptool [-h] [--chip {auto,esp8266,esp32}] [--port PORT] [--baud BAUD]
               [--before {default_reset,no_reset}]
               [--after {hard_reset,soft_reset,no_reset}] [--no-stub]
               {load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,version}
               ...

esptool.py v2.0.1 - ESP8266 ROM Bootloader Utility

positional arguments:
  {load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,version}
                        Run esptool {command} -h for additional help
    load_ram            Download an image to RAM and execute
    dump_mem            Dump arbitrary memory to disk
    read_mem            Read arbitrary memory location
    write_mem           Read-modify-write to arbitrary memory location
    write_flash         Write a binary blob to flash
    run                 Run application code in flash
    image_info          Dump headers from an application image
    make_image          Create an application image from binary files
    elf2image           Create an application image from ELF file
    read_mac            Read MAC address from OTP ROM
    chip_id             Read Chip ID from OTP ROM
    flash_id            Read SPI flash manufacturer and device ID
    read_flash_status   Read SPI flash status register
    write_flash_status  Write SPI flash status register
    read_flash          Read SPI flash content
    verify_flash        Verify a binary blob against flash
    erase_flash         Perform Chip Erase on SPI flash
    erase_region        Erase a region of the flash
    version             Print esptool version

optional arguments:
  -h, --help            show this help message and exit
  --chip {auto,esp8266,esp32}, -c {auto,esp8266,esp32}
                        Target chip type
  --port PORT, -p PORT  Serial port device
  --baud BAUD, -b BAUD  Serial port baud rate used when flashing/reading
  --before {default_reset,no_reset}
                        What to do before connecting to the chip
  --after {hard_reset,soft_reset,no_reset}, -a {hard_reset,soft_reset,no_reset}
                        What to do after esptool.py is finished
  --no-stub             Disable launching the flasher stub, only talk to ROM
                        bootloader. Some features will not be available.

So I know its a silly/noob problem like im in the wrong directory or something but I would really appreciate your help. Thank you very much for your time.

@espagnol01 find esptool.py on your PC and run the command from that directory.

I fix it. I had to use for example:

sudo esptool.py -p /dev/cu.usbmodem1441 -b 9600 read_mac

instead of:

sudo python esptool.py -p /dev/cu.usbmodem1441 -b 9600 read_mac

I don´t know if its a version syntax related issue or what. Im a noob but it worked. Thanks!

1 Like

I manage to to all this and to update the firmware to the latest one (20161121). But now im having problems to set up the Blynk app. With hardware should I use? Thanks.

@espagnol01 I don’t have this hardware but as it’s an Uno (with an ESP shield) then you should select Uno in Blynk.

I have one quick question. When I run this command; “sudo esptool.py -p /dev/tty.usbmodem1441 -b 9600 read_mac”

I got this output:

esptool.py v2.0.1
Connecting.......
Detecting chip type... ESP8266
Chip is ESP8266
Uploading stub...
Running stub...
Stub running...
MAC: 5c:cf:7f:82:39:aa
Hard resetting...

Is this correct? Im I doing something wrong? If it hard reset itself, it means I have to disconnect and connect again in b/l pressing the button to run the next command? Thanks for your time.

This is the output after all:

sudo esptool.py -p /dev/tty.usbmodem1461 -b 9600 write_flash -ff 80m -fm qio -fs 32m 0x00000 20151223/boot_v1.4.bin_rep 0x1000 20151223/user1.bin 0x3FC000 20161121/esp_init_data_default.bin_rep 0x3FE000 20161121/blank.bin
WARNING: Flash size arguments in megabits like '32m' are deprecated.
Please use the equivalent size '4MB'.
Megabit arguments may be removed in a future release.
esptool.py v2.0.1
Connecting.......
Detecting chip type... ESP8266
Chip is ESP8266
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Compressed 2752 bytes to 2006...
Wrote 2752 bytes (2006 compressed) at 0x00000000 in 2.2 seconds (effective 10.2 kbit/s)...
Hash of data verified.
Compressed 305060 bytes to 231736...
Wrote 305060 bytes (231736 compressed) at 0x00001000 in 244.1 seconds (effective 10.0 kbit/s)...
Hash of data verified.
Compressed 128 bytes to 71...
Wrote 128 bytes (71 compressed) at 0x003fc000 in 0.1 seconds (effective 8.1 kbit/s)...
Hash of data verified.
Compressed 4096 bytes to 26...
Wrote 4096 bytes (26 compressed) at 0x003fe000 in 0.1 seconds (effective 428.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...

This it look ok? Thank you for your time.’

Edit: After the flashing I can’t upload any sketch to the board. I only get:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

Any solution?

Looks ok, you asked to see the MAC and it gave you the MAC.

What does b/l mean?

Uno WiFi & WiFi Link unofficial documentation

1 Like

boot loader…maybe?

1 Like

the link in my previous comment earned me a ‘Popular Link’ badge. For some months now, the link is obsolete and redirects to my new Uno WiFi Serial1 library and to my version of WiFi Link for any Arduino + esp8266.

And today I added a Blynk example to Uno WiFi Serial1 library and a Blynk example to WiFi Link library. Elegant and simple, Blynk :slight_smile:

1 Like