Skip to content
Permalink
Browse files

demo

  • Loading branch information...
admin
admin committed Mar 18, 2016
1 parent 2748b72 commit 72fc7d57ab1508c57caef0f5ef3788e83cd0f153
0 modules/mysql/mysql.php 100644 → 100755
No changes.
0 modules/mysql/mysql_add.php 100644 → 100755
No changes.
0 modules/mysql/mysql_send.php 100644 → 100755
No changes.
0 modules/mysql/mysql_settings.php 100644 → 100755
No changes.
0 modules/mysql/mysql_test.php 100644 → 100755
No changes.
@@ -6,47 +6,25 @@ date=`date +%y%m%d-%H%M`
dev=ttyACM0
dev2=ttyUSB0
ip=172.18.10.101
i2c=500
gpio=1

skey=$(sqlite3 -cmd ".timeout 2000" $dir/dbf/nettemp.db "select server_key from settings WHERE id='1'")

# wifi counters
val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=water value=$val device=wireless ip=$ip current=$val

val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=gas value=$val device=wireless ip=$ip current=$val

val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=elec value=$val device=wireless ip=$ip current=$val

#wifi temp
val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=temp value=$val device=wireless ip=$ip current=$val

#gpio counters
val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=water value=$val device=gpio gpio=1 current=$val

val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=gas value=$val device=gpio gpio=2 current=$val

val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=elec value=$val device=gpio gpio=3 current=$val

#ups USB
val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey usb=$dev device=usb value=$val type=watt current=$val

val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey usb=$dev device=usb value=$val type=volt current=$val

val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey usb=$dev device=usb value=$val type=amps current=$val

#watt
val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey usb=$dev2 device=usb value=$val type=watt current=$val

for i in temp humid relay lux press volt amps watt trigger gas water elec
do
val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=$i value=$val device=wireless ip=$ip current=$val
val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=$i value=$val device=gpio gpio=$gpio current=$val
val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=$i value=$val device=i2c i2c=$i2c current=$val
val=$(( ( RANDOM % 10 ) + 1 ))
php-cgi -f $dir/receiver.php key=$skey type=$i value=$val device=usb usb=$dev2 current=$val
done



#sqlite3 dbf/nettemp.db "DELETE FROM newdev"
#sqlite3 dbf/nettemp.db "DELETE FROM sensors"

0 comments on commit 72fc7d5

Please sign in to comment.
You can’t perform that action at this time.