Transfer files over serial / uart from ONT to PC (linux)

Hello there,

I'm playing with an old ONT (Alcatel-Lucent I-010G-U) on which I am trying to learn things before breaking the real important hardware :face_with_hand_over_mouth:

I've connected the UART cable (USB to TTL) and have no problem connecting to the ONT with screen or minicom.

I wanted to transfer the files on the ONT to my computer in order to easily read them, learn from them, and have some sort of a backup - however, I can't manage to find a way to transfer them to my PC.

I've searched the internet and the answers I've found could not work for me (I do not have a network cable connected, I can not find rz/sz on my ONT, etc.)

For example, this is all I have in the ONT's busybox

#ONT/system/shell>busybox
BusyBox v1.18.4 (2014-02-25 17:37:25 CST) multi-call binary.
Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.

Usage: busybox [function] [arguments]...
   or: busybox --list[-full]
   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:
        [, [[, ar, arp, arping, ash, awk, basename, bunzip2, bzcat, bzip2, cal,
        cat, catv, chgrp, chmod, chown, cksum, cmp, comm, cp, cut, date, dd,
        df, dirname, dmesg, dnsdomainname, dos2unix, du, echo, egrep, env,
        expand, expr, false, fgrep, fold, free, ftpget, ftpput, grep, gunzip,
        gzip, halt, head, hostid, hostname, id, ifconfig, ifdown, ifup, init,
        insmod, install, ip, ipaddr, ipcs, iplink, iproute, iprule, iptunnel,
        kill, killall, killall5, length, linuxrc, ln, logname, logread,
        losetup, ls, lsmod, lspci, lsusb, md5sum, mkdir, mkfifo, mknod, mktemp,
        modinfo, modprobe, mount, mountpoint, mv, netstat, nice, nohup, od,
        pidof, ping, ping6, poweroff, printenv, printf, ps, pwd, readlink,
        realpath, reboot, rm, rmdir, rmmod, route, run-parts, sed, seq, sh,
        sha1sum, sha256sum, sha512sum, sleep, sort, split, stat, stty, sum,
        sync, sysctl, syslogd, tac, tail, tar, tee, test, tftp, top, touch, tr,
        traceroute, traceroute6, true, tty, udhcpc, umount, uname, unexpand,
        uniq, unix2dos, usleep, uudecode, uuencode, vconfig, vi, wget, zcat

I thought about transferring the files over network, but connecting my PC (linux mint 20.3) directly to the ONT doesn't work (neither gets an IP address, I assume because neither has DHCP).
Maybe I can somehow force them communicate over network and then use FTP?

I'm a newbie trying to learn, so any help will be appreciated. Thanks.

(Note: I know installing OpenWRT on an ONT is silly, but I'm using the ONT as a learning step, not as the final destination :slight_smile: )

See e.g. the guides for https://openwrt.org/toh/arcadyan/vgv7510kw22, which needs that for the initial flashing from OEM.

You have got ifconfig to configure the NIC, and ftpput to upload files to an ftp server.
Doesn't the box run a webinterface? Reuse of the http daemon is more convenient than using an external ftp server.

Thanks
@slh - I reviewed the link, but I could not find anything there that helped me... maybe I'm missing something... I don't have network connection between the two devices and as far as I could see, everything there uses FTP over network.

@Mijzelf - no web interface as the ONT is not accessible from network, only from UART so far.

I've tried connecting the ONT to the main router but it did not get an IP assigned to it. I then tried to give it an IP manually, inside the range, but it still has no network access

#ONT/system/shell>ip ad add 192.168.1.66/24 dev eth0
#ONT/system/shell>ip a      
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether a8:58:40:6a:5a:8c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.66/24 scope global eth0
#ONT/system/shell>ping 192.168.1.1            <--- ROUTER       
PING 192.168.1.1 (192.168.1.1): 56 data bytes
ping: sendto: Network is unreachable
#ONT/system/shell>ping 192.168.1.100        <-- DESKTOP
PING 192.168.1.100 (192.168.1.100): 56 data bytes
ping: sendto: Network is unreachable

I've tried connecting the two machines directly with a network cable

  • Assigned static IP 10.0.0.10 to my desktop linux using the networking GUI
  • Assigned static IP 10.0.0.20 to my ONT using
ip ad del 10.0.0.20/24 dev eth0

Pinging from ONT

#ONT/system/shell>ping 10.0.0.10                   
PING 10.0.0.10 (10.0.0.10): 56 data bytes
ping: sendto: Network is unreachable

Pinging from desktop

$ ping 10.0.0.20
PING 10.0.0.20 (10.0.0.20) 56(84) bytes of data.
From 10.0.0.10 icmp_seq=1 Destination Host Unreachable
From 10.0.0.10 icmp_seq=2 Destination Host Unreachable
From 10.0.0.10 icmp_seq=3 Destination Host Unreachable
From 10.0.0.10 icmp_seq=4 Destination Host Unreachable

Still trying. It's a learning process :slight_smile:

if the busybox functions you posted earlier are working, uuencode, then cat the uuencoded file through the serial connection.
capture it on the client, and uudecode.

if it's a large file, bzip2 it 1st, then uuencode.

1 Like

The NIC is DOWN. Try ifup eth0

Progress!

The ONT has 21 interfaces - lo, eth, teql, tunl, lan, wan,...
Once I moved the assigned IP to lan0 instead of eth0, the network looks fine

Thank you all for helping. I know this is not 100% an OpenWRT issue, so I really appreciate it.
Now to try FTPing, SSHing, Telneting, etc :nerd_face:

#ONT/system/shell>ip addr add 192.168.1.66/24 brd + dev lan0

#ONT/system/shell>ifconfig
lan0      Link encap:Ethernet  HWaddr A8:58:40:6A:5A:8C  
          inet addr:192.168.1.66  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:461 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:22838 (22.3 KiB)  TX bytes:2280 (2.2 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

#ONT/system/shell>ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=0.799 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=0.541 ms

--- 192.168.1.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.541/0.670/0.799 ms

#ONT/system/shell>netstat -tunpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      296/dropbear
tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN      292/telnetd

1 Like

More progress!

I have installed tftpd-hpa on my desktop, configured it, and managed to transfer a file from the ONT to the desktop :star_struck:

$ sudo apt-get install tftpd-hpa
$ sudo vi /etc/default/tftpd-hpa
$ sudo systemctl restart tftpd-hpa.service

and now when I run

#ONT/system/shell>tftp -p -l /tmp/testing/test.txt -r /mnt/tftp/test.txt 192.168.1.100

the file gets to my /mnt/tftp folder.

So, to sum it up - I didn't manage to transfer files over serial / UART but I did manage to configure and set up my environment to be able to transfer files over TFTP

I followed the instructions here: https://www.baeldung.com/linux/tftp-server-install-configure-test
Comments about this how-to:

  • I had to set the owner of the target folder to tftp:tftp as it didn't work for me with their suggested permissions (0777 nobody:nogroup)
  • I chose not to use --secure in order not to complicate things as I turn off the TFTP server anyways when I'm not using it.

Thank you @frolic @Mijzelf @slh for your help!