When solving problems of electronics, all methods are good if they are satisfied with the TK, the budget and the developer. Linux was unknown to me, but with the tasks that you solve, you grow up yourself. This post will tell you how to use a computer with Ubuntu to connect a large computer with a controller in accordance with the scheme:
The article describes the practice of using the described technique and does not set out to cover all the depths and possibilities of modern equipment. This is one of the solutions to the task.
Description : It is necessary to transfer considerable amounts of data (for example, 50 MB / s each), generated by a controller of a certain device, to a computer with Windows for their subsequent mathematical processing, display in some form on the screen, and so on ...
Solution options :
- Build a controller with Gigabit ethernet interface on FPGA
- The same, but on some thing (for example, AX88180)
- Your option
The first option will not be easy. If you do garlic, then expensive. The implementation of each protocol is a matter of time and skills of the programmer, but this is not the task that you want to spend time creating the device. Without protocol or only up to UDP level - compatibility complexity. Add something new - like a horse to travel.
')
The second option is also not a gift. Implementing an interface for the sake of an interface is not the goal of a project. And such a chip will eat a bunch of legs that might be useful. As a result, the FPGA grows, the fee grows, the budget grows. And there is no simplicity ...
In this regard, they decided to experiment - to build an Ethernet conglomerate on a computer and a controller with a USB interface. The notorious manufacturer of
FTDI relatively recently proposed a solution for USB3.0 based on the
FT600 . And this small computer will interconnect a large and convenient Windows-controlled PC with a controller, it is possible to process the primary data.
The question is, how will a small computer work?
For some reason, the desire to use Windows for this business did not even appear, but Linux is a real option. But the trouble is that no one in the team knows what to do with it. Without hesitation,
Ubuntu Desktop appeared on the virtual machine. Yes, he is working. There was no doubt, but I wanted to see. Now to the point ...
I will not describe all the torments of a person who has used Windows for 20 years and then you have Linux. But I will try to give directions on where to look and what to look for if something goes wrong.
Stages:Computer selectionSingle board computers still did not want to take, because USB 3.0 is not everywhere, not every Gigabit Ethernet that may be suddenly needed, and the actual performance of such cards is a question. I took the decision in a box with an Intel processor, very similar to nuc: HDD 500Gb, RAM 2Gb, USB 3.0, Ethernet 100/1000. I do not think this is a matter of principle.
Install Ubuntu ServerWe go
here . We download the latest version with the inscription LTS, which means long-term support and release of updates up to 5 years.
I had Ubuntu Server 16.04.2.
We put on the PC from the flash drive. For this purpose:
instructions on how to install a boot image on a flash drive, and
instructions on how to install an OS.
Do not forget to tick the box when installing OpenSSH server to access the network to the computer. We will transfer files and control the computer with the help of utilities from Putty.
We configure and supplement the serverIn addition to direct contact with the controller, you need to create an ecosystem that allows you to compile the project (it seemed to me convenient to do this on a prototype, and not on a working machine with cross-compiling), to allocate an IP address for the user's control computer. The most convenient way to install additional packages is to use the online storage of the deb packages available via apt-get, which works when connected to the Internet. Fortunately, this is not the only installation option. If you want not to depend on the Internet and any changes in libraries and packages, you can download the necessary packages and install them yourself with the help of:
sudo dpkg -i <_>.deb
But for this you need to know all the dependencies. For example, the installation of isc-dhcp-server pulled the following packages from me:
- libisccfg-export140
- libirs-export141
- isc-dhcp-server_4.3.3
To begin with, we connect the server to the Internet via a router, which will allocate an IP to it (if anything, look for the settings of the / etc / network / interfaces file in a search engine) and do the following:
Compiler installationFTDI FTD3XX driver examples are written in C ++ 11. You can install the g ++ compiler, and when compiling you will need to specify the option -std = c ++ 11
sudo apt-get install g++
Enter the password and agree.
Now in the folder where there is a correct Makefile you can write
make
and the project will be compiled, but more on that later.
Installing a DHCP serverI used isc-dhcp-server. On ubunte we write:
sudo apt-get install isc-dhcp-server
Enter the password and agree.
- Put the driver from FTDI
- Compile the program
- Making a daemon for autoloading and tracking the program
- We control the processes
At this stage I want to stop and see the reviews of dear readers, and most importantly knowledgeable people. Maybe you should make adjustments. However, the results will appear the second part, more meaningful.