|
Post by doxidad on Jan 15, 2022 14:26:23 GMT -8
You do not have a email address/password set up. Also the module sendemail.py expect you to use gmail.
It is trying to send the startup message to 'yourusername' with a password of 'yourmailpassword' through the gmail gateway 'smtp.gmail.com'
If you have a gmail account - setup the username and password in SkyWeatherConfigure. If you don't have a gmail address but some other mail service you can enter the username/password for that account and then edit the sendemail.py module and modify the the line
s = smtplib.SMTP("smtp.gmail.com", 587)
Appropriately.
If you don't have any email service you would need comment out any line in SkyWeather2.py that starts with
sendemail.sendEmail(
Also, the dash_app gets almost all of it's data from the mysql database. So, if SkyWeather2 is not executing, the database is not getting updated. Note that the database is only updated every 15 minutes.
|
|
|
Post by doxidad on Jan 15, 2022 5:00:24 GMT -8
You will need to put a remote user in the user database. The default user creation uses host 'localhost' which is the system where the database resides
From my mysql
MariaDB [mysql]> select user, host from user; +------------+-----------+ | user | host | +------------+-----------+ | phpmyadmin | localhost | | root | localhost | | weather | localhost | +------------+-----------+ 3 rows in set (0.001 sec)
You can see that for all 3 users the host is localhost.
You will need to create another user with the host that you are trying to connect from.
mysql> create user 'username'@'somehost' identified by 'somepassword';
The remote host name/ip needs to be in the /etc/host file or you could use the IP instead of the host name in the above command
you would then need to grant privileges to that user so they can read/modify the tables
The following will give all privileges to the user - you may or may not want that - see the docs for granting privileges.
mysql> grant all privileges on SkyWeather2.* to 'username'@'somehost;
The remote host's name/ip needs to be in the /etc/host file or you can use the ip address in the create instead of the host name.
|
|
|
Post by doxidad on Jan 15, 2022 4:31:25 GMT -8
Enable SWDEBUG in your JSON file with SkyWeatherConfigure. This will give us some information about what is going on.
Are you executing SkyWeather2 this way?
sudo python3 SkyWeather2.py
|
|
|
Post by doxidad on Jan 10, 2022 16:54:42 GMT -8
You can install phpMyAdmin. It has a very nice web interface for examing and doing maintenance on mysql databases. It also has a very nice extract/backup function. It allows you to export will all data and rebuild the database with the sql file it creates.
|
|
|
Post by doxidad on Jan 10, 2022 10:46:07 GMT -8
OP = Original Poster
|
|
|
Post by doxidad on Jan 10, 2022 8:06:03 GMT -8
SkyWeather2.py is reporting the outside temperature on the SkyWeather2 instrument. The testBMP280 program is reporting the temperature on the BMP280 which is located ?? with your Raspberry PI inside somewhere I would assume since it is reading about 84F. They are not the same device.
|
|
|
Post by doxidad on Jan 4, 2022 17:36:43 GMT -8
I have something that pops in on channel 7 or 8 every few months. I got tired of cleaning out the database since once it in there even if it goes away it will still be reported. SO, I put a check in to see if there are more than 3 channels (since I have 3 internal sensors) to throw any channel GT than 3 away. This was done in pclogging.py added the following - note this is a hack and could be done a lot cleaner.
def writeITWeatherRecord():
if (config.enable_MySQL_Logging == True): # open mysql database # write log # commit # close
# check for errant channel - we onlyhave 3 channels active \ sensorcount = len(state.IndoorTH) \ #print ("**** Length of state.IndoorTH array =", sensorcount) > Added this code if (sensorcount > 3): / return /
try:
|
|
|
Post by doxidad on Jan 4, 2022 13:34:04 GMT -8
You are speaking of the nohup.out file in the SkyWeather2 directory? Yes - there should be one in the SDL_Pi_SkyWeather2 directory for SkyWeather2 and one in the dash_app directory for dash
Here a few things you can look at to see if the data is getting to you from the camera.
You can look at the file as it is written. To do this be in the SDL_Pi_SkyWeather2 directory and use this command
tail -f nohup.out
As entries are put in the file they will display on your terminal session - a control-c will terminate the command. The camera reports every 60 seconds or so.
You can always search for camera entries by using this command
grep mySkyCameraText nohup.out
This will look for mySkyCameraText (case important) in the nohup.out file and display them if found
You can also check the database to see if there are any entries. Go into the database and enter the the SQL statement below and it will show you the last 10 entries ordered by. example follows
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 19848 Server version: 10.3.31-MariaDB-0+deb10u1 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]> select * from SkyCamPictures order by Timestamp desc limit 10;
+-------+---------------------+-----------+----------+------------------------------------+-------------+---------+------------+ | id | timestamp | messageID | cameraID | picturename | picturesize | resends | resolution | +-------+---------------------+-----------+----------+------------------------------------+-------------+---------+------------+ | 75825 | 2022-01-04 16:22:10 | 81903 | C939 | C939_81903_2022-01-04-16-22-09.jpg | 51645 | 0 | 9 | | 75824 | 2022-01-04 16:21:09 | 81902 | C939 | C939_81902_2022-01-04-16-21-09.jpg | 52011 | 0 | 9 | | 75823 | 2022-01-04 16:20:08 | 81901 | C939 | C939_81901_2022-01-04-16-20-08.jpg | 52187 | 0 | 9 | | 75822 | 2022-01-04 16:19:07 | 81900 | C939 | C939_81900_2022-01-04-16-19-07.jpg | 52256 | 0 | 9 | | 75821 | 2022-01-04 16:18:05 | 81899 | C939 | C939_81899_2022-01-04-16-18-05.jpg | 52461 | 0 | 9 | | 75820 | 2022-01-04 16:17:05 | 81898 | C939 | C939_81898_2022-01-04-16-17-05.jpg | 52086 | 0 | 9 | | 75819 | 2022-01-04 16:16:04 | 81897 | C939 | C939_81897_2022-01-04-16-16-04.jpg | 52019 | 0 | 9 | | 75818 | 2022-01-04 16:15:03 | 81896 | C939 | C939_81896_2022-01-04-16-15-02.jpg | 52152 | 0 | 9 | | 75817 | 2022-01-04 16:14:02 | 81895 | C939 | C939_81895_2022-01-04-16-14-02.jpg | 52586 | 0 | 9 | | 75816 | 2022-01-04 16:13:01 | 81894 | C939 | C939_81894_2022-01-04-16-13-00.jpg | 53242 | 0 | 9 | +-------+---------------------+-----------+----------+------------------------------------+-------------+---------+------------+ 10 rows in set (0.001 sec)
One other thing- do you have mosquitto installed and running? And do you have MQTT enabled in the SkyWeather2 configuration.
The camera communicates via the MQTT protocol and mosquitto is the server.
|
|
|
Post by doxidad on Jan 4, 2022 9:32:58 GMT -8
The 2 commands do the proper install with nothing else for you to do. (you do need the sudo part of the command or they may not install properly).
Do you have the SD card from SwitchDoc? If you do, mysql should be installed with the databases created. The 2 lines that have you update the mysql databases are just updates to the supplied databases.
If you don't have the SD card there will be a number of things that need to be installed for SkyWeather2 to work. There are some topics here that specify what needs to be installed.
|
|
|
Post by doxidad on Jan 4, 2022 7:57:54 GMT -8
There are no extra programs. The images are stored via SkyCamRemote which is a background job in the scheduler If you look in your nohup.out file - is there logging showing the camera was actually reading? Should look something like this -
Picture ID 80915 Good Message 2 Resends: 0 CameraRotation= 270 mySkyCameraText= WeatherSense SkyCam-C939 04-Jan-2022 00:04:28 query= INSERT INTO SkyCamPictures (cameraID, picturename, picturesize, messageID, resends,resolution) VALUES('C939', 'C939_80915_2022-01-04-00-04-28.jpg', 10471, 8091 5, 0, 9 ) INFO msg Received: b'{"id": "C939", "messageid": "80915", "messagetype": "4", "softwareversion": "23", "sunairplusdevicepresent": "1", "hdc1080devicepresent": "1", "i nternaltemperature": "18.27", "internalhumidity": "52.24", "currentrssi": "-71", "batteryvoltage": "4.17", "batterycurrent": "142.80", "loadvoltage": "4.98", "loadcur rent": "84.60", "solarpanelvoltage": "0.04", "solarpanelcurrent": "0.00", "gndrreboots": "693"}' in INFO with SQL
The camera pictures are stored in the directory tree static. You should have a jpg file in the sub directory CurrentPicture. The accumulated pictures end up in the sub directory SkyCam under another sub directory named for the cameraID The time lapses are built in a sub directory named TimeLapses with the name of the cameraId Dash_app looks at the directories in static/SkyCam and uses that for the Status display. The status should show up as SkyCam xxxx where xxxx is the camera ID. If there are no camera ID sub directories you won't see anything on the status screen for the camera
|
|
|
Post by doxidad on Jan 4, 2022 5:22:39 GMT -8
You need to install python-aqi
sudo pip3 install python-aqi
Also
sudo pip3 install ffmpeg
Look in the README.md file in the SDL_Pi_SkyWeather2 directory
|
|
|
Post by doxidad on Dec 31, 2021 9:31:05 GMT -8
Look on page 53 of the SkyCamAssemblyAndTestManual1.1.pdf for the resolutions available and the value to set in the code.
In the code change the value for the framesize. Then rerun the test program
if (messageType == MQTTRESOLUTION): # set resolution myMessage = { "messagetype": MQTTRESOLUTION, "myip": myIP, "framesize":10 # set UXGA <-----<<< set the value here for what resolution you desire. 10 = 1024x768 }
|
|
|
Post by doxidad on Dec 31, 2021 5:05:56 GMT -8
You don't have any commands selected to be sent. They are all commented out.
Uncomment this line. This will send the new resolution to be sent to the camera. The framesize is set to 10 in the code.
# this command will be sent after an INFO messagetype 4 from cameraID
# sendWhatCommand = MQTTERASEMEMORY # sendWhatCommand = MQTTCYCLECHANGE sendWhatCommand = MQTTRESOLUTION # sendWhatCommand = MQTTBLINKXTIMES # sendWhatCommand = MQTTUPDATEPARAM # sendWhatCommand = MQTTSTARTDELAY # sendWhatCommand = MQTTREBOOT
|
|
|
Post by doxidad on Dec 30, 2021 4:51:49 GMT -8
You are missing a package called future (weird I know - looking for past but need future to get it) use pip and install - that should fix the problem Example: pi@WPI2~$ pip install future Here's a link that explains what it does pypi.org/project/past/
|
|
|
Post by doxidad on Dec 27, 2021 13:18:01 GMT -8
Do you have a SDR USB radio and antenna plugged into your USB on the PI and did you install the rtl_433 software?
|
|