Getting MySQL Working After OX 10.10 Yosemite Upgrade

I updated my development computer to OS X 10.10 (Yosemite) and found MySQL was dead. These are notes on what I did to get MySQL running again.

Update the latest MySQL off of their website. At the time of this writing, that is Mac OS X 10.9 (x86, 64-bit), DMG Archive from the MySQL download site.

I found that MySQL would run but MySQL Workbench couldn’t connect. It turns out that the data directory is kept under each version. Thus, when I updated from 5.6.17 to 5.6.21 MySQL was pointing to a fresh new database.

The new version is installed in /usr/local/mysql-5.6.21-osx10.8-x86_64, with the MySQL data files in the data subdirectory. I renamed the data subdirectory to ensure I have a backup and made a copy of the old directory.

sudo cp -rp ../mysql-5.6.17-osx10.7-x86_64/data .

It appears that MySQL is working fine now. Note that this will only work for incremental revisions. If you’re reaching across minor version numbers (such as 5.5 to 5.6), the changes in structure will probably not work. (You did make a backup of the original data directory, didn’t you?)

 

 

Posted in Mac | Tagged , , , , | Leave a comment

Setting the Probotix Comet Configuration to Find Your G-Code Library

Personal notes on how to get the LinuxCNC software that comes with the Probotix Fireball Comet CNC to find your personal library of G-code files.

The Probotix Comet controller software (AXIS) by default looks for extra G-code files in /home/probotix/emc2/nc_files.

If one does not wish to store files there, one can edit the /home/probotix/configs/Comet/Comet.ini to point it to the directory of choice.

Change the  PROGRAM_PREFIX parameter to point to the directory of choice. (As always, please back up files before hacking them.)

This will allow one to, for example, load a standard preamble with the G-code:


o<preamble> call

or otherwise allow one to create a library of useful routines.

 

Posted in CNC & Robotics | Tagged , , , , , | Leave a comment

Probotix Comet CNC Startup and Shutdown

These are my notes on starting and stopping the Probotix Fireball Comet CNC mill.

Danger

I’m not kidding about danger. There is one cardinal rule.

The motor control box must never have power without the AXIS control software running.

The AXIS control software (the Comet icon on the desktop) must and I repeat must be running before power is applied to the stepper motor control box, and must remain running as long as power is applied to the stepper motor control box.

Why This Is Important

The motor control box translates signals from the computer’s parallel port into motion and spindle control. The AXIS software controls the signals to the parallel port. If the motor control box is powered on before the AXIS software is running, or the AXIS software is exited before the motor control box has been powered off, then the parallel port and thus the motor control box will be thrown into an unknown, unpredictable, and uncontrolled state and the mill can start operating by itself.

Think about how dangerous this is:

  1. The spindle can start without warning and the red emergency stop button will not be operable. (I had this happen to me.)
  2. The motors can start moving  without warning and the red emergency stop button will not be operable. These motors are powerful and can crush fingers.

A powerful uncontrolled robotic cutting tool is not something to leave to chance.

Steps

Now that I’ve beat that horse to death, here are the steps to safely start up and shut down a Comet:

Start Up

  1. Start the computer
  2. Double click on the Comet program icon and leave it running.
  3. Power on the controller box.
  4. Ensure the emergency stop button on the machine is out (off). Twist the knob to reset it.
  5. Turn on the (virtual) machine power on. Push F2 or click on the orange power button icon on the top tool bar of the AXIS software.
  6. Use Home All button to put the CNC into a known state.
  7. Use the machine to make all manner of wonderful creations.

Shut Down

  1. Turn off the controller box.
  2. Exit the AXIS (Comet) program. You can use the X in the upper right-hand corner.
  3. Turn off the computer. In the top right hand corner of the screen there is a power symbol. Click on this to bring up the menu and select Shut Down….

Restarting LinuxCNC

If you ever need to restart LinuxCNC power off the stepper motor controller box first. The motor control box must never have power without LinuxCNC running. (Did you think that I was done beating that horse?)

I have had problems having LinuxCNC crash when trying to restart it. If this happens, reboot the computer. There is a power symbol in the top right corner of the screen. Click on this to bring up the menus and select Restart….

 

Posted in CNC & Robotics | Tagged , , , , , , , | Leave a comment

Contact Form Updated

The venerable cformII plugin has been retired as it’s not supported  any more, and spam bots started pinging my mailbox.

I’m hoping the that the shiny new contact form plugin works well.

 

Posted in Announcements | Leave a comment

Django 1.7, PyCharm, and Apache

I’ve had some ongoing problems with PyCharm support for Django since the 1.7 release. Here is a summary.

WSGI Broke

The entire app failed to run under Apache. This caused some moments of terror. The WSGI file needed to be edited.

This code started on version 1.3. The old WSGI configuration worked until 1.7. This discussion thread described the behaviour, which bites projects started pre-1.4. See also Issue #23437 describes the WSGI problem, and the official release notes under app-loading changes.

The correct call to initialize WSGI is:

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

 

PyCharm Testing Broke

Tests in PyCharm broke. This a case of being bitten by older code again. Django uses the standard Python unittest module now. I had to go through dozens of files and tweak the import statements.

Update: LH asked for more information.

In my unit testing, I used the old-style Django test classes and had import statements like:

from django.test import TestCase

which must be changed to:

from unittest import TestCase

in order to use the built-in Python unit testing core.

PyCharm Django Console Broke

This is kind of annoying. The problem isn’t so much PyCharm itself but Django “fixed” a long-standing “bug”. Now what used to work fine doesn’t. Per the app-loading changes in the 1.7 release notes, one must, every time they start the Django console from within PyCharm, execute the following commands:

import django
django.setup()

This became annoying enough I hacked the Django helper

/Applications/PyCharm.app/helpers/pycharm/django_manage_shell.py

and added the two lines to that file. Problem resolved.

 

Posted in Programming | Tagged , , , , , , , | 2 Comments

Hair Donated

I’ve been blessed with a full head of thick hair and decided to share that blessing with others. Today I had my pony tail cut off, harvesting approximately 13 inches for donating to charity. It will be used in making wigs for children with hair loss due to cancer or other conditions.

 

My hair, before harvesting it for charity.

My hair, before harvesting it for charity.

Posted in Extra Mile | Tagged , , , , , | Leave a comment

Control VMware Fusion from the Command Line

Background

Virtualization has been a key technology for me as a contractor. Because I have multiple clients, keeping their projects sequestered from each other is a snap: one or more VMs (virtual machines) per project. Development, testing, and in some cases deployment is all on separate VMs.

I’ve been using VMware Workstation since it first came out 1999. The ability for me to seamlessly move VMs between Windows, Linux, and OS X has been a key reason I’ve stuck with them for so long.

Automating tasks via scripting one of many reasons I insist that my workstation run  Un*x of some flavour. I’ve been using OS X for quite a while quite happily as a software developer, however VMware Fusion (for OS X) doesn’t present the full set of features available on VMware Workstation (for Linux and Windows). Fortunately hidden under the hood are the same tools.

The Executable vmrun

VMware provides a tool called vmrun that allows common operations to be performed on VMs — starting, suspending, taking snapshots, etc. On OS X it’s tucked away in the VMware Fusion bundle under Contents/Library.

In my shell startup I add the directory to PATH:

# VMware Fusion
if [ -d "/Applications/VMware Fusion.app/Contents/Library" ]; then
    export PATH=$PATH:"/Applications/VMware Fusion.app/Contents/Library"
fi

Find the Virtual Machine’s .vmx File

To use vmrun you need to have the path to the .vmx file that resides inside of the VM bundle on OS X. For example, I have a VM with an install of RedHat Enterprise Linux 7:

RHEL7 VM

This is actually not a single file, but a directory called RHEL7.vmwarevm. The contents can be seen in the Finder by right clicking:

Show Contents

This will open up the directory and show the various files that make up the virtual machine.

Inside the Bundle

As can be seen, the .vmx file is prominently displayed.

Put the Pieces Together

To start the VM from the command line one uses the “start” parameter. For example, if the above virtual machine were in one’s home directory one can type:

$ vmrun start ~/RHEL7.vmwarevm/RHEL7.vmx

vmrun Commands

If one runs vmrun without parameters it gives a farily long summary of commands that it accepts. One can:

  1. control the power state of the VM,
  2. control snapshots,
  3. perform various operations inside a running VM, and
  4. other operations such as installing tools and cloning.

A short list of common operations:

Description Command Parameters
List running VMs list
Start a VM start /path/to/vmx/file
Suspend a VM suspend /path/to/vmx/file
Take a snapshot snapshot /path/to/vmx/file snapshot name

 Additional Information

VMware has a PDF on vmrun here.

 

Posted in SysAdmin | Tagged , , , , | Leave a comment