Ex-teacher & sound engineer. Now #Smallholder and #Woodsman working in Property and Electrical Installations. Into all things #STEM; #getoutside to walk, kitesurf and cycle.
Having purchased a Tontec Touch Screen (Model MZ61581) for the Raspberry Pi from Amazon I went about following the instructions found via the product description. These instructions are what I used for the Raspberry Pi 2 (or Model B+). I was using the 2015-05-05 version of raspbian-wheezy.
My screen was installed as below
***The unmodified instruction file can be downloaded at https://s3.amazonaws.com/ttbox/35screen.zip
After booting your Raspberry Pi for the first time on Raspbian-Wheezy, we will need to perform the normal tasks of setting up our Raspberry Pi. including: expanding the filesystem; and setting the timezone.
You also need to set the date correctly as otherwise the rpi-update command in step 3 will error with tar timestamp is in the future. The following instructions taken from this Stack Exchange Post explain what we need to do:
Go to http://support.ntp.org/bin/view/Servers/NTPPoolServers, select your region, then your country and a list of servers will be display. Now edit your /etc/ntp.conf file e.g.
1 |
sudo nano /etc/ntp.conf |
Replace the list of servers with the one you found in the webpage. e.g.
1 2 3 4 |
server 0.uk.pool.ntp.org iburst server 1.uk.pool.ntp.org iburst server 2.uk.pool.ntp.org iburst server 3.uk.pool.ntp.org iburst |
Save and exit.
Before restarting the ntp deamon I would advise setting your time manually to a time close to the current time. Apparently if the pi time is too different to ntp time it will not sync and my investigations seem to support this.
1 2 |
date -s "8 Jul 2015 19:00:00" sudo /etc/init.d/ntp restart |
check that the date is correct. There maybe some delay in it setting and you could also reboot.
1 |
date |
Then we need “update” and “upgrade”. If you want to learn more about the update, upgrade and rpi-update process read Michael’s post on the subject.
1 |
sudo apt-get update |
1 |
sudo apt-get upgrade |
1 |
sudo reboot |
We now need to update our firmware to the newest version to support Tontec screen. Check that your date is correct (step 1) before starting this process.
1 |
sudo rpi-update |
My first attempts failed with a white screen on the Tontec. Further investigation via the main HDMI showed that the boot sequence was freezing on fbtft_register_backlight:
(Edit) This is actually normal behaviour and once the Tontec screen was working the main screen still froze at this point. I contacted iTonTec support and they suggested running
1 |
sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update |
instead of the plain rpi-update, which appeared to make the difference.
1 |
sudo reboot |
Open Raspi-Config and set the following on:
Thanks to the amazon commenters for this as it was missing from the user guide.
Open /boot/config.txt
1 |
sudo nano /boot/config.txt |
And add these lines to the bottom
1 |
dtparam=spi=on |
1 |
dtoverlay=mz61581 |
Then save and reboot
1 |
sudo reboot |
Here we will change the default output display from HDMI to Tontec Screen
1 |
sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf |
Change
1 |
Option "fbdev" "/dev/fb0" |
To
1 |
Option "fbdev" "/dev/fb1" |
Note: if you want to switch back to the HDMI display, just change it back to fb0
Here we will enable Tontec Screen to display during the booting process
1 |
sudo nano /boot/cmdline.txt |
Add
1 |
fbcon=map:10 |
at the end of current line. (No need to start a new line)
Done!
If you need to calibrate the touchscreen for X, Please download the instruction at http://s3.amazonaws.com/ttbox/35calibrate.zip
This was my backup installation for Weewx and a La Crosse WS2350 Weather Station on a Raspberry Pi (RPi) after I suffered Python library problems with our Synology box. It is assumed you are running headless (no mouse, keyboard or monitor on the RPi) and have installed an SSH client on your main machine.
I started by getting a fresh version of the Raspbian OS from the Raspberry Pi website and then used the dd tools on my Mac to image the card. On the Weewx Google group there is a discussion on the life expectancy of card on the RPi and I would suggest taking an image of the card once you have everything set up should it fail. It would also be worth setting up some form of scp/rsync to copy your databases to a remote backup. You should also read the Raspberry Pi section of the Weewx website before starting.
Once you have plugged your RPi to the network and powered it up you will need to find it on your network. If you are using a linux based computer as your main machine then you can use something like
1 |
sudo nmap -sP 192.168.1.* |
but windows will need some software like Advanced IP Scanner (untested).
I started by creating a new user for Weewx and added them to the superusers group so I have greater control over what the weather station can do.
1 2 3 |
sudo su adduser weewx usermod -a -G sudo weewx |
next I, patiently, worked through installing all the prerequisites.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# required packages: sudo apt-get install python-configobj sudo apt-get install python-cheetah sudo apt-get install python-imaging # required if hardware is serial or USB: sudo apt-get install python-serial sudo apt-get install python-usb # required if using MySQL: sudo apt-get install mysql-client sudo apt-get install python-mysqldb # optional for extended almanac information: sudo apt-get install python-dev sudo apt-get install python-pip sudo pip install pyephem |
If you are installing Weewx onto the latest version of Raspbian then NTP is already installed. You can check this by checking the existence of the config file
1 |
more /etc/ntp.conf |
and then checking that the correct time has been set with
1 |
date |
if you get output that looks like Tue Dec 31 08:45:45 UTC 2013 then the time is set.
Caveat from M:
Installation using the deb package is probably easier for most people with little linux experience. when you install using a deb package, dpkg will prompt for the altitude, lat/lon, station type, and any other required parameters. so there is little or no puzzling with config files when you install from deb package, at least for a generic installation.
However, for a manual or custom installation read on…
So download the latest version of Weewx onto your RPi and unzip it with
1 2 3 |
<span style="font-size: 14px; line-height: 1.5em;">wget http://downloads.sourceforge.net/project/weewx/weewx-2.5.0.tar.gz </span>tar -xvf weewx-2.5.0.tar.gz cd weewx-2-5.0 |
Next set the install path so weewx does not run in the home folder of the weewx user by opening the setup.cfg file with nano setup.cfg
1 2 |
# Set the following to the root directory where weewx should be installed home = /home/weewx/system25 |
with this done we can build the install (checking for errors) before running the install itself.
1 2 |
python setup.py build python setup.py install |
If everything has gone to plan and Weewx has been installed into /homes/weewx/system25 we can now start configuring and running Weewx. You will want to configure: location; latitude; longitude; altitude; and station_type. This can all be done using vi or another text editor
1 |
vi weewx.conf |
At the time of writing my station type (Technoline branded La Cross WS2350) was in Beta so I had to add WS23xx support manually. If you are working with version 2.5.1 or greater then you should be able to skip steps 1 to 3 and jump straight to 4.
1) download the ws23xx.py driver and the wee_config_ws23xx utility:
1 2 |
https://sourceforge.net/p/weewx/code/HEAD/tree/trunk/bin/weewx/drivers/ws23xx.py https://sourceforge.net/p/weewx/code/HEAD/tree/trunk/bin/wee_config_ws23xx |
2) put the two files in the right place, set permissions on the utility:
1 2 3 |
cp ~/Downloads/ws23xx.py /home/weewx/bin/weewx/drivers cp ~/Downloads/wee_config_ws23xx /home/weewx/bin chmod 755 /home/weewx/bin/wee_config_ws23xx |
3) add the ws23xx directives in weewx.conf:
1 2 3 4 5 6 |
[Station] station_type = WS23xx [WS23xx] port = /dev/ttyUSB0 driver = weewx.drivers.ws23xx |
4) Check/ Update station interval.
When my reports first started to run I was getting dots and not lines as shown in the first part of the image. This was due the station interval time being set at 60 minutes.
If you are seeing something similar then you can check the station configuration and the hardware archive interval (‘hi’) using:
1 |
./bin/wee_config_ws23xx /home/weewx/system25/weewx.conf --info |
you can set this interval with
1 |
sudo ./bin/wee_config_ws23xx /home/weewx/system25/weewx.conf --set-interval=5 |
and now you should have a working station.
Another caveat from M:
Another way to deal with the dots is to change the line_gap_fraction in skin.conf. some people might want to keep a long archive interval. for example, a long interval makes it possible to do weekly synchronization to stations with little memory. others simply do not need ‘live’ or even 5 minute updates of the data. reducing the value of line_gap_fraction will connect the dots without increasing the number of samples.
Now plug your station in to the RPi and check that is has loaded ok with the following command and you should see a listing for ttyUSB0
1 |
ls -l /dev/ttyUSB* |
Depending on which user you intend to run the station as you might need to change the permissions of this file.
1 |
sudo chmod 664 /dev/ttyUSB0 |
although sadly unless you set up udev rules you might have to repeat this every time you unplug/replug the weather station.
Finally you can get down to running the station with
1 |
./bin/weewxd weewx.conf |
or if you want it to continue after you have logged off via SSH you will need to use nohup as shown below.
1 |
nohup ./bin/weewxd weewx.conf & echo $! > run.pid |
this starts weewxd and then stores the pid in a file called run.pid for later when we would like to kill (stop) the weather station from running. We can check that the station is still running with
1 |
ps -e | grep "weewxd" |
and now kill/stop it with
1 |
kill -TERM $(cat run.pid) |
You will be able to view output created on the RPi first by listing the contents of the public_html folder which is created inside your weewx system folder at the correct interval.
1 |
ls -la public_html |
If you are playing with templates and have problems seeing updates I have had success deleting the public_html and starting over. Weewx will only create some first the first time so without the folder it starts over.
Assuming that folder exists you will want a web server to view those file. If you already have web space available then the easiest solution is to refer to the FTP section of the standard reporting section of the weewx.conf. You will need to restart weewxd if you make changes there.
If you want to install a webserver on the Raspberry Pi you start by getting the main apache package. As we are only viewing static pages there is no need for php or anything else.
1 |
sudo apt-get install apache2 |
Once this installation has completed you should be able to browse to the ip address of the RPi and see the standard it works! webpage. The easiest way to then view your actual weather pages is to create a link from the webroot to your weewx public_html folder:
1 2 |
cd /var/www sudo ln -s /home/weewx/system25/public_html weather |
and then it should work!
In this experiment I am going to use my first outside library to add Capacitive Sensing to the Arduino as demonstrated on You Tube. This is the same technique used by most modern touch screen such as the iPad and iPhone and this feature is brought to the Arduino via the CapSense library written by Paul Badger.
Our Joomla Windguru Plugin and WordPress Windguru Plugin now provide the official
support of the Windguru Plugin inside Joomla and WordPress. After much waiting I found time to double check the Joomla and WordPress versions; tweak my class version of Vaclav’s plugin and get everything looking good on a products page.
Docker makes creating a weewx installation on a lieghtweight and non RPi computer much easier. Start by creating a Ubuntu Docker container (not LXC although I’m certain it can be done this way!)
And set the network
Install the required packages. The -y stops an Error debconf: unable to initialize frontend: Dialog error because we are running headless.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
#We need to update the apt-get package lists first apt-get update #Now install Python 2.7 apt-get install -y python2.7 # install the python imaging library: apt-get install -y python-pil # other required packages: apt-get install -y python-configobj apt-get install -y python-cheetah # required if hardware is serial or USB: apt-get install -y python-serial apt-get install -y python-usb # required if using MySQL: apt-get install -y mysql-client apt-get install -y python-mysqldb # optional for extended almanac information: apt-get install -y python-dev apt-get install python-pip pip install pyephem # Required so we can get the latest version of Weewx from the downloads page apt-get install -y wget |
Now grab the latest version of weewx.
1 |
<span class="cmd">wget http://weewx.com/downloads/weewx-3.8.2.tar.gz</span> |
Next expand and move into the source folder
1 2 |
tar xvfz weewx-X.Y.Z.tar.gz cd weewx-3.8.2 |
Now build and install Weewx following the on-screen prompts.
1 2 |
./setup.py build ./setup.py install |
Now we can set Weewx up as a daemon automatically when the computer starts:
1 2 3 4 5 |
cd /home/weewx cp util/init.d/weewx.debian /etc/init.d/weewx chmod +x /etc/init.d/weewx update-rc.d weewx defaults 98 /etc/init.d/weewx start |
Ubuntu Docker does not install the rsyslog by standard so we must do that. Finally you can check the logs.
1 2 3 4 |
export RUNLEVEL=1 apt-get install -y rsyslog service rsyslog start tail -f /var/log/syslog |
Its probably high treason but I like nano over Vi or Vim and its required for the next step.
1 |
apt-get install -y nano |
#And if you want to work across SSH then you’ll need the server too and will need to add a user to the system. I also find its useful to change the /home/weewx folder ownership to my SSH user.
1 2 3 4 |
apt install -y openssh-server service ssh start adduser username chown -R username:username /home/weewx |
If you are not sure the IP address allocated to the Docker images you can install Network tools which gives access to ifconfig
1 2 |
apt-get install -y net-tools ifconfig |
You may also need to install a webserver such as Apache (First Command) but to remove the ServerName error you must add it to the ServerName directive to the config.
1 2 3 |
apt-get install -y apache2 nano /etc/apache2/apache2.conf service apache2 restart |
I like to link to the web root. The penultimate command should show the simlink has been created and the final command will run the report service and should create the weewx files at the webserver root.
1 2 3 4 5 |
cd /home/weewx rm -rf public_html ln -s /var/www/html public_html ls -la ./bin/wee_reports weewx.conf |
We have ended up with a number of winches over the last couple of years that all have their own pros/cons but did we make the right decision?
Truck Winch
+ Strong: Will pull 4 Tonnes
+ Effort: Doesn’t require strength.
– Location: Truck needs to be in location/position
– Expensive: Cost around ~£1K for a cheapish set up.
– Fixing: Requires some engineering skill to fit.
ATV Winch
+ Cheap: They cost around £40.
– Limited Length: max 6m or 3m if doubled up for heavy loads.
– Capacity: They are only really designed for pulling quads so have limited strength.
– Fitting: Need a modified tractor or quad to fit one.
Lug-All Cable Winch
+ Lightweight: easy to carry around the wood.
+ Cheap: as far as winches go its not that expensive.
– Capacity: We have overloaded ours once pulling a large tree
– Limited Length: max 6m or 3m if doubled up for heavy loads.
– Handle Overload: The handle is designed to bend on overload costing ~£70 to replace.
Wire Rope Pulling Hoist (aka Trifor – other brands do exist including v. cheap knock offs.)
+ Capacity: different capacities are available. Ours is the 3200KG one.
+ Capability: It only pulls in 1.5″ at a stroke so its very capable and will just slowly drag/pull whatever is attached to it.
– Weight: Its so heavy and the wirerope is even heavier.
– Cost: The originals are expensive. There are cheaper ones around but watch for people claiming to sell one make whilst providing a cheaper alternative.
– Loading: Its not the easiest thing to load.
If I needed to start over I would probably end up with two winches:
Writing a woodland management plan can be a daunting process and I remember when starting to write ours I had moments when I doubted myself. I started asking myself questions such as: what should I say here; or is this what they are looking for? I’m also aware that although the Forestry Commision (FC) are supposed to provide help, due to workloads and priorities, the amount of help they give is proportional to the size of your wood. So if our 8 acre woodland allowed me to access a 40 minute phone conversation those with 3 acres are unlikely to glean much information or knowledge from a 15 minute conversation.
Anyway its not all doom and gloom.
Firstly remember you are able to chop down 5 cubic metres of wood every quarter (3 months) without a licence. In their Timber Volume Calculator the FC provide a useful little table to help us figure out how many trees that actually is (see below). And its also worth remembering that the 5m3/qtr does not include: trees under 8cm (as they are not considered a tree); standards under 10cm (if for thinning and/or improving neighbouring trees); and coppiced trees under 15cm. All these diameters are taken at chest height.
Secondly, there is a lot of useful information in the form of booklets and examples and we have been provided with templates we can use. Below I have highlighted the ones I found most helpful:
General:
Protected Species:
Apparently there are bats living across Warleigh Lane in the old quarries and therefore woods close to the road would need to take account of this in their management plans. I found these documents when considering a different wood:
Management Plan:
If you are looking at creating open spaces in your wood you will need to consider the environmental impact and the following documents will aid you.
Specifically related to Felling Applications:
If you are undertaking operations in your woodland it would be prudent to complete an operational impact assessment (OSA):
Lastly, I believe, given the size of our woods we are unlikely to get drawn across the coals for not writing a 100% perfect management plan or felling licence request. Or this is my hope at least!