mirror of
https://github.com/weewx/weewx.git
synced 2026-04-18 08:36:54 -04:00
238 lines
8.4 KiB
HTML
238 lines
8.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>weewx: Installation on macOS systems</title>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<link rel="stylesheet" href="css/weewx_ui.css"/>
|
|
<link rel="icon" href="images/favicon.png" type="image/png"/>
|
|
<!-- Use cash, a lightweight jQuery clone: -->
|
|
<script src="js/cash.min.js"></script>
|
|
<script src="js/weewx.js"></script>
|
|
<script>
|
|
$(function () {
|
|
// Create a click on the first tab to get things started.
|
|
$('#prereq-tabs .tab')[1].click();
|
|
$('#setup-tabs .tab')[1].click();
|
|
$('#run-tabs .tab')[1].click();
|
|
})
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<h1 class="title">WeeWX: Installation on macOS systems <span class='os-icons'>
|
|
<img class='logo' src='images/logo-apple.png' alt=""/>
|
|
</span>
|
|
</h1>
|
|
|
|
<p>This is a guide to installing WeeWX on macOS.</p>
|
|
|
|
<h2>Download</h2>
|
|
|
|
<p>
|
|
Download the source archive <span class='code'>weewx-X.Y.Z.tar.gz</span> from <a
|
|
href="https://weewx.com/downloads"><span class="code">weewx.com/downloads</span></a>.
|
|
</p>
|
|
|
|
<h2>Install prerequisites</h2>
|
|
|
|
<div id="prereq-tabs" class="tabs" style="width:95%; padding: 10px 10px 10px 10px;">
|
|
<nav>
|
|
<button class="tab" onclick="openTab(event, '#prereq-py2')">
|
|
Python 2
|
|
</button>
|
|
|
|
<button class="tab" onclick="openTab(event, '#prereq-py3')">
|
|
Python 3
|
|
</button>
|
|
</nav>
|
|
<div id='prereq-py2' class="tab-content">
|
|
<p>Ensure that Python 2.7 is installed. Earlier versions will not work.</p>
|
|
<pre class='tty cmd'>python2 -V</pre>
|
|
|
|
<p>Make sure that a Python 2 version of <a href="https://pypi.python.org/pypi/pip">pip</a> has been installed
|
|
on your system. If not, it may be as simple as:
|
|
</p>
|
|
<pre class='tty cmd'>sudo easy_install pip</pre>
|
|
<p>Now install the required Python packages using pip.</p>
|
|
<pre class='tty cmd'>sudo python2 -m pip install pysqlite
|
|
sudo python2 -m pip install configobj
|
|
sudo python2 -m pip install Cheetah
|
|
sudo python2 -m pip install PIL
|
|
sudo python2 -m pip install pyserial
|
|
sudo python2 -m pip install pyusb
|
|
|
|
# For extended almanac information (optional):
|
|
sudo python2 -m pip install pyephem</pre>
|
|
<p>Depending on the macOS and Python versions, you might have to use <span class="code">Pillow</span> instead of
|
|
<span class="code">PIL</span>.
|
|
</p>
|
|
<p>If the PIL or Cheetah installation fails, you might have to install xcode:</p>
|
|
<pre class='tty cmd'>xcode-select --install</pre>
|
|
<p>then try the pip install again.</p>
|
|
</div>
|
|
|
|
<div id='prereq-py3' class="tab-content">
|
|
<p>Ensure that Python 3.5 or later is installed.</p>
|
|
<pre class='tty cmd'>python3 -V</pre>
|
|
<p>If not, Python 3 can be installed using <a href="https://brew.sh/">Homebrew:</a></p>
|
|
<pre class="tty cmd">brew install python</pre>
|
|
|
|
<p>This will also install the Python 3 version of <a href="https://pypi.python.org/pypi/pip">pip</a>.
|
|
</p>
|
|
<p>Now install the required Python packages using pip.</p>
|
|
<pre class='tty cmd'>sudo python3 -m pip install configobj
|
|
sudo python3 -m pip install Cheetah3
|
|
sudo python3 -m pip install Pillow
|
|
sudo python3 -m pip install pyserial
|
|
sudo python3 -m pip install pyusb
|
|
|
|
# For extended almanac information (optional):
|
|
sudo python3 -m pip install pyephem</pre>
|
|
<p>If the Cheetah3 or Pillow installation fails, you might have to install xcode:</p>
|
|
<pre class='tty cmd'>xcode-select --install</pre>
|
|
<p>then try the pip install again.</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h2>Install WeeWX</h2>
|
|
<p>Expand the source archive:</p>
|
|
<pre class="tty cmd">tar xvfz weewx-X.Y.Z.tar.gz</pre>
|
|
<p>Change directory:</p>
|
|
<pre class="tty cmd">cd weewx-X.Y.Z</pre>
|
|
<p>Modify <span class="code">home</span> in <span class="code">setup.cfg</span> to set the installation location to
|
|
<span class="code">/Users/Shared/weewx</span></p>
|
|
<pre class="tty cmd">perl -pi -e 's%^home.*%home = /Users/Shared/weewx%' setup.cfg</pre>
|
|
<p>Install:</p>
|
|
|
|
<div id="setup-tabs" class="tabs" style="width:95%; padding: 10px 10px 10px 10px;">
|
|
<nav>
|
|
<button class="tab" onclick="openTab(event, '#setup-py2')">
|
|
Python 2
|
|
</button>
|
|
|
|
<button class="tab" onclick="openTab(event, '#setup-py3')">
|
|
Python 3
|
|
</button>
|
|
</nav>
|
|
<div id="setup-py2" class="tab-content">
|
|
<pre class="tty cmd">python2 setup.py install</pre>
|
|
</div>
|
|
|
|
<div id="setup-py3" class="tab-content">
|
|
<pre class="tty cmd">python3 setup.py install</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<p style="clear:left">
|
|
The installer will prompt for a location, latitude/longitude, altitude, station type, and parameters specific to the
|
|
station.
|
|
</p>
|
|
|
|
<h2>Run</h2>
|
|
|
|
<p>Run the main program directly:</p>
|
|
<div id="run-tabs" class="tabs" style="width:95%; padding: 10px 10px 10px 10px;">
|
|
<nav>
|
|
<button class="tab" onclick="openTab(event, '#run-py2')">
|
|
Python 2
|
|
</button>
|
|
|
|
<button class="tab" onclick="openTab(event, '#run-py3')">
|
|
Python 3
|
|
</button>
|
|
</nav>
|
|
<div id="run-py2" class="tab-content">
|
|
<pre class="tty cmd">cd /Users/Shared/weewx
|
|
python2 ./bin/weewxd weewx.conf</pre>
|
|
</div>
|
|
|
|
<div id="run-py3" class="tab-content">
|
|
<pre class="tty cmd">cd /Users/Shared/weewx
|
|
python3 ./bin/weewxd weewx.conf</pre>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<p style="clear:left">Or as a daemon automatically when the computer starts:</p>
|
|
<pre class="tty cmd">sudo cp /Users/Shared/weewx/util/launchd/com.weewx.weewxd.plist /Library/LaunchDaemons
|
|
sudo launchctl load /Library/LaunchDaemons/com.weewx.weewxd.plist</pre>
|
|
|
|
<h2>Status</h2>
|
|
<p>To make sure things are running properly, look in the system log for messages from WeeWX. Run the <span class="code">Console</span>
|
|
application and select <span class="code">All Messages</span>.
|
|
</p>
|
|
|
|
<h2>Verify</h2>
|
|
<p>After about 5 minutes, open the station web page in a web browser. You should see your station information and data.
|
|
If your hardware supports hardware archiving, then how long you wait will depend on the <a
|
|
href="usersguide.htm#archive_interval">archive interval</a> set in your hardware.
|
|
</p>
|
|
<pre class='tty'><a href="file:///Users/Shared/weewx/public_html/index.html">file:///Users/Shared/weewx/public_html/index.html</a></pre>
|
|
|
|
<h2>Customize</h2>
|
|
<p>To enable uploads such as Weather Underground or to customize reports, modify the configuration file <span
|
|
class='code'>/Users/Shared/weewx/weewx.conf</span>. See the <a href="usersguide.htm">User Guide</a> and <a
|
|
href="customizing.htm">Customization Guide</a> for details.
|
|
</p>
|
|
|
|
<p>WeeWX must be restarted for configuration file changes to take effect.
|
|
</p>
|
|
|
|
<h2>Start/Stop</h2>
|
|
<p>To start/stop WeeWX:</p>
|
|
<pre class='tty cmd'>sudo launchctl load /Library/LaunchDaemons/com.weewx.weewxd.plist
|
|
sudo launchctl unload /Library/LaunchDaemons/com.weewx.weewxd.plist</pre>
|
|
|
|
<h2>Uninstall</h2>
|
|
<p>To uninstall, simply delete the directory <span class='code'>/Users/Shared/weewx</span>. This will delete WeeWX,
|
|
configuration files, and data.
|
|
</p>
|
|
<pre class='tty cmd'>rm -r /Users/Shared/weewx
|
|
sudo rm /Library/LaunchDaemons/com.weewx.weewxd.plist</pre>
|
|
|
|
<h2>Layout</h2>
|
|
<p>The instructions above will result in the following layout:</p>
|
|
<table class='locations' style="width: auto;">
|
|
<tr>
|
|
<td align='right'>executable:</td>
|
|
<td class='tty'>/Users/Shared/weewx/bin/weewxd</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'>configuration file:</td>
|
|
<td class='tty'>/Users/Shared/weewx/weewx.conf</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'>skins and templates:</td>
|
|
<td class='tty'>/Users/Shared/weewx/skins/</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'>sqlite databases:</td>
|
|
<td class='tty'>/Users/Shared/weewx/archive/</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'>generated web pages and images:</td>
|
|
<td class='tty'>/Users/Shared/weewx/public_html/</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'>documentation:</td>
|
|
<td class='tty'>/Users/Shared/weewx/docs/</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'>examples:</td>
|
|
<td class='tty'>/Users/Shared/weewx/examples/</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'>utilities:</td>
|
|
<td class='tty'>/Users/Shared/weewx/bin/wee_*</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p class='copyright'>
|
|
© <a href='copyright.htm'>Copyright</a> Tom Keffer
|
|
</p>
|
|
|
|
</body>
|
|
</html>
|