Networking and communications

This week assignment deals with building a wired or wireless network of at least two nodes. So I choosed to build a wired network using a serial bus. For this I milled and stuffed two types of boards, a bridge board and a node board (two of this last one).

Then I programmed the boards using the terminal, first the bridge using the c file "hello.bus.45.c" and the make file "hello.bus.45.make". The commands for programming all the boards are:

The same files are used for the node boards also, but you'll have to change the line 41 of the c file to define the node number. The bridge was defined as '0' and the nodes will be '1' and '2' respectively. You can use Worpad in windows or Nano in Linux for edition, then you save the file with the same filename; you have to do in this way, because the makefile (necessary for compiling) contains the original filename.

I built also the network cable (I made one short and another longer) using a c clamp for assembling and a couple of pins for testing continuity. This 4 pin connector cable connects the signal pins V, GND, Tx and Rx of all the boards and is used also in programming to supply power to the nodes.

Then the bridge board is connected to the computer via a FTDI cable and the two node boards are connected to the bridge board.

Finally execute in the terminal the python file:python term.py /dev/ttyusb0 9600, remenber that you have to place the port address (usually usb0, or find it with the command ls/dev). You can also use the windows shell with the command: python term.py COMX 9600 (being X the port number), and an arduino IDE running the serial terminal (from the tools menu), as yo can see in the following picture.

 

Final comments

Despite the fact that the entire procedure is ok, the results were not as expected, since not always the data entry 0, 1 and 2, weren't properly replicated in the terminal. I reviewed the program and it seems all is well, maybe a problem of data synchronization with the serial port or the baud rate is not adequate.

I will try other types of networks, especially wireless.