[[cha:updating-linuxcnc]] (((Updating LinuxCNC)))

= Updating LinuxCNC

This section describes how to upgrade LinuxCNC to version 2.7 from
version 2.6.  It assumes that you have an existing 2.6 install that you
want to update to 2.7.

To upgrade LinuxCNC to version 2.7 from a version older than 2.6,
you have to first upgrade your old install to 2.6, then follow these
instructions to upgrade to 2.7.

If you do not have an old (pre-2.7) version of LinuxCNC to upgrade,
then you're best off making a fresh install of 2.7 as described in the
section <<cha:getting-linuxcnc,Getting LinuxCNC>>.


== Upgrade to the new version

The basic idea is to disable the old linuxcnc.org apt sources and add
a new linuxcnc.org apt source for 2.7, then upgrade LinuxCNC.

The details will depend on which platform you're running on.
Run `lsb_release -ic` to find this information out:

-----
> lsb_release -ic
Distributor ID: Debian
Codename:       wheezy
-----

You should be running on Debian Wheezy (as above), or Ubuntu Precise,
or Ubuntu Lucid.


=== Setting apt sources

* Open the `Software Sources` window.  The process for doing this
  differs slightly on the three supported platforms:

** Debian Wheezy:

*** Click on `Applications Menu`, then `System`, then
  `Synaptic Package Manager`.

*** In Synaptic, click on the `Settings` menu, then click `Repositories`
  to open the `Software Sources` window.

** Ubuntu Precise:

*** Click on the `Dash Home` icon in the top left.

*** In the `Search` field, type "software", then click on the `Ubuntu
  Software Center` icon.

*** In the Ubuntu Software Center window, click on the `Edit` menu,
  then click on `Software Sources...` to open the `Software Sources`
  window.

** Ubuntu Lucid:

*** Click the `System` menu, then `Administration`, then
  `Synaptic Package Manager`.

*** In Synaptic, click on the `Settings` menu, then click `Repositories`
  to open the `Software Sources` window.

* In the `Software Sources` window, select the `Other Software` tab.

* Delete or un-check all the old linuxcnc.org entries (leave all
  non-linuxcnc.org lines as they are).

* Click the `Add` button and add a new apt line.  The line will be
  slightly different on the different platforms:

[options="header"]
|===================================================================
| Platform       | apt source line
| Debian Wheezy  | `deb http://linuxcnc.org wheezy base 2.7-rtai`
| Ubuntu Precise | `deb http://linuxcnc.org precise base 2.7-rtai`
| Ubuntu Lucid   | `deb http://linuxcnc.org lucid base 2.7-rtai`
|===================================================================

image::images/upgrading-to-2.7.png[align="left"]

* Click `Add Source`, then `Close` in the Software Sources window.
  If it pops up a window informing you that the information about
  available software is out-of-date, click the `Reload` button.


=== Upgrading to the new version

Now your computer knows where to get the new version of the software,
next we need to install it.

The process again differs depending on your platform.

==== Debian Wheezy and Ubuntu Lucid

Debian Wheezy and Ubuntu Lucid both use the Synaptic Package Manager.

* Open Synaptic using the instructions in <<_setting_apt_sources,Setting
  apt sources>> above.

* Click the `Reload` button.

* Use the Search function to search for `linuxcnc`.

* Click the check box to mark the new linuxcnc and linuxcnc-doc-*
  packages for upgrade.  The package manager may select a number of
  additional packages to be installed, to satisfy dependencies that the
  new linuxcnc package has.

* Click the `Apply` button, and let your computer install the new
  package. The old linuxcnc package will be automatically upgraded to
  the new one.


=== Ubuntu Precise

* Click on the `Dash Home` icon in the top left.

* In the `Search` field, type "update", then click on the `Update Manager`
  icon.

* Click the `Check` button to fetch the list of packages available.

* Click the `Install Updates` button to install the new versions of
  all packages.


== Updating your config

LinuxCNC version 2.7 differs from version 2.6 in some ways that may
require changes to your machine configuration.


=== Hostmot2 Watchdog

The Hostmot2 watchdog now gets handled by the hm2 `write` Hal function.
Remove any `addf` lines that refer to the `pet_watchdog` function.

=== Hostmot2 dpll

The Hostmot2 dpll's default time constant has been changed from 40960 to 2000.
The original value could occasionally lead to following errors when software
like ntpd and ntpdate adjusted the rate of the linux CLOCK_MONOTONIC time
source by up to 1000ppm in a single step.  The new value allows the dpll to
adjust to the change in the base period frequency without error.

=== Parport changes

Older versions of the LinuxCNC `hal_parport` driver conflicted with the
Linux `parport_pc` driver.  This required two mitigation techniques:
we would prevent `parport_pc` from loading, and we would load another
LinuxCNC driver called `probe_parport` before loading `hal_parport`.

The LinuxCNC `hal_parport` driver now cooperates well with the Linux
`parport_pc` driver, and these mitigation techniques are no longer
needed or useful.  In 2.7, the `probe_parport` driver has been removed
from LinuxCNC.

This means configs that use the parallel port may need to be updated in
the following ways:

* Make sure LinuxCNC does not prevent the Linux `parport_pc` driver
  from loading.  Older versions of LinuxCNC would blacklist `parport_pc`
  in `/etc/modprobe.d/linuxcnc.conf` (or `/etc/modprobe.d/emc2.conf`
  for even older versions of LinuxCNC).  Comment out any
  lines in either of those files that looks like this:
  +
  `install parport_pc /bin/true`

* Make sure your Hal configuration does not load the `probe_parport`
  component.


=== Huanyang VFD driver

LinuxCNC 2.7 includes a driver for the Huanyang family of VFDs.  This
driver is based on an out-of-tree driver by "scotta" and "alan_3301"
at CNCZone.com, and curated by Benjamin Brockhaus.  This new driver
talks to the same hardware as the original driver, but has a slightly
different HAL interface:

[options="header"]
|===================================================================
| Original hy-vfd driver   | New LinuxCNC hy-vfd driver
| hy_vfd.fwd               | hy_vfd.forward
| hy_vfd.rev               | hy_vfd.reverse
| hy_vfd.modbus-ok         | hy_vfd.hycomm-ok
| hy_vfd.motor-pole-number | (removed)
| hy_vfd.base-freq         | (removed)
|===================================================================

// vim: set syntax=asciidoc:
