Difference between revisions of "4E Network"

From SlugWiki
Jump to: navigation, search
(Server Hardware)
m (33 revisions imported)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Introduction==
+
===Wiring===
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 requires one twisted pairs. Becuase the 4E network is a bus, adding a new node is as easy as tapping off the closes existing node. Currently, Shallow Walcott, Bemis, and Shallow Goodale bathrooms as well as both lounges have 4E network wiring.
  
The 4E network uses a combination of half and full duplex RS485 and RS232. Some devices have a dedicated line back to the server while others are on a bus.
 
 
The latest version of the 4E network is half duplex RS485 in a bus configuration. The Walcott lounge and bathroom have use this.
 
 
==Wiring==
 
The 4E network requires one twisted pairs.
 
  
 
Each bathroom recieves 2 cat 3 cables for Bemix, one for signal and one for power. The signal cable is pinned as shown below
 
Each bathroom recieves 2 cat 3 cables for Bemix, one for signal and one for power. The signal cable is pinned as shown below
Line 14: Line 8:
 
|-
 
|-
 
| Wire
 
| Wire
| Walcott
+
| Function
| Bemis
+
 
|-
 
|-
 
| Green with white
 
| Green with white
 
| Tx/Rx+
 
| Tx/Rx+
| Tx+
 
  
 
|-
 
|-
 
| White with green
 
| White with green
 
| Tx/Rx-
 
| Tx/Rx-
| Tx-
 
  
 
|-
 
|-
 
| Orange with white
 
| Orange with white
 
| unused
 
| unused
| Rx+
 
  
 
|-
 
|-
 
| White with orange
 
| White with orange
 
| unused
 
| unused
| Rx-
 
  
 
|-
 
|-
 
| Blue with white
 
| Blue with white
| Left audio
 
 
| Left audio
 
| Left audio
 
|-
 
|-
 
| White with blue
 
| White with blue
|Audio ground
 
 
|Audio ground
 
|Audio ground
 
|-
 
|-
 
| Brown with white
 
| Brown with white
| Right audio
 
 
| Right audio
 
| Right audio
 
|-
 
|-
 
| White with brown
 
| White with brown
| Audio ground
 
 
| Audio ground
 
| Audio ground
 
|}
 
|}
Line 56: Line 41:
 
For the power cable, all colored wires are +12V and all white wires are ground.
 
For the power cable, all colored wires are +12V and all white wires are ground.
  
==Server Hardware==
 
The portmaster serial port server is accessed through telnet:
 
*administrative-port 23
 
*serial port 0-port 6000
 
*serial port 1-port 6001
 
* ...
 
*serial port 30-port 6030
 
  
Now, everything is 6025 and 6026 just listens in.
 
  
==4E Network Protocol==
 
===Packet Format===
 
All data sent over the 4E network is encapsulated in packets. The packet format is outlined below:
 
*header code (2 bytes) = escape character + header character
 
*header (3 bytes)
 
*data (variable length)
 
*end code (2 bytes) = escape character + end character
 
where:
 
*escape character = '\'
 
*header character = 'H'
 
*end character = 'E'
 
  
The header contains three 1 byte fields:
+
==Connecting to the 4E Network==
*'''destination address:''' This allows the server to route packets from one client to another.
+
The portmaster serial port server is accessed through telnet:
*'''source address:''' This allows one client to respond to a request made by another client.
+
*administrative - port 23
*'''port:''' This tells the device what type of data to expect and how to processes it.
+
*4E network, debug - port 6020
 +
*4E network, primary - port 6025
 +
*Shallow Goodale - port 6026 (temporary)
  
Note: If the escape character needs to be transmitted in the data block, two should be transmitted instead.
+
====Addresses====
 +
Each device, including the server, is a assigned a unique address.
 +
* 0 = unused
 +
* 1 = server
 +
* 66 (B) = Bemis
 +
* 67 (C) = control panel
 +
* 71 (G) = shallow goodale
 +
* 87 (W) = shallow walcott
 +
* 92 (\) unused
 +
* 255 = broadcast, all devices listen (not yet implemented)
  
===Data and Ports===
+
====Ports====
Currently, only three ports will be implemented:
+
Ports can include:
 
*31 - debug
 
*31 - debug
 
*32 - ping
 
*32 - ping
 
*64 - Bemix
 
*64 - Bemix
 +
*65 - control panel
  
 
Other possible ports include:
 
Other possible ports include:
 
*EEPROM - for storing data that is currently hardcoded but shouldn't be
 
*EEPROM - for storing data that is currently hardcoded but shouldn't be
 
*programming - so the PICs can download their own software
 
*programming - so the PICs can download their own software
*cocoa pot
 
*other projects
 
  
==Addresses==
+
===Data===
Each device, including the server, is a assigned a unique address.
+
 
* 0 = unused
+
 
* 1 = server
+
* 66 (B) = Bemis
+
* 67 (C) = control panel
+
* 71 (G) = shallow goodale
+
* 87 (W) = shallow walcott
+
* 92 (\) unused
+
* 255 = broadcast, all devices listen
+
  
 
==How to control Bemix==
 
==How to control Bemix==
Line 139: Line 108:
  
 
==To Do==
 
==To Do==
 +
* Make it so that messages not addressed to the PIC don't overwrite the recieve buffer
 +
* Make code modular
 
* Fix bugs with reception
 
* Fix bugs with reception
 
* Store PIC's address in EEPROM, be able to send an address and data pair and have PIC write it to EEPROM
 
* Store PIC's address in EEPROM, be able to send an address and data pair and have PIC write it to EEPROM
 
* Make devices listen to address 255
 
* Make devices listen to address 255
 
==PIC Code==
 
See [[Bemix PIC code]].
 
  
 
==See Also==
 
==See Also==
Line 151: Line 119:
 
*[[Control Panel]]
 
*[[Control Panel]]
 
*[http://portmasters.com portmasters.com]
 
*[http://portmasters.com portmasters.com]
 +
*[http://bemix.org/bemixnet bemixnet]
  
 
[[Category: Projects]]
 
[[Category: Projects]]

Latest revision as of 22:53, 25 August 2015

Wiring

The 4E network requires one twisted pairs. Becuase the 4E network is a bus, adding a new node is as easy as tapping off the closes existing node. Currently, Shallow Walcott, Bemis, and Shallow Goodale bathrooms as well as both lounges have 4E network wiring.


Each bathroom recieves 2 cat 3 cables for Bemix, one for signal and one for power. The signal cable is pinned as shown below

Wire Function
Green with white Tx/Rx+
White with green Tx/Rx-
Orange with white unused
White with orange unused
Blue with white Left audio
White with blue Audio ground
Brown with white Right audio
White with brown Audio ground

For the power cable, all colored wires are +12V and all white wires are ground.



Connecting to the 4E Network

The portmaster serial port server is accessed through telnet:

  • administrative - port 23
  • 4E network, debug - port 6020
  • 4E network, primary - port 6025
  • Shallow Goodale - port 6026 (temporary)

Addresses

Each device, including the server, is a assigned a unique address.

  • 0 = unused
  • 1 = server
  • 66 (B) = Bemis
  • 67 (C) = control panel
  • 71 (G) = shallow goodale
  • 87 (W) = shallow walcott
  • 92 (\) unused
  • 255 = broadcast, all devices listen (not yet implemented)

Ports

Ports can include:

  • 31 - debug
  • 32 - ping
  • 64 - Bemix
  • 65 - control panel

Other possible ports include:

  • EEPROM - for storing data that is currently hardcoded but shouldn't be
  • programming - so the PICs can download their own software

Data

How to control Bemix

When a Bemix client is booted, it sends a packet to the server containing "Bemix v3.0" over the debug port.

Touch Switch Output

The Bemix clients will send an ASCII number 1 through 5, corresponding to the 5 touch switches. The PIC can be programmed to send a single packet when a switch is touched or a continuous stream (at adjustable repeat rate) when it is touched.

Example: touch switches 1 and 5 are touched on device 70 which is programmed to tell device 1 (the server)

'\' 'H' 01 70 64 1 '\' 'E'
'\' 'H' 01 70 64 5 '\' 'E'

Touch Switch Recalibration

The touch switch may be recalibrated by disabling it then reenabling it. This is done by sending a packet containing "D" followed by "E" over the Bemix port:

'\' 'H' 70 01 64 'D' '\' 'E'
'\' 'H' 70 01 64 'E' '\' 'E'

Ping

Bemix clients will respond to a packet over the pinging port with an empty packet over the same port.

Example: server pinging device 70 and its response

'\' 'H' 70 01 32 '\' 'E'
'\' 'H' 01 70 32 '\' 'E'

One possible use of pinging is to build a routing table by sending a pinging each serial port to map serial port numbers to device addresses.

To Do

  • Make it so that messages not addressed to the PIC don't overwrite the recieve buffer
  • Make code modular
  • Fix bugs with reception
  • Store PIC's address in EEPROM, be able to send an address and data pair and have PIC write it to EEPROM
  • Make devices listen to address 255

See Also