weewx on Qnap

509 views
Skip to first unread message

Franklin Bockstael

unread,
Jan 19, 2016, 6:19:14 AM1/19/16
to weewx-user
I wanted to install weewx on a QNap TS-212P but after several attempts I aborted this project.
My conclusion is that my knowledge of Linux and the QNap OS is to little to succeed.
Of course I found several manuals but they seem to be outdated.
After QNap switching to QTS 4.2 and weewx being on version 3.4.0 a lot msut have been changed because I only get errors trying to do what is in the manual here in the Google Groups or in the manual I can find on QNap's forum.

Still I am very curious if someone succeeded on installing and running weewx on above mentioned setup.
And I would appreciate some kind of manual.
Is there someone who achieved this?

Franklin

Tryphon Cosinus

unread,
Jan 19, 2016, 1:00:59 PM1/19/16
to weewx-user
Hello,

Of course, it is possible to run Weewx on Qnap : http://forum.qnap.com/viewtopic.php?t=95822

I have Weewx 3.3.1 under QTS 4.2 + Python 2.7.11.0

The graphs cannot easily got at this time, but with the next Python 2.x version il will be corrected I hope.

As I recently have Weewx on my NAS, the tutorial I made is not totally mature ... I need several weeks more.

Franklin Bockstael

unread,
Jan 20, 2016, 11:34:58 AM1/20/16
to weewx-user
Hello,

I did follow your tutorial. That is the only one I found that seems to be about complete.
But unfortunately I ran into trouble.
When trying to install I had trouble with the module "pil". Also there was complaining about missing vars.sh and more that was not there.
The weewx installer installed on 2 locations even if I explicitly changed the location to /home/weewx.
After a while almost all trouble seemed to be gone but the lines in the manual about self starting did not match the QNap OS.
I could not start from /etc/init.d/weewx start and not even from /home/weewx/bin/weexd /home/weewx/weewx.conf.
Also I ran into trouble creating the database and make the NAS interact with the DVP2 console because ttyUSB0 did not exist.
I don't want the graphs, so for me that is no issue. I don't use them in my live weewx (on raspberry pi) so I won't be using them on QNap.

Maybe it is an idea to start all over again and communicate here the trouble I ran into one by one.
I would be nice if we could bring this to an end together.
With all the errors and comments we could make a nice tutorial for this setup.




Op dinsdag 19 januari 2016 19:00:59 UTC+1 schreef Tryphon Cosinus:

Franklin Bockstael

unread,
Jan 20, 2016, 12:07:29 PM1/20/16
to weewx-user
The first error I encounter following your manual is this:

[/share/MD0_DATA/Download/pip-1.5.4] # pip install pil   
Downloading/unpacking pil
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement pil
Cleaning up...
No distributions at all found for pil
Storing debug log for failure in /root/.pip/pip.log
[/share/MD0_DATA/Download/pip-1.5.4] #

Op woensdag 20 januari 2016 17:34:58 UTC+1 schreef Franklin Bockstael:

As you can see I used pip wich was fairly simple to install.
I followed: http://gleenders.blogspot.nl/2014/04/install-python-pip-on-qnap-nas.html

P Simmons

unread,
Jan 20, 2016, 12:12:58 PM1/20/16
to weewx-user
Try "pillow" instead of "pil"...

Franklin Bockstael

unread,
Jan 21, 2016, 10:34:30 AM1/21/16
to weewx-user
I tried pillow with and without capital P but not working.
Of course I can install the tarball but I was wondering what was working and what did not.
When we want a manual for installing it would be nice if there was some consistency in the way of installing modules

So i installed pillow trough the tarball.
But when I tried to do python setup.py build I got the next error.

ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

I guess this is no fun for people who want to use jpeg images?
I don't use them with weewx, but nevertheless.
The problem could be worked around with adding --disable-jpeg, but where should I put it?




Op woensdag 20 januari 2016 18:12:58 UTC+1 schreef P Simmons:

Tryphon Cosinus

unread,
Jan 21, 2016, 2:14:26 PM1/21/16
to weewx-user
Hi Franklin,

1) As you do not own AcuRite weather station (the goal of my tutorial), you have to understand how to connect your weather station. I know this part is tricky.

First of all remember the Qnap NAS is not like a PC and you cannot do things as usual. Qnap does not maintain driver compatibility so you need to discover how to connect your station to the NAS and maybe it could done at a low level. A good way is to connect it to a linux distribution like Ubuntu on your computer and see the connection informations given by lsusb and dmesg commands. With this starting point you will learn the driver name chosen by Ubuntu. If it works, ttyUSB0 will appear and you will be able to see the data flux with sudo hexdump /dev/ttyUSB0 for example. If it does not work you have to unload (rmmod) the default driver loaded and load a new one with modprobe command. Maybe you will find on Google which driver to use for linux.
Give the complete name of your weather station so that I could see if I can gather some connection informations.

2) The Qnap NAS is a protected environnement and the possibility to compile code on it is very limited. In the case of PIL or Pillow the entire compile process may fail. Usually, developers compile on another system having OS caracteristics near the QTS version installed : same kernel and ideally, same glibc versions (32 and 64 bits).

I do not think you can use pip command directly or perhaps with Optware or Qnapware QPKG ... I never tried.

jpeg is not required to use weewx.

At this moment, my tutorial focuses on official Python QPKG which does not support pip. The next version of my tutorial will explain better how to use the unofficial Python QPKG :
http://forum.qnap.com/viewtopic.php?f=217&t=109899&hilit=python+qpkg

With it, all the modules needed by Weewx are included but at this time Pillow has a compilation error I reported to the author. Hence, I am waiting for the next version to go ahead with it. But if you do not need the graphs for now, Weewx works with QPython2. To use Weewx with QPython2, you have to uninstall Weewx before, install QPython2 QPKG, and start the Weewx setup using the python binary file of QPython2, something like that if I remember:

/opt/QPython2/bin/python /Public/weewx-3.3.1/setup.py

to be sure the installation will be done with the right python binary file.

Sure I will update the tutorial as soon as the libfreetype.so.6 compilation will be solved under QPyhton2.

Sty tuned.

Franklin Bockstael

unread,
Jan 22, 2016, 5:36:34 AM1/22/16
to weewx-user
Hello TC,

I was aware that you have another type of weather station but the part that has to prepare the QNap is the same to everyone I guess.
That is why I tried to follow your instructions. Connecting my Davis Vantage Pro 2 station is step 2 for now.
First I want to deal with preparing with the QNap.
Of course I will stay tuned. My inner nature drives me to that. My raspberry pi continuous to work with my second console and data logger so I am in no hurry ;-)

Op donderdag 21 januari 2016 20:14:26 UTC+1 schreef Tryphon Cosinus:

Franklin Bockstael

unread,
Jan 25, 2016, 6:17:01 AM1/25/16
to weewx-user
It worked.
At this moment my data is being uploaded from my second DVP2 console to my Qnap TS212-P.
I overcome a lot of trouble on the way, but at last after searching Google I managed to get this working.
One of the trouble ofcourse was to get the Nas talking to the console.
The solution was also in the manual TC supplied.
insmod usbserial.ko
and
insmod cp210x.ko
did the trick

Now I have to wait till all that data is being uploaded and then I can try to add my own weewx.conf and skin.conf to my dev.homepage

Thanks for all the support here.

Op vrijdag 22 januari 2016 11:36:34 UTC+1 schreef Franklin Bockstael:

Tryphon Cosinus

unread,
Jan 25, 2016, 7:05:01 AM1/25/16
to weewx-user
Congratulations! Now you just have to add a proxypass command in /etc/app_proxy.conf file and you will see your data from outside home.

Franklin Bockstael

unread,
Jan 26, 2016, 5:40:55 AM1/26/16
to weewx-user
Tanks TC,

There are some issues still.
After the data was uploaded from the console to my NAS, I copied config files and templates from my live raspberry pi to the NAS, but there are some mistakes.
I don't know what they mean exactly.
Maybe Tom will have to look at this, maybe you can give me some help please?

Jan 26 10:30:16 Qnapix user.notice weewx[11009]: manager: added record 2016-01-26 10:30:00 CET (1453800600) to database 'weewx'
Jan 26 10:30:16 Qnapix user.notice weewx[11009]: manager: added record 2016-01-26 10:30:00 CET (1453800600) to daily summary in 'weewx'
Jan 26 10:30:17 Qnapix user.err weewx[11009]: cheetahgenerator: Generate failed with exception '<type 'exceptions.TypeError'>'
Jan 26 10:30:17 Qnapix user.err weewx[11009]: cheetahgenerator: **** Ignoring template /home/weewx/skins/Standard/openweerdata.htm.tmpl
Jan 26 10:30:17 Qnapix user.err weewx[11009]: cheetahgenerator: **** Reason: 'UnknownType' object does not support indexing
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****  Traceback (most recent call last):
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****    File "/mnt/ext/home/weewx/bin/weewx/cheetahgenerator.py", line 300, in generate
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****      print >> _file, text
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****    File "/share/MD0_DATA/.qpkg/Python/lib/python2.7/site-packages/Cheetah/Template.py", line 1005, in __str__
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****      rc = getattr(self, mainMethName)()
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****    File "_home_weewx_skins_Standard_openweerdata_htm_tmpl.py", line 506, in respond
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****    File "/share/MD0_DATA/.qpkg/Python/lib/python2.7/site-packages/Cheetah/NameMapper.py", line 245, in valueFromSearchList
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****      executeCallables=executeCallables)
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****    File "/share/MD0_DATA/.qpkg/Python/lib/python2.7/site-packages/Cheetah/NameMapper.py", line 224, in _valueForName
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****      nextObj = getattr(obj, key)
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****    File "/mnt/ext/home/weewx/bin/weewx/units.py", line 905, in raw
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****      return self._raw_value_tuple[0]
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****    File "/mnt/ext/home/weewx/bin/weewx/units.py", line 911, in _raw_value_tuple
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****      vtx = self.converter.convert(self.value_t)
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****    File "/mnt/ext/home/weewx/bin/weewx/units.py", line 725, in convert
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****      if val_t[1] is None and val_t[2] is None:
Jan 26 10:30:17 Qnapix user.info weewx[11009]: ****  TypeError: 'UnknownType' object does not support indexing
Jan 26 10:30:17 Qnapix user.info weewx[11009]: cheetahgenerator: Generated 0 files for report StandardReport in 0.94 seconds
Jan 26 10:30:18 Qnapix user.info weewx[11009]: reportengine: ftp'd 0 files in 0.25 seconds
Jan 26 10:31:17 Qnapix auth.info sshd[11360]: Accepted password for admin from 192.168.1.106 port 47492 ssh2
Jan 26 10:32:38 Qnapix user.info weewx[11009]: engine: Shutting down StdReport thread



Op maandag 25 januari 2016 13:05:01 UTC+1 schreef Tryphon Cosinus:
Message has been deleted

Franklin Bockstael

unread,
Jan 26, 2016, 5:45:49 AM1/26/16
to weewx-user
And some other issue is this:

On my live pi I have a template for sending data to my own weather site.
In that template I use data for the moon phase, rise and set.
But after copying this template to the NAS I get an error displaying that moon is an unknown type.
I temporarily disabled this template, but now the error message I upload a few minutes ago appears.

Thomas Keffer

unread,
Jan 26, 2016, 9:09:21 AM1/26/16
to weewx-user
I don't recognize the template "openweerdata". 

It's very tough to debug template errors, because the comments in the logs don't normally help much. You'll have to talk to the template author.

-tk

--
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.
For more options, visit https://groups.google.com/d/optout.

Franklin Bockstael

unread,
Jan 26, 2016, 10:18:29 AM1/26/16
to weewx-user
Hello Tom,

I guess that is not the solution.
That template is doing fine on my pi (live for several years now on grandix.nl). Just copied it to my NAS and it is giving me this error.
It must be something else in preparing the NAS I guess.
Maybe this is a lead:


cheetahgenerator: **** Reason: 'UnknownType' object does not support indexing

Franklin
 

Op dinsdag 26 januari 2016 15:09:21 UTC+1 schreef Tom Keffer:

Franklin Bockstael

unread,
Feb 1, 2016, 12:33:54 PM2/1/16
to weewx-user
I did a fresh install this time on a spare Pi. OS now is debian wheezy and weewx version is 3.4.0.
Still I am getting this error:
Feb  1 18:25:18 Grandos weewx[3168]: ****    File "_home_weewx_skins_Standard_grandixweerdata_htm_tmpl.py", line 259, in respond
Feb  1 18:25:18 Grandos weewx[3168]: ****    File "/home/weewx/bin/weewx/units.py", line 905, in raw
Feb  1 18:25:18 Grandos weewx[3168]: ****      return self._raw_value_tuple[0]
Feb  1 18:25:18 Grandos weewx[3168]: ****    File "/home/weewx/bin/weewx/units.py", line 911, in _raw_value_tuple
Feb  1 18:25:18 Grandos weewx[3168]: ****      vtx = self.converter.convert(self.value_t)
Feb  1 18:25:18 Grandos weewx[3168]: ****    File "/home/weewx/bin/weewx/units.py", line 725, in convert
Feb  1 18:25:18 Grandos weewx[3168]: ****      if val_t[1] is None and val_t[2] is None:
Feb  1 18:25:18 Grandos weewx[3168]: ****  TypeError: 'UnknownType' object does not support indexing
Feb  1 18:25:18 Grandos weewx[3168]: cheetahgenerator: Generated 0 files for report StandardReport in 1.64 seconds
Feb  1 18:25:18 Grandos weewx[3168]: reportengine: ftp'd 0 files in 0.12 seconds

Also this template is running on my live Pi for several years now.
I already changes from Jessy to Wheezy. Could it me a difference between weewx 3.2.1 and 3.4.0?

Op dinsdag 26 januari 2016 16:18:29 UTC+1 schreef Franklin Bockstael:

Thomas Keffer

unread,
Feb 1, 2016, 12:39:39 PM2/1/16
to weewx-user
I don't know who the template author is (this is not a template that comes with Weewx), but it looks like it created a value tuple with only 2 elements. Value tuples have 3 elements: (value, unit, unit_group). The last was missing.

-tk

Franklin Bockstael

unread,
Feb 2, 2016, 9:49:03 AM2/2/16
to weewx-user
Hello Tom,

I really don't know why this is happening.
Those 2 templates are working fine on my live Pi now for several years. They are copied unchanged to this test Pi.
Why are they working fine in one Pi and not in another one?


Op maandag 1 februari 2016 18:39:39 UTC+1 schreef Tom Keffer:

Thomas Keffer

unread,
Feb 2, 2016, 9:54:24 AM2/2/16
to weewx-user
The templates may be unchanged, but the environment they operate in --- search list extensions, the database, etc. --- must be different.

-tk
Reply all
Reply to author
Forward
0 new messages