OpenWrt Forum Archive

Topic: wrt54gsv4 test serial port

The content of this topic has been archived on 12 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,
I would be grateful if someone could explain if it is possible to demonstrate a test for ttys0 and ttys1 on a wrt54gsv4 with openwrt-wrt54gs_v4-squashfs.bin installed.
I have read the wiki on that router in openwrt, and understand the modifications required to add a line driver chip, which I have done.
My problem seems to be that there is no command built into the "Busybox" that installed to configure/start the serial ports

BusyBox v1.00 (2007.01.30-11:42+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
WHITE RUSSIAN (0.9) -------------------------------
  * 2 oz Vodka   Mix the Vodka and Kahlua together
  * 1 oz Kahlua  over ice, then float the cream or
  * 1/2oz cream  milk on the top.
---------------------------------------------------
root@OpenWrt:~# opkg update
-ash: opkg: not found
root@OpenWrt:~# busybox
BusyBox v1.00 (2007.01.30-11:42+0000) multi-call binary

Usage: busybox [function] [arguments]...
   or: [function] [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use, and BusyBox
        will act like whatever it was invoked as.


Currently defined functions:
        [, arping, ash, awk, basename, bunzip2, busybox, bzcat, cat, chgrp,
        chmod, chown, chroot, clear, cp, crond, crontab, cut, date, dd,
        df, dirname, dmesg, du, echo, egrep, env, expr, false, fgrep,
        find, free, grep, gunzip, gzip, head, hexdump, hostid, httpd,
        id, ifconfig, init, insmod, kill, killall, killall5, klogd, length,
        ln, lock, logger, logread, ls, lsmod, md5sum, mesg, mkdir, mkfifo,
        mknod, mktemp, more, mount, mv, nc, netmsg, netstat, nslookup,
        passwd, pidof, ping, ping6, pivot_root, printf, ps, pwd, rdate,
        reboot, reset, rm, rmdir, rmmod, route, sed, seq, sh, sleep, sort,
        strings, sync, sysctl, syslogd, tail, tar, tee, telnet, telnetd,
        test, time, top, touch, tr, traceroute, true, udhcpc, umount,
        uname, uniq, uptime, vconfig, vi, watchdog, wc, wget, which, xargs,
        yes, zcat

I am able to WinSCP into the router and see all the directories/files.

Can I install the files to "set serial" with that instead of opkg, which was "not found"


As you can probably gather, I am new to this, but any help will be much appreciated.
Thanks in advance
David

ps

login as: root
root@192.168.1.1's password:


BusyBox v1.00 (2007.01.30-11:42+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
WHITE RUSSIAN (0.9) -------------------------------
  * 2 oz Vodka   Mix the Vodka and Kahlua together
  * 1 oz Kahlua  over ice, then float the cream or
  * 1/2oz cream  milk on the top.
---------------------------------------------------
root@OpenWrt:~# ipkg install http://downloads.openwrt.org/backfire/1 … cm-2.4.ipk
Downloading http://downloads.openwrt.org/backfire/1 … cm-2.4.ipk
wget: downloads.openwrt.org: Unknown host
Nothing to be done
An error ocurred, return value: 4.
Collected errors:
ipkg_download: ERROR: Command failed with return value 1: `wget --passive-ftp    -q -P /tmp/ipkg-0uIYhp http://downloads.openwrt.org/backfire/10.03.1/brcm-2.4/packages/setserial_2.17-1_brcm-2.4.ipk'
Cannot find package http://downloads.openwrt.org/backfire/1 … m-2.4.ipk.
Check the spelling or perhaps run 'ipkg update'
root@OpenWrt:~#

(Last edited by dh1948 on 10 Jun 2013, 10:53)

It seems I was able to update after connecting the linksys wan port to my internet router.
Cheers though,
D
ps do I need to implement stty and if so how
root@OpenWrt:/usr/sbin# stty -a /dev/tts/1
stty: can't resolve symbol '__uClibc_start_main'

After searching I extracted stty from
http://downloads.openwrt.org/kamikaze/8 … mipsel.ipk
I can execute
root@OpenWrt:~# stty -F /dev/tts/1 115200
root@OpenWrt:~#

without any errors,
but the big question is how do I test the serial port?

(Last edited by dh1948 on 10 Jun 2013, 20:36)

I found that with the cat command I could see when my jumper wire  connected  serial port header TX_1 to RX_1 (loopback). Proof that I am "getting through" to serial port ttyS1 (tx and rx increase by 12). Removing the short, only tx increased by 12.


root@OpenWrt:~#  cat /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:B8000300 irq:3 baud:116379 tx:4804 rx:4592 RTS|DTR
1: uart:16550A port:B8000400 irq:3 baud:9588 tx:61 rx:53 CTS|DSR|CD
root@OpenWrt:~# echo "hello world" > /dev/tts/1
root@OpenWrt:~#  cat /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:B8000300 irq:3 baud:116379 tx:4804 rx:4592 RTS|DTR
1: uart:16550A port:B8000400 irq:3 baud:9588 tx:73 rx:65 CTS|DSR|CD
root@OpenWrt:~# echo "hello world" > /dev/tts/1
root@OpenWrt:~#  cat /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:B8000300 irq:3 baud:116379 tx:4804 rx:4592 RTS|DTR
1: uart:16550A port:B8000400 irq:3 baud:9588 tx:85 rx:65 CTS|DSR|CD


There must be a simpler way to demonstrate a test though????

The discussion might have continued from here.