TE923 script Installieren

te923tool runterladen und conf datei erstellen

sudo apt-get update
sudo apt-get install gcc
sudo apt-get install libusb-dev
wget http://te923.fukz.org/downloads/te923tool-0.6.1.tgz
tar -xvzf te923tool-0.6.1.tgz
cd te923tool-0.6.1/
gcc -Wall -lusb -o te923con te923con.c te923usb.c te923com.c
ls -l te923con
sudo cp te923con /usr/bin/
sudo nano /etc/udev/rules.d/99-te923.rules
ATTRS{idVendor}=="1130", ATTRS{idProduct}=="6801", MODE="0660", GROUP="plugdev", RUN="/bin/sh -c 'echo -n $id:1.0 > /sys/bus/usb/drivers/usbhid/unbind'"

STRG O / J / STRG X

sudo udevadm control --reload-rules
sudo mkdir /usr/lib/cgi-bin
sudo nano /usr/lib/cgi-bin/get_data.cgi 
#!/bin/bash
TE923=/usr/bin/te923con
#header content type end empty line
echo "Content-type: text/plain"
echo
#end header
#parameter
PARAM="$QUERY_STRING" #oder $1
#run
if [ -x $TE923 ]; then
#binary must be placed into same dir
#this runs only if apache user www-data is member of group plugdev
#and udev rule is added
 case "$PARAM" in
 data) $TE923 -i 'i';;
 status) $TE923 -s -i 'i';;
 debug) $TE923 -D -i 'i';;
 version) $TE923 -v;;
 esac
fi
sudo chmod a+x /usr/lib/cgi-bin/get_data.cgi
export QUERY_STRING=data
/usr/lib/cgi-bin/get_data.cgi
sudo bash -c "QUERY_STRING=data"
/usr/lib/cgi-bin/get_data.cgi
Content-type: text/plain 1565908927:21.15:64:15.20:48:i:i:i:i:i:i:i:i:1014.7:i:5:0:15:0.8:0.5:15.0:975

sudo reboot

sudo te923con

1565909025:21.15:65:15.20:48:i:i:i:i:i:i:i:i:1014.7:i:5:0:14:0.8:0.7:15.0:975

Hessen Werra-Meissner-Kreis