|Participants||The JinX, Ultratux, Wizzup|
See picture on the right. Four two-way toggle switches with center null rest position.
|Lights East||Lights West||Power sockets||Audio system|
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...
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.