With Instructables you can share what you make with the world, and tap into an ever-growing community of creative experts.
Tell us about yourself!
Uncle Paddy's Irish Lamb Stew
I ended up going a different route with displaying the data. Instead of RasPiConnect I set up weewx, which gives allot of flexibility. PM me if you are interested in what needs to be done to set it up.
I believe I found the solution to the Wind Vane problem. I'm not sure why this problem had popped up, whether a change in the hardware or what, but try changing two lines in SDL_Pi_Weather_80422/SDL_Pi_Weather_80422.pyLINES 191 & 207:ORIGINAL: voltageValue = value/1000TO: voltageValue = value / 1000 * 3One thing I have not been able to quite figure out is, what is the purpose of _currentWindDirection? It is always 0.0. There is no code that updates that value, and from what I can tell that should be the previous Wind Direction value. Maybe I'm missing something though.Let me know if the above fix works for you. It worked for me in my test code, and I am going to merge it into my modified code. If you are still having problems I'll post the test python script.
The other option is to change:ADJUST3OR5 = 0.66toADJUST3OR5 = 0.22
I have experienced the same problem. But I thought it was connected to other changes I made to the SDL_Pi_Weather_80422.py file, as I altered it to use the updated Adafruit ADS_1x15 library.I've been needing to get in and figure the Wind Direction problem out, so I'll do some work on it now. From some initial testing I've done, I do get an analog output from the Wind vane, but the translation to Wind Direction is not calculating correctly. I'll write a quick python script that will record the analog output, the calculated voltage, and the Wind Direction Value and write it to a file, which can be run while manually positioning the wind vane. Once I have it done, I'll post if you'd like to use it to test.
Here is the code within the WeatherPi.py script that changes the Mux's (TCA9545) I2C Bus:tca9545.write_control_register(TCA9545_CONFIG_BUS1)The above assumes that the AM2315 is attached to BUS 1, if you followed the instructable, it would be attached to the SunAirPlus which would be connected to Bus 1 of the Mux.Now, there is a much easier way to use the TCA9545, which no longer requires calling the above code to switch between the I2C buses of the Mux. In RaspberryPi Kernel 4.4 we can add a Device Tree Overlay for the TCA9545 that adds access to the TCA9545 from the kernel.To get kernel 4.4 you may or may not require running (it might be the current version):sudo BRANCH=next rpi-updateSo what would adding the overlay do?It will allow you to access the mutiplexed I2C address via the ras...see more »Here is the code within the WeatherPi.py script that changes the Mux's (TCA9545) I2C Bus:tca9545.write_control_register(TCA9545_CONFIG_BUS1)The above assumes that the AM2315 is attached to BUS 1, if you followed the instructable, it would be attached to the SunAirPlus which would be connected to Bus 1 of the Mux.Now, there is a much easier way to use the TCA9545, which no longer requires calling the above code to switch between the I2C buses of the Mux. In RaspberryPi Kernel 4.4 we can add a Device Tree Overlay for the TCA9545 that adds access to the TCA9545 from the kernel.To get kernel 4.4 you may or may not require running (it might be the current version):sudo BRANCH=next rpi-updateSo what would adding the overlay do?It will allow you to access the mutiplexed I2C address via the raspberry pi's I2C interface. Currently, if you look within your /dev directory on your RPi you will see i2c-1, but no other i2c devices (even with the TCA9545 connected). When you add the Device Tree Overlay for the TCA9545 you will see (in my case), not only i2c-1, but also i2c-3, i2c-4, i2c-5 and i2c-6 (I do not know why i2c-2 was skipped, but it was). This then allows you to use i2cdetect -y [bus] to see the devices on each i2c bus. It also gets rid of the need to use the:tca9545.write_control_register(TCA9545_CONFIG_BUS1)to access the i2c buses of the mux. This is huge as far as I'm concerned. The only thing you will need to do is define the bus your device is connected to when you initialize the device.So here is what you need to do to get the Device Tree Overlay working for the TCA9545:1) Make sure you are on Raspberry Pi Kernel 4.4 (may require sudo BRANCH=next rpi-update).2) Add the device tree overlay file for the TCA9545a to the /boot/overlays directory (I will post a link to the i2c-mux-pca9545a.dtbo file that I created).3) Add the following line to you /boot/config.txt file:dtoverlay=i2c-mux-pca9545a,addr=0x734) Reboot your RaspberryPiYou should now see multiple i2c devices in your /dev directory, where i2c-1 is your raspberry pi's i2c bus, and the additional i2c devices are your mux where the first (after i2c-1) is Bus 0 on the mux, etc.
Lets try to tackle the AM2315 issue first.Edit Line 3 of the testAM2315.py file to:am = AM2315(0x5c,"/dev/i2c-4")And then try running it to see if you get any output.If you still get 0, then check your wiring. Refer to the yellow tag on the AM2315 to make sure you have the SCL/SDA wires correct. (The difference here with the AM2315 is that it is using 5V logic. I need to check my wiring at home to make any further recommendations. I will check when I get home in a few hours.)
The above changes assume the following:MUX Bus 0 = i2c-3MUX Bus 1 = i2c-4MUX Bus 2 = i2c-5MUX Bus 3 = i2c-6If your bus numbering is different as shown in /dev then adjust the numbering in the above line changes (such as: twi=4, bus=5, /dev/i2c-4, etc...)The above also assumes that the i2c hierarchy is as follows:-i2c Mux---BUS 0: WeatherPi-----FRAM-----DS3231-----ADS1015---BUS 1: SunAirPlus-----ina3221-----AM2315---BUS 2: AS3935
The UU in 0x73 on i2c-1 is expected, as that denotes that the i2c address is in use, which it is, as it is the MUX. It is used across all Buses.NOTE: In the below directions I have the AS3935 connected to MUX Bus 2, it appears you have it connected to MUX Bus 0, so adjust as necessary.
You need to make sure you have run the following:sudo apt-get install python-pip libi2c-devsudo pip install tentacle_piThe AM2315 library used is from tentacle_piThe AM2315 is a bit finicky. From what I can tell it doesn't follow i2c standards, but the tentacle_pi python library works pretty well.
Hmm...I've not quite gotten that far so can test it myself. I ran into your previous problem with the as3935 error, and tried the 48 to 49 address fix, but that didn't seem to fix it, and after trying to troubleshoot for a while, I commented out all of the as3935 code and that got me past that error. But ran into another error (Error accessing 0x48: Check your I2C address), followed by other errors. So I might recheck my wires and set it up exactly as described and reflash and install everything to start fresh.BTW...Once I get the code and hardware working I plan on implementing weewx (http://weewx.com/) as the interface.
Be sure to set the ip address in the WLAN_check function to the ip address of your router. It is hard coded to 192.168.1.1, which may be different for you.
Do you have the AS3935 connected through the I2C Mux or the WeatherPiArduino board?From what I can tell in the github code, the code is set up to have it connect through the I2C Mux and not to the WPA board.I am currently working on building this project and am working through the code now, so I will report back if I run into the same problem.
Create Your Own Solar Powered Raspberry Pi Weather Station (Updated)
Join 2 million + to receive instant DIY inspiration in your inbox.
© 2016 Autodesk, Inc.