|
Post by drstang on Oct 27, 2022 4:17:46 GMT -8
Hi -
I'm trying to run WeatherSense on my pi flashed with the SDL software.
When I try: sudo python3 WeatherSenseMonitor.py I get the error: MySQL Database WeatherSenseWireless Not Installed. Run this command: sudo mysql -u root -p < WeatherSenseWireless.sql WeatherSenseMonitor Stopped
When I run : sudo mysql -u root -p < WeatherSenseWireless.sql I get the error: ERROR 1046 (3D000) at line 5: No database selected
I've also tried: sudo mysql -u root -p WeatherSenseWireless < WeatherSenseWireless.sql Which appears to be silent, and doesn't help run the python code.
Ive gone into MariaDB and confirmed the database exists. Any help would be appreciated!
|
|
|
Post by doxidad on Oct 27, 2022 8:00:45 GMT -8
Check the WeatherSenseWireless database to see if the tables were created Example:
pi@WPI2:~/SDL_Pi_WeatherSense $ sudo mysql -u root -p WeatherSenseWireless Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 26110 Server version: 10.3.36-MariaDB-0+deb10u2 Raspbian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [WeatherSenseWireless]> show tables; +--------------------------------+ | Tables_in_WeatherSenseWireless | +--------------------------------+ | AQI433MHZ | | AS433MHZ | | Generic | | IndoorTHSensors | | RAD433MHZ | | SkyCamPictures | | SkyCamSensors | | SolarMax433MHZ | | TB433MHZ | | WeatherData | +--------------------------------+ 10 rows in set (0.001 sec)
If the tables are present the database should be OK.
The WeatherSenseWireless.sql script only needs to be run one time to create the database and tables.
What errors do you get when you execute
sudo python WeatherSenseWireless.py
|
|
|
Post by drstang on Oct 27, 2022 9:25:57 GMT -8
Hi - thanks for the response!
My tables look ok, same as what you posted.
I don't have the file WeatherSenseWireless.py in my SDL_Pi_WeatherSense folder... only WeatherSenseMonitor.py (or weathersensewireless.sql).
|
|
|
Post by doxidad on Oct 27, 2022 13:18:19 GMT -8
Whoops- eyes and finger not in sync.
sudo python WeatherSenseMonitor.py
|
|
|
Post by drstang on Oct 30, 2022 9:02:54 GMT -8
Thanks for the response and sorry for my delay.
sudo python WeatherSenseMonitor.py (as opposed to sudo python3..)
Gives:
Traceback (most recent call last): File "WeatherSenseMonitor.py", line 6, in <module> import wirelessSensors File "/home/pi/SDL_Pi_WeatherSense/wirelessSensors.py", line 5, in <module> import config File "/home/pi/SDL_Pi_WeatherSense/config.py", line 6, in <module> from builtins import hex ImportError: No module named builtins
|
|
|
Post by drstang on Oct 30, 2022 9:13:52 GMT -8
I ran sudo apt-get install python-future and now when I try sudo python WeatherSenseMonitor.py I'm now getting:
SafecastPy missing. run: sudo pip3 install SafecastPy
When I try to install SafecastPy (both pip and pip3), its telling me the requirements are already satisfied.
|
|
|
Post by SDL on Nov 4, 2022 8:33:50 GMT -8
Try uninstalling SafecastPy and reinstalling it.
BP
|
|
|
Post by drstang on Nov 12, 2022 13:39:20 GMT -8
Try uninstalling SafecastPy and reinstalling it. BP Thanks. Tried that, but didn't work. I now reflashed my card, hoping that'll work, but I'm still getting the database error. Running 'sudo python WeatherSenseMonitor.py' gives me: File "WeatherSenseMonitor.py", line 6, in <module> import wirelessSensors File "/home/pi/SDL_Pi_WeatherSense/wirelessSensors.py", line 5, in <module> import config File "/home/pi/SDL_Pi_WeatherSense/config.py", line 6, in <module> from builtins import hex ImportError: No module named builtins I just bought a bunch of sensors, so would really like to get this up and running. Any help appreciated. Thanks.
|
|
|
Post by drstang on Nov 12, 2022 15:27:33 GMT -8
I went through and reinstalled several modules - but now I'm getting this:
File "WeatherSenseMonitor.py", line 14, in <module> import PictureManagement File "/home/pi/SDL_Pi_WeatherSense/PictureManagement.py", line 31 print(f"threshold = {time.ctime(threshold)} ") ^ SyntaxError: invalid syntax
|
|
|
Post by drstang on Nov 12, 2022 15:33:05 GMT -8
Sorry for the additional post but I figured out the issue:
When I ran sudo mysql_secure_installation initially I changed the root password. When I changed it back to the default 'password' it works now!
|
|