Giter VIP home page Giter VIP logo

unowifidevedserial1's Introduction

UNO WiFi (Developer Edition) Serial1

Arduino UNO WiFi is an Arduino UNO R3 with ESP8266 integrated on the board. It was developed and manufactured by Arduino.org. More information in UNO WiFi Wiki.

UNO WiFi Developer Edition connects ATmega328 to ESP8266 using additional on board UART chip SC16IS750. This additional UART is connected to ATmega as I2C device.

This library creates a Serial1 object with SC16IS750 on Arduino UNO WiFi Developer Edition. This Serial1 enables to communicate with the on-board ESP8266 over it's serial interface. The included tool EspProxy enables accessing the on-board ESP8266 over USB for 'flashing' tools, IDE sketch upload or Serial Monitor.

The release version of the library is available in Library Manager in IDE.

Use for:

UNO WiFi with Espressif AT firmware

This is now the best option for Uno WiFi Dev Ed.

Prepare

Download the AT firmware from [Espressif's repository]https://github.com/espressif/ESP8266_NONOS_SDK/releases) and unzip it. Replace the esp_init_data_default.bin with this one. It has the 40MHz crystal setting.

  1. Open in IDE the EspProxy.ino from UnoWiFiDevEdSerial1 examples tools subfolder.
  2. Uncomment the #define FLASHING line (remove the // at the beginning of the line)
  3. Upload the EspProxy sketch into UnoWiFi. (No need to save it.)
  4. let the sketch open in IDE

Option 1 - flashing with esptool.py

Install Python 2.7 and esptool.

Go on command line in the folder with the AT firmware files and run the following command with the COM port of your UNO WiFi:

esptool.py -p COM-PORT write_flash -ff 80m -fm qio -fs 4MB 0x0 boot_v1.7.bin 0x01000 at/512+512/user1.1024.new.2.bin 0x3fc000 esp_init_data_default.bin 0xfe000 blank.bin 0x3fe000 blank.bin

Option 2 - flashing with Espressif Flash Download Tools (Windows)

Download the tool from Espressif download page, unzip it and run.

Select files, addresses and settings like on this picture:

settings

Use the Start button to execute.

Note: In field DETECTED INFO the detected frequency will be half of the real frequency. That is why the SpiAutoSet must not be checked.

Checking the firmware

  1. Return to EspProxy.ino sketch in the IDE
  2. Comment the #define FLASHING line (make Undo or put // at the beginning of the line)
  3. Upload the EspProxy sketch into UnoWiFi.

Open the Serial Monitor. EspProxy sketch resets the ESP and you will see the boot log at 115200 baud. The strange characters sequence is normal.

Set the CR/LF setting and send test command 'AT'. The ESP should replay with OK.

Serial Monitor

Next commands:

  • AT+GMR - prints the version
  • AT+CWMODE=1 sets tha STA mode
  • AT+CWJAP="ssid","pass" connects to AP

Alternative AT firmware

Jiri Bilek created an alternative AT 1.7 firmware implementation over esp8266 Arduino core and WiFi library. This supports SSL TLS1.2 connection in passive mode with WiFiEspAT library.

WiFiEspAT library

With AT firmware 1.7.x (SDK 3), you can use my WFiEspAT library.

To test it, only add #include <UnoWiFiDevEdSerial1.h> at the beginning of the example sketches of the WiFiEspAT library.

UNO WiFi with WiFi Link firmware

WiFi Link firmware is an Arduino esp8266 core sketch. It can by installed by Uploading from source code in IDE, with EspProxy sketch in ATmega.

To make UNO WiFi ready for WiFi Link flashing, open in IDE the EspProxy.ino from UnoWiFiDevEdSerial1 examples tools subfolder and upload it into UNO WiFi. EspProxy will reset the ESP8266 into bootloader mode always when the Atmega is reset with DTR signal from IDE and esp flashing is detected.

To build the WiFi Link for the UNO WiFi install esp8266 support in IDE.

Repository and instructions for generic board/module with ESP8266 are here.

The version of WiFi Link library modified for use with any serial implementation is here.

Writing sketches for ESP8266

Firmata is a system for accessing pins and interfaces of a microcontroller (MCU) from a computer (or other MCU). Library FirmataMaster is for esp8266 and enables control of an attached MCU with Firmata.

Example UnoWiFiFirmata shows how to modify a Firmata sketch to work with Serial1 and combine it with EspProxy features to upload sketches into esp from IDE without thinking about how is it connected and without caring about flashing mode.

To build and upload sketches into esp you need esp8266 support in IDE and in ATmega the EspProxy sketch or other sketch with automatic 'flashing bridge' like the UnoWiFiFirmata example.

Serial1 overflow

Creators of the UNO WiFi did not connect the interrupt pin of the SC16IS750. It is not possible to start receiving from SC16IS750 into Serial1 buffer on interrupt. SC16IS750 has 64 byte RX buffer. If this receive buffer is full, SC16IS750 sets the overflow flag and more bytes are not received. The sketch or library then stops while waiting for declared count of bytes.

After requesting data from ESP, it is necessary to check for incoming data without delays. It takes time before a http response arrives, but then the data come fast.

Serial1 objects has overflow() function which checks the overflow flag of SC16IS750. It is useful for debugging overflow situations.

I2C a.k.a. Wire a.k.a. TWI

Serial1 is an I2C device with address 0x48. Like other devices libraries, it calls twi_init in Serial1.begin() function. With baud rates over 57600, Serial1 sets the I2C 'full speed' (400 kHz). Call Serial1.begin() after initializing other I2C devices.

Serial1 can handle 230400 baud at I2C 'full speed', but only 57600 at I2C 'standard mode' (100 kHz).

unowifidevedserial1's People

Contributors

jandrassy avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

unowifidevedserial1's Issues

Missing .bin files

What exactly should be boot_v1.7.bin and blank.bin?
When I download zip from Espressif download page these files are not there, so when I run esptool.py it reports that they are missing.

Can you please post links to these two files?

UNO WiFi with Espressif AT firmware - Blynk

I tried to use blynk example with UNO WiFi with Espressif AT firmware, but nothing happens, and nothing is logged in console as well.

Can Blynk be used with this firmware or it works only with UNO WiFi with WiFi Link firmware?

Problem flashing

Hello Juraj, followed your guide "UNO WiFi (Developer Edition) Serial1" to flash the "ESP8266_NonOS_AT_Bin_V1.7.4" firmware on an Arduino Uno Wifi Rev 3.
All went well until the step "Checking the firmware". After running the tool "EspProxy.ino" with "//#define FLASHING" I get the message you described but then a lot more, which keeps flooding the serial monitor:

2nd boot version : 1.7(5d6f877)
SPI Speed : 80MHz
SPI Mode : QIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000

correct flash map
mismatch map 2,spi_size_map 4
system param partition error
system_partition_table_regist fail
V2
Mo
rf_cal[0] !=0x05,is 0xFF

ets Jan 8 2013,rst cause:1, boot mode:(3,6)

load 0x40100000, len 2592, room 16
tail 0
chksum 0xf3
load 0x3ffe8000, len 764, room 8
tail 4
chksum 0x92
load 0x3ffe82fc, len 676, room 4
tail 0
chksum 0x22
csum 0x22

What can I do to correct this behaviour?
Tried to flash again using the same procedure but then I get the message that esptool cannot connect to the COM Port anymore. Thanks jn advance for your advice
JP Slootmans

UnoWiFiDevEdSerial1 ThingSpeak

Dear jandrassy,

First, thank you for the great job made with this library. I am an engineer and I started working with Arduino a few months ago.

Merging ThingSpeak example with UNO WiFi Developer Edition Serial1 example I managed to make the Arduino Uno Wifi work with ThingSpeak and I would like to share the result with others which may find it useful.
Since I am not a coding/GitHub expert, I would like discuss with you the best practice to reach this goal.

Should I fork/clone this repo, thingspeak repo or both?

Best regards

russilui

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.