Author Archives: James Reuben Knowles

Installing a PhoneGap App On an iOS Device Using iTunes

Preliminary Steps

To produce an iOS build using the PhoneGap Build web site, one must have created a signing certificate and provisioning list for the devices that the app is allowed to run on. These notes assume that this has been done, and there is a successful build on the PhoneGap Build web site.

Loading into iTunes

The first step, and the first potential roadblock, is loading the app into iTunes.

  1. Plug in the iOS device into the computer and select the device.
  2. Download the .ipa file from the PhoneGap Build site.
  3. Drag and drop the .ipa file onto iTune.

This is where the first “gotcha” may turn up. The .ipa file does not have Apple’s blessing. By default OS X will refuse to load any un-blessed apps.

skitch

This can, however be changed in the Security preferences.

skitch

Use the lock symbol to allow for changes to the security settings, then choose “Anywhere” in the “Allow apps downloaded from:” section.

skitch

OS X will give a final warning about the dangers of doing this, and that the setting will revert to after a certain amount of time.

skitch

 

Now the app should show up in the list of apps to load onto the iOS device, and will be loaded when you sync the device.

Hydration Hanging

Hydration is a wonderful development tool that will automatically fetch the latest version of the app from the PhoneGap Build web site. (It must be removed before submitting the app to Apple for review.) However, when one starts the app,  it will sometimes hang.

To kill the hung app, the Apple support web site has an excellent tip.

Korad KA3005P Serial Programming

korad-ka3005pThis is a cheap lab bench power supply that given its flaws is a surprisingly solid piece of equipment. I wouldn’t call this a precision power supply, but its tolerances and ripple are acceptable for ordinary bench work. (And really, if you’re doing precision work, you’ll invest in a precision supply anyhow.)

There are two methods for communicating with the unit: a serial interface and a proprietary binary USB interface. One may use either the DB-9 connector or USB to access the serial interface.

I wrote a Python wrapper for the serial protocol to encapsulate the various tidbits  of information I’ve encountered on the  Internet. The firmware is buggy and there are various gotchas. Hopefully the Python wrapper will address the worst of the problems one might encounter.

Git Cheat Sheet

An acquaintance sent this to me last year and I thought the link might be useful to others before I deleted the old e-mails.

Git Cheat Sheet by Tower

I haven’t looked at Tower’s GUI since their version 1 beta so I can’t comment on their product. However git is git and that makes the cheat sheet useful.

(I settled into using SourceTree for my daily work a while ago.)

 

Turning the Spindle On/Off on a Comet CNC

Comet CNC SpindleIt’s common for people to use a low-end spindle on a Probotix Comet CNC. The LinuxCNC software can turn the spindle on and off, but not control the speed or direction.

The G-code for turning a spindle on is M3,  but that command alone will not work. It needs a non-zero speed parameter. For example:

[code]
M3 S1
[/code]

will turn the spindle on. To turn it off use M5.

[code]
M3 S1
…other commands…
M5
[/code]

As always, stay safe.

 

Resolving the git error “pack exceeds maximum allowed size” during push

Elephant_near_ndutuI have a large repository that takes up a modest number of gigabytes. When attempting to push it to a  new remote repository,  the push failed, complaining that the pack size exceeds the maximum allowed.

First of all, let’s get out of the way the fact that repacking the local repository or fiddling with the pack.packSizeLimit limit configuration setting won’t fix the problem. That will simply tidy  up your local machine.

As I understand it (corrections welcome), the problem is a collision of several things. When performing this massive beginning-to-end push, git creates a massive pack on  the fly and pipes that across the network to the remote machine. The remote machine needs  to be able to perform memory mapping on this huge wad of data. File system, CPU architecture, and memory needs have to be satisfied for this to work. Otherwise, the pack size error is reported and the push fails. Annoyingly, this can happen after you’ve transferred gigabytes of data across a network with a bottleneck, completely wasting a lot of time.

Fortunately the work-around is simple. Push the repository in chunks, working your way up the tree.

If your repository has a lot of branching, you may be able to push a branch at a time, as the generated pack will be for that branch.

This repo of mine has a very linear history, and feeling a little lazy I used my git GUI (SourceTree) to make a temporary branch about a third way up the tree, and pushed that. I moved the temporary branch another third of the way up the tree, and pushed that. Finally I could push master and remove the temporary branch.

If the repository were big and hairy enough one could write a script to traverse the tree and programmatically push at appropriate commit points, but for me it’s an exceptional situation that doesn’t warrant that type of effort.