Difference between revisions of "4E Network"

From SlugWiki
Jump to: navigation, search
m (33 revisions imported)
 
(30 intermediate revisions by 8 users not shown)
Line 1: Line 1:
The purpose of the 4E Network is to interface all of our microcontroller-based [[Projects]] to a central computer. We will use RS485 serial because it allows multiple devices and will be simple to implement  on a PIC. Our implementation is similar to RS232, but allows up to 32 devices to be strung together on 2 pairs of  cables.  Each device will have a unique address, which will allow multiple devices on a single line.
+
===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
 +
 
 +
{| border="1"
 +
|-
 +
| 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)
 +
<pre>
 +
'\' 'H' 01 70 64 1 '\' 'E'
 +
'\' 'H' 01 70 64 5 '\' 'E'
 +
</pre>
 +
 
 +
===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:
 +
<pre>
 +
'\' 'H' 70 01 64 'D' '\' 'E'
 +
'\' 'H' 70 01 64 'E' '\' 'E'
 +
</pre>
 +
 
 +
===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
 +
<pre>
 +
'\' 'H' 70 01 32 '\' 'E'
 +
'\' 'H' 01 70 32 '\' 'E'
 +
</pre>
 +
 
 +
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==
 
==See Also==
* [[Bemix]]
+
*[[Bemix]]
* [[Cruft Alarm]]
+
*[[Bemix Notes]]
 +
*[[Control Panel]]
 +
*[http://portmasters.com portmasters.com]
 +
*[http://bemix.org/bemixnet bemixnet]
  
[[Category:Slugfest Projects]]
+
[[Category: Projects]]

Latest revision as of 23: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