Gitee仓库开源地址:https://gitee.com/lalhan/wireless-downloader
特别感谢
立创开源:多功能无线下载器https://oshwhub.com/q837877663/duo-gong-neng-wu-xian-xia-zai-qi
本项目是基于该项目的硬件更新/修改
使用ESP8266ex芯片,增加集成化,减小体积
修改接收端引脚,去除T外部供电YPEC接口(失去51单片机下载能力),采用板子供电的方式,更符合无线下载的定义
接收端分两侧,一侧SWD下载接口,一侧无线串口
提供更加简洁的esp8266下载方式
看视频
软件程序无修改,请在原作者链接下载,我这里放置三个hex文件方便测试
#include < ESP8266WiFi.h >
IPAddress local_IP(192,168,4,1);
IPAddress gateway(192,168,4,1);
IPAddress subnet(255,255,255,0);
// Set these to your desired credentials.
const char *ssid = "ESP0000";
const char *password = "1234567890";
WiFiServer server(8080);
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, 1);//灭
Serial.begin(500000);
Serial.setTimeout(1);
WiFi.mode(WIFI_AP);
WiFi.setSleepMode(WIFI_NONE_SLEEP);
// You can remove the password parameter if you want the AP to be open.
// WiFi.softAPdisconnect(true);
WiFi.softAPConfig(local_IP,gateway,subnet);
WiFi.softAP(ssid, password);
// IPAddress myIP = WiFi.softAPIP();
server.begin();
}
void loop()
{
WiFiClient client = server.available(); // listen for incoming clients
digitalWrite(LED_BUILTIN, 1);//灭
// delay(2000);
if (client)
{
delay(100);
digitalWrite(LED_BUILTIN, 0);//亮
client.setNoDelay(true);
while(1)
{
if (client.available()) //如果有数据可读取
{
char line = client.read(); //读取数据到换行符
Serial.print(line);
}
if (Serial.available()) //如果有数据可读取
{
String s = Serial.readString();
client.print(s);
}
if(WiFi.softAPgetStationNum()==0)
{
// WiFi.softAPdisconnect(true);
// WiFi.softAPConfig(local_IP,gateway,subnet);
// WiFi.softAP(ssid, password);
// server.begin();
break;
}
}
}
// WiFi.softAPdisconnect(true);
// WiFi.softAPConfig(local_IP,gateway,subnet);
// WiFi.softAP(ssid, password);
// server.begin();
}
审核编辑:汤梓红
全部0条评论
快来发表一下你的评论吧 !