with ESP8266 ESP-01S ESP01S Serial Wireless WIFI Module
and UNO R3
and Arduino 1.8.12
and i already dd the following URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json
i use example this
i attach image all
i chosse in Board selector - Arduino UNO
i get this error
i chosse in Board selector - Generic ESP8266 Module
i get error
please help
i try this .. work
and UNO R3
and Arduino 1.8.12
and i already dd the following URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json
i use example this
i attach image all
ESP8266 - Getting Started
B4R v1.20 added support for ESP8266 modules. ESP8266 is a great module for IoT solutions. For a few dollars you get a powerful microcontroller with built-in support for wifi. I recommend to develop with a board that includes a USB to serial converter. Configuration Open Arduino IDE - File -...
www.b4x.com
B4X:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 600
#End Region
Sub Process_Globals
Public Serial1 As Serial
Public WiFi As ESP8266WiFi
Public esp As ESP8266
Private eeprom As EEPROM
Private const MAGIC_EEPROM As Byte = 123
Private bc As ByteConverter
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
WiFiServer.Start
ConnectToNetwork
End Sub
Public Sub SaveNetworkDetails(SSID As String, Password As String)
Log("Saving network data: ", SSID, ", ", Password)
SSID = bc.StringFromBytes(WiFiServer.ReplaceString(SSID, "%20", " "))
eeprom.WriteBytes(Array As Byte(MAGIC_EEPROM, SSID.Length + 1 + Password.Length), 0)
Dim pos As Int = 2
eeprom.WriteBytes(SSID, pos)
pos = pos + SSID.Length
eeprom.WriteBytes(Array As Byte(0), pos)
pos = pos + 1
eeprom.WriteBytes(Password, pos)
End Sub
Public Sub ConnectToNetwork
WiFi.Disconnect
'read settings from EEPROM
Dim header() As Byte = eeprom.ReadBytes(0, 2)
If header(0) = MAGIC_EEPROM Then
Dim data() As Byte = eeprom.ReadBytes(2, header(1))
Dim i As Int = bc.IndexOf(data, Array As Byte(0))
If i = -1 Then
Log("Error parsing network data.")
Return
End If
Dim SSID As String = bc.StringFromBytes(bc.SubString2(data, 0, i))
Dim Password As String = bc.StringFromBytes(bc.SubString(data, i + 1))
Log("Trying to connect to: ", SSID, " password: ", Password)
If WiFi.Connect2(SSID, Password) Then
Log("Connected successfully to: ", SSID)
Log(WiFi.LocalIp)
Else
Log("Failed to connect.")
End If
Else
Log("Network data not found.")
End If
End Sub
i get this error
B4X:
.................
.................
[cc.arduino.packages.discoverers.serial.SerialDiscovery] Fail to get the Vid Pid information from the builder response code=404
In file included from C:\Users\ENTER\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.h:28:0,
from C:\Users\ENTER\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFi.h:34,
from D:\d\B4R\exmple\wifi\1\ESP826~2\ESPCON~1\Objects\bin\sketch\rESP8266WiFi.h:7,
from D:\d\B4R\exmple\wifi\1\ESP826~2\ESPCON~1\Objects\bin\sketch\B4RDefines.h:26,
from D:\d\B4R\exmple\wifi\1\ESP826~2\ESPCON~1\Objects\src\src.ino:1:
C:\Users\ENTER\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:27:10: fatal error: functional: No such file or directory
#include <functional>
^~~~~~~~~~~~
compilation terminated.
exit status 1
DEBUG StatusLogg....................
..........................................
i chosse in Board selector - Generic ESP8266 Module
i get error
please help
i try this .. work
C++:
#include <SoftwareSerial.h>
SoftwareSerial ESPserial(7, 6); // RX | TX
int cnt=110;
void setup() {
Serial.begin(9600);
ESPserial.begin(115200);
Serial.println("");
Serial.println("");
}
void loop() {
if (ESPserial.available()) {
Serial.write( ESPserial.read() );
}
if (Serial.available()) {
ESPserial.write(Serial.read());
}
}
Attachments
Last edited: