Talk about sensors, OSD systems, radios and anything else related to electronic hardware.

WifiMCU

User avatar
User

VArcht

Posts

287

Joined

Thu Mar 06, 2014 5:24 am

WifiMCU

by VArcht » Tue Sep 08, 2015 12:12 am

Picked up a few of these http://www.wifimcu.com/

Idea is to be able to log into a fc and adjust settings over wifi without a gcs.

Just started playing with it and learning Lua but happy to be making some progress.

uavo stream is coming through, next up is to parse the objects and serve a web page "black box".

wifidbg1.png
wifidbg1.png (62.39 KiB) Viewed 1809 times


Lua Script

Code: Select all
--uavtalk WifiMCU
print("------uavtalk WifiMCU------")
--setup a ap
cfg={ssid = 'WiFiMCU_Wireless',pwd = ''}
wifi.startap(cfg)
cfg=nil

print("tcp server started")
skt = net.new(net.TCP,net.SERVER)
uartClt = nil --save the clt socket
net.on(skt,"accept",function(clt,ip,port) uartClt = clt; end)
net.on(skt,"disconnect",function(clt) uartClt=nil end)
net.on(skt,"receive",function(clt,d)
   print("Receive:"..d)
   uartClt = clt
   --send to uart 1
   uart.send(1,d)
end)

net.start(skt,9000)

--uart pin:D8(RX1), D9(TX1)
--setup uart
uart.setup(1,9600,'n','8','1')

-- local write = io.write

function hexdump(buf)
    local n = #buf
    for i=1, n do
        if (buf:byte(i) == 0x3C) then io.write'\\n' end   
        local v = string.format('%02X ', buf:byte(i))..""
        io.write(v)   
    end
end

uart.on(1, 'data',hexdump)
User avatar
User

DougLorenz

Posts

86

Joined

Fri Jun 05, 2015 4:38 am

Location

Sacramento, CA

Re: WifiMCU

by DougLorenz » Tue Sep 08, 2015 12:55 am

I tried to do something kind of like this using ESP8266, but kept having trouble getting it to do a reliable access point. I look forward to watching your efforts.

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron