BeagleBoard/GSoC/BeagleBone-based serial terminal server

=BeagleBone-based Serial Terminal Server Proposal=

Easily set up a serial terminal server on a BeagleBone, configure and manage attached serial devices through an UI and read past I/O logs.

Student: Giorgio Gross Mentors: Michael Welling Code: https://github.com/ordsen/BeagleBone-based-Serial-Terminal-Server Wiki: http://elinux.org/BeagleBoard/GSoC/BeagleBone-based_serial_terminal_server GSoC: [GSoC entry]

=Status= This project is currently just a proposal. I am collecting Ideas and thoughts on my blog and preparing for the project on GitHub

=Proposal= I made a pull request to the gsoc-application repo

About me
IRC: ordsen Github: https://github.com/ordsen School: Karlsruhe Institute of Technology Country: Germany Primary language: German Typical work hours: 8AM-4PM UTC

About my project
Project name: BeagleBone-based Serial Terminal Server

Synopsis
There are many commercial solutions for serial terminal servers such as those provided by Cisco or Moxa. Their products allow easily accessing serial devices connected to a server from remote and include features like buffering of past I/O, remote configuration of serial devices through an UI, interconnecting serial devices over a network or setting up rules for automation. However, these products are often expensive and exceed the budget of makers, small developer studios or hobbyists. This project aims to provide an open source solution which includes most of these features, is easy to set up and runs on the BB.

--verbose
Let's step back a bit: What is this all about and what is already possible? Let's assume you have a laser cutter standing in your living room 'cause your one of these people who have a laser cutter in their living room. And lets assume that said laser cutter provides an UART interface for logging its head position and accepting shutdown-messages. As you want to control what's really going on you connect a BB to the laser cutter. Now you could log into the BB via SSH (from your PC) and read out all the messages from the terminal you used to open that SSH connection. But configuring the serial port from the command line and reading all the logs continuously sounds like a time consuming task. This is where my project comes to the rescue: Instead of doing all of this manually, get the Debian image which this project will be packaged into. After you hooked up everything, you just open the provided website in your browser and use the UI to configure the serial ports you need and to enable logging. Now all I/O will be written to a log file and logging will go on even if you disconnect your PC from the BB. After you enjoyed yourself watching the cutter cutting things out you decide to send a shutdown-message through the web interface to the laser cutter. After the shutdown, all the I/O logs are still available on the BB and you can read them whenever you want.

Project Structure
The project can be divided into three main components which expose interfaces to other components. These components and interfaces describe the deliverables:
 * C Library for accessing UART devices: Direct access to the serial devices will be done inside a C-library like component. It will handle communication with multiple serial devices, keep track of all the configurations for each serial port and map the logging files to the appropriate serial port. The project was supposed to use already existing software like Screen or Minicom, but they are more appropriate for interactive tasks. Expect can be useful for scripted interaction, but the actual device access will happen through device nodes. The library is accessed through an interface written in C. Stretch Goals: Also include SPI, I2C etc.
 * Library Interface: This interface allows other applications, e.g. the front end, to access the library's features.
 * NodeJS Bindings: As the terminal server component will be implemented with NodeJS I also need bindings to talk to my library. This component behaves like a wrapper.
 * Terminal Server: This provides a runtime for the web interface. The first goal for this component is to just delegate calls from the web interface to the binding. Stretch Goals: For future use this component can be turned into a web server which exposes the HTML interface to the whole network. Note that functionality can be extended here without needing to modify the C library. This comes in handy when features like automation, action buttons, interconnection of serial devices, scripted interaction (etc) are added.
 * HTML Interface: Provides the web interface and other applications with an HTML interface. The scope of this component depends on the features implemented in the terminal server component. To allow access to new features this interface will have to be extended accordingly.
 * Web Interface: Any functionality added to the terminal server component can be included into the UI and will rely on the HTML interface. Implementation will happen with ReactJS unless I find an appropriate framework/template to start from. The UI provides the user with...
 * Configuration of UART communication (parity bit, baud rate)
 * Enable/Disable logging of I/O to files
 * Read logs and current messages
 * Send messages to a UART device
 * Handle multiple UART devices comfortably

Timeline
Provide a development timeline with a milestone each of the 11 weeks. (A realistic timeline is critical to our selection process.)  TODO as soon as scope is approved...

2017-06-06: Milestone #1 2017-06-13: Milestone #2 2017-06-20: Milestone #3 2017-06-27: Milestone #4 2017-07-04: Milestone #5 2017-07-11: Milestone #6 2017-07-18: Milestone #7 2017-07-25: Milestone #8 2017-08-01: Milestone #9 2017-08-08: Milestone #10 2017-08-15: Milestone #11

Experience and approach
I developed strong skills in Java and after creating some PC pograms and Android apps in Java I got involved in web development. I wrote a web back end for an Android app in PHP and proceeded with writing small JavaScript games. You can find some of my projects on my website or GitHub profile. In my latest project I created an app in a team of five people, the code can be seen in this repo. I also experimented with C# and Unity5. However, after finding out about Arduino I decided to give embedded systems a closer look and created a DIY smart watch some time ago which offloads processing intensive tasks to an Android phone. My university requires me to know basics in Assembler and some robust C skills. At the moment, I'm developing my C skills even further in order to prepare for GSoC (and my C exam) and I'm confident that I will improve my C coding until GSoC starts. I know that I will also have to get familiar with the BeagleBone, so I ordered one to try out some ideas before GSoC starts, including finding out about drivers, serial communication and web servers(see my blog). I'm also spending some time to get more familiar with NodeJS.

I aim to specialize on embedded systems during my studies and regard GSoC as a great opportunity to dive into this topic; I enjoy working on projects I'm interested in and, in these cases, am comfortable with steep learning curves

Contingency
BeagleBone is an open source project, but even more important, its an open source community. If I get stuck on a problem and my mentor is not available I will ask the community for help and try to find a solution that way. If there still is no solution or there is something only my mentor knows I can also proceed with different tasks until he is available again.

Benefit
After implementing above features, end user will be able to set up a serial terminal server and to configure serial ports faster and without needing to use the command line. This will lead to more people regarding BeagleBoards as a true alternative to costly commercial products. Developers can build applications which access serial devices straight through the HTML interface, which will make including serial device interaction easier. As the project evolves (stretch goals, future developments) it will move more towards a serial control application, equipped with useful API's which, at some point, might allow accessing serial devices through the Internet. This project will lay the foundation of making such a serial control application along with a feature rich API possible.

TODO add quotes

Suggestions
I intend to dedicate most of my time to this project. This means that I will not attend university lectures or work elsewhere during the coding period except from one course which I will have to attend. That will require about 7h a week; I will make sure to provide up to 40h/week for GSoC and use the weekends for preparing that course.