OHMS BLOG

Sunday, June 17, 2012

technology

How to switch a Cisco DPC3825 / EPC3825 to/from bridge mode at will

DISCLAIMER: This blog entry is unsupported. It outlines the steps that I successfully taken to switch this device into bridge mode. I am posting this as a courtesy to people who would like to know how to do the same. Having said that, my work here is done and my problem has been solved. This technique might not work for all firmwares. It requires knowledge of HTML and HTTP. If this isn't working for you, please do not post comments or send me emails asking me to solve your problem for you.

A few weeks ago I had to help somebody deal with an annoyance: They had a Cisco DPC3825 device that is a combination cable modem + wireless router device. They were unhappy with the device's router functionality and wanted to set it to "bridge mode," i.e. disable everything but the cable modem.

This is easier said than done; this device had its firmware customized such that no user interface was available to change such things. There were no form fields present pertaining to the device's mode. I found some limited information on other websites. Many of these users had devices with firmwares that were different from the one that I was working with. In their cases, the form fields for switching modes were present in the HTML but hidden via CSS.

On the forum website, their solution was to remove the display: none from the field's CSS, making the form field visible. I was disappointed with this solution, as it wouldn't work in my case. On the other hand, I couldn't help but notice that the forum users had posted a few images of their HTML. Indeed, one of the screenshots includes the necessary <select> tag, whose name was "working_mode"! We weren't finished yet, however: I still needed to figure out which value to use for the hidden field. I noticed that in other <select> inputs, the firmware set the field's value to the 0-based index of the option in the select. The screenshot showed that "Router Mode" was the first option, implying a value of "0", followed by "Bridged Only," implying a value of "1". This means that one can, as part of the administration form, just insert an additional field. I'm lazy and I only needed to execute the command once, so I just used Firebug to inject a hidden input into the administration form. Look for the

<form name="administration" method="POST" action="/goform/Administration">

tag and add the following:

<input name="working_mode" type="hidden" value="1">

I submitted the form and was then presented with a screen informing me that the device was rebooting. When it reboots in bridge mode, the device resets its IP address to 192.168.100.1. To switch back to router mode, do the same thing but set the input value to "0".



Of course you might want to script all of this and POST the form directly.

Wednesday, March 14, 2012

technology

How do I reference TrustedInstaller?

I was editing some ACLs on my Windows box the other day, and I wanted to assign ownership of a directory to TrustedInstaller. The trouble was that I couldn't figure out how to specify the TrustedInstaller user into the security editor. After scouring several blog posts I finally found the answer. Here it is for posterity:

NT SERVICE\TrustedInstaller

Wednesday, February 08, 2012

code

Announcing Audio Auto-adjust

As I've been chronicling in my Adventures in Android series, I've been working on an Android app. I'm pleased to announce that today I have published Audio Auto-adjust 1.0.0 to the Android Market. I'd like to take this opportunity to provide a brief overview of what Audio Auto-adjust is and how to use it.

While there are numerous volume control apps already on the Android Market, I wrote this app to because I had some very specific needs that I wanted to address. I wanted an app that didn't leave services constantly running in the background, yet I wanted an app that would be responsive to system actions. In particular, I wanted to be able to save my audio settings as presets, and then associate those presets with actions.

The Main Activity



Here is the main activity as it appears in the portrait orientation. As you can see, the various audio streams are easily adjusted by moving the slider controls.




The toolbar across the top provides three widgets. The first button on the left toggles silent mode. The next button saves the current volume configuration to a preset. The third widget is a dropdown that displays the currently active preset (if any) and allows you to switch to a different preset. This widget is only enabled when there are two or more presets that have been saved.

Notice that some of the streams are identified by hyperlinks. Those hyperlinks lead to context menus for additional configuration settings that are permitted for the selected audio stream.

To access Audio Auto-adjust's advanced features, select your phone's menu button to activate the main menu. Note that the Edit Presets and Actions options are only available if you have already saved at least one preset.



Edit Presets Activity



This activity lists all the presets that have been saved in Audio Auto-adjust. In this example I have saved two presets, "Foo" and "Max." Touching one of those presets will command Audio Auto-adjust to switch to that preset. Long-pressing a preset, however, raises a context menu that allows you to modify that preset. For example, long-pressing the "Foo" preset presents this menu:



Actions Activity

The most powerful feature of Audio Auto-adjust is the ability to associate presets with system actions. My personal use case for this was when I enter my car and my phone connects to my vehicle's hands-free system via Bluetooth. Upon receiving notification that my phone has connected to my car, Audio Auto-adjust will automatically switch to an associated preset.

NOTE: In order to configure Bluetooth events, you must enable Bluetooth on your phone before entering the "Configure Actions" activity.



Each row in this activity lists a system action that may be associated with a preset. Actions containing "(None)" are simply ignored by Audio Auto-adjust. To associate an action with a preset, select the action's corresponding dropdown, and then choose a preset from the list.

A Note About Precedence

The order of the listed system actions in the "Configure Actions" activity affects the precedence of those actions. Entries that are located higher on the list are given a higher precedence by Audio Auto-adjust. If more than one system event is activated at the same time, the action with the highest precedence is the one that will be activated by Audio Auto-adjust.

Precedence may be adjusted by placing your finger on the grip on the left side of the row, and then dragging it up or down to your desired position.

Settings Activity

I've tried to ensure that each preference in the settings activity contains a useful summary. Here's a brief overview that goes into a bit further detail:

  • Volume Control Stream: Chooses which audio stream will be adjusted by your phone's hardware volume controls. Note that this setting only applies when Audio Auto-adjust is running in the foreground.
  • Background Notification: When enabled, Audio Auto-adjust will post a notification whenever it switches presets while running in the background.
  • Play Sounds: When adjusting volume settings, play sounds to illustrate the loudness of the setting.
  • Tie Ring Volume: When set, hide the controls for the Notification audio stream. Instead, the Ring audio stream will control both itself and the Notification stream.


In Conclusion

My goal with Audio Auto-adjust was to make a volume control app that fulfilled my needs. I hope that is as useful to others as it is to me. In the future I plan to expand the app with additional features, so please stay tuned!

Release 7.0; Copyright © 1996-2012 Aaron Klotz. All Rights Reserved.