|
|
il y a 5 ans | |
|---|---|---|
| .. | ||
| .vscode | il y a 5 ans | |
| lib | il y a 5 ans | |
| lib-old | il y a 5 ans | |
| sound | il y a 5 ans | |
| AM2320.lua | il y a 5 ans | |
| README.md | il y a 5 ans | |
| config.lua | il y a 5 ans | |
| control.lua | il y a 5 ans | |
| err.log | il y a 5 ans | |
| haikang.lua | il y a 5 ans | |
| hmi.lua | il y a 5 ans | |
| iot.lua | il y a 5 ans | |
| main.lua | il y a 5 ans | |
增加mqtt异常检测
增加指令可开关定时拍照 {"cmd":"photo","ext":{"ws":0}} {"cmd":"control","ext":{"status":0,"type":"timer photo status"}}
滴液时间更改为1
增加远程对焦拍照
更改开机语音,"欢迎使用孢子捕捉仪"
更改拍照出发间隔改为1.1S,待测试
iot中,定时9点抓拍任务: 增加: sys.wait(15000) haikang.http_chose_photo_task()
haikang中,增加 http_chose_photo、http_chose_photo_task函数,图像采集完毕,http触发图片筛选; http封装函数,开新携程,retry重试3次,通过http状态码判断是否请求成功;如果成功, 增加提示音提示; 将图像采集完毕的标志位置1,替换为http请求;
control中增加转盘转动超时标志位和复位超时标志位; turn_timeout = 0 turn_reset_timeout = 0
iot中:增加预警上报; if control.turn_reset_timeout ~= 0 then
if not mqttc:publish(pub, upwarn("turn_reset_timeout:",control.turn_reset_timeout), serverconf.qos) then break end
control.turn_reset_timeout = 0
end if control.turn_timeout ~= 0 then
if not mqttc:publish(pub, upwarn("turn_timeout:",control.turn_timeout), serverconf.qos) then break end
control.turn_timeout = 0
end
优化语音提示OK; 将培养时间默认值改为1小时;
修改所有相关滴液时间默认为2; 本地测试更换的语音提示;
1、 -- 涂抹凡士林油:在正常工作流程中,增加10s延时后,再转转盘到收集位置; -- 涂抹凡士林油: audio.play('/ldata/alarm.mp3') if first_turn == 0 then
-- turn(1,5)
-- 判断是否在复位位置;
turn_init()
turn()
-- 涂抹凡士林油:
add_fsl(dat,5)
sys.wait(10000)
first_turn = 1
end -- 涂完凡士林,再次转动转盘; turn() 2、 滴液时间修改为200ms,测试; -- sys.wait(t*1000) sys.wait(200)
3、增加了远程转仓指令: {"ext": {"type": "turn"}, "cmd": "ctrl"}
云飞孢子仪,最新结构,加凡士林,加初始限位版本:V2.5
VERSION = "2.1.13"
1、control中 -- 最低端拍照一张、最高端拍一张; -- haikang.autotakepic() -- 自动对焦: haikang.autotakepic2()
2、自动运行时:
-- http出发计算清晰度;
local url = "http://yfzhwlw.com/test"
local param = {
imei="",
step = 0,
photo_num = 0
}
while not socket.isReady() do sys.wait(2000) end
param.imei = misc.getimei()-- 唯一ID
param.step = step
param.photo_num = photo_num
log.error("#################### type param is:",type(param))
local code, head, body = http.request("POST", url, 5000,nil,param)
log.error("#################### http code is:",code)
log.error("#################### http body is:",body)
if code == "200" then
log.error("#################### http code is:",code)
end
VERSION = "2.1.12"
hmi中,单个测试项结束,增阿测试页面的提示语显示; 滴液测试结束后,发送粘附测试结束
VERSION = "2.1.11" hmi测试模式下: 对应动作执行完,按钮归位;
对焦拍照:write('sysTest.switchAutopic.val=0')
立即拍照:write('sysTest.switchPic.val=0')
散热:write("sysTest.switchCool.val=0")
凡士林涂抹: sys.taskInit(function()
control.add_fsl(dat,5)
sys.wait(10*1000)
write('sysTest.switchFsl.val=0')
end)
升级完成,上报http码
if update.uptate_ok ~= 0 then
log.warn('======================= update is ok!!!')
if not mqttc:publish(pub, upwarn("bzy_update",update.uptate_ok), serverconf.qos) then break end
update.uptate_ok = 0
end
VERSION = "2.1.10"
if code == "200" then
io.writefile(UPD_PATH, body)
uptate_ok = code
break
else
uptate_ok = code
break
end
mqtt上报拍照完成后,将step和photo_num清零;
haikang.step = 0 haikang.photo_num = 0
set_photo_step:
2--------750张左右; 20-------75张左右; 10-------150张左右;
VERSION = "2.1.9"
-- 涂完凡士林,再次转动转盘; turn()
VERSION = "2.1.8"
增加对拍照脉冲数的设定和读取指令: {"cmd":"get_photo_step"} {"cmd":"warn","ext":{"status":100,"type":"get_photo_step"}}
{"cmd":"set_photo_step","ext":100} {"cmd":"warn","ext":{"status":100,"type":"set_photo_step"}}
优化:拍照步进数:step,在mqtt上传step后,将step清零; 判断由 >= 5,改为%5 == 0
while limit_up() == 1 do
step = step + 1
motor_mv(1)
sys.wait(1)
motor_mv(0)
sys.wait(1)
-- 拍照的脉冲间隔;
-- if step >= 5 then
if step%photo_step == 0 then
-- sys.wait(1000)
photo_num = photo_num + 1
sys.wait(2000)
log.warn("=========================take pic!!!")
hk_takephoto()
end
end
VERSION = "2.1.7"
一键测试时和正常工作的循环中,收集完毕,转盘转动后,滴液前增加5s的延时 立即拍照中增加拍照后mqtt触发图片选择后显示;
VERSION = "2.1.6" 一键测试:hmi write('sysTest.swichAutotest.val=0') 改为: write('sysTest.switchAutotest.val=0')
VERSION = "2.1.5" 优化流程;
上电:转盘复位; 开始收集时:判断是否在复位位置:如果在,则转一次盘,后加凡士林;如果不在,则先复位,后转一次转盘,最后加凡士林; 流程结束,拍照后,转盘转动用复位限位检测;
修改stm8,复位操作; 如果复位限位在位,则转盘不动; 同样202复位操作,先判断限位是否在位,如果在位,则不发送转动转盘指令;
转盘转动期间,发送复位指令;或者复位期间,发送转盘指令,做异常处理:增加转盘转动标志位;
VERSION = "2.1.4" 优化限位;
一键测试;
解决bug:一键测试下,回显屏幕按钮导致的测试流程异常;
VERSION = "2.1.3" 执行完拍照流程后,和重启系统前,增加停止所有STM8动作; 其实,此处不用调用,正常流程到此处,stm8动作全部停止了;
sec = sec or 30-- 超时时长设为10s时,刚好转90度;避免刚好错过上一个限位,所以设置为两个90度的时间;
VERSION = "2.1.2" 执行完拍照流程后,和重启系统前,增加停止所有STM8动作; 其实,此处不用调用,正常流程到此处,stm8动作全部停止了;
haikang.autotakepic() resetinit() log.error("this work finished,system will restart after 5s!!!") sys.restart("work finished")
VERSION = "2.1.1" 1、 status中,增加当前工作阶段的字段: work_sta = 0,-- 工作状态:0待机;1收集;2培养;3拍照; status.work_sta = hmi.hmista.work_sta 2、 在两个mqtt客户端中,增加设置设备开关和制冷开关后,上传指令响应后,再上传最新状态; if not mqttc:publish(pub, upwarn("coldon","ok"), yfmqtt.qos) then break end if not mqttc:publish(pub, upStatus(), yfmqtt.qos) then break end
-- 孢子捕捉仪: PROJECT = "BZY-V21" VERSION = "2.1.0"