power – James Batchelor https://james-batchelor.com Useful I.T & VoIP Ramblings Sun, 24 Sep 2017 14:00:27 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.5 https://james-batchelor.com/wp-content/uploads/2025/05/cropped-cropped-logo-jb-202505-32x32.png power – James Batchelor https://james-batchelor.com 32 32 Netgear – Wireless Power To It’s Full https://james-batchelor.com/index.php/2017/09/24/netgear-wireless-power-to-its-full/ Sun, 24 Sep 2017 14:00:27 +0000 http://james-batchelor.com/?p=536 Continue reading "Netgear – Wireless Power To It’s Full"]]> Living in a block of flats is a nightmare when it comes to getting reliable wireless network coverage, especially when only having 2.4Ghz Wi-Fi as it is a heavily congested frequency. Over the last few months I’ve found the connection constantly dropping on my wireless devices, even within a few feet of the access point.

I use a Netgear FVS318N for my wireless connections and a frustration is that the region is locked to Europe, where the radio power is limited more than other parts of the world.

This means the highest achievable power is half, raising it to full results in this dead end:

Very annoying, this post shows how to get a region locked Netgear use all the power available, and to discover what devices in the area are competing for the wireless space.

Back to my initial problem of intermittent connections. Thinking the worst, the first hunch was a nearby miscreant creating a DOS attack by using de-auth packets, but this was quickly dismissed by a quick sniff on Wireshark.

Next was to discover the wireless devices competing with my access point, for this I use Inssider 3, the last free version of the product. Simply run the program, select your wireless card and a list of all discoverable access points display, along with their signal strength.

My Network (Yellow) being overlapped by other access points

In this example, it’s clear why the disconnects were happening, my access point was competing a lot of others, including one that was on the same channel and power level as mine. Seeing something like this would normally be a cue to experiment with moving the access point to a different location to try and improve the strength, however for many this is not possible.

Moving onto the Netgear and getting the most power from it. While the web portal blocks the power rating, the command line interface (CLI) is not so sophisticated, but is just as useful in making configuration changes.

Getting access to this involves a Telnet connection. Using Putty, select the Telnet radio box and enter the IP address of the router. The username and password is the same used for the web interface.

To navigate the menus, enter a question mark to see the options that are available. To get to the radio section, enter dot11 radio configure to get to the radio sub menu.

Then default_transmit_power Full to set the radio power. Without fuss the CLI will just accept the command and displays a new line for the next. It’s important to commit the changes but typing exit to finish with the radio sub menu.

Then to exit completely, remove the pre-typed menu location and enter .exit to quit.

To check its successful, log in the web interface once more and the full power setting is populated when visiting the radio settings.

Note: clicking apply on this page with trigger the same region error as before, therefore if changes are to be made the power must be turned back down to half or lower in order to save. To get the full power back, Telnet into the router and repeat the above steps.

Revisiting Inssider, we can see that my access point has gained an advantage over the others for this location. It doesn’t look significant but is enough for my iPhone and other devices to keep a stable wireless connection.

Much better increase in separation over other APs

]]>
2 Servers 1 UPS, Windows 2012 Edition https://james-batchelor.com/index.php/2016/05/29/2-servers-1-ups-windows-2012-edition/ Sun, 29 May 2016 22:47:53 +0000 http://james-batchelor.com/?p=404 Continue reading "2 Servers 1 UPS, Windows 2012 Edition"]]> In a previous post I showed how to shutdown two servers safely using just one UPS with a single communications port. It was pretty straight forward with the comms port connected to a Windows Server 2003 machine.

But doing the same with Windows Server 2012 is much more difficult, since Microsoft decided to remove the ability to run a program on a low battery event from its power management settings. To make things worse I discovered that a bug in Server 2008 and later meant that issuing a Shutdown command from the native power settings would not perform a clean shut down, instead killing the power in a few seconds. This is not good news for RAID arrays and data integrity.

Time for a new solution, and since Microsoft are of no use, help would need to come from a 3rd party. After research and testing answer came from Shutter, a small program that runs as a trigger and event type program for a variety of different scenarios, with battery discharging status being one. Luckily two instances of the program could be run, one to shut down the remote servers and another for the host machine. Importantly the program can also be run as a Windows service, but more on this in the walk through.  here is how it is done:

Download the portable version of Shutter from den4b.com.

In the Windows directory, create a new folder, here it will be named ups.

In that folder create another 2 folders, one will handle the local server shutdown and the other for remote servers.

Copy the contents of the downloaded Shutter zip to both of the folders.

Before opening the program for the first time, create a .bat that will issue commands to shut down servers. Open Notepad and enter the following text:

shutdown /s /f /t 10 /c “Battery Backup Low”

This is for shutting down the host server. To save, select the folder to be used for host shutdown, in the file type menu select All files, and create a file name with it ending in .bat

Do the same for remote server shutdown using this script, and save to the remote folder:

shutdown /s /f /m \\SERVER /t 10 /c “Battery Backup Low”

Replace SERVER with the name or IP address of the other server running on the UPS.

Now go to the local shutdown folder and open Shutter.

In the events box, add battery and choose a trigger percentage and add. In the action box, choose run a program, and locate the .bat file you created for shutting down the host server.

Shutter

Important: Go to the settings window and copy the following options:

Shutter Options GeneralShutter Settings Advanced

Save settings and the program can now be closed. Repeat these steps to shut down the remote server, it’s essential to set the battery percentage trigger higher for remote server as they will not get the signal if the host server has already shut down, I recommend at least 5% higher as a safety net especially if the UPS battery drains quickly.

As a power outage is an unpredictable event, Shutter needs to be running at all times on the host server, therefore it needs to be ran as a system service. Microsoft did release a tool that could allow any program to run as a service, however it is very basic and will not restart a program if it happened to crash. Lucky a superior utility by the name of NSSM is available that takes this into account, it also has a more user friendly interface to set up services.

Download the latest release of NSSM and place in the main folder created previously, as it needs to be run alongside the Shutter instances.

From a Command Prompt, navigate to the folder holding the program, by using cd, then a space and the full path to the folder, e.g: cd C:\Windows\ups

Type nssm install and enter, and the new service setup screen will appear.cmd nssm

Choose the Shutter program to run, and create a name to the process, additional details can be made in the Description tab.

nssm install

Move to the login tab and select Log on as, then use an account capable of administrator access and password details.

Click create service and its installed, repeat the process for the other shutter program, giving it a different service name.

By default, these newly created services will start when Windows starts, but need to be started manually when first installed. To start them, the simple option is to restart the machine, but much better would be to press the Windows key & R, then type services.msc and click Run. Scroll down the list to the created services, right click on each and choose start.

Testing

It’s worth testing to see if it works rather than just hoping it does. And to save the wait for the batteries to discharge its worth raising the trigger values on Shutter to shut down the machines earlier, this also gives the benefit more charge left if the shutdown does not work.

Before opening Shutter to change values, the services need to be stopped. Open services.msc like before and chose stop against the service.

Make the changes in the action box, its recommended to choose somewhere between 70 and 90 percent. Close the programs and start the services back up. Then testing is as simple as unplugging the UPS from the wall, for security the host machine can be left logged on to monitor the remaining battery percentage so you know when the trigger points are happening.

]]>
2 Servers, 1 UPS https://james-batchelor.com/index.php/2015/12/10/2-servers-1-ups/ Thu, 10 Dec 2015 14:10:32 +0000 http://james-batchelor.com/?p=382 Continue reading "2 Servers, 1 UPS"]]> 2 Servers, 1UPSWith the new server up and running it seemed fitting to connect it to my UPS, and thanks to the low power consumption of the HP Microservers I still get around 40 minutes of battery only time with both servers running before the UPS runs out of juice.

Unfortunately, the UPS in use only has one monitoring port which is connected to my original server, meaning during a spell of prolonged power outage, the new server will not know when to shut down safely and will continue to run until the UPS runs out of battery supply, leaving it vulnerable to data corruption that affected the original server prior to battery backup.

But with a simple script and some setup both servers can shut down safely before the batteries run out.

The Idea is to have a script sent from the host server with instructions to shut down the other server when the battery level runs low, luckily Windows gives the ability to run a program on low and critical power level notifications, with adjustable power level triggers.

The most important factor with this idea is that the host server is able to communicate and send the script to the other server, in my current setup both servers are connected to the main network switch that does not have battery backup, meaning that during a power outage the servers will be unable to communicate and therefore unable to shut down safely.

The simple solution was to introduce another switch close to the servers that has power provided by the UPS, for this I chose a NetgearProsafe GS105 and connected both servers to it, with an uplink to the main switch. This also has the advantage of removing traffic away from the main hub when backups between servers take place.

Netgear Prosafe GS105, powered from the UPS
Netgear Prosafe GS105, powered from the UPS

With the servers connected via a backed up power source, it is time to create the shutdown command. On the host server connected to the signal of the UPS, create a .bat file using Notepad with the following line:

shutdown /s /f /m \\MACHINENAME /t 10 /c “Battery Backup Low”

This script tells the computer MACHINENAME to force a shut down in 10 seconds regardless of who is logged in, for those that are the message “Battery Backup Low” will be displayed. The script was then saved to the Windows directory to help avoid accidental deletion.

From the host server, open the power settings from the Control Panel, on the Alarms tab choose Alarm Action on the Low battery alarm field. Check the Run program box and choose the .bat file created to run on the low battery alarm. I chose the Low power instead of Critical to allow the other server to shut down as the Critical would be reserved for the host server itself to shut down.

Power Alarm Settings
Power Alarm Settings

For testing I chose to put the alarm settings pretty high, which makes the process quicker and also allows more time for a safe shutdown when on battery power. Apart from that the only way to test is to kill the power from the wall and see what happens, look for the other server setting down first as it will hit the Low battery first, then wait for the host server to shut down later. Expect the host server to last a little longer than expected as with the other server shut down, the battery life doubles on two identical machines when one is off.

]]>
UPS Investment https://james-batchelor.com/index.php/2015/01/12/ups-investment/ https://james-batchelor.com/index.php/2015/01/12/ups-investment/#respond Mon, 12 Jan 2015 22:42:00 +0000 http://james-batchelor.com/?p=274 Continue reading "UPS Investment"]]> From the last post, the idea of having UPS in my home may put me off forever, but to put it into context the unit had been installed before I was employed over 12 years ago, and over the past 2 years it was beeping intermittently to indicate a fault that a convenient press on any button would silence.

The post before that however had more gravitas, with my server being offline for close to a month all due to a one second power cut made me feel vulnerable to another downtime incident over something I couldn’t control. It was time to look into a Uninterruptable Power Supply to protect my server from power cuts that could knock my RAID out of sync.

My purchasing requirements were as cheap as possible,  but had to be an online system, meaning that the UPS would notify the server when it was running on batteries and shut down the system down before the juice ran out. An offline system would be less inexpensive, but a long term power outage would just postpone the problem, plus since I don’t intend to supply backup to the network hub, I would be powerless (on both levels) to do anything about it.

APC CS350
APC CS350

I settled on the APC CS350, a lead-acid unit with serial and USB connectivity. Making thing simple I connected the UPS to the server via USB and Windows 2003 found it without extra drivers, making it as familiar to use as a laptop with its battery management.

Shutdown at 25%
Shutdown at 25%, to ensure data is safe

After allowing the battery to charge, testing is easy, switch off the mains and see how it does. Even from this modest unit my HP Microserver in idle gets 50 minutes of extra life before the battery runs out. I set Windows to shut down at 25% charge, more than enough to shutdown, given that during a power outage the router would be down so the server would be unable to communicate with anything, data preservation is the main game.

The UPS cost £46, my preferred WD Caviar Green 1TB drive costs £48, if another power cut occurs then my it would of paid for itself, another cut and its paid for itself. Yes?

]]>
https://james-batchelor.com/index.php/2015/01/12/ups-investment/feed/ 0