FNET

fdrhighresBeing a data nut, a relatively recent electronics enthusiast, and now a burgeoning “time nut”, there was a thread on the timenuts email list on monitoring the mains frequency (60Hz in North America, and 50Hz most other places), and how accurate it actually is. One of the responses pointed toward FNET, or a project run by the University of Tennessee. They provide a “box” that you plug into your network, mains (120V in my case), and a GPS antenna. It measures your mains frequency with what I assume is a zero cross detector, correlates that frequency with a highly accurate 1PPS signal that it’s GPS receiver generates, and then streams that data to the FNET servers (which can be viewed here).

Thinking that sounded pretty awesome, I contacted them, and asked if they wanted a box in Eugene (my intent being to install it on Campus in my office). They jumped at the chance, and sent me a box. A week or two later, I got it, and tried to set it up. Sadly, after a couple days of futzing, I realized to my dismay that Low-E windows block GPS signals. =( BUT! I have access to the “penthouse” where they have all our HVAC equipment, and has roof access. After some investigation, and some help of a friend, I was able to run the GPS cable through an empty 1″ conduit, outside, up the side of the penthouse, and onto it’s roof, which is solid steel, so the magnetic GPS puck sticks great. The unit itself I hung from some electrical conduit using some Velcro straps. Also slapping a label on the unit saying to contact me if there are any questions (since a box with flashing lights on it, could be confusing to a random Facilities employee).

GPS lock was great (I average about 10 satellites), and the cable was a perfect length (5 meters). I would suggest they switch to SMA connections for their GPS in the future, but meh. If you’re curious, take a look here. I’m unit #1033. It’s interesting to see how the mains frequency droops, or elevates during the time of day, and knowing whether that’s when people are just getting home, or leaving, etc. I would also highly suggest reading up on the US Power grid, and how the West and East are joined by the Texas interconnect.

phpMyAdmin not working with Cloudflare

logo-ogI recently installed the “new” version of phpmyadmin, and noticed that it didn’t work (in Chrome or Firefox, but did work in Safari). After a fair amount of troubleshooting, I found there’s a setting in config that is: $cfg['AllowThirdPartyFraming'] = true; (this overrides the default “false”) that seems to be for blocking iFrame attacks.

This caused the first part of the login page to load, but still missing the login fields, etc. After some more troubleshooting, this turned out to be Cloudflare’s Rocketloader. Which, you can disable either via path rule (just excluding everything with a given path), or by adding a value to the <script> tags. The path rule works great, but you only get 3 path rules with a free cloudflare account. =/

So, going into Scripts.class.php and added the tags to the javascript tags. I created a patch, and posted it to the bug on the phpmyadmin bug tracker here. After the bug initially getting closed as invalid, after posting the patch, they re-opened the ticket, and may include the changes in a release (or find some other way to resolve the rocketloader issue). So far, I get the impression phpMyAdmin won’t be including my patch in their codebase. =/ (UPDATE: In fact, they accepted the patch, and it’s now to be included in 4.4.2!)

I’ve also opened a bug with Cloudflare (which, sadly, I can’t link to). I’ve heard nothing back from them.

Anyway, good luck if you run into this issue.

APC Smart-UPS 1400 Battery replacement

su1400Having just gotten a replacement battery for my Smart-UPS 1400, I went to replace the battery, only to have the UPS randomly shutdown. I had had this issue before where if you removed the front panel and metal plate, the UPS would randomly turn off and on again. Figuring it was some cold solder joint, to bad ribbon cable between the front panel and UPS, I took everything apart to troubleshoot. Sadly, I couldn’t find the issue. I did decide to figure out why the battery never seemed to seat fully, and really, it’s due to bad design on APC’s part. The terminal connector for the battery is supposed to neatly fall into a recessed area of the chassis, and lay flat enough for the battery to seat. 9/10 with my unit though, the terminal would end up sideways, and prevent the battery from fully inserting. Worse, and this is why the unit was turning off, when this happened, and you tried to press the battery all the way back, one of the standoffs holding the PCB to the chassis would tweak enough to cause some board fault, and shut down (I haven’t dug further, I just saw the tweaking happening when the UPS case was removed).

So, as a note for anyone that might have one of these units. Don’t try to hotswap the battery. Just shut stuff down, remove the case (6 screws on the bottom), and then replace the battery while you can see the terminal connection. Then you can actually see if it’s laying properly in the chassis, and the battery will slide all the way into the unit. You can “help” it do this by making sure the battery cables are laying “down” rather than up, or back. Just, a crappy design on APC’s part. The only way I can see it always working right would be if the battery, and UPS, cables were silicone coated rather than PVC, and therefore were a bit more relaxed, and wanted to let gravity have it’s way. Maybe it also has to do with the unit being 20 years old at this point, and the PVC hardening. Either way, not a great design.

Good luck!