国内综合精彩aⅤ无码不卡_日本少妇做爰全过程_欧美性爱在线播放免费_午夜?V日韩一区二区_免费a级毛片无码免费播放_成在人线av无码喷水_亚洲精品网站色视频_国产婷婷精品成人_老师撩起裙子让我桶的视频_秋霞影院国产

出現(xiàn)DNS失敗,是什么原因,如何解決?

作者:coldfish | 更新時(shí)間:2016-11-18 | 瀏覽量:2478

系統(tǒng)能正常運(yùn)行大約半小時(shí),然后出現(xiàn)以下錯(cuò)誤。

DNS retry 1!
DNS retry 2!
DNS retry 3!
DNS retry 4!
DNS Fail!
如何解決呢?


評(píng)論:共7條

貝殼物聯(lián) 評(píng)論于:2016-11-18 16:13:27
請(qǐng)?jiān)敿?xì)說明一下問題出現(xiàn)的情景。什么系統(tǒng),運(yùn)行的什么代碼?
coldfish 評(píng)論于:2016-11-18 17:04:34
DEVICEID = "939"
APIKEY = "0XXXXXXXe"
INPUTID = "875"
host = host or "m.placeboworld.cn"
port = port or 8181
uOnline = 0
LED = 8
gpio.mode(LED,gpio.OUTPUT)
local function run()
local cu = net.createConnection(net.TCP)
cu:on("receive", function(cu, c)
print("R:"..c)
r = cjson.decode(c)
if r.M == "say" then
if r.C == "play" then
gpio.write(LED, gpio.HIGH)
ok, played = pcall(cjson.encode, {M="say",ID=r.ID,C="LED turn on!"})
cu:send( played.."\n" )
end
if r.C == "stop" then
gpio.write(LED, gpio.LOW)
ok, stoped = pcall(cjson.encode, {M="say",ID=r.ID,C="LED turn off!"})
cu:send( stoped.."\n" )
end
firstidx, lastidx, key, value = string.find(r.C, "(%a+)%s+(%d+)")
if key == "open" then
print(key,value)
time=tonumber(value)
gpio.write(LED,gpio.HIGH)
tmr.alarm(2,time*1000,0,function()
gpio.write(LED,gpio.LOW)
end)
ok, stoped = pcall(cjson.encode, {M="say",ID=r.ID,C="LED turn off!"})
cu:send("open "..value.."\n" )
end
end
if r.M == "checkinok" then
pwm.close(signLed)
pwm.setup(signLed,1,1000)
pwm.start(signLed)
uOnline=1
end
end)
cu:on('disconnection',function(scu)
cu = nil
--停止心跳包發(fā)送定時(shí)器,5秒后重試
tmr.stop(1)
pwm.close(signLed)
pwm.setup(signLed,1,512)
pwm.start(signLed)
uOnline=0
tmr.alarm(6, 5000, 0, run)
end)
cu:connect(port, host)
ok, s = pcall(cjson.encode, {M="checkin",ID=DEVICEID,K=APIKEY})
if ok then
print(s)
else
print("failed to encode!")
end
cu:send(s.."\n")
tmr.alarm(1, 30000, 1, function()
temp=adc.read(0)
str="{\"M\":\"update\",\"ID\":\""..DEVICEID.."\",\"V\":{\""..INPUTID.."\":\""..temp.."\"},\"K\":\""..APIKEY.."\"}\n"
if uOnline==1 then
cu:send(str.."\n")
print(str)
else
cu:send(s.."\n")
-- print(s)
end
end)
end
run()


就是這段代碼,運(yùn)行一段時(shí)間后就報(bào)上面的錯(cuò)誤
coldfish 評(píng)論于:2016-11-18 17:06:40
我猜是不是原先的數(shù)據(jù)間格太小,或者沒有設(shè)置成公開?
coldfish 評(píng)論于:2016-11-18 17:12:58
NudeMCU,帶json,adc,wifi,uart,file等模塊
貝殼物聯(lián) 回復(fù)于:2016-11-18 21:26:17
回復(fù) @coldfish:試試直接用貝殼的IP地址,不用域名
host = host or "121.42.180.30"
coldfish 回復(fù)于:2016-11-24 10:09:28
回復(fù) @貝殼物聯(lián):好的,有可能是域名解析有問題
spzmmd 評(píng)論于:2017-08-12 09:24:29
我出現(xiàn)這個(gè)問題都是網(wǎng)絡(luò)不順,換個(gè)好網(wǎng)就沒事了
返回頂部