4E Network

From SlugWiki
Revision as of 18:32, 12 January 2006 by Wrchan (Talk)

Jump to: navigation, search


As the number of planned projects increased, it became clear that we needed a set of standards which would allow them to communicate with a central computer and each other. It is not practical to have a separate computer, separate wiring, and a separate communications protocol for every project. The 4E network will allow all the projects to share these things.

The network will use RS485 serial. This standard was chosen because it allows for multiple nodes to be connected to a single cable run. It is also extremely easy to interface with serial on computer and a PIC.

Each PIC will be its own node, so a project may have multiple nodes. For example, Bemix version 3 will have one node for each bathroom. On the other hand, a single node may be associated with multiple projects. The control panel will provide a physical interface to most 4E projects.

Each node will have a unique address and will filter incoming data and only listen to packets that are addressed to it.

The 4E network will most likely be full duplex, meaning that a node can transmit and recieve at the same time. It is unclear whether it is better to have the computer poll each node or to implement some collision avoidance system.

Packet Format

Each packet consists of an 8 byte header and up to 256 bytes of data, along with escape sequences to separate the parts:

Size Contents
1 escape
1 header code
8 header
1 escape
1 data code
0-256 data
1 escape
1 end code

The header is shown below:

Byte Contents
1 destination address
2 source address
3 version
4 length of data
5 0
6 0
7 0
8 0

Check out more projects going on around 4e.