TP-Link TL-WR703N. Small but useful mod

    The miniature router TP-Link TL-WR703N has become a kind of successor to the famous D-Link DIR-320 - on the network you can find many designs based on this device, such as robots with a webcam and web-based control, Internet radio receivers, etc. d. I ordered it for use for its intended purpose, but my hands were still combed to make any design changes - and the idea was born to build a display in the case to display system information. Under the cut - there is little text and a lot of photos) We




    disassemble the router with the most suitable tool for this - an old credit card, take out a fee.



    Near the ethernet connector there is a free area, here we will place the connector on which we will output the UART from the pins TP_IN and TP_OUT, +5 and +3.3 volts for the display, and the ground.



    ByThe router circuit is easy to find where to power.



    That's the display itself, on Ebay it is searched for “Nokia 5110 LCD Module”.



    But even such a small display in the case just does not fit. Part of the board along with two of the four backlight LEDs will have to be cut.



    We try on in the case ...



    ... and cut a window under the display in the lid, and at the same time check its operation.



    We will connect the display to the ATmega48p controller, and it will already read the characters from the UART router. I don’t see a point in the scheme because of its extreme simplicity. The port and pins to which the display is connected can be viewed in the lcd_nokia3310pin.h file from the archive at the end of the article. The library itself is taken from here.

    Printed circuit board.



    Flashing the controller ...



    ... and solder the board from the back of the display.



    We connect to the router. The connector pins are bent - otherwise the display will not fit.



    Everyone is here. You can collect.
    The display is pressed against the usb connector on the board by a cover, not very strong, but enough to make it fixed.



    The display with the controller is understood by only three commands
    :! S00Test ^ - we print “Test” on the first line, starting with the first character;
    ! c - clear the display;
    ! b - turn on / off the backlight.
    The router loads for a long time, and until the first line arrives via UART, a fake text progress bar is filled in the display.



    Router firmware - naturally, OpenWRTHowever, I had to use a slightly modified assembly , in which I managed to get a Huawei E3276 modem. Add a new UMTS / GPRS / EV-DO connection (“MTS” in my case) And in a directory convenient for us, create a script that will send the current time, uptime, number of clients connected via Wi-Fi to the serial port (/ dev / ATH0) , traffic statistics for the connection we created and load average. To set the port speed (9600 baud), you will have to install the stty packet , as at a standard speed of 115200, the controller did not want to receive data at all.




    script text
    #!/bin/sh
    port="/dev/ttyATH0"
    speed="9600"
    stty -F /dev/ttyATH0 raw speed $speed -crtscts cs8 -parenb -cstopb
    lcdwrite() {
      echo "!s0${1}$2^" > $port
    }
    while [ : ]
    do
      s=`date | tail -c 18 | head -c 12`
      lcdwrite 0 "$s"
      sleep 1
      s=`uptime`
      s=`expr "$s" : '.*up.\(.*\),  l'`
      lcdwrite 1 "uptime: $s"
      sleep 1
      s=`iw dev wlan0 station dump | grep Station | wc -l`
      lcdwrite 2 "wifi cl: $s"
      sleep 1
      s=`ifconfig 3g-mts`
      s=`expr "$s" : '.*(\(.*\)).'`
      lcdwrite 3 "DL: $s"
      sleep 1
      s=`ifconfig 3g-mts`
      s=`expr "$s" : '.*(\(.*\))'`
      lcdwrite 4 "UP: $s"
      sleep 1
      s=`uptime | tail -c 17 | head -c 10`
      lcdwrite 5 "LA: $s"
      sleep 1
    done
    

    We make the script executable and add it to startup at the System> Startup> Local Startup section , reboot the router and get the result shown in the first photo)

    Archive with firmware, circuit board file and script - rghost.ru/45733310
    (Caution! The firmware source code may cause bouts of panic, fear and various pains.)

    Also popular now: