FreeBSD / TrueNAS Jail Install Help

458 views
Skip to first unread message

S R

unread,
Jan 14, 2021, 1:04:06 PM1/14/21
to weewx-user

I have a TrueNAS box and want to install in a FreeBSD jail. I'm a complete knob, can anyone help with instructions for installing on FreeBSD. Sadly, such great document for Linux, but none for FreeBSD (although i see there is a startup script, for those who know how to get that far)

Greg Troxel

unread,
Jan 14, 2021, 1:09:53 PM1/14/21
to S R, weewx-user
I haven't installed on FreeBSD but on NetBSD, it's basically:

install python (from pkgsrc, in my case - ports for you probably)
install the python packages that weewx needs
check out weewx from git
edit setup.cfg to set home where you want (/usr/weewx for me)
./setup.py build
# make sure you can write /usr/weewx
./setup.py install

and then it's installed and you have to do whatever setup of weewx same
as anyplace else, and start it on boot.
signature.asc

S R

unread,
Jan 14, 2021, 3:20:17 PM1/14/21
to weewx-user
i got python37 on, but where how do i get the python packages for freebsd? i did say i was a knob

kilo...@gmail.com

unread,
Jan 14, 2021, 3:55:30 PM1/14/21
to weewx-user
I have used weewx on FreeNAS / TrueNAS for many years and it works well, for hardware that sends loop data to an IP address.  Have not tried it with usb hardware.  

1. Create and run weewx in it's own standard jail.  Given that you want to play with FreeBSD I assume you are familiar with jails and you can handle this.  All further instructions assume that you are working within the active running jail.
2. Python packages are named a little different than  linux distributions.  
     a) Start by installing python3 using pkg command.  Available package names are python36, python37, python38, python39.  Further instruction will assume you installed python37
     b) Install py37-cheetah3 using the pkg command
     c) Install py37-configobj
     d) Install py37-pillow
     e) Install py37-sqlite3, assuming you are using sqlite database
3. Install weewx using the setup.py method
4. To run weewx directly con command line, cd to /home/weewx and use the  ./bin/weewxd  command, run this as su.
5. To start weewx automatically from at startup,  copy the attached script to /usr/local/etc/rc.d/
6.  Add the following line weewx_enable="YES" to the /etc/rc.conf file.  Now weewx will start automatically and you can start and stop the service with service weewx start or service weewx stop command




weewx

S R

unread,
Jan 14, 2021, 6:43:24 PM1/14/21
to weewx-user
that didn't work in 2.
I managed to install python37 and pip
i then had to install with the commands below and follow the packages per debian10 instructions
pip install configobj
pip install serial
pip install usb
pip install pip
pip install cheetah3
pip install ephem

But i get an error with
pip install pil  - "could not find a package that satisfies the requirement pil"
Do i need pil?

I have a WH2900 Fine Offset and in the forums it talks about using the interception driver, but this is not an option during install.

George Morgan

unread,
Jan 14, 2021, 7:25:39 PM1/14/21
to weewx-user
Try:

pip install pillow

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/6aaa91b0-b1e4-4eed-b49a-60a74933ae25n%40googlegroups.com.

kilo...@gmail.com

unread,
Jan 14, 2021, 7:37:47 PM1/14/21
to weewx-user
What was the error message you got when you tried installing the packages in section 2 of my instructions?
 
Yes you need pil or pillow, it is the same as py37-pillow I listed.

Pip should be your last resort to install any packages and you should always use the native compiled binaries if your system offers it.   Also, you dont need the serial or usb  packages if you intend to use the interceptor driver.

I confirmed that the packages listed are available as binaries to be installed with the pkg command in a FreeBSD 12.0 release jail. To confirm, are you trying to install the missing packages in a running jail?  Also, to install any binary packages you need to run the pkg command as su 

So start over by uninstalling all the packages you installed with pip,                pip uninstall <packagename>

Now type   pkg search py37-cheetah
If it shows the following result then it is available to install
py37-cheetah3-3.2.4            HTML template engine for Python

Now you type pkg install py37-cheetah

And so on to install all the packages.

On first run you configure weewx to run with the simulator driver.  This allows you to confirm that weewx is working.  Once you get to that point we'll try to get the interceptor driver working

Marius Schamschula

unread,
Jan 14, 2021, 8:14:23 PM1/14/21
to weewx-user
Using pip to install python packages under FreeBSD isn't a great idea. Freshports can keep everything up to date for you. I've been running weewx on my FreeBSD server for several years. 

S R

unread,
Jan 15, 2021, 6:29:52 AM1/15/21
to weewx-user
ok. thanks guys. i deleted the jail and started again per your instructions. everything installed without errors and I've loaded the startup scrip and the service starts.
i can ping the weewx and ping from the weewx jail to the internet.
if i try to reach via the browser i get Refused to Connect

S R

unread,
Jan 15, 2021, 8:20:08 AM1/15/21
to weewx-user
the process is definitely running. Do I have to add some user permissions for the public_html directory?
i installed into path /usr/local/share/weewx

S R

unread,
Jan 15, 2021, 10:51:09 AM1/15/21
to weewx-user
just tried to install on Kubuntu 20.10 via the debian packages. same thing. install completes, but "refuse to connect".
Has any tested a fresh install recently.

kilo...@gmail.com

unread,
Jan 15, 2021, 10:56:04 AM1/15/21
to weewx-user
You need to run a web server on the local machine (jail) to be able to view the files generated and placed in the  public_html directory.

OR

You need to upload the generated files to another machine that acts as a web server.  This can be done with the ftp or rsync reports

S R

unread,
Jan 15, 2021, 1:03:21 PM1/15/21
to weewx-user
yeh, i figured that out in the end - thanks.

I got the simulator running on both feebsd (nginx) and kubuntu (apache2) and
i have installed the interceptor on both with the instructions in her https://github.com/matthewwall/weewx-interceptor
i set to observer for the Fine Offset WH2900C but it is still showing me the Simulator on both firefox and chrome.
I have tried clearing the cache and restarting, but even from a fresh machine it shows the simulator.

kilo...@gmail.com

unread,
Jan 15, 2021, 2:43:05 PM1/15/21
to weewx-user
Please post the startup log (the first bunch of lines of the weewx log when it first starts up) so we can see which driver it is using

S R

unread,
Jan 15, 2021, 4:42:23 PM1/15/21
to weewx-user
I the linux box i had success. installation of the intercept driver does not disable the simulator.

Now i have a healthy startup log, and the web page just says "success", there is not display like with the simulator.

what do i have to do next pls

weewx[1369] INFO user.interceptor: driver version is 0.53
weewx[1369] INFO user.interceptor: device type: observer
weewx[1369] INFO user.interceptor: mode is listen
weewx[1369] INFO user.interceptor: listen on :80
weewx[1369] INFO user.interceptor: sensor map: {'pressure': 'pressure', 'barometer': 'barometer', 'outHumidity': 'humidity_out', 'inHumidity': 'humidity_in', 'outTemp': 'temperature_out', 'inTemp': 'temperature_in', 'windSpeed': 'wind_speed', 'windGust': 'wind_gust', 'windDir': 'wind_dir', 'windGustDir': 'wind_gust_dir', 'radiation': 'solar_radiation', 'dewpoint': 'dewpoint', 'windchill': 'windchill', 'rain': 'rain', 'rainRate': 'rain_rate', 'UV': 'uv', 'txBatteryStatus': 'battery', 'extraTemp1': 'temperature_1', 'extraTemp2': 'temperature_2', 'extraTemp3': 'temperature_3', 'extraHumid1': 'humidity_1', 'extraHumid2': 'humidity_2', 'soilTemp1': 'soil_temperature_1', 'soilTemp2': 'soil_temperature_2', 'soilMoist1': 'soil_moisture_1', 'soilMoist2': 'soil_moisture_2', 'soilMoist3': 'soil_moisture_3', 'soilMoist4': 'soil_moisture_4', 'leafWet1': 'leafwetness_1', 'leafWet2': 'leafwetness_2', 'pm2_5': 'pm2_5', 'extraTemp4': 'temperature_4', 'extraTemp5': 'temperature_5', 'extraTemp6': 'temperature_6', 'extraTemp7': 'temperature_7', 'extraTemp8': 'temperature_8', 'extraHumid3': 'humidity_3', 'extraHumid4': 'humidity_4', 'extraHumid5': 'humidity_5', 'extraHumid6': 'humidity_6', 'extraHumid7': 'humidity_7', 'extraHumid8': 'humidity_8', 'soilTemp3': 'soil_temperature_3', 'soilTemp4': 'soil_temperature_4'}
weewx[1369] INFO weewx.engine: StdConvert target unit is 0x1
weewx[1369] INFO weewx.engine: Archive will use data binding wx_binding
weewx[1369] INFO weewx.engine: Record generation will be attempted in 'hardware'
eapema78g weewx[1369] INFO weewx.engine: Using archive interval of 300 seconds (specified in weewx configuration)
weewx[1369] INFO weewx.restx: StationRegistry: Registration not requested.
weewx[1369] INFO weewx.restx: Wunderground: Posting not enabled.
weewx[1369] INFO weewx.restx: PWSweather: Posting not enabled.
weewx[1369] INFO weewx.restx: CWOP: Posting not enabled.
weewx[1369] INFO weewx.restx: WOW: Posting not enabled.
weewx[1369] INFO weewx.restx: AWEKAS: Posting not enabled.
weewx[1369] INFO __main__: Starting up weewx version 4.3.0
weewx[1369] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
weewx[1369] INFO weewx.manager: Starting backfill of daily summaries
weewx[1369] INFO weewx.engine: Starting main packet loop.

kilo...@gmail.com

unread,
Jan 15, 2021, 5:08:30 PM1/15/21
to weewx-user
After installing the interceptor driver it still needs to be configured in the weewx.conf file

Typically the installer will add a section like this at the end of the config file.  Note that this is my modified version, there is no raineagle device in the official interceptor driver.  

[Interceptor]
    # This section is for the network traffic interceptor driver.

    # The driver to use:
    driver = user.interceptor

    # Specify the hardware device to capture.  Options include:
    #   acurite-bridge - acurite internet bridge
    #   observer - fine offset WH2600/HP1000/HP1003, aka 'observer'
    #   lw30x - oregon scientific LW301/LW302
    #   lacrosse-bridge - lacrosse GW1000U/C84612 internet bridge
    device_type = raineagle
    mode = listen
    address = 192.168.1.89
    port = 80

You have to configure the driver with the correct options for your station.

In the [Station] section of the weewx.conf file you need to change the driver so that is does not point to the simulator, but to the Interceptor

    # Set to type of station hardware. There must be a corresponding stanza
    # in this file with a 'driver' parameter indicating the driver to be used.
    station_type = Interceptor

After saving the config file you need to restart weewx service

kilo...@gmail.com

unread,
Jan 15, 2021, 5:11:27 PM1/15/21
to weewx-user
I forgot to add that you also need to configure you weatherstation to upload to a the weewx machine's address
Reply all
Reply to author
Forward
0 new messages