Fix prameters
Add upload camera.jpg
This commit is contained in:
28
read.sh
28
read.sh
@@ -3,14 +3,14 @@
|
|||||||
host="172.16.1.254"
|
host="172.16.1.254"
|
||||||
topic="home/sensor/strecha/bme280"
|
topic="home/sensor/strecha/bme280"
|
||||||
url="https://meranie.bh.ttx.sk/upload/image"
|
url="https://meranie.bh.ttx.sk/upload/image"
|
||||||
tty="/dev/ttyUSB0"
|
ttyname="/dev/ttyUSB0"
|
||||||
|
|
||||||
cd /tmp
|
cd /tmp
|
||||||
|
stty -F $ttyname 115200 -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -
|
||||||
|
tostop -echoprt -echoctl -echoke
|
||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
while true
|
|
||||||
do
|
|
||||||
echo "measure"
|
echo "measure"
|
||||||
|
|
||||||
input=
|
input=
|
||||||
@@ -35,19 +35,17 @@ do
|
|||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
break
|
break
|
||||||
done <$ttyname >$ttyname
|
done <$ttyname >$ttyname
|
||||||
|
|
||||||
mosquitto_pub -h $host -t $topic/temperature -m N:$t
|
mosquitto_pub -h $host -t $topic/temperature -m N:$t
|
||||||
mosquitto_pub -h $host -t $topic/humidity -m N:$h
|
mosquitto_pub -h $host -t $topic/humidity -m N:$h
|
||||||
mosquitto_pub -h $host -t $topic/pressure -m N:$p
|
mosquitto_pub -h $host -t $topic/pressure -m N:$p
|
||||||
|
|
||||||
echo "capture" > $ttyname
|
echo "capture" > $ttyname
|
||||||
echo "rb" > $ttyname
|
echo "rb" > $ttyname
|
||||||
rb --ymodem <$ttyname >$ttyname
|
rb --ymodem <$ttyname >$ttyname
|
||||||
|
|
||||||
echo "free" > $ttyname
|
echo "free" > $ttyname
|
||||||
|
|
||||||
curl -v -X POST -F "submit=OK" -F "file=@camera.jpg" $url
|
curl -v -X POST -F "submit=OK" -F "file=@camera.jpg" $url
|
||||||
rm camera.jpg
|
rm camera.jpg
|
||||||
sleep 300
|
|
||||||
done
|
|
||||||
|
|||||||
Reference in New Issue
Block a user