Latest Firmware Download
WiFiMCU is developed based on EMW3165 module produced by MXCHIP.INC. A Lua interpreter is builded inside with hardware support. A light weight file system and socket protocols can help to realize IoT development easily and quickly. Basically, you can load Lua scripts on your device and then run it on board with nothing more than a terminal connection.
Enjoy Programming!
; . . .___ . . __ . . ,--. ["] | |o[__ o|\/|/ `| | ,<-|__oo| /[_]\ |/\||| || |\__.|__| / |// | ] [ /o|__| [www.wifimcu.com@2015]
#Overview
- Based on Lua 5.1.4 (package, string, table, math modules)
- Build-in modules: mcu,gpio, timer, wifi, net, file, pwm, uart, adc, spi, i2c, bit
- Modules to be builded: 1-wire, bit, mqtt...
- Integer version provided
Free memory >48k bytes
##Highlights
#####Cortex-M4 microcotroller
STM32F411CE
- 100MHz,Cortex-M4 core
- 2M bytes of SPI flash and 512K bytes of on-chip flash
- 128K bytes of RAM
- Operation Temperature:-30℃ ~ +85℃
#####Multi-Interface
- 18 GPIO Pins
- 2 UARTs
- ADC(5)/SPI(1)/I2C(1)/USB(1)
- SWD debug interface
- 11 PWMs
#####Broadcom IEEE 802.11 b/g/n RF Chip
- Supports 802.11 b/g/n
- WEP,WPA/WPA2,PSK/Enterprise
- 16.5dBm@11b,14.5dBm@11g,13.5dBm@11n
- Receiver sensitivity:-87 dBm
- Station,Soft AP and Station+Soft AP
- CE, FCC suitable
GPIO index | Alternative Function | Discription |
---|---|---|
D0 | GPIO/BOOT | WiFiMCU would enter into Bootloader Mode, if D0 goes to LOW |
D1 | GPIO/PWM/ADC | |
D2 | GPIO | |
D3 | GPIO/PWM | |
D4 | GPIO | |
D5 | GPIO | SWD Flash Programming Pin: swclk |
D6 | GPIO | SWD Flash Programming Pin: swdio |
D7 | GPIO | |
D8 | GPIO/PWM | Uart1 rx pin: RX1 |
D9 | GPIO/PWM | Uart1 tx pin: TX1 |
D10 | GPIO/PWM | I2C interface: SCL |
D11 | GPIO/PWM | I2C interface: SDA |
D12 | GPIO/PWM | |
D13 | GPIO/PWM/ADC | |
D14 | GPIO/PWM | |
D15 | GPIO/PWM/ADC | |
D16 | GPIO/PWM/ADC | |
D17 | GPIO/ADC | A LED is connected on WiFiMCU board |
- Basic
-- Install USB Driver
-- Quickly Start with WiFiMCU STUDIO
---- Prepare
---- Power UP
---- Check the COM Port
---- Run WiFiMCU STUDIO
---- Toggle LED on WiFiMCU board
---- Start AP mode
---- Setup a simply webserver
--Use SecureCRT (Optional) - Adavanced
-- Flash LED -use TIMER module
-- Breathing LED -use PWM module
-- Socket programming –use Net module
-- WiFi to Serial transparent transmission
-- Update Firmware
----Get the latest firmware
----Use WiFiMCU STUDIO to update firmware
----Use SecureCRT to update firmware
----Use SWD to update firmware
###How to
- Using MCU Module
- Using GPIO Module
-- GPIO input demo
-- GPIO output demo - Using TIMER Module
- Using WIFI Module
-- Set up a simple AP
-- Set up a advanced AP - Using NET Module
-- Set up a TCP Server
-- Set up a webserver
-- Set up a TCP Client
-- Set up a UDP Server
-- Set up a UDP Client - Using FILE Module
- Using PWM Module
- Using ADC Module
- Using UART Module
-- Uart receive data
-- WiFi to Serial transparent transmission
###Reference
WiFiMCU Function Refecence
WiFiMCU Tutorial
EMW3165 Datasheet(English)
EMW3165 Datasheet(Chinese)
WiFiMCU SCH
###Resource
Home site:www.wifimcu.com
discussion:www.emw3165.com
http://bbs.smartarduino.com
http://bbs.doit.am
###The IDE tool for wifimcu can be found here
https://github.com/SmartArduino/WiFiMCU-STUDIO
#Program demos ####Setup a AP
cfg={ssid='Doit_3165',pwd=''}
wifi.startap(cfg)
####WebServer
skt = net.new(net.TCP,net.SERVER)
net.on(skt,"accept",function(clt,ip,port)
print("accept ip:"..ip.." port:"..port.." clt:"..clt)
net.send(clt,[[HTTP/1.1 200 OK
Server: WiFiMCU
Content-Type:text/html
Content-Length: 28
Connection: close
<h1>Welcome to WiFiMCU!</h1>]])
end)
net.start(skt,80)
####Connect Wireless Router
print(wifi.sta.getip()) --check ip
0.0.0.0
cfg={ssid="Doit",pwd="123456789"} wifi.startsta(cfg) --sta mode connect
print(wifi.sta.getip()) --check ip
0.0.0.0
print(wifi.sta.getip()) --check ip
192.168.1.116
####Connect Remote Server
clt = net.new(net.TCP,net.CLIENT)
net.on(clt,"dnsfound",function(clt,ip) print("dnsfound clt:"..clt.." ip:"..ip) end)
net.on(clt,"connect",function(clt) print("connect:clt:"..clt) end)
net.on(clt,"disconnect",function(clt) print("disconnect:clt:"..clt) end)
net.on(clt,"receive",function(clt,data) print("receive:clt:"..clt.."data:"..data) end)
net.start(clt,6579,"115.29.109.104")
####GPIO Operation
gpio.mode(17,gpio.OUTPUT)
gpio.toggle(17)
gpio.write(17,gpio.HIGH)
gpio.write(17,gpio.LOW)
gpio.mode(17,gpio.INPUT)
=gpio.read(17)
1
=gpio.read(17)
0
####Timer
function tmr_cb() print('tmr1 is called') end
tmr.start(1,1000,tmr_cb)
tmr1 is called
tmr1 is called
####File Operation
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()
####Auto start
file.open ("init.lua","w+")
file.write("print('Hello WiFiMCU!')")
file.close()
mcu.reboot()
####Acknowledgements
Thanks to eLua project,NodeMCU project,spiffs file system
####Doctors of Intelligence & Technology
DoIT website
WiFiMCU Dev Kit
####Version log
v0.9.5@2015-9-5
Release Integer and Float version
Enable LTR function to save ram(48k free)
Update logo
Change exlibs, delete usb folder
Repair package module bug
Add tmr.delayus()
Add sensor/bit module
Add i2c module
Add spi module
Add mqtt(not work yet)
v0.9.4@2015-8-24
repair wifi module bugs
v0.9.3@2015-8-18
change the bootloader ymodem.c
v0.9.2@2015-8-15
add uart/pwm/adc modules change
change net module
change the logo
v0.9.1@2015-7-26
initial publish