Date post: | 14-Apr-2016 |
Category: |
Documents |
Upload: | nathan-imig |
View: | 80 times |
Download: | 9 times |
1. introduction2. TechnicalSpecifications3. MechanicalSize4. InterfaceandFunctions5. Startquickly6. RevisionHistory7. TechnicalSupport8. SchematicsforESP-12EDevKit9. SourceCode10. HowtoGetit
TableofContents
UserManualforESP-12EDevKit
2
ESP-12EisdesignedanddevelopedbyShenzhenDoctorsofIntelligence&Technology(SZDOIT)basedontheUltra-lowpowerconsumptionUART-WiFiESP8266,whichisspeciallyformobiledevicesandapplicationofIoT(InternetofThings).Now,ESP-12Eiswidelyappliedtointernet,communicationinlocalarea,intelligenthome,industrialcontrol,handed-devices,andetc.
ESP-12EDevKitisusedthedesignofon-boardantennaandencapsulatedby2.54directinsertion.Itisveryconvenienttodebugandinstalldevice.
InESP-12EDevKit,HardwareAPIoperationisencapsulatedbyLualanguage,whichcanavoidthehardwaredifficultyforsorfwareengineers,andthencanspeedthedevelopofproducts.
Formoreinformation,pleasevisithttp://www.doit.am,http://www.smartarduino.com.
Introduction
UserManualforESP-12EDevKit
3introduction
SupportSTA/AP/STA+AP3workingmodes;Built-inTCP/IPprotocolstack,supportmultiple-channelTCPClientconnection(max5);0〜D8,SD1〜SD3:usedforGPIO,PWM,IIC,ect;thedrivenabilitycanbearrivedat15mA;AD0:one-wayADC;Powerinput:4.5V~9V(10VMAX),supportUSBpoweredandUSBdebug;Workingcurrent:≈70mA(200mAMAX,continue),standby<200uA;Transmissiondatarate:110-460800bps;SupportUART/GPIOdatacommunicationinterface;Supportupdatefirmwareremotely(OTA);SupportSmartLink;Workingtemperature:-40℃〜+125℃;
Drivenmode:doublelarge-powerHbridgedrivenWeight:7g.
TechnicalSpecifications
UserManualforESP-12EDevKit
4TechnicalSpecifications
PCBviewforESP-12EDevKit
ProductviewforESP-12EDevKit
MechanicalSize
UserManualforESP-12EDevKit
5MechanicalSize
Forthisboard,pinsarescreen-printedontheboard,anddefinedasfollows.
InterfaceandFunctions
UserManualforESP-12EDevKit
6InterfaceandFunctions
ESP-12EDevKitisalreadybuilt-inLuafirewarewithAPmode,togetherwiththefollowingsteps:
1.LetESP-12EDevKitconnecttoyourcomputerwithMicroUSB.ESP-12Emodulewouldbebrightenwithbluelight,andthenthelightisout;
2.IfthedriverisnotinstalledinyourPC,aninformationwouldbepop-uptoshowanunknowndevice.Atthistime,aserial-driverforCP2102mustbeinstalledbytheOS.
3.OpenthewirelessnetworktolookforaWiFiwirelessnetworknamedasDoitWiFi(itsSSID),andconnectit.Ifuse
mobilephonebrower,pleasevisitthesourcecodeinthisbook.
4.Theinitialpassowrdis12345678.
5.Input192.168.1.1inthebrower,thenhave
6.Click"D0",thelightisbrightenwithbluecolor;
Startquickly
UserManualforESP-12EDevKit
7Startquickly
7.Testiscompleted.
FormoreinformationaboutESP8266,pleaseseewww.ai-thinker.com,andmoreinformationforLua,pleasevisitwww.doit.am.
UserManualforESP-12EDevKit
8Startquickly
Version Content Date
1.0 DrALtVersion 2015-05-19
RevisionHistory
UserManualforESP-12EDevKit
9RevisionHistory
Formoreinformationaboutourproducts,pleasevisithttp://www.doit.am.
ContactInformation:
Company ShenzhenDoctorsofIntelligence&Technology(SZDOIT)
Tel +86-15899880115
skype yichone
Emails [email protected];[email protected]
TechniqueSupport
UserManualforESP-12EDevKit
10TechnicalSupport
SchematicsforESP-12EDevKit
UserManualforESP-12EDevKit
11SchematicsforESP-12EDevKit
File1:init.lua
--DoitWiFiRoboCarCtronlDemo
--apmode
--Created@2015-05-13byDoitStudio
--Modified:null
--GlobalSite:http://doit.am/
--ChinaSite:http://cn.doit.am/
--GlobalShop:http://www.smartarduino.com/
--ChinaShop:http://szdoit.taobao.com/
--ChineseBBS:bbs.iot.fm
print("\n")
print("ESP8266Started")
localexefile="webserver"
localluaFile={exefile..".lua"}
fori,finipairs(luaFile)do
iffile.open(f)then
file.close()
print("CompileFile:"..f)
node.compile(f)
print("RemoveFile:"..f)
file.remove(f)
end
end
iffile.open(exefile..".lc")then
dofile(exefile..".lc")
else
print(exefile..".lcnotexist")
end
exefile=nil;luaFile=nil
collectgarbage()
File2:WebServer.lua
--DoitWiFiRoboCarCtronlDemo
--apmode
--Created@2015-05-13byDoitStudio
--Modified:null
--GlobalSite:http://doit.am/
--ChinaSite:http://cn.doit.am/
--GlobalShop:http://www.smartarduino.com/
--ChinaShop:http://szdoit.taobao.com/
--ChineseBBS:bbs.iot.fm
--[isusedtoreplace《
print("StartsoftAP")
wifi.setmode(wifi.SOFTAP)
localcfg={}
cfg.ssid="DoitWiFi";
cfg.pwd="12345678"
wifi.ap.config(cfg)
cfg={}
cfg.ip="192.168.1.1"
cfg.netmask="255.255.255.0"
cfg.gateway="192.168.1.1"
wifi.ap.setip(cfg)
start_init=function()
gpio.mode(0,gpio.OUTPUT);
gpio.mode(1,gpio.OUTPUT);
gpio.write(0,gpio.HIGH);
SourceCode
UserManualforESP-12EDevKit
12SourceCode
gpio.write(1,gpio.HIGH);
D1_state=0;
D0_state=0;
end
sendFileContents=function(conn,filename)
iffile.open(filename,"r")then
--conn:send(responseHeader("200OK","text/html"));
repeat
localline=file.readline()
iflinethen
conn:send(line);
end
untilnotline
file.close();
else
conn:send(responseHeader("404NotFound","text/html"));
conn:send("Pagenotfound");
end
end
responseHeader=function(code,type)
return"HTTP/1.1"..code.."\r\nConnection:close\r\nServer:nunu-Luaweb\r\nContent-Type:"..
type.."\r\n\r\n";
end
httpserver=function()
start_init();
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive",function(conn,request)
conn:send(responseHeader("200OK","text/html"));
ifstring.find(request,"gpio=0")then
ifD0_state==0then
D0_state=1;gpio.write(0,gpio.LOW);
else
D0_state=0;gpio.write(0,gpio.HIGH);
end
elseifstring.find(request,"gpio=1")then
ifD1_state==0then
D1_state=1;gpio.write(1,gpio.LOW);
else
D1_state=0;gpio.write(1,gpio.HIGH);
end
else
ifD0_state==0then
preset0_on="";
end
ifD0_state==1then
preset0_on="checked=\"checked\"";
end
ifD1_state==0then
preset1_on="";
end
ifD1_state==1then
preset1_on="checked=\"checked\"";
end
sendFileContents(conn,"header.htm");
conn:send("[div>[inputtype=\"checkbox\"id=\"checkbox0\"name=\"checkbox0\"class=\"switch\"onclick=\"loadXMLDoc(0)\""..preset0_on.."/>");
conn:send("[labelfor=\"checkbox0\">D0[/label>[/div>");
conn:send("[div>[inputtype=\"checkbox\"id=\"checkbox1\"name=\"checkbox1\"class=\"switch\"onclick=\"loadXMLDoc(1)\""..preset1_on.."/>");
conn:send("[labelfor=\"checkbox1\">D1[/label>[/div>");
conn:send("[/div>");
end
print(request);
end)
conn:on("sent",function(conn)
conn:close();
conn=nil;
end)
end)
end
httpserver()
UserManualforESP-12EDevKit
13SourceCode
File3:header.htm
UserManualforESP-12EDevKit
14SourceCode
UserManualforESP-12EDevKit
15SourceCode
UserManualforESP-12EDevKit
16SourceCode
TheNodeMCUkitcangetat:http://www.smartarduino.com/nodemcu-development-kit-nodemcu-motor-shield-l293d_p94573.html
HowtoGetit
UserManualforESP-12EDevKit
17HowtoGetit