script problem with arduino

Post new topic   Reply to topic    DD-WRT Forum Index -> Hardware DIY / Hardware Mods
Author Message
narzan
DD-WRT Novice


Joined: 26 Apr 2015
Posts: 2

PostPosted: Sun Apr 26, 2015 2:42    Post subject: script problem with arduino Reply with quote
hi everyone, i don't know where i must post this post!
anyway Rolling Eyes i connect my cisco e900 with arduino+LCD to display all data on that screen,
i am using TX&RX ports to send the data to the arduino
my problem is the code not work! there is no data
this is my code
Code:
#!/bin/sh
I=`nvram get wl0_ifname`
SR="/dev/tts/0"
vr=`nvram get DD_BOARD`
stty -F /dev/tts/0 9600

while sleep 1; do

WIP=`nvram get wan_ipaddr`
NC=`grep 0x /proc/net/arp | grep br0 | wc -l`
DU=`uptime  | cut -c2-9`
UP=`awk '{print int($1/3600)":"int(($1%3600)/60)":"int($1%60)}' /proc/uptime`
LD=`uptime  | sed -n -e 's/^.*average: //p' |  sed s/[,]//g`
D1=`date +"%F"`
D2=`date +"%r"`
Rxw=`grep vlan1 /proc/net/dev | awk '{print ($2-l1)/1024"kB/s"}'`
Txw=`grep vlan1 /proc/net/dev | awk '{print ($10-l2)/1024"kB/s"}'`
Rxv=`grep eth1 /proc/net/dev | awk '{print ($2-l1)/1024"kB/s"}'`
Txv=`grep eth1 /proc/net/dev | awk '{print ($10-l2)/1024"kB/s"}'`
NET=`wget -qO- http://ipecho.net/plain`
ISP=`nslookup $NET | tr ' ' '\n' | tail -1 | cut -d. -f3`
IS="your_isp_home_page"
SP=`ping -c2 -W2 $IS | tail -1`
PM=$(echo $SP | awk '{print $4}' | cut -d '/' -f 1);
PA=$(echo $SP | awk '{print $4}' | cut -d '/' -f 2);
PI=$(echo $SP | awk '{print $4}' | cut -d '/' -f 3);

  if [ -z `wl -i $I assoclist` ]; then
     echo -ne "\4" > $SR
    else
     echo -ne "\3" > $SR
  fi
  echo -n "$vr" > $SR
sleep 8

  echo -ne "$D1      $D2" > $SR
  sleep 3
    echo -ne "WAN IP:         $WIP" > $SR
  sleep 3
 if ! ping -c2 -W2 $IS > /dev/null; then
   echo -ne "$NC client        Internet DOWN" > $SR
   echo -ne "\2" > $SR
   nt=0;
 else
   nt=1;
   echo -ne "$NC client        Internet UP" > $SR
   echo -ne "\1" > $SR
   sleep 3
   echo -ne "Net IP:         $NET" > $SR
   sleep 3
   echo -ne "ISP:            $ISP" > $SR
 fi
  sleep 3
 if [ "$nt" -eq 1 ]; then
    echo -ne "Ping avg: $PA$PM/$PI" > $SR
  sleep 4
 fi
    echo -ne  "WAN RX:         $Rxw" > $SR
  sleep 3
    echo -ne  "WAN TX:         $Txw" > $SR
  sleep 3
    echo -ne "WLan RX:        $Rxv" > $SR
  sleep 3
    echo -ne "WLan TX:        $Txv" > $SR
  sleep 3
    echo -ne "Time $DU   UP $UP " > $SR
  sleep 3
    echo -ne "Load            $LD" > $SR
  sleep 3
done

can someone help me in this?
Sponsor
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Hardware DIY / Hardware Mods All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum