Monday, August 24, 2020

How to Disable Google Fiber WiFi

The Problem:

WiFi signal from Google Fiber hardware is interfering with my preferred home WiFi hardware signal.  I discovered that we cannot permanently disable WiFi on GFBR set-top box (STB) using Fiber software.  It can be temporarily disabled using Fiber App, but it will eventually be re-enabled.  I've tried using a crude "Faraday Cage" place around the STB, but this did not reduce the Fiber WiFi signal by more than ~5 dBm.

The Fix:

ATTENTION: If you want/need support from Google, or if you don't really know what you are doing... don't do this!  Think of this as a warranty-voiding activity for the tech-savvy folks only.  

You've been warned.  To proceed:

1) Unscrew four (4) T9x40 screws found on bottom of GFBR set-top box.

2) Remove cover.  See the white and black wires?  Those six (6) wires (3 black + 3 white) are the WiFi Antennae.  The top plastic plate is hinged. It gently lifts from left side to reveal 6 RF connectors.

I recommend using plastic tweezers or phone disassembly tools for this next step.

3) Gently unplug the 6 RF connectors. 

4) Once disconnected, pull the wires and RF connectors away from the main printed circuit board (PCB).  I recommend taping these to the underside of the hinged platform to prevent an accidental short on exposed components below.  Be careful not to interfere with the fan/blower.  Be careful not to apply tape to any metal surface.  (Those metal-encased RF modules get hot-enough without additional insulation.)

5) Close the hinged platform back into place, reassemble the plastic enclosure and reinstall screws.


The Results:

WiFi Signal Strength Comparison

Before:   -45 dBm                          After: -71 dBm                      Delta: -26 dBm

 

NOTES: 

[1] Signal Strength measured using a smartphone app: WiFiAnalyzer (open-source) downloaded from Google Apps Store... this is not an Ad or endorsement.  Just FYI.  Your results may vary.

[2] Measurements taken less than 10 ft from Google Fiber / GFBR set-top-box (STB).

[3] Without turning off the RF modules, it is pretty much impossible to have no RF signal.  But >25 dBm signal attenuation is plenty to ensure my preferred home WiFi hardware does not experience more signal interference form the Fiber hardware than it does from a neighbor's WiFi signal.

Tuesday, October 8, 2013

UPS-connected 12-Volt DC car jack to 5-Volt DC USB power adapter

It all started when a friend of mine was going to throw out the old uninterrupted power supply (UPS) that came with her previous Internet set-top box.  All it needed was a new lead-acid battery, but she did not know that until she had two of them.  The newer one did not cost her anything, but she had no use for it and was ready to trash it.

After saving the old UPS from the trash heap I made sure to dispose of the old lead-acid battery responsibly by taking it to a toxic waste disposal facility.  Next I purchased a new lead-acid battery for $30 at my favorite home improvement store.  In no time at all, I had a good-as-new 120VAC to 12VDC battery back-up power supply on my hands.  It did not take me long to figure out what to do with it...


Now, I am using it to keep some "mission critical" 5V-powered home electronics up and running, even when the power goes down.  (FYI: those 12VDC AutoPlug-to-USB converters can be bought really cheap, under $10.)  And in an emergency, I can use this setup to charge our mobile phones.  (I love USB.)


Tuesday, October 1, 2013

Arduino UNO as USB Keyboard "Emulator"

I started out by searching the online Arduino help web pages and discovered that native Arduino software libraries exist to support creating a USB Human Interface Devices (HID) such as a keyboard, mouse or gaming joystick.  Unfortunately, this support does not extend to the Arduino UNO boards.

The root of the problem, is that the Arduino UNO board cannot behave like a USB HID (e.g. keyboard) while supporting uploading compiled sketches to the microprocessor.  
 
Fortunately, I am not the first Arduino UNO user who has run across this limitation.  Better yet, there are several Arduino-savvy power users who have figured out and shared their knowledge with the rest of the Arduino user community.

Here's the gist of the solution: The Arduino UNO board needs to be put into Device Firmware Update (DFU) Mode.  While in DFU mode, the Arduino board's USB interface firmware is changed from a USB Arduino programming device to a USB keyboard interface device.  While a keyboard device, an Adruino sketch can include sending "keystrokes" to the USB host device such as a PC or Mac. 


In the following discussion, I am going to refer to "Programming Mode (PM)" and "Keyboard Mode (KM).  These are just terms I have created for the purpose of this description.  PM refers to the "mode" where the standard Arduino USB firmware is installed to the Arduino UNO board.  PM supports uploading Arduino sketches.  KM is the "mode" where your sketch can interface with you computer as if it were a standard USB keyboard.  The fore-mentioned DFU mode is a more commonly used term that we will recognize as an intermediate state required to "toggle" between these other two states.

So the programming sequence goes like this:

  1. Connect a USB cable to the Arduino UNO board.
  2. The original Adruino UNO board starts in "Programming Mode (PM)".  So, to start, compile and upload your "Keyboard Mode (KM)" sketch the same way you would normally for non-KM sketches.
  3. Put the Adruino board into DFU Mode.  This is a 2-step process:
    1. First, you must connect two points of the Adruino UNO board to ground.
    2. Next, use the "dfu-programmer" command to set the Adruino into DFU mode and upload the keyboard firmware (Arduino-keyboard-0.3.hex) file.
  4. Unplug the USB cable to remove power.
  5. Plug-in the USB cable.  The KM sketch will begin to run.
Done!

For details, please refer to [solved] DFU Mode Arduino UNO without soldering.
IMPORTANT:  While the Arduino UNO board is in keyboard mode, you can no longer upload new sketches.  So, when you are finished running the KM sketch, you need to use DFU mode to upload the original PM firmware (Arduino-usbserial-uno.hex).

The process is similar to going from PM to KM,except that this time the "dfu-programer" command is used to upload the PM firmware (.hex) file:

  1. Connect a USB cable to the Arduino UNO board.
  2. Put the Adruino board into DFU Mode.  This is a 2-step process:
    1. First, you must connect two points of the Adruino UNO board to ground.  (Same as before.)
    2. Next, use the "dfu-programmer" command to set the Adruino into DFU mode and upload the PM firmware (Arduino-usbserial-uno.hex).
  3. Unplug the USB cable to remove power.
  4. Plug-in the USB cable.  The KM sketch may begin to run, but no keystrokes will be sent to PC or Mac.
After that the trick was toggling through the modes to write the sketch.

EDIT (Months later):  I never quite finished this blog entry.  Sorry dear reader, but I moved on before really putting together the kick-ass USB game controller that I'd originally intended.  Brainstorms sometimes do that.  They come, then go.  Despite this, I've decided to publish what I figured out As-Is to help some aspiring hacker to perhaps carry on from where I left off.  Or I may pick it up again in the future.

Wednesday, February 20, 2013

Linux & Arduino UNO Development


During my latest foray into Arduino development, it became obvious that many of the things I want to do are easier to do in the Linux environment.  This is due to the fact that many Arduino developers are Mac users.  MacOS is based on Linux. 

Professionally, I program in Windows exclusively.  So, up until recently, I have stuck with programming my Arduino sketch editor, compilter and uploader in Windows.  Having said that, I used Unix throughout my undergrad years and early in my professional career.  Even after moving to Windows, I have attempted to use Linux several times over the years.  Unfortunately, each of my earlier attempts with Linux was abandoned for some reason or another. 

For my most recent attempt, I have installed Ubuntu 12.10.  The install on my Acer One (Windows 7 64-bit) laptop went smoothly.  Ubuntu installation is easy and straight-forward.  I opted for a 10G partition for Ubuntu.  After that, it was a matter of searching the web for a handful of Linux tools for a text editor as well as the Linux Arduino software development kit (SDK).  I am still re-learning my Unix/Linux shell control and command.   But, so far, I am pretty happy with Ubuntu and being reminded of how much fun it is to write simple but powerful scripts that can be run from the terminal window.

Frankly, I am not certain I would have been able to figure out how to get the Arduino UNO USB keyboard firmware up-and-running without  moving to Linux.  So, if you are interested in doing this, I recommend you make the move to Linux too.



Sunday, February 17, 2013

Arduino UNO as USB Keyboard "Emulator" : Motivation

Earlier this year, I built a nice gaming PC.  (More about this in a later post.)

While playing my current favorite FPS, I had the thought that it would be really cool if I had a customizable keyboard/controller.

Any experienced gamer can tell you, there are a handful of keystroke sequences that you use over and over again.  Some are pretty simple, like fire (L-mouse) then reload (R).  Others are more complicated.  One example is during stealth sniping in Crysis or Crysis 2.  In both of these games you often need to uncloak, fire, re-cloak.  If you fire while cloaked, your cloaking energy is rapidly depleted.  The faster you fire, the faster it is depleted.  So, one strategy is to first uncloak then start firing.  Then to ensure you remain undetected, immediately re-cloak as a defensive measure while seeking a new attack position.  The complexity of this maneuver has been reduced in Crysis 2. But, this idea of an Arduino UNO -based mouse + keyboard "macro" came to mind while I was playing Crysis. 

Having that said, I know there are some excellent gaming keyboards and controller systems commercially available.  So, if so motivated, I can buy one, but I found this idea so compelling that I finally had something new to explore with my old Arduino UNO.

Wow! It's been a while...

It has been over year since my last post.  What can I say?  I've been busy and frankly, I got a little too ambitious with my Arduino software plans.  My ambitious ideas led to a lot of "mental intertia" leading to a sense of foreboding preventing me from continuing any more work on the UNO-controlled cell phone project.

So, I have pretty much given up on my overly ambitious UNO project.  Instead, I have spent my time on less time-consuming, simpler experiments and home projects.  I will spend some time over the next few weeks describing these here.

For instance, I have recently built a decent mid-end gaming PC.  It took about two weeks from initial spec to final build and test.  I'll describe some of my inspiration and thinking as I was doing this and share some thoughts on what I might have done differently.

Over the past year I have built a couple of LED lighting projects that I would like to share.  There is also a bit of DIY home-improvement I will share.

Finally, over the past week or two, I have dusted off the Arduino UNO and played around with programming it to behave as a USB keyboard device.  Despite the lack of respect for chronological coherence, that is where I plan to start.

Monday, February 13, 2012

Engineering Notation in VBA/VB6

I do a lot of work using MS Excel and VBA.  To help me quickly judge magnitudes of values in standard SI units, I like to see my measurement values listed in "Engineering Notation".  That is to say a customized for of Scientific notation where exponents are a multiples of 3 (etc. ... -9 (nano), -6 (micro), -3 (milli), 0 (unit), 3 (kilo), 6 (mega), etc...).  I have found it impossible to use the VB6 Format$() function to achieve this.   So, here is a short little function to convert a double floating-point number to an "Engineering Notation" string.

For the uninitiated, the format string that works in an Excel custom cell format, does not work the same way in VB.  Specifically, using the VB function, Format$(0.001, "##.0.0E+0") does not yield the same output as formatting the cell: Custom > ##.0.0E+0.  The cell format is what we want... it just can't seem to replicate this output using the Format$() function in VB  (You'd think it would.)  But, I assure you, it does not!

Years ago, when faced with this perplexing behavior, I wrote a similar function that used a series of If/ElseIf/Else statements; it is long and kind of kludgy, but it works.  However, this time around I wanted something more compact that would not need an If condition for each range of 10^(k3) numbers. 

In this most recent attempt, I've made use of logarithm functions to make one that is much shorter (in lines-of-code) as well as more extensible.  As is, this will cover a very wide range of values.  It is pretty much limited by the precision of the OS and/or CPU floating point processors.    I am sure there are even more efficient ways to code this, but I think in addition to being fairly compact (for VB) this code is very easy to understand.  The only caveat is know that the VB Log() is the natural log (a.k.a. Ln() or LN() or "log-base-e")  Not log-base-10 (a.k.a. log())).  So "log-base-e to log-base-10 conversion" is needed.

Anyhow, I am posting this more for my own future reference than anything else.  Based on my own Google search on the subject, I did not find any solution to suite my needs.  So, here's my attempt to fill the gap.
 
Public Function CEngNotation(doubleValue As Double) As String
    Dim x As Double    ' --- Original Double (Floating-point)
    Dim y As Double    ' --- Mantissa
    Dim n As Long      ' --- Exponent
    Dim str As String
    Dim sign As String
'On Error GoTo error_hander   ' --- uncomment for debug; disable when bug-free!
    x = doubleValue
    If x <> 0 Then
        If x < 0 Then
            ' --- x *must* be positive for log function to work
            x = x * -1
            sign = "-"    ' --- we need to preserve the sign for output string
        End If
        n = 3 * CLng((Log(x) / Log(1000)))   ' --- calculate Exponent...
                                                           '     (Converts: log-base-e to log-base-10)
        y = x / (10 ^ n)                     ' --- calculate Mantissa.
        If y < 1 Then                        ' --- if Mantissa <1 then...
            n = n - 3                        ' --- ...adjust Exponent and...
            y = x / (10 ^ n)                 ' --- ...recalculate Mantissa.
        End If
        ' --- Create output string (special treatment when Exponent of zero; don't append "e")
        str = sign & y & IIf(n <> 0, "e" & IIf(n > 0, "+", "") & n, "")
    Else
        ' --- if the value is zero, well, return zero...
        str = "0"
    End If
    CEngNotation = str
    Exit Function
error_hander:
    ' --- this is really just for debugging suspected problems
    Resume Next
End Function

And here's a function that I used to test my CEngNotation() function:

Private Sub Test_CEngNotation()
    Dim x As Double
    x = 10500300
    Do While x > 0.000000001
        Debug.Print x, CEngNotation(x)
        x = x / 10
    Loop
End Sub