This post is just an update to the last one.
Last time I was only able to successfully send SLIP frames over the serial link, but today, after nearly giving up because of slattach and modem flow control, the two machines could ping themselves.
The test was done using an Ubuntu 14.04 virtual machine with the same usbserial dongle. The culprit was the “-L” slattach argument, which disables modem-like flow control (i.e. no RTS/CTS/DTR/… needed) and that’s what I need.
Now I just need to set up iptables to forward packets from BBB’s eth0 to sl0.
In this second part, I’m going to resume what I’ve done since the last post.
For the linux box and usbserial adapter I settled on my BeagleBone Black, which already sports many, I really mean many, UARTs. The procedure to enable the UART on the BBB and setup the SLIP interface is below; my BBB is running Debian 7.5.0 with kernel 3.8.13-bone60 (installed on the eMMC) as the debian (unprivileged) user.
- Power up the BBB and log in via ssh.
- Enable UART1 (pins UART1_TXD:P9_24 and UART1_RXD:P9_26) with this command:
$ sudo sh -c "echo BB-UART1 >> /sys/devices/bone_capemgr.9/slots"
This loads the UART1 Device Tree Overlay via the ‘Bone capemanager.
- Setup the SLIP interface with these commands:
$ sudo slattach -p slip -s 115200 /dev/ttyO1 & $ sudo ifconfig sl0 188.8.131.52 pointopoint 184.108.40.206 up
The former command sets UART1 (which has been loaded as /dev/ttyO1) in SLIP mode at 115200 baud and keeps running in background, presenting us a new network interface called sl0 that the latter command sets up with local IP 220.127.116.11 and remote IP 18.104.22.168. THESE COMMANDS DON’T WORK, READ THIS UPDATE.
This procedure still doesn’t allow the SLIP interface to access Internet, as this is something I have yet to wrap my head around. By the way, I’m actually at a good point in this project, but after realizing that to load Hackaday’s retro/full site I’d have to write at least a TCP and HTTP stack (no, I don’t like uIP for the TCP part), I think I’ll first write a small working UDP/ICMP stack and then I’ll move on to TCP, putting that goal a bit further that I thought.
I did also test the serial line using an usbserial adapter on my main PC connected to UART1, pinging 22.214.171.124 from the BBB (which is the IP i gave to the other end of the SLIP “cable”) and watching on RealTerm for any hex value showing. I even wrote a small C app that loads the hex captured from RealTerm and saved with HxD, and shows (only) the IP header information. You will find everything in a github repo, sooner or later.
For today, this is it; I am going to start writing something for my Launchpad right now, and will tell you everything when it’s time.
This project for the Tiva C Launchpad has been floating in my mind in the last days, and here I am resuming my thoughts before starting.
Everything started from this Hackaday post, when I read about internet over serial and slow modems, reviving in me the charm of such vintage communication modes. I first thought of trying to load the retro Hackaday page on the below setup, though then i realized I could even load the full site, yet needing to write an HTML parser…
What I need is:
- Tiva C Launchpad
- Linux box + usbserial
- TFT LCD
What I’m gonna do is:
- First of all, I need to setup the Linux box to share my internet connection from eth0 to a SLIP interface created with slattach (I may use an interface bridge)
- Then I need to implement the simple SLIP protocol (RFC1055) and test the connection
- After that is done, being able to draw on the LCD screen is the first big thing
- Eventually, writing a (simple) TCP/IP stack and the HTML parser will be the hardest parts
Problems I may encounter:
- The only issue I think I may run into is running out of RAM when loading the full site with images and everything (I’ll probably optimize loading of scripts and CSS by simply ignoring them, but that would defeat the purpose of loading the “full” site)
That’s it for now, when I progress I’ll tell ya everything.