fogbound.net




Page 4 of 62« First...23456...1020...Last »

Tue, 29 Sep 2015

Doorbell

— SjG @ 9:14 pm

The Quagg Wedding Chapel has had a cheap wireless doorbell system, and over time the plastic case for the button itself got corroded and ugly.
db01

Aha! This looks like a good Saturday project!

So, I disassembled the plastic button to get at the actual circuit board. Then I selected some nice wood stock and measuring devices, and started designing.
db02Screen-Shot-2015-09-29-at-9.51

As mentioned before, my primary fabrication/making tool here is my Nomad 883 CNC device. I create my designs using Moment of Inspiration (MoI), convert them to GCode using MeshCAM, and carve them from wood, plastic, or metal with the Nomad.

First, I cut the heart-shaped button piece. This was cut from a piece of recovered Red Oak (the plank had spent some years being a wine barrel). As you can see, to prevent the cut-out piece from breaking free and rattling around before the surface was completely carved, I left some connector supports. They were cut away later.
db03
Next is the main body of the piece, cut from the lighter wood (I think it may be ash). This is a two-sided cut: the basic shape of the button holder is the one side, and the hollowed out interior with areas for the button and circuit board is the other. There are elaborate means that can be used to make a very precise two-sided cut (Carbide 3D sells their recommended “flip-jig”, which is accurate to around 1/100th of an inch, but I don’t have one). For this project, however, the alignment of the two sides only needed to be within a millimeter or two, so I did it mostly by eyeball.
db04
You can see there were two attempts here. The first time, I used an 0.0625″ ball cutter. The thin cut around the edge got clogged with chips, and skipped. The second attempt, I used an 0.125″ ball cutter and vacuumed a few times during the process.
Next, I flipped the piece, and did the hollowing cut. This used an 0.125″ end mill. I’m not positive I know what this lighter wood is — I set the carving parameters for as a soft wood, but I think perhaps I should have chosen hardwood. The feed-rate of the cut (the speed that the cutting bit moves) was a little too aggressive. Part of the way through the finishing phase, the cutter bound briefly and the servos skipped, resulting in an aborted cut. The carving was mostly complete and still usable, however. The damaged areas are on the inside of the hollowed pocket, so they aren’t visible when it’s all assembled. I figured it was good enough, and didn’t bother to redo the whole process.
db05
I sanded everything down a bit, and tested to see that the button portion had clearance. Yup! It works!
db07
db06
Now I separated the main object from the larger piece using an X-Acto knife. I smoothed the edges, and treated the pieces with polyurethane sealant. I slotted in the circuit board, and it all fit together nicely.
db08
Not shown are the screws and the mounting hardware that loops around the circuit board in the slots by the battery. I added that hardware, and, with a silent mental fanfare, I put it up!
db09
My final conclusion is that it’s kind of ugly, but in a much more homey/craftsy way than the corroded plastic it replaced. And hey! It works!


Sat, 15 Aug 2015

Dinner Party

— SjG @ 5:48 pm

If you were throwing a dinner party, and had a table for eight, a fantastic chef, an unlimited travel budget, and were able to invite seven guests1, who would you invite?

While picking a good table is an impossible challenge, here’s what my first table would look like:

I found coming up with this table such a fun challenge that I will doubtless expand this into a dinner series. Maybe we’ll meet once a month.

Who is coming to your dinner party?

1 I’m making the assumption that the invitation would be so compelling that the guests would all attend. And I’m further limiting this thought experiment to living people.

Filed in:

Wed, 29 Jul 2015

Selenium, PHPUnit, and TinyMCE

— SjG @ 8:40 am

Nearly two years ago, I wrote a quick note on how to switch iframes in PHPUnit/Selenium to populate an xhEditor text area.

Because we’re seeing a lot of formatted text cut/pasted from Microsoft Word, we needed to replace xhEditor with a WYSIWYG that does a better job of stripping out all of the horrible cruft that the Word formatting causes. TinyMCE seems to do a decent job (given the impossible nature of the requirements), but my test code no longer works.

Here’s how I got it working again. I added a function to my base WebTestCase:

protected function typeInTinyMCE($text,$field)
{
   $this->getEval("selenium.browserbot.getUserWindow()."+
      "tinyMCE.get('".$field."').setContent('".addslashes($text)."');");
}


Then, in any arbitrary functional test, I can type stuff into my TinyMCE field:

public function testWhatever()
{
   $this->login();
   $this->click("link=WYSIWYG Page");
   $this->waitForPageToLoad("30000");
   $this->typeInTinyMCE('Hey, I can put stuff into my WYSIWYG field!','field_id');
...
}


Mon, 27 Jul 2015

Reactivating an iPhone

— SjG @ 6:34 pm

I upgraded my trusty iPhone 5 to an iPhone 6 back in December. I’ve used the old iPhone as a camera for doing some timelapse work, as a geocaching GPS and Ladybug recorder when taking my nephew on a Lost Ladybug expedition, and as a music player to drive a bluetooth speaker in my office. Now that my Mom is tentatively considering entering the world of smart phones, I thought I’d get it re-provisioned so she could try it and see if she likes it before springing for a bigger / newer phone.

Now, one of the great things about the iPhone 5 (as opposed to earlier generations) is that it has multiple radios in it, and supports multiple carriers. This particular phone is unlocked, and was used successfully in India with a Telestial India Airtel SIM card, and in several areas in the US with various other third-party GSM SIM cards on AT&T’s network.

When Mom’s hiking, her AT&T coverage drops out with her current phone. My Sprint coverage in the mountains is spotty at best, so a process of elimination led me to think it would be a good idea to switch the phone over to Verizon. The internet assured me that this was possible, beginning with the iPhone 5. Thus begins Act I.

Photo-Jul-27,-6-42-22-PM

Reactivating an iPhone, a Tragicomedy in 7 Acts
In which the author wastes over six hours in various retail establishments to get an unlocked phone active with a month-to-month plan.

Act I. The Verizon Store. The first tech looked at me dubiously. “You can’t use a Sprint phone on Verizon,” she said. “It’s unlocked,” I assured her. After recounting the litany of networks above, her suspicion increased. “You sure you weren’t just roaming on other networks?” she asked. Once I had sufficiently convinced her that I had swapped SIMs, she was willing to give it a try. She warned me that she hadn’t seem much success in moving iPhones from Sprint, even when unlocked, due to a “Verizon block.” Being prudent, she tried to use one of the store’s demo SIMs. After half an hour of resetting carrier settings and various other things, the best we could get was an “Invalid SIM” error. “See?” she asked me.

Act II. Another Verizon Store. I had tested my phone’s IMEI on Verizon’s compatibility check, and it said I was good. So I went to another Verizon store, armed with this information, and tried again. This time, I was signed up for an account, assured that it would be simple, given a SIM, and had my credit card charged all between sessions where the technician froze, spellbound by the Mexico/Panama football game on the big TV. But it didn’t work. We got “Invalid SIM” errors. It turns out there is some mysterious Verizon block, after all, even if Sprint considers the phone unlocked. “No problem,” he told me. “We can get you into a free iPhone on a month-to-month plan.” I was skeptical and amazed, but said OK. When it came time to sign on the dotted line, the box I was handed was a Galaxy S4. I made it clear I needed an iPhone. “OK, I can’t get that for free, but I can get you that for $100.” Still skeptical, I again said I’d try it. This time, I was presented an iPhone 5c, a $100 activation fee, $150 in various other up-front fees, and a 2-year contract. At this point, I got my original charge refunded, and left.

Act III. Screw it, thought I. I’ll just keep it on Sprint. If Mom likes it, we can switch networks later when she upgrades. I went to the Sprint store. “No problem,” they said. “We’ll just add it to your existing account as an extra line; it’ll be cheap and easy.” But then they noticed there was no SIM. Somewhere in the long history, the original Sprint SIM had gone missing. If I had known the pain this would engender, I would have given up then and there, and just bought a new goddamn phone. But it seemed no problem. They had a SIM card from an iPhone 6 that someone had returned, we’d just use that. The tech and I had long conversations about travel, Boston, work, school, and such things while she went through the endless steps to provision and reprovision the phone. After a few popups about SIM failure, it seemed to work. I could call to and from the phone! Victory!

Act IV. The phone, sitting on the charger, showed a popup saying “SIM has been locked” and the carrier header said “SIM Fail.” I power cycled the phone, and hey presto! It was back on Sprint. I tried, just for kicks, to bring up the web browser. Immediately, I got a “Data access denied” error, followed rapidly by the “SIM has been locked” and “SIM Fail” notices. Power cycling brought it back. And then the fail cycle happened again.

Act V. Back at the Sprint store. “Sorry, the iPhone 6 SIM must not be compatible. Better to go the Apple store and get an iPhone 5 SIM.”

Act VI. At the Apple store. “Sorry, we’re out of nano SIMs. We don’t have any for the iPhone 5.” but I looked over the shoulder of the tech, and saw numerous SIMs listed. “What about those?” I asked, pointing. The tech went off to talk to another tech. She soon returned. “OK, we have a floater phone, and we’ll use that SIM.” So eventually someone brought over a card with the SIM, and the tech spent a long and frustrating session on the phone with Sprint trying to get the SIM activated. Eventually, this was successful. Strangely, the phone would connect to the network, get three bars, then drop to a single bar and lose 3G and display the “1x extended” data plan. “We have awful Sprint coverage here,” said the tech. I looked at my other phone, at it had three bars. “It may also be that they haven’t activated it yet,” she said. In the settings, we confirmed that it displayed the correct phone number. “I’ll try calling it,” I said. Nothing happened. We power cycled the phone. The phone number in the settings now read “0007423.” The tech said “Well, either your phone is broken, or you need to wait for the activation to go through.” When I asked how it could be broken, she shrugged. “You said yourself that you didn’t use it as a phone for a few months,” was her best answer.

Act VII. At the Sprint Store. I recounted Act VI to the tech. He looked up the SIM in his database, and scowled. “No way, dude, that SIM’s not compatible.” I handed him the iPhone 6 SIM the other Sprint store had given me. The process repeated. “No way,” he said. “Not compatible.” Where could I get a compatible SIM? His advice was to go to a Sprint repair center, where they have more supplies, since the retail stores don’t carry extras. As I was about to leave, he said “wait! Someone returned an iPhone 5 not too long ago. Let me see if it’s still back there, and if it had a Sprint SIM in it.” Wonder of wonders, it was and it did! After a mere ten minutes of typing into the mysterious terminal, it came up. I could call it from another phone, and it could call another phone. It connected to data services with LTE!

Exuent Samuel, cackling with glee.


Wed, 22 Jul 2015

Error: Timeout – Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.

— SjG @ 2:04 pm

No, this site’s not crashing. That’s the error message I was getting when running a Karma test of some Angular / JavaScript code.

The usual suspects (when Googling) is having an argument to your it function. But my it function had no argument.

However, my afterEach function *did* have an argument due to a typo. That was the culprit. If it’s not your it function, it could be your beforeEach or afterEach function. Either one will also cause the entire it function to run asynchronously.

As usual, this is likely obvious to everyone but me. I’m posting this in the off chance someone else has the same problem and is as dumb as I am 🙂


Page 4 of 62« First...23456...1020...Last »