Post by mickey53usa on Jun 10, 2020 12:30:06 GMT -8
I have the WeatherBoard for Pi Arduino. This is connected to a Raspberry Pi through the PiGrover Board. The WeatherBoard.py program reads the sensors that are connected with out issue, I have three problems:
1) Using the AM2315 - On the program display I show two "InTemp" and two "press" - How do I tell which is which?
2) Temperature reading is in Centigrade and I would like Fahrenheit. Which script do I change this in?
3) Barometric Pressure is reading as "Kpa" and not "PSI" (?) which script and how do I change this.
Appreciate the help. Google searches indicate a section of code must be added to do the conversion, but I do not know where this would be added or to what script (WeatherBoard. BMP280, etc).
Post by mickey53usa on Jun 11, 2020 11:53:22 GMT -8
Well, this morning I received an error when I tried to launch the program.
I received - "sudo python /home/pi/SDL_Pi_Weatherboard/WeatherBoard.py Error accessing 0x48: Check your I2C address Error accessing 0x48: Check your I2C address Type Error DS3231= 2020-06-11 14:33:18 ----------------- ----------------- AT24C32 EEPROM ----------------- writing first 4 addresses with random data address = 0 writing value=146 Traceback (most recent call last): File "/home/pi/SDL_Pi_Weatherboard/WeatherBoard.py", line 198, in <module> bmp280 = BMP280.BMP280() File "build/bdist.linux-armv6l/egg/Adafruit_BMP/BMP280.py", line 46, in __init__ self._device = i2c.get_i2c_device(address, **kwargs) File "build/bdist.linux-armv6l/egg/Adafruit_GPIO/I2C.py", line 65, in get_i2c_device File "build/bdist.linux-armv6l/egg/Adafruit_GPIO/I2C.py", line 57, in get_default_bus RuntimeError: Could not determine default I2C bus for platform."
I can see what is causing the error, just not how to correct.
WeatherBoard for Pi - JP4 connects to Pi2Grover I2C header WeatherBoard for Pi - J4 connects to Pi2Grover I2C header WeatherBoard for Pi - JP11 connects to RTC WeatherBoard for Pi - J3 connects to AM2315
Consequently, I cannot provide the requested information regarding changing Metric to English.
WeatherBoard is 0010-052516-01 Pi2Grover is 0100-062416-01 Raspberry Pi - Zero W
I tried a simple change on Line 557, changing it from "C" to "F" Change line 558 from "KPa" to "mbar" (found out that it should change from "KPa" to "inches") Those changes did nothing - still displaying "C" and "KPa" Does some conversion language need to be added?
Post by mickey53usa on Jun 15, 2020 7:02:06 GMT -8
Your response is not helpful, especially when compared to your response on June 12 _ "What is the GitHub archive that you got the software from? Then I can point you to the place to make the changes (hint - right around your print statements).
I can find conversion scripts. Question is where do they get inserted in the WeatherBoard.py program. At the start? Line 557, line999?
Now a problem with the Wind Vane has arisen - it does not show up. I make an assumption that the Pi2Grove board that I purchased is an Analog to Digital Converter. So, why doe I not get the reading from that device. I found the mention of an ADC in this post -https://forum.switchdoc.com/thread/484/weather-board-rack-help-needed.
Additionally, starting at line 499 - currentWindSpeed = struct.unpack('f', str(block1[9:13])) /1.6
currentWindGust = 0.0 # not implemented in Solar WXLink version
Check your wiring carefully on the Wind Direction Sensor. Also, check the voltage on the Wind Direction pin (see the specification) with a voltmeter and make sure it changes (according to the WeatherRack specification) as you move it.
Post by mickey53usa on Jun 17, 2020 16:36:00 GMT -8
The next place the Celsius to Fahrenheit conversion needs to take place is for the AM2315. I have looked for and cannot find a AM2315 configuration file. I have looked in several places and failed to find a location where the calculation can be placed and work.
(python) 339 # Detect AM2315 340 try: 341 from tentacle_pi.AM2315 import AM2315 342 try: 343 am2315 = AM2315(0x5c,"/dev/i2c-1") 344 temperature, humidity, crc_check = am2315.sense() 345 print "AM2315 =", temperature 346 config.AM2315_Present = True 347 if (crc_check == -1): 348 config.AM2315_Present = False 349 except: 350 config.AM2315_Present = False (/python) (python) 453 if (config.AM2315_Present): 454 temperature, humidity, crc_check = am2315.sense() 455 print "AM2315 temperature: %0.1f" % temperature 456 print "AM2315 humidity: %0.1f" % humidity 457 print "AM2315 crc: %s" % crc_check (/python) (python) 515 # now do the AM2315 Temperature 516 temperature = struct.unpack('f', str(block1[25:29])) 517 elements = [block1, block1, block1, block2] 518 outHByte = bytearray(elements) 519 humidity = struct.unpack('f', str(outHByte)) 520 print "AM2315 from WXLink temperature: %0.1f" % temperature 521 print "AM2315 from WXLink humidity: %0.1f" % humidity (/python)