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 18.104.22.168 pointopoint 22.214.171.124 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 126.96.36.199 and remote IP 188.8.131.52. 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 184.108.40.206 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.
Today I’m here to introduce you to my little loved BeagleBone Black, the 45$ ARM PC which carries a whopping 1GHz ARM Cortex-A8, 512MB of DDR3L RAM and 2GB of eMMC (onboard flash storage) and features 65 GPIOs, many SPI, I2C, UART lanes, an Ethernet PHY, μHDMI output and *just* one USB host port.
As you can guess, it’s a very powerful Altoids-can-sized (or credit-card-sized if you prefer) board which can boot a custom Linux 3.8 kernel; that means you can run Ubuntu, Android, Arch or any Linux distro you may prefer.
The BeagleBoard.org developers decided to ship this little guy loaded with Linux Angstrom, a distro tailored to embedded computing. Oooh… Angstrom! The first thing I did after failing to get something working on this distro, was flashing Ubuntu to the eMMC. And I do not regret. Ubuntu just runs much better and is much more lightweight, so much that it just needs 50MB of RAM to run the basic services.
So, this is the first of the many incoming articles about my BeagleBone Black (one of which is already in the works), which I hope will help someone in need of an enlightenment.
Bye bye! 😀