From 6249dd6074624e13e2820ef30cf0603a971013f3 Mon Sep 17 00:00:00 2001 From: Jaro Date: Fri, 15 Oct 2021 18:55:13 +0200 Subject: [PATCH] speed, script update --- openwrt/files/usbserial-dw.config | 2 +- openwrt/files/usbserial-dw.sh | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/openwrt/files/usbserial-dw.config b/openwrt/files/usbserial-dw.config index b29222b..a4093ad 100644 --- a/openwrt/files/usbserial-dw.config +++ b/openwrt/files/usbserial-dw.config @@ -1,6 +1,6 @@ config capture option port /dev/ttyUSB0 - option speed 115200 + option speed 460800 option directory /tmp option file camera.jpg option url https://meranie.bh.ttx.sk/upload/image diff --git a/openwrt/files/usbserial-dw.sh b/openwrt/files/usbserial-dw.sh index 0b67028..547caad 100644 --- a/openwrt/files/usbserial-dw.sh +++ b/openwrt/files/usbserial-dw.sh @@ -19,8 +19,10 @@ parse_capture() { config_get _file "$section" "file" config_get _url "$section" "url" + echo $PROG --port $_port --speed $_speed --path $_dir --file $_file --capture $PROG --port $_port --speed $_speed --path $_dir --file $_file --capture - cd $_dir + cd $_dir + echo $CURL -X POST -F "submit=OK" -F "file=@camera.jpg" $_url $CURL -X POST -F "submit=OK" -F "file=@camera.jpg" $_url rm $_file } @@ -39,10 +41,12 @@ parse_post() { _hum=`$PROG --humidity` _pre=`$PROG --pressure` - $_mqtt_prg -h $_host -t $_topic/temperature -m N:$_tmp - $_mqtt_prg -h $_host -t $_topic/humidity -m N:$_hum - $_mqtt_prg -h $_host -t $_topic/pressure -m N:$_pre - + echo $_mqtt_prg -h $_host -t $_topic/temperature -m N:${_tmp} + $_mqtt_prg -h $_host -t $_topic/temperature -m N:${_tmp} + echo $_mqtt_prg -h $_host -t $_topic/humidity -m N:${_hum} + $_mqtt_prg -h $_host -t $_topic/humidity -m N:${_hum} + echo $_mqtt_prg -h $_host -t $_topic/pressure -m N:${_pre} + $_mqtt_prg -h $_host -t $_topic/pressure -m N:${_pre}} } start() {