Reader small image

You're reading from  GNU/Linux Rapid Embedded Programming

Product typeBook
Published inMar 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781786461803
Edition1st Edition
Languages
Right arrow
Author (1)
Rodolfo Giometti
Rodolfo Giometti
author image
Rodolfo Giometti

Rodolfo Giometti is an engineer, IT specialist, GNU/Linux expert and software libre evangelist. He is the author of the books BeagleBone Essentials, BeagleBone Home Automation Blueprints and GNU/Linux Rapid Embedded Programming by Packt Publishing and maintainer of the LinuxPPS projects. He still actively contributes to the Linux source code with several patches and new device drivers for industrial applications devices. During his 20+ years of experience, he has worked on the x86, ARM, MIPS, and PowerPC-based platforms. Now, he is the co-chief at HCE Engineering S.r.l., where he designs new hardware and software systems for the quick prototyping in industry environment, control automation, and remote monitoring.
Read more about Rodolfo Giometti

Right arrow

Communicating with a remote device


Since the scope of this book is not to provide details on networking programming, we're not going to spend too much time in showing the several available communication protocols or in explaining the details of the following example codes. However, we're going to show you how you can use an Ethernet port to quickly establish a networking communication.

A simple TCP client/server application

Just as a simple example of network communication, we can use two simple Python programs that implement a TCP/IP client and server examples. These examples are not so useful to show you how you can write a server or a client (there are tons of these examples on the Internet). However, they are useful to show you how you can easily interact with several ready-to-use tools (presented in the next section) that can speed up the development stage of every networking task.

The first program is named tcp_srv.py, and it implements a TCP/IP server. Here is its relevant code:

# Check...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
GNU/Linux Rapid Embedded Programming
Published in: Mar 2017Publisher: PacktISBN-13: 9781786461803

Author (1)

author image
Rodolfo Giometti

Rodolfo Giometti is an engineer, IT specialist, GNU/Linux expert and software libre evangelist. He is the author of the books BeagleBone Essentials, BeagleBone Home Automation Blueprints and GNU/Linux Rapid Embedded Programming by Packt Publishing and maintainer of the LinuxPPS projects. He still actively contributes to the Linux source code with several patches and new device drivers for industrial applications devices. During his 20+ years of experience, he has worked on the x86, ARM, MIPS, and PowerPC-based platforms. Now, he is the co-chief at HCE Engineering S.r.l., where he designs new hardware and software systems for the quick prototyping in industry environment, control automation, and remote monitoring.
Read more about Rodolfo Giometti