Comprar desde US | Comprar desde UK | Comprar desde DE | Comprar desde FR | Comprar desde IT | Comprar desde ES | ここでご購入を! |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Para conectar nuestras Cosas a Internet, necesitamos seleccionar algún protocolo de comunicación de Internet para que los diferentes dispositivos de Internet puedan hablar entre ellos. Algunos protocolos IoT comúnmente utilizados son HTTP, MQTT, etc.
En esta lección, aprenderemos como usar el protocolo HTTP y como hacer un simple servidor web HTTP con Osoyoo MEGA-IoT shield y el micro-controlador MEGA2560 y mostrar una página web “Hello World!” al navegador remoto. La página web también muestra el voltaje de entrada del pin A0 que es detectado por las funciones analogRead() de Arduino.
1).Por favor, conecte la tarjeta de extensión OSOYOO MEGA-IoT en la tarjeta OSOYOO MEGA2560.
2) Utilice el puente Cap para conectar ESP8266 RX con A8, TX con A9)
Fuente abierta Software (IDE) |
Descargar IDE aquí: https://www.arduino.cc/en/Main/Software?setlang=en |
|
7 zip es una utilidad que descomprime archivos zip |
|
Paso 1: Instale la última versión del IDE (Si tiene una versión del IDE después de la 1.1.16, por favor salte este paso).
Descargar IDE desde https://www.arduino.cc/en/software, e instale el software.
Paso 2: La extensión OSOYOO MEGA-IoT tiene los pines TX/RX conectados por defecto a los pines A9/A8. Por lo tanto, en el código de su sketch, necesitamos utilizar el Puerto Serial de Software para comunicarnos con el ESP8266 (estableciendo A9 como TX y A8 como RX en el objeto SoftwareSerial). Primero, necesitamos descargar la biblioteca WiFiEsp-master desde el siguiente enlace: https://osoyoo.com/driver/WiFiEsp-master.zip
Paso 3: Abra el IDE -> Sketch -> Incluir Biblioteca -> Añadir Biblioteca en Zip para cargar los archivos zip anteriores en el IDE de Arduino.
Paso 4: Después de instalar la biblioteca anterior, por favor descargue el código principal desde el siguiente enlace. Descomprima el archivo zip descargado “lesson3.zip”, y encontrará una carpeta llamada “smarthome-lesson3”.
https://osoyoo.com/driver/smarthome/smarthome-lesson3.zip
Paso 5: Una vez completadas las operaciones anteriores, conecte la placa OSOYOO MEGA2560 al PC con el cable USB.
Paso 6: Abra el IDE y elija el tipo de placa y el tipo de puerto correspondientes a su proyecto.
Paso 7: IDE: Pulsa archivo -> pulsa Abrir -> elige código “smarthome-lesson3”, carga el sketch en tu placa.
Nota: En el sketch, busque las siguientes líneas:
char ssid[] = "******"; // your network SSID (name) char pass[] = "******"; // your network password
Por favor, reemplace los ****** con su SSID y contraseña wifi correctos, de lo contrario su proyecto no podrá conectarse a Internet.
Después de cargar el sketch en el IDE, abra el monitor serie en la esquina superior derecha del IDE, y verá el siguiente resultado:
Desde el monitor serie, usted puede ver la dirección IP de su tarjeta MEGA2560 en el círculo rojo (en la imagen anterior, 192.168.50.102).
A continuación, utilice su navegador para visitar el sitio web http://mega2560-ip-address (in above case, http://192.168.50.102), verá el siguiente resultado:
El resultado anterior también muestra el voltaje de entrada del pin A0 a través de la función analogRead(0) en la línea 94. analogRead() puede leer el voltaje de entrada 0-5V y devolver un valor entre 0 y 1023 que representa el voltaje.
Si conectamos A0 a GND mediante un cable puente, la entrada analógica A0: muestra 0
Si conectamos A0 a 5V mediante un cable puente, la entrada analógica A0: muestra 1023.
A veces, cuando se ejecuta el proyecto lesson3, ESP8266 podría tener problemas de inicialización con MEGA2560 A8, A9 pines y esto causa WifiESP error de inicialización que muestra en el monitor serie como sigue:
[WiFiEsp] Initializing ESP module [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] Cannot initialize ESP module
Para resolver el problema, tenemos que utilizar el pin estable D10,D11 para inicializar ESP8266 y luego cambiar de nuevo a A8,A9.
Para ello, por favor haga como por los siguientes pasos:
Original line 15 is :
SoftwareSerial softserial(A9, A8); // RX, TXPlease change above line to:
SoftwareSerial softserial(10, 11); // RX, TX
Paso 3) Carga el sketch al IDE y el Initializing normalmente pasará y mostrará
[WiFiEsp] Initilization successful - 1.5.4 SSI
DownLoad Url osoyoo.com
You must be logged in to post a comment.
I am getting this error on the serial monitor:
[WiFiEsp] Initializing ESP module
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] Cannot initialize ESP module
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] No tag found
WiFi shield not present
Does this mean that my ESP shield is bad?
Nevermind. I solved the problem. The diagram showing the jumper cap connection is not very descriptive.
Hi Cbales!
I’m running into the same problem but I am sure I have the jumpers right.
What did you end up doing exactly?
Do I need a third jumper on Tx0 and Rx0 or something?
Check if your hotspot name and password are correct
Nevermind Cbales:
I had some bent pins on the board.
This is the message I am getting – what could I be doing wrong. I checked to make sure the ssid and password are correct and the pins are entered correctly.
[WiFiEsp] Initializing ESP module
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] Cannot initialize ESP module
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] No tag found
WiFi shield not present
I’m running into the same problem. The pins are OK.
What shall I do ?
Hi gents
I get the same problem and jumpers seem to be ok
How did you solve yours?
The wifi module works when I do the troubleshooting steps for connecting to 10, 11. However, when I try to roll back to the A8, A9 it is not working.
can anyone help by showing a picture of how the cables should be connected to A8, A9 — do i use the pnp jumpers or do i use the regualr jumper cables. Please help.
I’ll reply you by email
Hi David,
I havent received the reply yet.
Thanks
have you sent it yet?
The mailbox prompts that the mail was delivered successfully