Connection and sending e-mail with Arduino Uno WiFi

Hello everyone,
I am a beginner on the subject and I am making a project with Arduino UNO WiFi (https://store.arduino.cc/arduino-uno-wifi) which consists of alerting the user by e-mail if certain thresholds of gas (detected with appropriate sensors) were exceeded.
I set the Arduino UNO WiFi through the following guide:

I'm having problems in the code related to the connection to the internet with the consequent creation and sending of the e-mail. After several searches on the internet, I did not find anything that referred to the Arduino UNO WiFi but only codes related to Arduino UNO + shield Ethernet / WiFi.
I tried to follow the guide found on this forum at the following address:

http://playground.arduino.cc/Italiano/Mail

trying to adapt the instructions of the Ethernet library with those of the WiFi library without success.
The arduino UNO WiFi can be treated as an arduino UNO + shield wifi or needs specific libraries? Is the WiFi.h library sufficient?

If someone can give me a hand I would be really grateful.
Thank you.

Michele

change the firmware

Uno WiFi docs and Serial1 library

So it is obligatory to change firmware or it'possible to use <UnoWiFiDevEd.h> to permit Arduino to connect and send emai?
in the case in which we must install a new firmware, we have to install Expressif AT firmware or Wifi link firmware?

For the connection of Arduino we tried to use <UnoWiFiDevEd.h> ,but we have in output on the serial monitor value=0 therefor false,where is the error?

#include <UnoWiFiDevEd.h>

char ssid[]="X";
char pass[]="X";

int time=1000;

int wait=1000;

ArduinoWifiClass *wd=new ArduinoWifiClass();

void setup() {
Serial.begin(9600);
Serial.println("Program started,waiting for router...");
delay(time);
Serial.println("Starting network module...");
wd->begin();
wd->connect(ssid,pass);

delay(2000);
Serial.println("Connecting...");

boolean value= wd->connected();
Serial.println(value);

}

void loop() {

}

you can't send email with factory firmware. I recomend WiFi Link

Excuse me Juraj, I have a couple of questions:

  1. The library that you linked to me can only be used by changing the Arduino UNO wifi firmware, right? What does the firmware change mean from an electronic point of view (using pins, etc.)?

  2. I read this on the link you sent me: "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." Being ignorant on the subject, what does it mean? Is the SC16IS750 chip already on the Arduino UNO Wifi?

I hope you can help me, I'm in a panic.

Thanks so much.

Michele

Michele94:
Excuse me Juraj, I have a couple of questions:

no problem. I am on 'the mission' for perfect Uno WiFi for everyone :slight_smile:

Michele94:

  1. The library that you linked to me can only be used by changing the Arduino UNO wifi firmware, right?

the Uno WiFi Serial1 library is independent from firmware. it only makes the connection to the esp8266 WiFi chip.

WiFi Link library requiers WiFi Link firmware

Michele94:
What does the firmware change mean from an electronic point of view (using pins, etc.)?

no change

Michele94:
Is the SC16IS750 chip already on the Arduino UNO Wifi?

yes, it is what makes Uno WiFi unique for now

Michele94:
I hope you can help me, I'm in a panic.

WiFi Link is for general networking. it is easy to port sketches written for Ethernet or WiFi library.

every day there are more Uno WiFi owners with Uno WiFi with Serial 1 and WiFi Link. the community grows.

Thank you very much :), later I change the firmware and then I will try to sketch the code for the connection of the Arduino to the internet with the relative sending of e-mail.

If I had problems with the code, could you still give me a hand?

Thank you again!

yes

Michele94:
If I had problems with the code, could you still give me a hand?

yes

and write immediately if something doesn't work in WiFi Link installation sequence

Hi juraj, I followed the guide you suggested to me: https://github.com/jandrassy/UnoWiFiDevEdSerial1.
I have carried out all the various steps indicated and at the moment I am following the following guide: [https: //github.com/jandrassy/arduino-firmware-wifilink.](http://https: //github.com/jandrassy/arduino-firmware-wifilink.)
I'm stuck for a few hours in the passage: "Go to config.h tab and uncomment the #define for your board or GENERIC_ESP8266". To which define do I have to remove the comment?

This is the config.h code:

/*
 * Firmware version and build date
 */

#define BUILD_DATE  __DATE__ " " __TIME__
#define FW_VERSION  "1.1.0"
#define FW_NAME     "wifilink"

/*
 * Define board model name
 */

//#define STAROTTO
//#define PRIMO
//#define UNOWIFIDEVED
//#define UNOWIFI
//#define GENERIC_ESP8266

//#define MCU_OTA

/*
 * Enable/Disable Debug
 */

//#define DEBUG
//#define BAUDRATE_DEBUG 115200

/*
 * Define board hostname
 */

#define DEF_HOSTNAME "arduino"

/*
 * Defines the communication channel between microcontroller
 * and esp82266, with concerning parameters
 */

//#define HOSTNAME "arduino" //used by mdns protocol

#if defined(STAROTTO)
  //Arduino STAR OTTO configuration parameters
  #define BOARDMODEL "STAROTTO"
  #define ARDUINO_BOARD "star_otto" //mdns
  #define ESP_CH_UART
  #define BAUDRATE_COMMUNICATION 460800
  #define WIFI_LED 14
  #define SSIDNAME "Arduino-Star-Otto"
#elif defined(PRIMO)
  //Arduino PRIMO configuration parameters
  #define BOARDMODEL "PRIMO"
  #define ARDUINO_BOARD "primo"     //mdns
  #define ESP_CH_SPI
  #define WIFI_LED 2
  #define SSIDNAME "Arduino-Primo"
#elif defined(UNOWIFI)
  //Arduino UNOWIFI configuration parameters
  #define BOARDMODEL "UNOWIFI"
  #define ARDUINO_BOARD "unowifi"     //mdns
  #define ESP_CH_SPI
  #define WIFI_LED 2
  #define SSIDNAME "Arduino-Uno-WiFi"
#elif defined(UNOWIFIDEVED)
  //Arduino UNO WIFI DEV. EDITION configuration parameters
  #define BOARDMODEL "UNOWIFIDEVED"
  #define ARDUINO_BOARD "unowifi"   //mdns
  #define ESP_CH_UART
  #define BAUDRATE_COMMUNICATION 115200 // assuming use of Serial1
  #define WIFI_LED 14
  #define SSIDNAME "Arduino-Uno-WiFi"
#elif defined(GENERIC_ESP8266)
  #define BOARDMODEL "GENERIC_ESP8266"
  #define ARDUINO_BOARD "esp8266"   //mdns
  #define ESP_CH_UART
  #define BAUDRATE_COMMUNICATION 9600 // to start with SoftwareSerial, set 115200 for good connection
  #define WIFI_LED 14
  #define SSIDNAME "ESP8266-Module"
#endif

Thank you so much!

remove // before #define UNOWIFIDEVED

OK, thank you. After performing the next step: "In the tools menu select board options and choose your board / shield / module or Generic ESP8266 from the ESP8266 section of the board menu.", I encounter the following error during verification:

 In file included from C: \ Users \ Apollonia \ Documents \ Arduino \ ArduinoFirmwareEsp \ ArduinoFirmwareEsp.ino: 6: 0:
sketch \ Configuration.h: 26: 25: fatal error: ArduinoJson.h: No such file or directory

  #include <ArduinoJson.h>

                          ^

compilation terminated.

exit status 1
Error compiling for board Arduino.

Where did I go wrong? :confused:

install ArduinoJson library in Lib. Manager

I installed the ArduinoJson library, the file is compiled and I display the following lines:

Archiving built core (caching) in: C:\Users\APOLLO~1\AppData\Local\Temp\arduino_cache_484843\core\core_esp8266_esp8266_arduino-esp8266_BoardModel_unowifideved,UploadSpeed_115200,FlashSize_4M1M_871cf574c062a3909371a8db80bd9ca3.a
Sketch uses 345579 bytes (33%) of program storage space. Maximum is 1044464 bytes.
Global variables use 43320 bytes (52%) of dynamic memory, leaving 38600 bytes for local variables. Maximum is 81920 bytes.

Is it correct?

However, I forgot to perform the following step: "install the Arduino ESP8266 filesystem uploader IDE plugin". Is it necessary to do it? Because I read that the procedure was tested for the version of the Arduino IDE 1.6.5-r2, 1.6.6 and at the moment I use version 1.8.5.

Thanks so much.

yes the spiffs uploader is necessary

the build is ok

Hi Juraj,

I'm having problems with the file system upload guide.

I followed everything step by step, but when I click on "ESP8266 Sketch Data Upload" a window will pop up saying:
"No files have been found in your data folder! Are you sure you want to create an empty SPIFFS image?"

In the previous steps it does not tell me to load something in the data folder, it says:
"Create a directory named data and any files you want in the file system there."

What do you advise me to do?

Thank you very much

Ps. I do not think it can be a problem of incompatibility with the version of the IDE

do you have the firmware source code opened in the IDE when you start the SPIFFS upload? did you download the firmware from github as zip including the data subfolder?

No, I downloaded only the first zip under the heading Download at the following link:

and I followed the instructions in the paragraph "installation "from this link:

In the following section "usage", I have to follow what the guide tells me by downloading the second zip always present at the link Release Update plugin for newer Arduino IDE · esp8266/arduino-esp8266fs-plugin · GitHub ?

and so, when he tells me to open the sketch, which one should I open?

I did not understand, the guide is not very clear.

Thanks and sorry :frowning:

our goal is to upload the data of WiFi Link firmware. there are the html, js and css files of the Web Panel. the SPIFFS upload tool uploads the data of the current project opened in IDE. so open the ArduinoFirmwareEsp sketch in IDE and then use "ESP8266 Sketch Data upload" from Tools menu

Ok, you were clear, maybe I understood :slight_smile:

Recapitulate:

I currently have in the ide screen, eleven open sketches (I opened ArduinoFirmwareEsp.ino).
In the lower right corner of the Arduino ide, I visualize the board: "Arduino, Uno Wifi, 115200, 4M (1M SPIFFS) on COM3"
I modified the sketch config.h as you already told me yesterday and I compiled it (with no error).

Now, which sketch should I upload via the "ESP8266 sketch data upload" plugin?

If I load the sketch config.h that I have compiled, are the other 10 sketches on the screen loaded too?

And the Data folder I do not have to create because it already exists and contains the files you told me (html, js and css files of the Web Panel), right?

Excuse me if I'm so precise and if I'm asking trivial things, but I'm afraid of doing some irreversible damage. I hope you understand me.

Thank you very much.

Michele94:
I currently have in the ide screen, eleven open sketches (I opened ArduinoFirmwareEsp.ino).
In the lower right corner of the Arduino ide, I visualize the board: "Arduino, Uno Wifi, 115200, 4M (1M SPIFFS) on COM3"
I modified the sketch config.h as you already told me yesterday and I compiled it (with no error).

it is ok.

did you upload the EspProxy with define FLASHING sketch into Atmega?
If yes, you can hit Upload

Michele94:
Now, which sketch should I upload via the "ESP8266 sketch data upload" plugin?

After you uload the sketch you can upload data for it. Go to Tools menu and use the tool.

Michele94:
If I load the sketch config.h that I have compiled, are the other 10 sketches on the screen loaded too?

Arduino sketches can be build from multiple files. Those 10 tabs are the files of WiFi Link firmware.

Michele94:
And the Data folder I do not have to create because it already exists and contains the files you told me (html, js and css files of the Web Panel), right?

yes it is there :slight_smile:

Michele94:
Excuse me if I'm so precise and if I'm asking trivial things, but I'm afraid of doing some irreversible damage. I hope you understand me.

Some months ago I could not help one forum member with bricked Uno WiFi. But since then I know the board so well that with software you can't do nothing wrong. The original recovery procedure from arduino.org will always work.