Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have cisco e900 router, with dd-wrt firmware, i connect it to arduino uno-r3 + LCD 16*2 to show-up the status and some data from that router, anyway i am using TX-RX port in both sides my problem is: there is no data!! arduino LCD just showing that > "dd-wrt - powerd cisco e900"

is there any mistake i make in my code !! this is my code on my arduino
C++
// include the library code:
#include <Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
int led1 = 8;
float raw;
byte bl[8] = {
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
};
void setup(){
   pinMode(led1, OUTPUT);
   lcd.begin(16, 2);
  Serial.begin(9600);
  lcd.createChar(1, bl);
  lcd.createChar(2, bl);
  lcd.createChar(3, bl);
  lcd.createChar(4, bl);
  lcd.setCursor(0,0);
  lcd.print("dd-wrt - powered");
  lcd.setCursor(0,1);
  lcd.print("cisco e900");
}
void loop()
{
  int charcount;
  boolean secondline;
  if (Serial.available()) {
    delay(200);
    lcd.clear();
    charcount = 0;
    secondline = false;
    while (Serial.available() > 0) {
      if (charcount > 15 && secondline == false ) {
        lcd.setCursor(0,1);
        secondline = true;
      }
      char inChar = (char)Serial.read();
      if (inChar != '\0') {
      lcd.write(inChar);
    }
       if (inChar == '\3') {
      digitalWrite(led1, HIGH);
      }
       if (inChar == '\4'){
      digitalWrite(led1, LOW);
     }
      charcount++;
    }
  }
 }

and this command on my router cisco e900
<pre lang="Python">#!/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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900