Tuesday, May 14, 2013

Remotely Disable/Enable IR on FOSCAM MJPEG Cameras

FOSCAM cameras are generally a good value. You get a decent set of features and performance for the price. The one important feature they lack, however, is a permanent or default setting to disable the IR lights. This is useful when you're mounting the camera behind a window pane, for example, and don't want the IR reflection from the glass.

Fortunately, the camera allows you to pass commands to it via HTTP. The two we're interested in are:
http://<Camera IP or URL>/decoder_control.cgi?command=94 to disable IR and
http://<Camera IP or URL>/decoder_control.cgi?command=95 to enable IR.

This comes in handy because this means we can set up a task in Task Scheduler (on a machine running Windows) to periodically send a command to the camera to disable its IR lights (in case the camera has rebooted).

One way to send an HTTP request in Task Scheduler is to use PowerShell:
powershell -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadString(\"http://<Camera IP>/decoder_control.cgi?command=94"&"user=admin"&"pwd=\")"

The above assumes that your camera uses the default "admin" account with a blank password. Of course, you should replace <Camera IP> with your camera's actual IP address.

Thursday, May 22, 2008

Play NES and SNES on your Mac using the Wii Classic Controller

Remember the original Nintendo and the Super Nintendo? Ever wish you could relive those days of yore on your Mac?


Well not only can you play those games again in full 8-bit glory, you can play them using the Wii Classic Controller. Here are the components you'll need:
  • NES or SNES emulator
  • Wiimote
  • Wii Classic Controller (optional)
  • Wiimote interface for OS X
NES Emulator

Nestopia is the most mature NES emulator for the OS X that I've come across so far. It runs games such as Super Mario Bros. 3, Mega Man 2, and Castlevania III almost flawlessly.

To install the emulator, simply drag and drop the application into your Applications folder.

SNES Emulator

SNES9X is one of the best SNES emulators to set up on the OS X. You should also take a look at the unofficial OS X build of ZSNES. They both run games such as Super Mario World flawlessly.

To install the emulator, simply drag and drop the application into your Applications folder.

Wiimote Interface for OS X

DarwiinRemote is the application we'll need in order to interface with the Wiimote via Bluetooth.

To install DarwiinRemote, simply drag and drop the application into your Applications folder.

To connect the Wiimote to your Mac, click on the "Find Wiimote" button, then follow the on-screen directions. (The directions will tell you to press the 1 and 2 buttons on your Wiimote simultaneously.) Once your Wiimote is connected, you'll be able to see your Wiimote movements graphed in real-time by DarwiinRemote.

Using the Wiimote or Wii Classic Controller with the Emulators

Since our emulators all accept keyboard input for controlling the emulated games, we'll set up the Wiimote or Wii Classic Controller to mimic keyboard key presses via DarwiinRemote.

First, we'll configure the emulators' keyboard controls. As an example, I've included my keyboard layout for SNES9X:
Then, we'll configure DarwiinRemote to mimic the appropriate keyboard key presses through the Preferences panel. As an example, I've included the mapping for my Wii Classic Controller that corresponds to my key configuration in SNES9X:That's all there is to it!

Tuesday, April 22, 2008

Sony VAIO VGN-S270 and Windows Vista

My Sony VAIO VGN-S270 (also known as the VGN-S2XP in Europe) is a great laptop. It's got just the right combination of performance, features, and weight for the things that I do. In fact, it's still running strong after three and a half years.

My hope is that upgrading the S270 with Windows Vista should allow the computer to stay current for a few more years.

Unfortunately, Sony isn't supporting Vista for this model.

I've had to do some research online to put together a somewhat acceptable installation of Vista on my S270. I've documented the installation steps below.

Windows Vista

I always recommend performing a clean installation of any operating system simply because upgrades usually preserve the same baggage from the previous operating system.
  1. Perform a clean install of Windows Vista (i.e. not an "upgrade" installation).
  2. Install Service Pack 1 for Vista.
  3. Install all updates marked as "required" and "recommended" from Windows Update.

Audio

The S270 uses an ADI SoundMAX chip for its integrated audio. I wasn't able to find a native Vista driver for this old audio chipset, but fortunately, the XP drivers work just fine.
  1. Download the ADI SoundMAX driver for Windows XP
  2. Run the installer, but don't actually install anything. Just click on "Next" until it extract its files into the temp directory: C:\Users\{Username}\AppData\Local\Temp\drivers
  3. Copy the driver files from the temp directory.
  4. "Cancel" out of the installation.
  5. Go to your Device Manager. Find the multimedia audio device marked with an exclamation point icon.
  6. Update the driver for the multimedia audio device and manually point it to the "drivers" directory you copied out earlier.

Touchpad

Touchpads nowadays are either made by Alps or Synaptecs. For the S270, the touchpad happens to be an Alps. The latest Alps touchpad driver can be found on Sony's European VAIO website for the S5XP.

Memory Stick Reader

The memory stick reader slot uses a Texas Instruments chipset. The latest memory stick driver can be found on Sony's European VAIO website for the S5XP.

For a nice touch, you can install a memory stick icon for your reader drive. (Tip courtesy of Surefire.)

Video

The S270 has an ATI Mobility Radeon 9700 graphics chip with 64MB of video memory. Unfortunately, ATI does not make any of their Mobility chipset drivers available to the end user. Instead, they refer you to the original manufacturer of the notebook.

However, we can "unlock" the drivers we need from ATI's driver packages by using the ModTool utility. (Tip courtesy of Supratik.)
  1. Download the latest Windows Vista video drivers from ATI.
  2. Run the ATI driver installer but do not actually install anything. It should ask to extract itself into C:\ATI\Support. After it has extracted itself, quit the installer.
  3. Download the ModTool utility.
  4. Follow the instructions for ModTool to modify the ATI drivers you extracted.
  5. Install the modified ATI drivers. During installation, Windows Vista will warn you that it cannot verify the publisher of the new drivers, but this is to be expected because you modified the original drivers.

Fn Keys

I haven't gotten the Fn buttons to work. I've installed the required drivers and made sure that the Event Service is running, but the Fn keys still refuse to respond. I can't change the audio volume or display brightness using the Fn key combinations.

VAIO Power Management

The VAIO Power Management utility does not work for this model. Trying to access the VAIO Power Management configuration panel will only result in a Rundll32 error.

Wireless Switching Utility

The Wireless Switching Utility does not work for this model either. The program runs fine but toggling the Wifi or Bluetooth modules has no effect.

Battery Checker Utility

Do NOT install the Battery Checker Utility. It's completely unnecessary. All it does is run in the background and pop up a warning if you're not using an official Sony battery. Sometimes it will warn you anyway even when you're using an official Sony battery.

Conclusion

There are some shortcomings to this Vista installation. The features I miss from my former XP installation are: Fn key volume control, and automatic display dimming by the VAIO Power Management (when the S270 is unplugged).

But overall, Windows Vista works pretty well on the S270. The essentials all work well: audio, video, wireless network, and wired network. The system doesn't seem to run any slower under Vista than it did under XP.

Considering the advantages and disadvantages of this Vista installation, I'd say it's worth it... for now. We'll see if the lack of Fn key functionality can stand the test of time.

I hope this article has been useful to other S270 owners out there. I welcome any tips, corrections, or feedback you may have.