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 | Revisione precedente | ||
projects:upshack [10/11/2013 23:26] admin |
projects:upshack [14/11/2013 15:57] admin [Communication Protocol] |
||
---|---|---|---|
Linea 11: | Linea 11: | ||
But then I saw a predisposition for serial port... some checks and it worked! | But then I saw a predisposition for serial port... some checks and it worked! | ||
- | === Warnings === | + | ===== Warnings ===== |
This is a hack onto shock hazardous circuits. 230VAC (300VDC) are present everywhere also when everything shut down. | This is a hack onto shock hazardous circuits. 230VAC (300VDC) are present everywhere also when everything shut down. | ||
Linea 21: | Linea 21: | ||
**This hack is not 100% safe** | **This hack is not 100% safe** | ||
- | === Adding the Fan === | + | ===== Adding the Fan ===== |
{{:projects:smallhacks:img_0081.jpg?200|}} | {{:projects:smallhacks:img_0081.jpg?200|}} | ||
Linea 31: | Linea 31: | ||
Note. Fan wires ARE actually connected to MAINS. | Note. Fan wires ARE actually connected to MAINS. | ||
- | === Adding the RS-232 interface === | + | ===== Adding the RS-232 interface ===== |
{{:projects:smallhacks:detail2.jpg?300|}} | {{:projects:smallhacks:detail2.jpg?300|}} | ||
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 55: | Linea 55: | ||
{{:projects:smallhacks:conddtl.jpg?300|}} | {{:projects:smallhacks:conddtl.jpg?300|}} | ||
- | === Communication Protocol === | + | ==== Communication Protocol ==== |
- | == NUT rulez == | + | === NUT rulez === |
It works with "network ups tools" ([[http://www.networkupstools.org/]]). The driver is called "**blazer_ser**". | It works with "network ups tools" ([[http://www.networkupstools.org/]]). The driver is called "**blazer_ser**". | ||
Protocol used is "Megatec/Q1". | Protocol used is "Megatec/Q1". | ||
Linea 88: | Linea 88: | ||
</file> | </file> | ||
- | == Watching how the driver works (reversing protocol) == | + | === Watching how the driver works (reversing protocol) === |
Link is 2400 baud, 8n1 | Link is 2400 baud, 8n1 | ||
Linea 107: | Linea 107: | ||
I don't know if other //commands// could be sent to the UPS, in addition to the shutdown. | I don't know if other //commands// could be sent to the UPS, in addition to the shutdown. | ||
- | === Final hack === | + | === I'm a stupid === |
+ | **//Some day after//** | ||
+ | |||
+ | Source code of NUT and its drivers, including blazer, is available at [[http://www.networkupstools.org/download.html|NUT download page]]. | ||
+ | |||
+ | If you look in "blazer.c" and "blazer_ser.c" (in the drivers directory) you can understand how the protocol works. | ||
+ | |||
+ | **Answer data fields** | ||
+ | <code> | ||
+ | InputVoltage ; InputVoltageFault ; OutputVoltage ; UpsLoad ; InputFrequency ; BatteryVoltage ; UpsTemperature ; StatusBits | ||
+ | </code> | ||
+ | |||
+ | **StatusBits field** | ||
+ | <code> | ||
+ | bit if=1 if=0 | ||
+ | 0 utility fail (OB) online (OL) | ||
+ | 1 battery low (LB) battery good | ||
+ | 2 bypass/boost active normal | ||
+ | 4 offline/interactive online | ||
+ | 5 test in progress normal | ||
+ | 7 beeper on beeper off | ||
+ | </code> | ||
+ | |||
+ | ===== 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''. | 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. | + | Now I can inquiry UPS status remotely connecting to the Cisco through a telnet session. |
+ | |||
+ | A small script in python has been written to keep the telnet connection alive and inquiry UPS status every 10 seconds. If there are problems a mail is sent. |