WiFiMCU is developed based on EMW3165. Run the Lua script directly; operate hardware resource; achieve product prototypes. EMW3165 is a low-power embedded WIFI module, which is developed by the Shanghai MXCHIP Technology Co., Ltd. It incorporates a WiFi RF-Chip and a microcontroller based on STM Cortex-M4. The WiFi module includes a "self-hosted" WiFi network library and application components. In addition, It also provides 2M bytes of out-chip flash, 512K bytes of on-chip flash, 128K bytes of RAM and a rich peripheral resources.
Interaction easily, Lua scripts program,Run directly
Reliability,STM32 MCU,Multi-Interface with sensors/monitor/actuator
Lua interaction,connect with wireless router,Send data to remote server,Provide rich WiFi and net function
Hardware Feature
Lua Interpreter,Serial Interation,WiFi and Net Module,File System,Interface Module
serial debugging tool(putty、Tera Term Pro),serial parameters:115200,n,8,1
Demo
>cfg={ssid='Doit_3165',pwd=''}
>wifi.startap(cfg)
>cfg={ssid='Doit_3165',pwd=''} wifi.startap(cfg)
>function listen_cb(c,ip,port)
c:on("disconnect",function(c) end)
c:on("sent",function(con) end)
c:on("receive",function(c,pl)
c:send([[HTTP/1.1 200 OK
Server: WiFiMCU
Content-Type:text/html
Content-Length: 19
Connection: close]]..'\r\n\r\n'..[[
Welcome to WiFiMCU!]]) end)
end
>sk=net.new(net.TCP,net.SERVER) sk:listen(80,listen_cb)
>print(wifi.sta.getip())
0.0.0.0
>cfg={ssid="Doit",pwd="123456789"} wifi.startsta(cfg)
>print(wifi.sta.getip())
192.168.1.112
>sk2=net.new(net.TCP,net.CLIENT)
>sk2:on("connect",function(c) print("client connected") c:send("From WiFiMCU") end)
>sk2:on("receive",function(c,pl) print("receive data:"..pl) c:send("Hello WiFiMCU")end)
>sk2:connect(6579,"115.29.109.104")
>gpio.mode(6,gpio.INPUT)
>print(gpio.read(6))
0
>print(gpio.read(6))
1
>gpio.mode(6,gpio.OUTPUT)
>gpio.write(6,gpio.HIGH)
> function tmr_cb() print('tmr1 is called') end
> tmr.start(1,1000,tmr_cb)
> tmr1 is called
> file.open ("test.lua","w+")
> file.write("this is a test")
> file.close()
> file.open ("test.lua","r")
> data=file.read()
> print(data)
this is a test
> file.close()
>
>file.open ("init.lua","w+")
>file.write("print('Hello world!')")
>file.close()
>mcu.reboot()