Nothing wrong with the Rapsberry Pi as a platform: thousands of WeeWX users
are using it successfully. However, you should reconsider your decision to
use MySQL if you are not familiar with it. It is much more complex to
administer then the default sqlite database.
In any case, check the access permissions for user weewx. To do this, run
'mysql' either as user weewx or user root. Then use the SHOW GRANTS command:
$ *mysql -u root -p*
mysql> *SHOW GRANTS FOR 'weewx'@'localhost';*
The results should look something like:
+-------------------------------------------------------------------------------------------------+
| Grants for weewx@localhost
|
+-------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'weewx'@'localhost'
|
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON `weewx`.* TO
'weewx'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON `test`.* TO
'weewx'@'localhost'
|
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON `test_dbd`.* TO
'weewx'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON `test_sim`.* TO
'weewx'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON `test_weewx`.* TO
'weewx'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON `test_alt_weewx`.*
TO 'weewx'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON `test_weedb`.* TO
'weewx'@'localhost' |
+-------------------------------------------------------------------------------------------------+
8 rows in set (0.00 sec)
(ignore the stuff for the 'test' users --- that's peculiar to my
environment.)
-tk
On Mon, Aug 20, 2018 at 9:57 AM John Clark <[email protected]> wrote:
> I decided to flush the SD and do a total reinstall. What follows id the
> chronology
> *Downloaded weewx-3.8.2.tar.gz *
> *sudo apt-get install mc Because it is so
> handy**sudo apt-get install python**sudo apt-get install python-pil**sudo
> apt-get install python-imaging**sudo apt-get install python-configobj**sudo
> apt-get install python-cheetah**sudo apt-get install python-usb**sudo apt-get
> install mysql-client**sudo apt-get install python-mysqldb**sudo apt-get
> install ftp**sudo apt-get install python-dev**sudo apt-get install
> python-pip**sudo pip install pyephem**sudo apt-get install apache2 **cd
> Downloads**tar xvfz weewx-3.8.2.tar.gz**cd weewx-3.8.2**./setup.py
> build**sudo ./setup.py install*
>
> Change, per instructions to use MySQL
> *mysql> CREATE USER 'weewx'@'localhost' IDENTIFIED BY 'weewx';**mysql> GRANT
> select, update, create, delete, insert, drop ON weewx.* TO weewx@localhost
> <weewx@localhost>;**sudo cp weewx/util/apache/conf.d/weewx.conf
> /etc/apache2/conf.d**cd /home/weewx**sudo cp util/init.d/weewx.debian
> /etc/init.d/weewx**sudo chmod +x /etc/init.d/weewx**sudo update-rc.d weewx
> defaults 98*
>
> Started weewx and got syslog*
> Aug 20 10:49:48 raspberrypi weewx[5749]: engine: Loading service
> weewx.wxservices.StdWXCalculate
> Aug 20 10:49:48 raspberrypi weewx[5749]: wxcalculate: The following values
> will be calculated: barometer=prefer_hardware, windchill=prefer_hardware,
> dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware,
> windrun=prefer_hardware, heatindex=prefer_hardware,
> maxSolarRad=prefer_hardware, humidex=prefer_hardware,
> pressure=prefer_hardware, inDewpoint=prefer_hardware, ET=prefer_hardware,
> altimeter=prefer_hardware, cloudbase=prefer_hardware
> Aug 20 10:49:48 raspberrypi weewx[5749]: wxcalculate: The following
> algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
> Aug 20 10:49:48 raspberrypi weewx[5749]: engine: Finished loading service
> weewx.wxservices.StdWXCalculate
> Aug 20 10:49:48 raspberrypi weewx[5749]: engine: Loading service
> weewx.engine.StdArchive
> Aug 20 10:49:48 raspberrypi weewx[5749]: engine: Archive will use data
> binding wx_binding
> Aug 20 10:49:48 raspberrypi weewx[5749]: engine: Record generation will be
> attempted in 'hardware'
> Aug* *20 10:49:48 raspberrypi weewx[5749]: engine: Using archive interval of
> 300 seconds (specified in weewx configuration)
> Aug 20 10:49:48 raspberrypi weewx[5749]: engine: Use LOOP data in hi/low
> calculations: 1
> Aug 20 10:49:48 raspberrypi weewx[5749]: engine: Database OperationalError
> exception: (2002, 'Can\'t connect to local MySQL server through socket
> \'/var/run/mysqld/mysqld.sock\' (2 "No such file or directory")')
> Aug 20 10:49:48 raspberrypi weewx[5749]: **** Waiting 2 minutes then
> retrying...*
>
>
> so I installed mysql-server
> *sudo apt-get install mysql-server*
>
> restarted weewx
> and got this error message
> *pi@raspberrypi:/home/weewx $ sudo tail **f /var/log/syslog
>
> Aug 20 10:55:51 raspberrypi weewx[7115]: **** File
> "/home/weewx/bin/weewx/manager.py", line 127, in open_with_create
> Aug 20 10:55:51 raspberrypi weewx[7115]: **** connection =
> weedb.connect(database_dict)
> Aug 20 10:55:51 raspberrypi weewx[7115]: **** File
> "/home/weewx/bin/weedb/__init__.py", line 89, in connect
> Aug 20 10:55:51 raspberrypi weewx[7115]: **** return
> driver_mod.connect(**db_dict)
> Aug 20 10:55:51 raspberrypi weewx[7115]: **** File
> "/home/weewx/bin/weedb/mysql.py", line 57, in connect
> Aug 20 10:55:51 raspberrypi weewx[7115]: ****
> database_name=database_name, engine=engine, autocommit=autocommit, **kwargs)
> Aug 20 10:55:51 raspberrypi weewx[7115]: **** File
> "/home/weewx/bin/weedb/mysql.py", line 48, in guarded_fn
> Aug 20 10:55:51 raspberrypi weewx[7115]: **** raise klass(e)
> Aug 20 10:55:51 raspberrypi weewx[7115]: **** DatabaseError: (1698,
> "Access denied for user 'weewx'@'localhost'")
> Aug 20 10:55:51 raspberrypi weewx[7115]: **** Exiting.*
> Which puts me back where I was before I redid it all.. Beginning to think the
> Raspberry Pi was a bad
> idea. I am perfectly willing to be corrected if I did something wrong, but I
> don’t see any omissions
> or mistakes on the install. Meanwhile weewx has been running without a hitch
> on the Dell Optiplex 790
> and Mint 19 for over a month non-stop. Was hoping to get it working on the PI
> so it would be easier to
> run on battery power. Beginning to wonder if it isn't a shortcoming of the
> Raspberian OS
>
> --
>
> *John Clark <[email protected]>*
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.