dlw27
New Member
Posts: 22
|
Post by dlw27 on Jan 4, 2021 8:52:54 GMT -8
At Christmas, I bought "The WeatherBoard w/Grove - interface board for Weather Instruments for Raspberry Pi / Arduino" and "WeatherRack" with wind direction, speed and rain gauge sensors. All from SwitchDoc Labs. Order #4103.
My Weather board is different from any pictured on your website . . . see below. I think 4-pin Grove cables plug into "Grove D Anemometer" and "Grove D Rainbucket" on WeatherBoard . . . correct?. Yellow boxes below.
<--Weatherboard <--I'm using Raspberry Pi 2, Model B Rev 1.1.
<--Pinouts for Pi GPIO <-- which folders/files go where in Pi?
I'm sure the RJ11 cables from sensors plug into corresponding RJ11 jacks on WeatherBoard.
FYI. pi@raspberrypi:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10"
Question #1: Which 1-strand Grove cables from Weatherboard get plugged into which GPIO pins on Pi? Question #2: Should I reference GPIO numbers on graphic above? Pin # or GPIO #?
Question #3: How do I use "BME680" . . . "Barometric Pressure, Temperature, Humidity" sensor on the WeatherBoard (red box above) Question #4: Of the folder/file listing above ("RaspberryPi-Weather PiArduino-master"), which folders/files go where in Pi file system?
Thanks much for your help.
|
|
|
Post by SDL on Jan 5, 2021 8:33:43 GMT -8
|
|
dlw27
New Member
Posts: 22
|
Post by dlw27 on Jan 12, 2021 16:58:29 GMT -8
From github, I'm using "SDL_Pi_Weatherbaord". Sensors connected to PiWeather board correctly, but syntax error shown below . . . help please
pi@raspberrypi:~ $ sudo python WeatherBoard.py Traceback (most recent call last): File "WeatherBoard.py", line 40, in <module> import SDL_Pi_WeatherRack as SDL_Pi_WeatherRack File "./SDL_Pi_WeatherRack/SDL_Pi_WeatherRack.py", line 26, in <module> from Adafruit_ADS1x15 import ADS1x15 File "./Adafruit_ADS1x15/Adafruit_ADS1x15.py", line 5, in <module> from Adafruit_I2C import Adafruit_I2C File "./Adafruit_ADS1x15/Adafruit_I2C.py", line 1 ../Adafruit_I2C/Adafruit_I2C.py ^ SyntaxError: invalid syntax
Folder Adafruit_ADS1x15/Adafruit_I2C.py has just 1 line . . . . ../Adafruit_I2C/Adafruit_I2C.py
Please help. thanks
|
|
|
Post by SDL on Jan 14, 2021 8:18:24 GMT -8
dlw27, Clear out the SDL_Pi_Weatherboard directory (sudo rm -rf SDL_Pi_WeatherBoard) and reload the software from the repository. That file is NOT the one up on the repository. git clone github.com/switchdoclabs/SDL_Pi_WeatherBoardBP
|
|
dlw27
New Member
Posts: 22
|
Post by dlw27 on Jan 14, 2021 16:52:34 GMT -8
Thanks much, removed directory and successfully got code using git clone . . . but
pi@raspberrypi:~/SDL_Pi_WeatherBoard $ sudo python WeatherBoard.py Traceback (most recent call last): File "WeatherBoard.py", line 139, in <module> weatherStation = SDL_Pi_WeatherRack.SDL_Pi_WeatherRack(anemometerPin, rainPin, 0,0, SDL_MODE_I2C_ADS1015) File "./SDL_Pi_WeatherRack/SDL_Pi_WeatherRack.py", line 186, in __init__ self.ads1015 = ADS1x15(ic=ADS1015, address=0x48) File "./Adafruit_ADS1x15/Adafruit_ADS1x15.py", line 138, in __init__ self.i2c = Adafruit_I2C(address) File "./Adafruit_ADS1x15/Adafruit_I2C.py", line 43, in __init__ self.bus = smbus.SMBus(busnum if busnum >= 0 else Adafruit_I2C.getPiI2CBusNumber()) IOError: [Errno 2] No such file or directory
Please help again.
|
|
|
Post by SDL on Jan 15, 2021 12:53:49 GMT -8
Have you enabled i2c on the raspberry pi?
Run the command:
sudo i2cdetect -y 1
and post the results
BP
|
|
dlw27
New Member
Posts: 22
|
Post by dlw27 on Jan 15, 2021 14:35:48 GMT -8
I'm using Raspberry Pi 2 Model B Rev 1.1 with 1GB RAM. Ran raspi-config to enable I2c. then script executed without error except below . . . very start of output
pi@raspberrypi:~/SDL_Pi_WeatherBoard $ sudo python WeatherBoard.py Error accessing 0x48: Check your I2C address Error accessing 0x48: Check your I2C address
Weather Board Demo / Test Version 1.6 - SwitchDoc Labs
pi@raspberrypi:~ $ sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- 73 -- -- -- --
Why only 1 address detected? Anemometer and rain gauge displays but why no wind direction?
Grove Cable from J4 of PiWeatherBoard (I2C) connects to Pin#1 (red), Pin#3 (white), Pin#5 (yellow) and Pin#6 (black)
Thanks for any help.
Program Started at:2021-01-15 21:19:42
---------------------- DS3231: Not Present BMP280: Not Present FRAM: Not Present HTU21DF: Not Present AM2315: Not Present ADS1015: Not Present ADS1115: Not Present AS3935: Not Present OLED: Not Present SunAirPlus: Not Present WXLink: Not Present
|
|
|
Post by SDL on Jan 16, 2021 9:03:13 GMT -8
The issue is that you are running software designed for the WeatherBoard on the PiWeather board. The PiWeather board has an I2C mux (0x73) to allow multiple i2c devices running at the same address: Get the SkyWeather software here: cd ~ git clone github.com/switchdoclabs/SDL_Pi_SkyWeatherTo test the i2c devices, run this command in the SDL_Pi_SkyWeather directory: sudo python testSDL_Pi_TCA9545.py This will show you the onboard devices on Bus 0. This will produce the following results if your board is good: Test SDL_Pi_TCA9545 Version 1.0 - SwitchDoc Labs
Sample uses 0x73 Program Started at:2021-01-16 08:59:34
-----------BUS 0------------------- tca9545 control register B3-B0 = 0x1 ignore Interrupts if INT3' - INT0' not connected tca9545 control register Interrupts = 0x0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- 73 -- -- -- 77
-----------------------------------
-----------BUS 1------------------- tca9545 control register B3-B0 = 0x2 ignore Interrupts if INT3' - INT0' not connected tca9545 control register Interrupts = 0x0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- 73 -- -- -- --
-----------------------------------
-----------BUS 2------------------- tca9545 control register B3-B0 = 0x4 ignore Interrupts if INT3' - INT0' not connected tca9545 control register Interrupts = 0x0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- 73 -- -- -- --
-----------------------------------
-----------BUS 3------------------- tca9545 control register B3-B0 = 0x8 ignore Interrupts if INT3' - INT0' not connected tca9545 control register Interrupts = 0x0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- 73 -- -- -- --
|
|
dlw27
New Member
Posts: 22
|
Post by dlw27 on Jan 22, 2021 17:51:21 GMT -8
Got it working . . . somewhat. But definitely got test results above.
Could I use the 5v instead of 3.3v . . . any better?
Thanks much . . . onto working with output in mariadb
|
|
|
Post by SDL on Jan 23, 2021 11:51:03 GMT -8
Both 3.3V and 5V should work, but you have to protect your Raspberry Pi (3.3V only inputs!).
Using a Pi2Grover board you are totally protected.
BP
|
|
dlw27
New Member
Posts: 22
|
Post by dlw27 on Jan 26, 2021 17:05:23 GMT -8
Thanks much for your help so far. I keep making progress after your replies. . . please continue.
Testing of WeatherRack is successful . . . see immediately below, but unexpected output to screen running sudo pigpiod sudo python SkyWeather.py
. . . See below ==================. BTW: Besides WeatherRack sensors, I only have BME680. WeatherData table is empty
pi@raspberrypi:~/SDL_Pi_SkyWeather $ sudo python testWeatherRack2.py ---------------------------------------- Rain Speed Dir Volts Rain Total= 0.00 in Wind Speed= 0.00 MPH (' value = ', 3062.0625) (' voltageValue = ', 3.0620625) Wind Direction= 270.00 Degrees Wind Direction Voltage= 3.062 V ----------------- ---------------------------------------- Rain Speed Dir Volts Rain Total= 0.00 in Wind Speed= 0.00 MPH (' value = ', 3062.25) (' voltageValue = ', 3.06225) Wind Direction= 270.00 Degrees Wind Direction Voltage= 3.062 V ----------------- ^CTraceback (most recent call last): File "testWeatherRack2.py", line 116, in <module> time.sleep(20.0) KeyboardInterrupt
============================================================================================= pi@raspberrypi:~/SDL_Pi_SkyWeather $ sudo pigpiod pi@raspberrypi:~/SDL_Pi_SkyWeather $ sudo python SkyWeather.py mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM) mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1) ('after bme680', True) as3935 start I/O error(121): Remote I/O error I/O error(121): Remote I/O error after SHT30 ^C SkyWeather Weather Station Version 055 - SwitchDoc Labs
Program Started at:2021-01-27 00:49:53
---------------------- I2C Mux - TCA9545: Present BME680: Present BMP280: Not Present SkyCam: Not Present DS3231: Not Present HDC1080: Not Present SHT30: Not Present AM2315: Not Present ADS1015: Not Present ADS1115: Present AS3935: Not Present OLED: Not Present SunAirPlus/SunControl: Not Present SolarMAX: Not Present SI1145 Sun Sensor: Not Present TSL2591 Sun Sensor: Not Present DustSensor: Not Present WXLink: Not Present Dual SolarMAX/WXLink: Not Present
UseBlynk: Not Present UseMySQL: Present Check WLAN: Not Present WeatherUnderground: Not Present UseWeatherStem: Not Present ---------------------- sendmail exception raised ----------------- Sample and Display ----------------- ----------------- Weather Sampling ----------------- (' value = ', 3062.4375) (' voltageValue = ', 3.0624375) ----------------- ----------------- SunAirPlus Not Present ----------------- ----------------- ----------------- ----------------- AS3935 Lightning Detector Not Present ----------------- ----------------- ----------------- Sample and Display Done ----------------- taking SkyPicture ----------------- Scheduled Jobs ----------------- Jobstore default: patTheDog (trigger: interval[0:00:10], next run at: 2021-01-27 00:50:05 GMT) checkForButtons (trigger: interval[0:00:10], next run at: 2021-01-27 00:50:05 GMT) sampleAndDisplay (trigger: interval[0:00:30], next run at: 2021-01-27 00:50:25 GMT) tick (trigger: interval[0:01:00], next run at: 2021-01-27 00:50:55 GMT) writeWeatherRecord (trigger: interval[0:05:00], next run at: 2021-01-27 00:54:55 GMT) writePowerRecord (trigger: interval[0:05:00], next run at: 2021-01-27 00:54:55 GMT) updateRain (trigger: interval[0:05:00], next run at: 2021-01-27 00:54:55 GMT) checkForShutdown (trigger: interval[0:05:00], next run at: 2021-01-27 00:54:55 GMT) doAllGraphs (trigger: interval[0:15:00], next run at: 2021-01-27 01:04:55 GMT) barometricTrend (trigger: interval[0:15:00], next run at: 2021-01-27 01:04:55 GMT) WLAN_check (trigger: interval[0:30:00], next run at: 2021-01-27 01:19:55 GMT) statusRain (trigger: interval[1:00:00], next run at: 2021-01-27 01:49:55 GMT) rebootPi (trigger: cron[day='5-30/5', hour='0', minute='4'], next run at: 2021-01-30 00:04:00 GMT) ----------------- ------Patting The Dog------- ------Patting The Dog------- ----------------- Sample and Display ------Patting The Dog-------
----------------- ----------------- Weather Sampling ----------------- (' value = ', 3062.25) (' voltageValue = ', 3.06225) ----------------- ----------------- SunAirPlus Not Present ----------------- ----------------- ----------------- ----------------- AS3935 Lightning Detector Not Present ----------------- ----------------- ----------------- Sample and Display Done ----------------- ^CTraceback (most recent call last): File "SkyWeather.py", line 1909, in <module> time.sleep(1.0) KeyboardInterrupt
|
|
|
Post by SDL on Jan 29, 2021 10:55:15 GMT -8
Turn debug on (in the SKyWeather file) and see what is going on with your database accesses. Do you have the database set up?
cd
cd SDL_Pi_SkyWeather cd SkyWeatherSQL
sudo mysql -u root < WeatherPiStructure.sql
You should have set up mysql with root access and the password "password"
BP
|
|
dlw27
New Member
Posts: 22
|
Post by dlw27 on Jan 31, 2021 7:56:11 GMT -8
Thanks for the reply, but no change in screen output and no records in WeatherData
1) yes, database was setup before I ran SkyWeather.py with results above (executed WeatherPiStructure.sql, tables created, but no records in WeatherData table). I'm very familiar with SQL language on mariadb.
- How else do I turn on debug?
2) in conflocal file, I have parameter "SWDEBUG = True", I'm guessing that is how to turn-on debug in SkyWeather.py
3) in conflocal file, I have parameter "enable_MySQL_Logging = True, MySQL_Password = matches my own password I verified works within mariadb.
4) Curiously, mysql -u root -p fails unless I place sudo in front "mysql -u root -p" . . . then ok
Your MariaDB connection id is 38 Server version: 10.3.27-MariaDB-0+deb10u1 Raspbian 10
My entire conflocal.py file below
# # # configuration file - contains customization for SkyWeather system #
# it is a good idea to copy this file into a file called "conflocal.py" and edit that instead of this one. This file is wiped out if you update SkyWeather.
SWDEBUG = True
SWVERSION = "000" # set in SkyWeather.py import uuid # printing the value of unique MAC # address using uuid and getnode() function MACADDRESS = hex(uuid.getnode())
mailUser = "Don" mailPassword = "yourmailpassword"
notifyAddress ="you@example.com"
fromAddress = "yourfromaddress@example.com"
enableText = False textnotifyAddress = "yourphonenumber@yourprovider"
#MySQL Logging and Password Information
enable_MySQL_Logging = True MySQL_Password = my unique password that works with mysql
# modify this IP to enable WLAN operating detection - search for WLAN_check in SkyWeather.py enable_WLAN_Detection = False PingableRouterAddress = "192.168.1.1"
# LED configuration (on use on a Raspberry Pi 3B+)
runLEDs = False
# WXLink and SolarMAX configuration SolarMAX_Present = False Dual_MAX_WXLink = False
# SolarMAX_Type = "LEAD" for SolarMAX Lead Acid # SolarMAX_Type = "LIPO" for SolarMAX LiPo SolarMAX_Type = ""
# WeatherSTEM configuration
USEWEATHERSTEM = False INTERVAL_CAM_PICS__SECONDS = 60 STATIONMAC = MACADDRESS STATIONKEY="XXXXYYYY" STATIONHARDWARE=""
# WeatherUnderground Station
WeatherUnderground_Present = False WeatherUnderground_StationID = "KWXXXXX" WeatherUnderground_StationKey = "YYYYYYY"
############ # Blynk configuration ############
USEBLYNK = False BLYNK_AUTH = 'xxxxx' BLYNK_URL = 'http://blynk-cloud.com/'
############ # AS3935 Lightning Configuration ############ # format: [NoiseFLoor, Indoor, TuneCap, DisturberDetection, WatchDogThreshold, SpikeDetection] AS3935_Lightning_Config = [2,1,3,0,3,3]
# for barometeric pressure - needed to calculate sealevel equivalent - set your weatherstation elevation here
BMP280_Altitude_Meters = 328.0
# device present global variables
Camera_Present = False TCA9545_I2CMux_Present = True SunAirPlus_Present = False AS3935_Present = False DS3231_Present = False BMP280_Present = False BME680_Present = True HDC1080_Present = False SHT30_Present = False AM2315_Present = False ADS1015_Present = True ADS1115_Present = False OLED_Present = False OLED_Originally_Present = False WXLink_Present = False Sunlight_Present = False TSL2591_Present = False DustSensor_Present = False
# set Sunlight High Gain (indoors - 1) or Low Gain (outdoors - 0) Sunlight_Gain = 0
# if the WXLink has stopped transmitting, == False WXLink_Data_Fresh = False WXLink_LastMessageID = 0
# Pin definitions pixelPin = 21
DustSensorPin = 19 DustSensorPowerPin = 26
#WeatherRack anemometerPin = 20 rainPin = 13
SHT30GSPIN = 6 AM2315GSPIN = 6
# for fan GPIO_Pin_PowerDrive_Sig1 = 5 GPIO_Pin_PowerDrive_Sig2 = 5 # To avoid stepping on GPIO 6
WATCHDOGTRIGGER = 4
|
|
dlw27
New Member
Posts: 22
|
Post by dlw27 on Jan 31, 2021 8:10:17 GMT -8
Another output to of interest
MariaDB [SkyWeather]> select * from systemlog; +------+---------------------+-------+----------+-------------------------------+ | ID | TimeStamp | Level | Source | Message | +------+---------------------+-------+----------+-------------------------------+ | 2181 | 2021-01-25 00:07:58 | 20 | __main__ | SkyWeather Startup Version055 | | 2182 | 2021-01-27 00:49:54 | 20 | __main__ | SkyWeather Startup Version055 | | 2183 | 2021-01-29 21:53:07 | 20 | __main__ | SkyWeather Startup Version055 | +------+---------------------+-------+----------+-------------------------------+ 3 rows in set (0.002 sec)
This seems to indicate SkyWeather is interacting with mariadb.
|
|
dlw27
New Member
Posts: 22
|
Post by dlw27 on Jan 31, 2021 12:52:33 GMT -8
As another troubleshooting test, I confirmed mysql connectivity with Python by writing some simple Python to test . . . and it worked fine.
Evidence below: #!/usr/bin/python # -*- coding: utf-8 -*-
import MySQLdb as mdb import sys
try: con = mdb.connect('localhost', 'root', 'my password', 'test')
cur = con.cursor() cur.execute("SELECT VERSION()")
ver = cur.fetchone() print "Database version : %s " % ver except mdb.Error, e: print "Error %d: %s" % (e.args[0],e.args[1]) sys.exit(1) finally: if con: con.close()
---output----
Database version : 10.3.27-MariaDB-0+deb10u1
|
|