Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Entrambe le parti precedenti la revisione Revisione precedente | Prossima revisione Entrambe le parti successive la revisione | ||
projects:upshack [10/11/2013 23:03] admin |
projects:upshack [10/11/2013 23:26] admin |
||
---|---|---|---|
Linea 19: | Linea 19: | ||
Do not connect Oscilloscopes to main-powered circuits. Isolate them, and connect a safety ground wire. | Do not connect Oscilloscopes to main-powered circuits. Isolate them, and connect a safety ground wire. | ||
- | '''This hack is not 100% safe''' | + | **This hack is not 100% safe** |
=== Adding the Fan === | === Adding the Fan === | ||
Linea 44: | Linea 44: | ||
Note. Opto-isolators separate RS-232 circuits (SAFE) from ups ttl circuits (NOT SAFE, connected to MAINS). | Note. Opto-isolators separate RS-232 circuits (SAFE) from ups ttl circuits (NOT SAFE, connected to MAINS). | ||
- | === Solving a "problem" === | + | == Solving a "problem" == |
Initially it did'nt work. This is what I got. | Initially it did'nt work. This is what I got. | ||
Linea 54: | Linea 54: | ||
{{:projects:smallhacks:conddtl.jpg?300|}} | {{:projects:smallhacks:conddtl.jpg?300|}} | ||
+ | |||
+ | === Communication Protocol === | ||
+ | == NUT rulez == | ||
+ | It works with "network ups tools" ([[http://www.networkupstools.org/]]). The driver is called "**blazer_ser**". | ||
+ | Protocol used is "Megatec/Q1". | ||
+ | This is the info that NUT and the blazer_ser driver provide: | ||
+ | <file> | ||
+ | battery.charge: 77 | ||
+ | battery.voltage: 12.40 | ||
+ | battery.voltage.high: 13.00 | ||
+ | battery.voltage.low: 10.40 | ||
+ | battery.voltage.nominal: 12.0 | ||
+ | device.type: ups | ||
+ | driver.name: blazer_ser | ||
+ | driver.parameter.pollinterval: 2 | ||
+ | driver.parameter.port: /dev/ttyS0 | ||
+ | driver.version: 2.6.4 | ||
+ | driver.version.internal: 1.55 | ||
+ | input.current.nominal: 2.0 | ||
+ | input.frequency: 49.9 | ||
+ | input.frequency.nominal: 50 | ||
+ | input.voltage: 223.6 | ||
+ | input.voltage.fault: 223.6 | ||
+ | input.voltage.nominal: 230 | ||
+ | output.voltage: 223.6 | ||
+ | ups.beeper.status: enabled | ||
+ | ups.delay.shutdown: 30 | ||
+ | ups.delay.start: 180 | ||
+ | ups.load: 2 | ||
+ | ups.status: OL | ||
+ | ups.temperature: 25.0 | ||
+ | ups.type: offline / line interactive | ||
+ | </file> | ||
+ | |||
+ | == Watching how the driver works (reversing protocol) == | ||
+ | |||
+ | Link is 2400 baud, 8n1 | ||
+ | |||
+ | Standard status inquiry is achieved sending 3 ascii characters: "Q1" followed by CR (13). (others are tried by blazer_ser, but only this works) | ||
+ | |||
+ | UPS answers with this string: | ||
+ | <file> | ||
+ | (005.2 005.2 237.9 002 50.1 12.0 25.0 10001001 | ||
+ | </file> | ||
+ | |||
+ | Comparing the string with the driver data, you can recognize the voltage 237.9, frequency 50.1, battery voltage 12.0 and temperature 25.0, then a series of boolean flags. Actually I don't know which of these data are reliable. Something could be not implemented, or badly implemented. | ||
+ | |||
+ | I don't know if other //inquiry// could be made to the UPS, in addition to "Q1". | ||
+ | |||
+ | Blazer_ser is also capable of remotely shutdown the UPS (''upsdrvctl shutdown''). **But if you do, you cannot turn it on again remotely**. I did'nt see which characters are sent to do this. | ||
+ | |||
+ | I don't know if other //commands// could be sent to the UPS, in addition to the shutdown. | ||
+ | |||
+ | === Final hack === | ||
+ | This is more likely a CISCO router related topic. However, I have connected the ups serial port to the router's AUX port and configured as ''modem inout''. | ||
+ | |||
+ | Now I can inquiry UPS status remotely connecting to the Cisco. In the next step I'll try to forward the remoted session to a virtual serial port. This can be usually achieved with unix **socat** command but in my case the Cisco asks for login before relaying to the serial port. |