annotation
Although one of the heroes of the second plan is the infrared port on the motherboard, I will not tell you about the TV remotes and how they switch tracks in your favorite media player. In the continuation of the story about the
FreeNAS server , built of old iron, I will tell you how to provide it with an equally simple onboard controller with a serial port (console) over IP (Serial-over-LAN), remote reset (RESET) and controlled power. The question is: why? After all, * nix and so unpretentious in remote control: turned on the same SSH and manage your health. But what about the accident? Starting operating system failure? What if you need to press RESET? To upgrade the system? Or run fsck in single user? Or restore the
sawed bitch misconfigured firewall? Do not go to the site every time, connect a monitor, keyboard and hang around the office at night for maintenance ... or make your eyes look like an angry Business day.
Another NAS do-it-yourself, part 4: the ghost of Chernobyl
I have long realized that laziness is the main engine of human progress. Probably the most elegant forms of laziness are found in the most progressive field: the sphere of information technology, where laziness is already part of the profession. We are implementing complex helpdesk-regulations in order not to install the necessary programs for users. We have been debugging the script for two days in order to save ourselves half an hour later. This is what we manage the desktop in the next room, using a server in the neighboring continent. That we have come up with a moratorium on work, to rest even a week before the New Year. Who is there waiting for the elevator in the evening rush hour, in order to decorously descend it from the second floor to the first floor? Business condescendingly calls us IT specialists, but we proudly magnify ourselves as IT Engineers ...
This suggests a device, often referred to as an off-band (baseboard) management controller, or a stand-alone on-board remote control controller. This is such a
silver silvered bullet that reduces excessive loads on the sacred sysadminsky ass. In terms of its functions, our product is close to
IPMI, after a deduction, and real server products like
iLO or
DRAC are far from here. Yes, it is better to buy a ready-made controller for half the cost of an old computer (or a server platform for a fivefold cost) if the importance of data and the associated risks require it. I assembled a working device a little more expensive than $ 70, which by the time the post was published had already managed to help me out several times, which I wish everyone.
')
Using an old Linux server PC at home or in the office? No one to press RESET? Not enough money for a server platform? Perhaps you will learn new ways to simplify your life. We almost will not program, a soldering iron and a Chorus of Druids will not be needed, but let us recall the merry 90s. Microelectronics is easy!
DISCLAIMER
The information is provided by AS-IS without any liability for its use by anyone, anywhere and ever. All inadvertently mentioned trademarks are the property of their respective owners. Some of them do not need advertising so much that I make them funny names.
Technical requirements
So, in the
first part we collected the NAS server from
trash and old iron
sticks , in the
second part we picked up the flash memory for the OS loader, and in the
third part we practically shoved dozens of spindle disks into the usual “tower” without fear of starting them or overheating . Go through the
server checklist:
Serverhood ChecklistECC memory motherboard | Not budgeted |
SMP CPU architecture | One core, but with HyperThreading |
Redundant power supply | Not budgeted |
SAN and Fiber Channel technologies | Joke of humor :) |
X * Disc Blown Case | there is |
Disk array | there is |
Specialized file system | ZFS UFS (due to RAM) |
Health Monitoring and Telemetry | there is |
Physical security | No requirements |
Watchdog timer | Not |
Server OS | FreeNAS (embedded) |
Remote control platform | TBD ** |
* X - Roman "ten"
** TBD - To Be Done (English: to do)
Yes, our product is far from the Real Server ... And we recognize right away: the usual motherboard on the serial port in the BIOS will not let us in:
0. Remote BIOS AccessBut this is a feature of the motherboard itself, and if it interferes too much, I recommend the reader to stop and look for either a solution in the form of a server platform (where the onboard remote controller should be embedded), or a PCI expansion card with KVM-over-IP (like
eRIC G4 ) . It will, of course, be more expensive. In the meantime, we will continue to write requirements for our DIY solution.
1. Connect to the server serial port via TCP / IPThis is quite a typical problem solved by an ordinary RS232-Ethernet interface converter. Literally the first thing that came to hand was the
MOXA NE-4110S, which cost about $ 50. Meet the protagonist of our current story - a packageless, slightly brutal product:

Of course, this is not the only option: there are converters produced under the trademarks WIZnet, TIBBO (
UPD: colleagues in the comments also recommend Lantronix). And besides converters, I accidentally opened another type of device, and even devoted a spoiler to it later in the text (read, it's worth it ;-)
So, “moha” I found it easier to order in the nearest store, and the brand is proven. As it turned out, it works on the good old i80186 and seems to be using the BSD IP stack. By the way, the NE-4110S has a programmable brother, its name is
NE-4110S-P , the
Network Enabler SDK is also available to it. You
know , the brother is half the price of a sister, it sells less frequently, and it still does not save you from writing the firmware. Therefore, I did not order a “brother”. And, cheers, one more childhood dream came true: “to work on 80186”. I always somehow lacked this missing link of evolution ...
Flashback from funny 90sI found an IBM PS / 2 with an i8086, sculpted in an IBM PC / XT assembler with an i8088 (on that old monitor, in the intervals between pixels, you could probably stick a match). I played on i80286 (and on both AT and XT; and what a juicy VGA graphics seemed then!).
But the thought wondered for a long time: where the hell did the 186th go? What kind of processor
is this?
At the time of
FidoNet, there was a US Robotics firm known for its Sportster and Courier modems. They were like two brothers: the younger Sportster (for the home) and the older Courier (for the business), and both are built on i80186.

The budget Sportster Soap Dish 14400, but it was lucky to accelerate more than 9,600; was still green 28800
Since the x86 command system was widely known in certain circles, there were also orders of magicians-brooders who were able to turn the Sportster soap box into Courier, a bulldozer for the Russian off-road telephone, on the
HST tracked half-duplex protocol with their spells. There was no Internet at that time, so it was possible to
fret even at half-duplex. And how sounded HST! Advanced users did not turn off the modem speaker in order to listen to the modulation noise and determine the quality of the connection using the
retrains . But at HST it was just a symphony: one could almost physically feel how streams of bits dodge at full speed from the floating logs of the old Soviet PBX, as if guided by the skillful hand of an invisible captain. As much as 16.8kbps, but believe me, then it was not bad at all.
The bulldozer reworked from the “soap box”, however, was buggy, and was often obtained with one “transfer”: either only “forward” (to dial) or to receive a call, depending on the DNA of the “soap box” (this is how lucky). And therefore, before the arrival of the Internet, all self-respecting
fidoshews dreamed of getting a red-eyed telecommunication devil with a real Courier logo.

The red-eyed telecommunication devil, the thunderstorm of all interference and the bulldozer of urban telephone networks
But only a few lucky ones fell asleep under the automatic lines of the courier relay courier dialing. The hardest to sleep was for those who had the
boss's phone number containing zeroes, nines and other particularly long and harsh combinations. Real ninjas, of course, were soldered to silent
reed relays , which they later remarked about in
echoes , causing a burning envy of the owners of simple soap boxes. And at the same time, everyone amicably dreamed that a new era would one day come, and our urban exchanges would also begin to understand tonal dialing, as in very distant and very happy countries ...
Peers, we get a napkin and catch it with a mean tear ... Hello, 80186, have not seen each other for a long time.
So, while the dish I ordered crossed the state borders, I found an interesting fact: it turns out that many interface converters supply up to a heap of digital I / O (GPIO or DIO). Probably to manage something, is not it?
Do I Need a Druid Choir
The phrase "without Al Durillo" in some circles means something like a quality mark: they say, not
fuckers are amateurs, some have gathered, but real electronic engineers. Forgive me, dear readers, but then I made my choice not in spite of, but by simple ignorance, and therefore I propose to do without broken copies, holivars and other kapslok. Having missed the successes of amateur microelectronics, under the influence of old reflexes, I simply rushed to look for an interface converter ...
Against programming MKHave I done right by avoiding programming microcontrollers? It seems to be a simple transfer of bytes back and forth, and all the work for five minutes, as one friend of mine said. But if I had a quick look at the forums on the subject area, I had enough relief to imagine such an encoding of the IP server in an assembler. I figured that I need at least two UART: one to the RS232 console, the second to a direct connection to the host (do not reset the same watchdog timer by IP!). Then he began to count the number of UART on the MK, used in the popular models of Ai Drobino. With
rare exceptions , it turned out to be only one. Therefore, we had to imagine pushing the bits into the wire using the popular scientific AVR method (bit bang, soft serial). Continuing the thought experiment, I put it all in parallel with an imaginary IP server in assembly language ... Brr! No, this is already some kind of long and spicy Asian dish for the whole family, and I asked for a light, dietary meal for one person.
I do not impose my point of view, but there is a subjective feeling that interconnection is a very weak link in microcontrollers, sometimes aggravated by the lack of elementary information security skills of hardcore hardware workers (the code is very vulnerable). Caesar - Caesar.
For programming MKIf it comes to that, personally it seems to me that the STM32 platform with its stuffed periphery seems more appropriate to me. And once again I can not fail to mention in this regard the
EasyElectronics project. As you can imagine, Chelyabinsk electronics engineers are so severe that they start microcontrollers with their own fingers. Do you doubt? Read about the
FUSE and finger method . If these guys are given a soldering iron in their hands (or put in a senior engineering position in a respectable concern), I’m generally afraid to imagine the consequences for the global electronics industry ...
There is a
debug board for such Ambidextr microelectronics, with interchangeable AVR, STM32, PIC and FPGA mezzanines. But I do not want to look at the card itself, but at the inconspicuous
LAN Ethernet Adapter product
on the ENC28J60 . The point is that on the back of the
LAN Ethernet Adapter is a socket for the same AVR or STM32 mezzanine board. On board, we get all the necessary strapping for the MK, USART legs from STM32 are also connected to the male connectors. For the problem to be solved, it remains to screw the adapters from USART to RS232 and USB, supply the device with power. Perhaps, for industrial needs,
PoE will not interfere, along with more heat-resistant performance and vibration protection, but that's another story ...
It would seem that now almost finished product based on a programmable MC, but ... who will breathe life into it? No one canceled the firmware, and this is still entertainment for the
mythical man-month . Nothing is impossible, but you go to a restaurant for lunch and not live a week or two, is not it? Think while on the shore ...
I will not mess with MK, I always have enough time to play enough. Here, by the way, from the recent one:
habrahabr.ru/post/208026And under my kindly comic names the reader, of course, easily recognized the popular platform used by amateurs and professionals all over the world. The market puts everything in its place ...
So, with the Serial-over-LAN task, everything is clear, but let's add the first dish to our main technical requirements menu:
2. Remote server reset using the RESET line on the motherboardLet's see what has already been done on this topic. As soon as I saw the
post of a noble don
workDNK , the baggage of knowledge obtained at the institute came to life and asked for a job. Dear don, with good reason, put the optorele directly on the digital output of the MK, but I had bad luck with the “mokha”. Page 3-8
NE-4100 Users Manual hints very unequivocally:
The output current for digital output channels is only 1 mA.
Those. unlike the PIC18F1320-I / P, the digital port on the moss will not squeeze more than 1mA out of itself, and for reliable opening the optorele must be more than ten times. From a distant nook of memory, there is suddenly a transistor switch (I was surprised, because the last time was fifteen years ago). We throw a sketchy scheme right into the
toaster standing next to the habr, and what do you think? Almost immediately we get a couple of useful answers from the noble dons. There was already a mean tear, probably,
Mr. Gates himself would have dropped (you would not think of anything like that, this is his famous speech about information at your fingertips).
In theory, everything is quite simple, and I almost stopped at that; but appetite, as you know, comes with eating.
Is it possible to control the
switched off PC? Sure you may. Moreover, we do it all the time, by pressing a large button on the PC case (for some it is small and not on the case, and not on the PC, but that's not the point). Even the simplest ATX power supplies have a + 5VSB line, powering the motherboard in the STANDBY state (switch on, computer off;
UPD: also called
standby power ). Turning on the PC from the keyboard is all from there. By the way, in STANDBY on some motherboards you can even burn something by rearranging the memory bars, but this is not about that now. Usually the power in the STANDBY mode is about 10W, but enough to power our controller, the tea is not a hadron collider. Therefore, let’s add another salad and side dish:
3. Independent controller power in STANDBY mode4. Remotely power on and off the host using the PWR_BTN lineAn attentive reader, of course, will argue on clause 4: what about the
Wake-on-LAN ? And it will be absolutely right: indeed, even the most ordinary motherboard today allows the computer to wake up from hibernation with a special network package. And, by the way, do not look for
ethtool in FreeNAS,
ifconfig (8) serves there for these purposes. All this is quite demanded and therefore well chewed, there are
examples of settings for popular home routers,
a launcher utility for Linux and much more. Well, you can not order a side dish, I do not insist. But I don’t intend to leave the reader without dessert.
Today we have
apple jelly green power indicator for sweets:
5. Remote monitoring of power on with full preservation of the functions of the visual indicator on the bodyMy server does not respond to ping ... Haha, check
if the power cord is plugged in if the server is on. Of course, I mean reading the status of the PWR_LED LED, although it is possible to read the + 5V line as well. I like the idea with the LED that is good, since it is the most trusted witness and is adjacent to the rest of the ingredients on the motherboard. What is the easiest way to replace the green LED in the circuit so that the computer does not notice anything? Obviously, to another LED, built-in optorele, and the signal to the cabinet LED, just return back on the other line. Further, I think, it is not necessary to explain, everything will be clear on the diagram.
Our RESET and PWR_BTN buttons must be released for normal operation of the computer, but in theory it can either pierce the transistor or the enemy can send the wrong logical signal. As a result, our controller will unauthorized close the optorele, and the buttons will turn out to be “normally pressed”, so to speak. I want to protect myself from this without disassembling our hypothetical fee. Also at the debugging stage, we want to visually monitor what is happening. Therefore, do not forget about salt, pepper and other seasonings to our table:
6. Hardware blocking of control lines RESET and PWR_BTN7. Control LEDs on the RESET and PWR_BTN lines8. Duplicate LEDs on the LED_100M and LED_10M lineAnd compote?
Morse from wild berries red indicator of disk activity on the case still displays only two disk ports out of ten available, so we will find a more useful application for it:
9. Visual monitoring of controller readiness (READY_LED) on the PC case through the HDD_LED indicatorThose. a lighted (red) indicator (disk activity) on the PC case will indicate that the controller is working (the PC switch is turned on, power is on). The green PC indicator retains its function and glows only when the server is running. If everything is completely bad, you can call the site and read the LED readings using the
biorobot of an office manager or another employee.
Here's what happened (forgive me, readers, some neglectful liberties):
Scheme
The electrical circuit of the onboard control controller; if small, open the image separately
Comment for beginners electronicsMake sure the top spoiler with the circuit is open. Go.
The core of the circuit: the small square on the left in the middle is like a J2 MOXA NE-4110S connector, it all starts with it.
The limiting resistors R4, R7, R8 for LEDs and R1, R2 for optorele are considered (you won’t believe it!) According to Ohm's law. To open the optorele and light the LED (but do not burn to death!), We need a current of the order of 10mA. We presume that the diode will drop from one and a half to two volts (we look at both the current and voltage in the characteristics of the devices). Since the power bus gives 5V, on the resistor it is necessary to “lose” 3V at a current of 10 mA, i.e. You need a resistance of about 300 ohms. Nothing complicated, and without
calculators . Excuse me, but what happened to the limiting resistor for the opto-switch along the PWR_LED line? There, where for the READY_LED (HDD_LED) indicator: they are both built into the circuits of our finished products, one on the motherboard, the other on the moss. Without cheating.
Pull-up resistors R3, R5, R6 (see
wikipedia ) 10 kOhm. We will tighten up the logic levels so that they do not dangle in the air and do not catch interference from there.
Transistor keys . To solve the problem with the lack of control current (need 10mA, but there is only 1mA), put a pair of keys 2N7000. Field-effect transistors are voltage-controlled devices: when moha gives a high level, the transistor gate opens, but it does not consume much current. At the same time, the drain-source circuit closes, and electricity runs from the + 5V bus through the limiting resistor to ground, turning on the LED on the road, or opening the optorele. A field device is a good device, only static electricity is scared to death in a literal sense.
Optorele dual unidirectional, normally open. This useful device allows you to close (or open in the normally closed case) electrical circuits, while isolating them from each other. The control current is supplied according to the same laws as the LED through the limiting resistor. Our relay is unidirectional: this means that the controlled (driven) current through it can be started strictly in one direction: the “plus” must be connected to pin 6 or 8, otherwise the current will not go, the relay will seem to be closed. Optorele is also afraid of electrostatics.
As you can see, not a quantum theory at all.
Well, let me remind you at the end that we are dealing with an embedded packageless product. If it is not secured properly, if you carelessly pull the Ethernet cable, our controller will chatter in the PC case,
like pants in a washing machine . To prevent this, serve cutlery:
10. Ethernet port fixed on computer caseThe task was solved as follows:
Why do we really need internal modems and 10 / 100BaseT adapters to the PCI busIt turns out that there is an excellent use of old, unnecessary PCI cards with square connectors.

PCI
«», , , : , RJ-45 «».

—
PCI (), PCI ( 10 100 , 1000 ). , , , .
So, your order is accepted, prepare meals and proceed to food!Another interesting remote access solution.,
TP-LINK MR3020 .

, , , . Atheros AR7240@400MHz, 4 -, 32, (
)
GPIO . USB-, Ethernet WiFi (, ). , $25:
http://wiki.openwrt.org/toh/tp-link/tl-mr3020 . , USB- microSD (
- Linux, ).
, - , +5VSB (: TTL-, RS232 , USB — ). , — , «» …
UPD: habrahabr.ru/post/151982 In order not to get involved with aggressive media, a soldering iron and his friend with an iron (these are no longer heroes from the 90s, they are doing this at home now), but I tried everything on real hardware and decided to assemble my simple product on a solderless breadboard ( breadboard). By the way, a very practical thing, especially for those who are on "you" with a soldering iron. As for self-made model jumpers, I respect the professionals, but I do not like all these “explosions on the telephone switchboard”, so I bought a beautiful brand set of different-sized jumpers.Depressant
« »
Although the jumpers and cost money, but you can sit for hours and stick them in the breadboard so and that, choosing the optimal length. This is such a special therapy for stress-tormented workers of the information shop, it calms no worse than gluing ships with airplanes: there is neither white-orange, nor white-green, nor white-blue, nor white-brown, everything is specially monotonous. More stress-resistant colleagues can, of course, cut jumpers from a single twisted pair, the section is suitable.In general, I recommend a beginner to read a bestseller: habrahabr.ru/post/148656 , after which I could barely restrain myself from buying the entire assortment of the nearest radio amateur store.Scheme of solderless prototyping board in the freestyle notation system By the way, if someone wants to make it in the form of a real board, let me know in a personal, perhaps I will even take part.Surely this is not news, but along the way, I found (literally) a cool way to pair the bezel-free layout with the surrounding world with connectors on a flat Insulation-Displacement Connector (IDC): we pin a DIP connector on one end of the loop (in 2.54mm pitch, go into the layout), and the other end is dissected and crimped with a crimper, then we shoe with the necessary BLS / BLD pin connector (the crimping pliers use the same ones as in another post ). Either we do not dismember the train, but simply prick another IDC connector. You can chop them up a lot, like on cables for old IDE disks. How many wonderful discoveries are being made by an electronics store.According to this principle, I assembled two cables: one (simple) to connect my board with the MOXA NE-4110S, and the second (tricky) to interface with the connectors on the motherboard. I highly recommend the color loop: it will not only please the eye with a cheerful rainbow of color markings, but on non-standard tasks it will also greatly save expensive resources of your central nervous system, freeing it for more interesting tasks. The dull gray train is good for simple and straightforward variants, it’s better not to perform any inverted pieces on it.If anyone has not seen fun
This IDC connector plug with a 2.54mm pitch we pin on the end of the
cable furthest from the breadboard board Sly loopLeft: connect the buttons and LEDs from the PC case to the plug (IDC connector) on the loop; from the connector further go two pairs ...Cprava: two pairs reached the standard contacts and RST_SW PWR_SW on the motherboard, nearly all the required chain locked
These two IDC connector (2.54mm pitch) prick on the proximal end of the loop, they "sit" on the breadboard
breadboard board with two connected cables.The assembly is centered on the left, and the Reserve Property of the Instrument stands alone on the right edge (a field effect transistor, if it breaks through the existing one). In my opinion, it turned out neatly, even despite the cyclopean dimensions of the limiting resistors (your humble servant hurried a little while purchasing).About nutrition
To fulfill requirement No. 3 on independent power in the STANDBY mode, we will look for something suitable on the motherboard. Well no incision and tsya same 20-pin ATX power connector, in fact. This is luck: judging from page 17 of the P4i65G manual , the completely useless IR port connector feeds on the + 5VSB line (looking ahead, I note that this turned out to be a cynical deception). Great, add to the basket the corresponding 2-row 6-pin connector with a 2.54mm pitch, sometimes referred to as BLD 2x3.
Almost useless connector for connecting IR devices to the P4i65G motherboard, BLD 2x3, +5VSB (aka , ), - USB, PS/2. BIOS , . , , «» +5VSB.

J2 connector on MOXA NE-4110S, BLD 2x7
In addition to the serial port J1 in the RS232 standard (analogous to what sticks out on motherboards), there is an unambiguous J2 connector for power supply, GPIO (DIO), control LEDs and a TTL-level debug serial port (TXD1, RXD1, GND) on the “moss”. ). Just in case, I would say that the TTL UART requires a linear driver to interface with the RS232, there are different voltages; but we will not connect and use this port. Just add to the purchase of a 14-pin connector type "mother", with a known pitch 2.54mm (1/10 ").
Stop, why does Mocha have two VCC + 5V contacts? Having read
dispensary about tasty and healthy nutrition of microcontrollers, I already began to suspect a separate bus. But when I saw a very unambiguous soldering on the board in front of a single voltage stabilizer (and even measuring its resistance just in case), I realized that such a double power supply has nothing to do with the internal strapping. Therefore, we will turn the situation around for our own selfish purposes: we will supply power with + 5VSB for one contact, and with the other we will immediately take it to our prototype. And the wolves are safe and the sheep are fed. Maybe for me and left these two contacts?
Little about electrostaticsI was last on the radio market, probably in the late 90s. Recently, I did not know anything at all about the solderless models, or about the AVR and their Chopped Crushes. All this immersion in microelectronics took about two weeks in the hobby mode, during which they had to read a lot.
At the same time, I decided to first of all pass my self-assessment on mock-ups, having bought a 7-segment indicator for exercise and every mikruha with crumbling. It is clear that instead of a common cathode, I took a common anode, and when connected to the 4511 chip, my indicator showed the numbers inversely and required many transistors. It's good that no one has seen my microelectronic bullying ...
Not only from laziness, but also for the sake of experiment, I decided to almost completely neglect electrostatic safety, taking a pair of protective tweezers and a dozen field-effect transistors in reserve. And as he looked into the water: in the process of passing the test, the death of the brave fell as many as seven out of ten "field men." Conclusion: if you work with field-effect transistors or other CMOS parts, protect the legs of these delicate devices from electrostatics, the reality of the problem is now confirmed by another experiment. There are a lot of protection options: from ritual wrapping in foil in which the mother gave birth to special bracelets and rugs. Only if there is no real “land” in the apartment, please note that during your electronic meditations, a kind neighbor according to the laws of the genre
will surely
drop the phase that
will ground the washing machine to the same pipe. And then, if your defense is not protected by itself, then you can inadvertently get a virtual reality helmet from a foil cap, as in one long-forgotten
fidosh bayan (then I didn’t have the concept of “I’m patstal,” but now I know what it is called). Personally, I preferred to pay with a pair of tweezers and several punched transistors (their eternal memory). And forgive me, electronics monsters. But seriously, google the
electrostatic bracelet .
Security
Let's not forget, however, about doors, windows and similar fences. Our NE-4110S device is not locked with passwords, but it can use simple ACLs for IP addresses, which are recommended to be restricted by the administrative network. The server operating system must necessarily request a login and password to enter through the serial port. All the contents of Serial-over-LAN are transmitted over the network in open form (telnet), so the transfer over public networks without encrypted VPN cannot be done at all (otherwise the root password, which you will probably enter, will leave). For the same reason, a separate VLAN is also needed (a simple Ethernet network switch with overflowed ARP tables turns into a hub, which starts to call packets to all ports of the segment). All devices for remote access to servers are potential vulnerabilities, they need to be treated with due respect, errors are rarely forgiven.
By the way, as some users have discovered, FreeNAS did not have everything going smoothly with the release of 9.2.x with the implementation of the serial console (
https://bugs.freenas.org/issues/4266 ). Be careful if you use this system.
Lazy null modem
I made a null modem RS232 cable for connecting the serial ports of the server and the controller from a cord from a disabled reader, to which Business dislocated a dozen feet some time ago. I had to order new 2-row 10-pin connectors such as "mother", because The old fool protection (in the form of a “flooded foot”) just did not allow us to connect the USB cable to the COM-port connector. You can easily make such a cable out of a flat cable, I'm just lazy, and so I took the finished cord, I had to compress the crimper just a couple of wires instead of two dozen. Again, I recommend the reader to use a fun color loop for such tasks.

The complete null modem cable scheme borrowed from
bogpeople.com/networking/SerialComms/rs232pinouts.shtmlThe question is: do we need all these DTR, DSR, RTS, CTS? And anyway, why is DCD in a null modem? A long time ago, I connected the console to a
Frame Relay switch with three wires (RXD, TXD, GND) over a twisted pair, and everything worked. But look at the serial console device in FreeNAS. It uses freenas_serial9600 entries from
gettytab (5) , and the `` nc '' attribute is not visible there. And in theory, this means that in the absence of a DCD signal, the serial port will be considered "dead", and the console will not go through it, at least without interfering with the FreeNAS code. I may be mistaken and not take into account the electrical properties of the line hanging in the air, but Crepsondo’s philosophical practices recommend pressing DCD lines in such cases, and not hooking the FreeNAS firmware on the read-only file system, sweating with each remote server upgrade. Do not read stories on the Internet about non-standard null modems, do the standard. Then it is useful somewhere else.
So, I will bring the null-modem crimping scheme to the form on imaginary 10-pin mother-type connectors sitting on an imaginary cable. The scheme, by the way, at the time of testing, almost brought me to
Zugunder , but more on that later.

Null-modem circuit, view on mother connectors, USB cable color marking (two black: one thicker, the second thinner)
Soft
Brothers, look at the length of this post, and we are not even going to program the microcontroller! However, the simplest perl script for remotely pressing buttons I still add to complete the narration. It's a bit redundant, but it's for beauty.
Sending a second push of the power button Sending a second click on the RESET button Equipment
The list of ingredients with pricesName | Qty | Cost of |
---|
Interface Converter MOXA NE-4110S | 1 PC. | $ 50 |
Fee breadboard | 1 PC. | from $ 10 |
Dual optorele KR293KP4B, body DIP8 | 2 pcs. | $ 4 |
Field Effect Transistor 2N7000, TO92 package | 2 pcs. | $ 1 |
Limiting resistor 330 Ohm 5%, "pin" case | 5 pieces. | $ 0.30 |
Pull-down resistor 10kΩ 5%, “pin” case | 3 pcs. | $ 0.20 |
LED red AL307LM d = 5mm | 1 PC. | $ 0.30 |
Yellow LED AL307ZHM d = 5mm | 1 PC. | $ 0.30 |
LED AL307HM d = 5mm green | 2 pcs. | $ 0.60 |
DIP switch, 4 pins | 1 PC. | $ 1 |
Connector-plug 2.54mm IDC (on the cable), two-row 10 pins | 1 PC. | $ 0.50 |
DIP IDC connector (on the loop), 10 pins | 2 pcs. | $ 0.50 |
Color cable, 10 contacts | 1m | $ 2.40 |
2.54mm female connector for BLD 2x7 cable (for MOXA J2) | 1 PC. | $ 0.50 |
2.54mm female connector for BLD 2x5 cable (for COM port) | 2 pcs. | $ 1 |
2.54mm female connector for BLD 2x3 cable (for IR port) | 1 PC. | $ 0.30 |
Socket 2.54mm to cable BLS 2x1 (for connection to the motherboard.) | 3 pcs. | $ 0.45 |
Unnecessary fee int. PCI modem | lying around |
Small nylon tie | was |
Crimping pliers for crimping BLS and BLD connectors | were also, but generally from $ 20 |
Patch cord Cat5e | found;) |
Jumper for prototyping board | buy or make yourself |
Time | not considered |
TOTAL | a little more than $ 70 |
All devices in the DIP, or in the "pinout" (not SMD, not planar) packages - for solderless prototyping board

Converter MOXA NE-4110S (on the bracket), as well as circuit board and cables
Spirit of experiment
Friday evening. Lightly buzzing at low fan speeds, our hard worker Zeus, methodically sucking the nearby office dust, methodically shelters a couple embracing from his switchboard and home router on his back. All data is saved. All users are dispersed to their homes and taverns. The LEDs blink comfortably, and the Spirit of Experiment is already in the air.
First of all, let's replace the
home router with a
wild one . This, of course, is a separate story; It is worth saying that the brought
wild router is already fully tamed on the stand: all firmware have been updated, all settings, addresses, passwords, attendances and firewalls have been set. Spend a few minutes on the mess with the wires, and everything went the first time. Ay, what a great man I am. Home router will go to the country.
Then we return to the main goal of the visit and try to implement the original plan, relying on the availability of the promised + 5VSB on the connector of the IR port.
We get our constructor, assemble and turn it on. It is dark and quiet, but it does not smell like smoke, but still an experimental spirit. We are looking for jumper PS2_USB_PWR1. Damn, it is under the cooler duct. Having analyzed our controlled vector of thrust for a while (see
habrahabr.ru/post/214707 ), we try it in this way and that. Nothing happens.
As they say, read, finally, the instructions. On page 26 of
the P4i65G manual in section 3.3.3, the ACPI Configuration of the devices mentioned is Ring-In (modem), PCI (Wake-on-LAN) and PS / 2 (keyboard). The IR port is not explicitly mentioned. Hm And about USB in general not a word. Ok, try the PS / 2 keyboard. When the PS2_USB_PWR1 jumper is in the correct position, the PS / 2 keyboard in STANDBY mode really shines with an indicator and takes the computer out of hibernation. Yeah, in a pinch, lend power to the PS / 2. The USB keyboard in the STANDBY mode is deaf, like a fish on a fence, and obviously does not want to wake the computer. Therefore, the PS2_
USB _PWR1 jumper name should be read as PS2_PWR1, and the promised + 5VSB on the IR connector - as a joke of the manufacturer. USB in the STANDBY state this motherboard does not power at all. Apparently, the developers thought that no one would notice such a cynical swindle.

Jumper PS2_USB_PWR1, which actually has no relation to USB
But how to power our economy without unaesthetic snot protruding from the PS / 2 outside the case? We remove the jumper PS2_USB_PWR1 completely and connect the power of our circuit to pin No. 3. Turn on. The server somehow sounded offended and indignantly, and does not seem to be about to start. And now the barely perceptible Ghost of Chernobyl seemed in the air ... The brain reflexively calculates the possible expense: one motherboard, one power supply, what else can you burn there? Not deadly, but running on Saturday for iron, and even with the feeling of loss, was not part of the plans of the great schemer. Okay, we quickly cut out of harm's way and again look at our electronic rebus.

Electronic rebus: how many positions does the jumper have?
We have not considered something. Probably a five-volt power bus, on which sits a keyboard controller and, perhaps, half a dozen useful devices. Apparently, this is her entrance sticking out at us right under the nose in the form of contact No. 2. On the left under No. 1 is the output from the + 5V line, and on the right under No. 3 is the output from + 5VSB. Thank you, Captain Obvious, and where were you wearing
on April 26, 1986? ? “Come to Kiev, you will be
amazed !” - then one respectable gentleman joked. “Idiot, run a five-volt bus to me!” - the computer squeaked for me ...
And here in general the accident at the Chernobyl nuclear power plant? And you will remember yourself in the famous pose of Danila-master with a stone flower : how many times did you have to get a shaman tambourine , connect hippopotamuses with rhinos and rely on chance ? How many times did you have to turn on something that you can’t turn on and turn off something that you don’t want to touch? I recently read some kind of global research, from which it followed quite clearly: a significant part of accidents in the IT sphere is caused by personnel, in the process of what is commonly called routine maintenance . This IT site is not Russian, it is worldwide. So I suffered there. Perhaps, will carry ...

Another avtos scheme
We put the jumper in position 1-2 (we give the usual + 5V to the bus), and we feed our product directly from contact No. 3 + 5VSB by borrowing the “ground” from the useless IR port connector. Be sure to shoe the terminal in heat shrinkage or the BLS 1x1 connector (otherwise it will necessarily short; this is usually not fatal, but the protection of the power supply will prevent the machine from starting). We take a deep breath and turn on the switch ... Exhale under the merry wink of the LED LED_100M. Fans and all other mechanics silently stand and wait. Telnet cheerfully gives the main menu of the controller. Hooray, now we really manage the computer turned off! The ghost of Chernobyl melts safely in the air, leaving a whitish cloud of childhood memories. A curtain.
Stop, stop, what curtain? The reader is well aware that so beautiful servers start only in fairy tales. Therefore, yes, between turning on the switch and the result was a half-hour crawling on the floor around the deaf serial port, accompanied by attempts to switch the speed / flow mode, turnip cues and UNIX commands, interspersed with the mat. Because when I crimped both ends of the cord, I looked at the same picture (both times on the left), having assembled the usual straight cable instead of the null modem ...

One connector must be crimped on the left picture, and the other on the right; order is not important
Ugh! Finding such an epic jamb, I immediately cheered up, squeezed the clip out of the office stapler and began to unbend the connector back. Having reworked the cable as it should, I received the FreeNAS console menu as a reward. Zugunder passed. Of course, there was the most magical moment of the check, when the box standing half a meter obediently gloh and came to life, obeying the invisible commands from a server in a distant country. The control LEDs blinked, telemetry on the digital input (green LED) showed “down” with the server on and “up” with the power off, and all this under the dumb but cheerful blink of the LED_100M indicator.
Apart from the jamb with a null modem cable, the experiment was a success the first time.
As demanded by Her Majesty Engineering.
At parting, another long-forgotten, but favorite button accordion from the 90s by an unknown author:
Was orthogonalSlowly rocking on the waves of a sine wave, the argument smoothly slides to infinity. Hypotenuses and legs are rushing past rapidly. Whistling fly limits.
Inverse trigonometric functions are slowly dragged, giving way to an important Higher-order Derivative. Modules and flag subspaces silently stand on the sides of the road. Occasionally it will flash and disappear, dragging its tail behind itself, a power series. On short legs, bouncing and stumbling, groups, algebras, domains D, Omega run, accompanied by a flock of restless ideals.
The normal vector tends to factoriality, the phase space tends to the limiting point, already supremum with infinum, having drawn power, were approximated by a constant, the bipods are smaller, like the headmistress and the center of mass already approached a small number of small numbers of Delta, all bad points were forced out without limiting the generality, Dirac distribution is applied to the system with connections; convergence was coming. The polynomials not yet given are multiplied vectorially by the transition matrix, and those who did not have time were crushed by the exponent. Everywhere shastali wavy coordinates. Small powerless logarithms chasing an epsilon, waving helplessly with a summable feature.
It was orthogonal.
In the ensuing instability, the crunch of rings rang out here and there. They acted on the second quadratic form.
The factor space, pursued by pointwise convergence, hung about between double and repeated integrals, which were proudly taken and carefully selected expressions in elementary functions.
Homomorphisms, choosing a corner more local, made love with the matrices of Gram and Jacobi.
Continuity went on as usual. Complex variables - the guardians of order, narrowing to an equivalence class, were decomposed into a Fourier series and quickly reduced the order, if any conditional extremum given by the Euclidean algorithm tried to clamp an infinitesimal sequence on both sides. O-large and o-small, up to the values ​​of the first order, were evaluated conditionally convergent series. The trigonometric system of functions flowed softly. Behind them, they were full of generalized ones. The smoothness did not change, the linearity was not broken, the singularity manifested itself only at the points of accumulation. The Riemannian manifold was covered with a subharmonic haze, the implication with the determinant silently satisfied the boundary conditions.
Began the next step. More and more will follow, and so on, ad infinitum. This will continue as long as there is a delta for any epsilon, while the amounts are Darboux, the rule is L'HĂ´pital, the principle is Maximum Module. Until the new Gauss, Cauchy, Lagrange, Pythagoras, Farm, Fourier, new Ostrogradsky come and will not reveal to the world a new, previously unknown knowledge,
new revelation
new math.
A curtain.