Difference between revisions of "PowerbarQuadSwitch"

From Technologia Incognita
Jump to: navigation, search
m (History / Technical)
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Project
 
{{Project
|ProjectStatus=Active
+
|picture=Quadswitch.jpg
 +
|ProjectStatus=Finished
 
|ProjectNiche=Electronics
 
|ProjectNiche=Electronics
 
|ProjectPurpose=Infrastructure
 
|ProjectPurpose=Infrastructure
 
}}
 
}}
With the use of 4x a two-way toggle switch with neutral center rest position, [[user:Jinx]] and [[user:ultratux]] are building a simple powerbar frontend with programmable functions. We're suggesting having one switch do '''lights ON''' / '''lights OFF''', the second do '''power ON''' / '''power OFF''', the third likely do '''audio ON''' / '''audio OFF'''. Fourth switch still TBD.  
+
= Operation =
Or perhaps more logical, '''lights West ON/OFF''', '''lights East ON/OFF''', '''Power ON/OFF''', '''Audio ON/OFF'''.
+
 
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
 
 +
 
 +
'''See picture on the right. Four two-way toggle switches with center null rest position.'''
 +
 
 +
 
 +
{| border="2" cellspacing="0" cellpadding="4" rules="all" style="clear:right; width:700px; margin:5px 0 1em 1em; border:solid 1px; border-collapse:collapse; background-color:#F9F9F9; font-size:95%; empty-cells:hide" class="wikitable"
 +
|- style="background: #DDDDDD; color: #000000; text-align:center;"
 +
|  On
 +
|  On
 +
|  On
 +
|  On
 +
|- style="background: #DDDDDD; color: #000000; text-align:center;"
 +
| <b>Lights East</b> || <b>Lights West</b> || <b>Power sockets</b> || <b>Audio system</b>
 +
|- style="background: #DDDDDD; color: #000000; text-align:center;"
 +
|  Off
 +
|  Off
 +
|  Off
 +
|  Off
 +
|}
 +
 
 +
= History / Technical =
 +
 
 +
<br>
 +
 
 +
With the use of 4x a two-way toggle switch with neutral center rest position, [[user:The_JinX]] and [[user:ultratux]] and [[user:Wizzup]] have built a simple powerbar frontend with programmable functions. We're suggesting having one switch do lights ON / lights OFF, the second do power ON / power OFF, the third likely do audio ON / audio OFF. Fourth switch still TBD.  
 +
 
  
 
<s>Currently, the box has been built, work needs to get done on making the electronics, either with an ESP and a circuit to extend that to 8 I/O pins, or <something else>. Project is currently a bit stalled due to lack of time...</s>
 
<s>Currently, the box has been built, work needs to get done on making the electronics, either with an ESP and a circuit to extend that to 8 I/O pins, or <something else>. Project is currently a bit stalled due to lack of time...</s>
  
A new idea hatched; instead of using an ESP and wifi etc., we are running a direct cable from the switch to the GPIO pins of the ARM board that drives the RS232 of the west space powerbar. Not only is that easier, it takes out the wifi and network as single point of failure. Thanks go out to [[user:Piele]] for initiating the discussion that led to this new idea.
 
  
The switchbox has been wired up, here I document how it is wired:
+
A new idea hatched; instead of using an ESP and wifi etc., we are running a direct cable from the switch to the GPIO pins of the ARM board that drives the RS232 of the west space powerbar. Not only is that easier, it takes out the wifi and network as single point of failure. Thanks go out to [[user:Piele]] for initiating the irc discussion that, indirectly, led to this new idea.
 +
 
 +
 
 +
The switchbox has been wired up, documentation how it is wired:
 +
 
  
 
leftmost switch => green pair
 
leftmost switch => green pair
 +
 
next switch => orange pair
 
next switch => orange pair
 +
 
next switch => blue pair
 
next switch => blue pair
 +
 
rightmost switch => brown pair
 
rightmost switch => brown pair
 +
 
shield (yep, it's STP for a reason): common
 
shield (yep, it's STP for a reason): common
 +
  
 
In all cases, pushing the switch up connects the white/colour wire to common, pushing the switch down connects the colour wire to common.
 
In all cases, pushing the switch up connects the white/colour wire to common, pushing the switch down connects the colour wire to common.
  
Left to do [[user:ultratux]]: run the wire up to the arm board (Mars) and put in onto a suitable header
+
In the marsboard case I placed a tiny perfboard which has 8 pullup resistors of 10K to pull the signals up to 3V3, and 8 1nF capacitors that ''may'' help stop outside interference/spikes (in any case it doesn't hurt) to ground.
 +
 
 +
 
 +
<s>Left to do [[user:ultratux]]: run the wire up to the arm board (Mars) and put it onto a suitable header.
 +
  n.b. suitable header means: '''2mm pitch !!''' So check what, if any, type header is on the board, and order stuff
 +
  It is likely pullup/pulldown resistors are needed as well, which means you'll have to have room to wire that.</s>
 +
 
 +
<s>Left to do: Reflash/change the mars board A10 so it can use GPIO pins. </s>
 +
  <s>n.b. In the schematics I saw only 6 pins labeled as GPIO. Does that mean we're 2 pins short or are other pins easily usable too?</s>
 +
 
 +
Today I took the marsboard and connected the wires. They are connected up to pins 43, 44, 45, 46, 47, 48, 61, 62, which translate to GPIO PH20-PH27.
 +
We had to change some pins; pins we chose initially did not work out cause we couldn't determine their names in the software universe.
 +
We also found out not all pins supported interrupts so we had to resort to polling. Every... 0.2 of a second I think... the software people were dismayed.
 +
 
 +
<s>Left to do by someone more fluent in coding: write code that evaluates the GPIO pins and tells the powerbar daemon what function to perform.</s>
 +
[[user:Wizzup]] Today did some magic on the marsboard which led to it recognizing 8 GPIO pins. We determined them to be wired up thusly:
 +
 
 +
sw 1 up    = /sys/class/gpio/gpio1_ph20/value
 +
sw 1 down  = /sys/class/gpio/gpio2_ph21/value
 +
sw 2 up    = /sys/class/gpio/gpio3_ph22/value
 +
sw 2 down  = /sys/class/gpio/gpio6_ph25/value
 +
sw 3 up    = /sys/class/gpio/gpio5_ph24/value
 +
sw 3 down  = /sys/class/gpio/gpio7_ph26/value
 +
sw 4 up    = /sys/class/gpio/gpio8_ph27/value
 +
sw 4 down  = /sys/class/gpio/gpio4_ph23/value
 +
 
 +
We're currently writing the code that -probably- fires off a curl call when it sees one of these change state...
 +
 
 +
= To Do =
 +
 
 +
<br>
 +
 
 +
<s>Left to do by [[user:Wizzup]]: Test/ascertain/verify that both powerbar daemons still continue working independently when a network outage severs the link between them, ie. not panic but still evaluate the local button-presses and send them to the local powerbar.</s>
 +
 
 +
We still want to run an ethernet cross cable between the two systems that manage the powerbars so no outage in any network component can inhibit the full functionality of the powerbar system then (quadswitch is hardwired, and the computers are hardwired to the powerbars with RS232).
  
Left to do by someone more fluent in coding: write code that evaluates the GPIO pins and tell the powerbar what function to perform.
+
This to help address the concerns [[user:Piele]] raised.

Latest revision as of 23:10, 26 November 2015

Projects
Quadswitch.jpg
Participants The JinX, Ultratux, Wizzup
Skills
Status Finished
Niche Electronics
Purpose Infrastructure

Operation










See picture on the right. Four two-way toggle switches with center null rest position.


On On On On
Lights East Lights West Power sockets Audio system
Off Off Off Off

History / Technical


With the use of 4x a two-way toggle switch with neutral center rest position, user:The_JinX and user:ultratux and user:Wizzup have built a simple powerbar frontend with programmable functions. We're suggesting having one switch do lights ON / lights OFF, the second do power ON / power OFF, the third likely do audio ON / audio OFF. Fourth switch still TBD.


Currently, the box has been built, work needs to get done on making the electronics, either with an ESP and a circuit to extend that to 8 I/O pins, or <something else>. Project is currently a bit stalled due to lack of time...


A new idea hatched; instead of using an ESP and wifi etc., we are running a direct cable from the switch to the GPIO pins of the ARM board that drives the RS232 of the west space powerbar. Not only is that easier, it takes out the wifi and network as single point of failure. Thanks go out to user:Piele for initiating the irc discussion that, indirectly, led to this new idea.


The switchbox has been wired up, documentation how it is wired:


leftmost switch => green pair

next switch => orange pair

next switch => blue pair

rightmost switch => brown pair

shield (yep, it's STP for a reason): common


In all cases, pushing the switch up connects the white/colour wire to common, pushing the switch down connects the colour wire to common.

In the marsboard case I placed a tiny perfboard which has 8 pullup resistors of 10K to pull the signals up to 3V3, and 8 1nF capacitors that may help stop outside interference/spikes (in any case it doesn't hurt) to ground.


Left to do user:ultratux: run the wire up to the arm board (Mars) and put it onto a suitable header.

 n.b. suitable header means: 2mm pitch !! So check what, if any, type header is on the board, and order stuff
 It is likely pullup/pulldown resistors are needed as well, which means you'll have to have room to wire that.

Left to do: Reflash/change the mars board A10 so it can use GPIO pins.

 n.b. In the schematics I saw only 6 pins labeled as GPIO. Does that mean we're 2 pins short or are other pins easily usable too?

Today I took the marsboard and connected the wires. They are connected up to pins 43, 44, 45, 46, 47, 48, 61, 62, which translate to GPIO PH20-PH27. We had to change some pins; pins we chose initially did not work out cause we couldn't determine their names in the software universe. We also found out not all pins supported interrupts so we had to resort to polling. Every... 0.2 of a second I think... the software people were dismayed.

Left to do by someone more fluent in coding: write code that evaluates the GPIO pins and tells the powerbar daemon what function to perform. user:Wizzup Today did some magic on the marsboard which led to it recognizing 8 GPIO pins. We determined them to be wired up thusly:

sw 1 up    = /sys/class/gpio/gpio1_ph20/value
sw 1 down  = /sys/class/gpio/gpio2_ph21/value
sw 2 up    = /sys/class/gpio/gpio3_ph22/value
sw 2 down  = /sys/class/gpio/gpio6_ph25/value
sw 3 up    = /sys/class/gpio/gpio5_ph24/value
sw 3 down  = /sys/class/gpio/gpio7_ph26/value
sw 4 up    = /sys/class/gpio/gpio8_ph27/value
sw 4 down  = /sys/class/gpio/gpio4_ph23/value

We're currently writing the code that -probably- fires off a curl call when it sees one of these change state...

To Do


Left to do by user:Wizzup: Test/ascertain/verify that both powerbar daemons still continue working independently when a network outage severs the link between them, ie. not panic but still evaluate the local button-presses and send them to the local powerbar.

We still want to run an ethernet cross cable between the two systems that manage the powerbars so no outage in any network component can inhibit the full functionality of the powerbar system then (quadswitch is hardwired, and the computers are hardwired to the powerbars with RS232).

This to help address the concerns user:Piele raised.