UNO WIFI 1st version: need guidance to develop an advanced wireless robot.

Hello all,
Here is my project: use the Arduino UNO Wifi (first edition from Arduino.org) to control wirelessly a moving robot. I plan to use my cellphone as a remote to control the robot (with a virtual joystick and other stuff).

(To start this personal project, I bought this UNO Wifi card in 2016, without knowledge of a war between Arduino.cc and Arduino.org. But because of the lack of information about the control of this board and my bad-understanding of the wifi protocols, I gave up. Today, and from now more than 1 month, I restart this project with motivation and more knowledge of C++)

I come here, firstly to receive experimented advices and not obligatorily receive easily all the solutions. If you could guide me in the steps to advance correctly in this project: prerequisites, efficient methods of working, what is possible to do, what is not, etc…
I chose to control the robot by WIFI instead of Bluetooth, because I would like a farer controlling range than ~10meters. Moreover, I’m curious to understand how WIFI works and mastering WIFI will allow me to work on nice home automation.
My following text is long because I prefer to give a precise view of my situation, but as I said above, I don’t ask you to answer to all my question in one shot

First, thank you for your participation Juraj, i was expecting you :slight_smile:

But, ... Arg, I just realize that my text has been sent only partially (i guess it was too long for the format, but i'm surprised). I paste the rest in the following:

Where I am and what I know in this project:
o Programming of the robot’s hardware (sensors, motors, etc..), I could manage. This is not the purpose here.
o From Arduino_Uno_WiFi_Dev_Ed_Library, I have tried the examples (RestServer, WebServerBlink) and it works: I can connect my computer to the UNO WIFI board IP address, then I can turn on/off the LED13 with URL commands or by clicking on HTML buttons. But this is not a dynamic control like a joystick! I know almost nothing about HTML, but I have started to study the very beginning. So, I have discovered the Jscript and AJAX, but for now I have to learn if necessary.
o Thanks to this forum topic Arduino Uno Wifi - Installation & Troubleshooting - Arduino Forum ; I have learnt that Juraj (an Arduino Developer active in the forum) has created another library (with examples) called Uno_WiFi_Developer_Edition_Serial1 that allows to program directly the ESP8266 (if I have well understood). Its EspProxy sketch replaces direct connections of the esp8266 to computer for flashing firmware or sketch. Here is its README : UnoWiFiDevEdSerial1/README.md at master · jandrassy/UnoWiFiDevEdSerial1 · GitHub
o I didn’t tried: It is possible to flash the esp8266 with two different firmware: WifiLink or Espressif AT. And afterthat, we can use the Firmata sketch to upload sketches into esp from IDE. So far, I don’t know what is the difference between WifiLink and Espressif AT, I have to study them if it is necessary.

Now to continue efficiently, I’m not sure the way that I have to take:
o I already know Blynk app for smartphone. It looks amazing, but I struggled to use it. I will try again, but meanwhile, I prefer to post this help request.
o Should I learn more about HTML or/and AJAX or/and JScript to create my own HMI? Or should I start with Blynk?
o Do I need to use Arduino_Uno_WiFi_Dev_Ed_Library or Uno_WiFi_Developer_Edition_Serial1 or both of them?
o These libraries, do I need to study them deeply (= to understand the .h and .ccp)? What deepness?
o Should I study the functioning protocols of the ESP8266? I plan to do it. Same question for the SC16IS750IBS?
All these investigation will ask me long hours of work and I’m not sure it will be really useful to my project .
Technical questions:
o Is it possible to communicate between my cellphone and the UNO Wifi, without passing through a router? If not, why? It would be interesting to be independant from the router.
o I imagine the UNO Wifi as a server where it is programmed an HTML page with a joystick.
=> When a client (my cellphone) connects to this server, it uses the joystick sent by the arduino. The modification of the joystick position changes the value of a variable into the HTML page.
=> The UNO Wifi reads continusly its server’s variables and command the robot according to the joystick variable.
o I also imagine the opposite and I take the exemple of Blynk: Blynk acts as a server with its joystick. UNO Wifi connects to Blynk as a client and is allowed to read the data coming from the joystick variables. And the user (me for example) connects also to the server Blynk and manipulates the joystick, changing the joystick variables values.
What do you think from these two imaginations?
o I can see that the UNO Wifi program storage is small. If I choose to use the Arduino as server, I guess that to program a HTML joystick and other commands could be too heavy. In this case, how to sort this problem out?
o What is the ZU4 component that we can see in the Arduino UNO Wifi schematic? (from original documents)

I repeat here, that what I'm looking for in this topic, is to get a guidance toward -what to study, what to learn, what to work on-. Even if, of course, some technical information and explanation will definitly help me to progress.

I thank you in advance for reading and thinking my project

the Uno WiFi Developer Edition is an Uno with esp8266 attached. Usually for common Uno SoftwareSerial is used to communicate with external esp8266 module. The Uno WiFi has a serial converter to connect the esp8266, so you need to use UnoWiFiDevEdSerial1 library instead of SoftwareSerial. (Arduino_Uno_WiFi_Dev_Ed_Library has the original library for the converter merged in)

Any sketch for Uno and esp8266 can be used with the Uno WiFi only replacing SoftwareSerial with UnoWiFiDevEdSerial1

if you see a sketch for Uno with esp8266 on SoftwareSerial with
#include <SoftwareSeria.h>
SoftwareSerial esp8266(6, 7);

it will work if you replace this with
#include <UnoWiFiDevEdSerial1.h>
#define esp8266 Serial1

every other aspect of your project is not Uno WiFi Dev Ed specific and you can use any solution for Uno + esp8266 you like

of course you need some tricks to upload to esp8266, but they can be used over SoftwareSerial too

the choice of firmware or own sketch is yours, but only one application can run in esp8266 (AT firmware, other firmware or sketch)

addition to firmware overview: with AT firmware you can run only one server and it is problem to receive large data without flow control. but some people like it for some reason. (there is no Serial with flow control for Uno)

Hello Juraj and thanks,
small step by step and with a lot of reading + motivation, I understand better.

Juraj:
the Uno WiFi Developer Edition is an Uno with esp8266 attached. Usually for common Uno SoftwareSerial is used to communicate with external esp8266 module. The Uno WiFi has a serial converter to connect the esp8266, so you need to use UnoWiFiDevEdSerial1 library instead of SoftwareSerial. (Arduino_Uno_WiFi_Dev_Ed_Library has the original library for the converter merged in)
Any sketch for Uno and esp8266 can be used with the Uno WiFi only replacing SoftwareSerial with UnoWiFiDevEdSerial1
if you see a sketch for Uno with esp8266 on SoftwareSerial with
#include <SoftwareSeria.h>
SoftwareSerial esp8266(6, 7);
it will work if you replace this with
#include <UnoWiFiDevEdSerial1.h>
#define esp8266 Serial1

=> I understand that, because of the SC16IS750 serial interface on the UNO WiFi, we need the <UnoWiFiDevEdSerial1.h> instead of the <SoftwareSerial.h>

Juraj:
every other aspect of your project is not Uno WiFi Dev Ed specific and you can use any solution for Uno + esp8266 you like

=> I agree, but some tips could help me. Like for exemple, is Blynk usable for my robot controlling application with the WiFiLink firmware?

Juraj:
of course you need some tricks to upload to esp8266, but they can be used over SoftwareSerial too

=> I’m not sure to understand what brings this topic as information: Do I need to study this if I chose to use Blynk?

Juraj:
the choice of firmware or own sketch is yours, but only one application can run in esp8266 (AT firmware, other firmware or sketch)
addition to firmware overview: with AT firmware you can run only one server and it is problem to receive large data without flow control. but some people like it for some reason. (there is no Serial with flow control for Uno)

=> I understand that a firmware is actually a sketch. But this sketch has been thought to be useful for almost all the current utilisations of the ESP8266. And this sketch will be flashed only in the ESP8266 chip and not in the ATMEGA chip of the UNO WiFi board.
AT firmware is a translator of AT commands (e.g. AT+GMR). With theses commands, we can configure the ESP8266 to communicate with our router. We can also activate or deactivate some of the ESP outputs. We can also read its inputs (ADC). We can also upload to the ESP as a server, an HTML file.
With WiFi Link, we can do the same things, with another language. This language will be closer to the Arduino librairies styles like ethernet.h or WiFi.h. So, it will be easier to copy the already existing sketches from other ethernet or wifi shield projects. And it avoids a certain overflow of the serial
Am I rather right?

I have started to install the WiFi Link firmware, but I have some issues and bad-understandings. I will soon explain that in a next message.

the WiFiLink library has Blynk example. (not the version in Library Manager, but the version in my GitHub repository)

You mean the version that I can open from : File -> examples -> INCOMPATIBLE -> Uno WiFi developer edition serial1 ?

Urob:
You mean the version that I can open from : File -> examples -> INCOMPATIBLE -> Uno WiFi developer edition serial1 ?

that too, but why INCOMPATIBLE ? you don't have Uno WiFi selected in Tools menu?

That was because I had ESP8266 board : Uno WiFi selected.

I still don’t understand while do i need the WifiLink firmware and the serial1 library to use Blynk.

I wonder that, because i was able to control the LED13 since the web panel with the original uno wifi library and the “webServerBlink” example.
This means that the ESP8266 (as a server) that receive a command from the web panel, was able to communicate with the ATMEGA to order the activation or deactivation of the LED13.

So, communication between ESP and ATMEGA was already available.

Urob:
That was because I had ESP8266 board : Uno WiFi selected.

I still don't understand while do i need the WifiLink firmware and the serial1 library to use Blynk.

I wonder that, because i was able to control the LED13 since the web panel with the original uno wifi library and the "webServerBlink" example.
This means that the ESP8266 (as a server) that receive a command from the web panel, was able to communicate with the ATMEGA to order the activation or deactivation of the LED13.

So, communication between ESP and ATMEGA was already available.

Blynk library requires Arduino core Client class implementation. The Arduino_Uno_WiFi_Dev_Ed_Library doesn't have it. The WiFiClient of WiFiLink/WiFiEsp library is a Client implementation.

And the speed of the old library on Serial1 is only 9600 baud.

Ok, let’s try to install the WiFi Link firmware.

First I must install the ESP8266 core to be able to directly program the ESP from USB :
=> from “https://arduino.esp8266.com/stable/package_esp8266com_index.json” and the board manager, the downloading of the ESP8266 freezes every 1Mb. The reason is probably my internet connection that is very bad at this time. I could start again and again the downloading until finishing, but I would be very long.
So I chose to download the ESP8266 core directly at the source (GitHub : Arduino core for ESP8266 WiFi chip) and to install it manually as we can see in the section “using GIT version” :

Clone this repository into hardware/esp8266com/esp8266 directory (or clone it elsewhere and create a symlink)
cd hardware
mkdir esp8266com
cd esp8266com
git clone https://github.com/esp8266/Arduino.git esp8266
cd esp8266
git submodule update --init

Download binary tools (you need Python 2.7)
cd esp8266/tools
python get.py

So I looked for the folder “hardware” and I found it only at this address:
C:\Program Files (x86)\Arduino\hardware

I created myself the folders “esp8266com” and “esp8266” and installed the core inside,

then, I ran the “get.py” from tools, but it seems that there is an error : "access denied : ‘dist/’
(see in attachment)

Nevertheless, in the board manager, I’m now able to access at the ESP8266 board menu and to configure it.

Am I good ?
first, I’m not sure in which folder I should work :

  • C:\Program Files (x86)\Arduino
  • C:\Users\ybuss\AppData\Local\Arduino15
  • C:\Users\ybuss\Documents\Arduino (sketches folders)

the installation of core from github is very complicated.

If you didn't start yet with WiFiLink, you could try my new WiFiEspAT library with AT firmware.