jardiamj / BYOWS_RPi

weeWX Driver for Build Your Own Weather Station for Raspberry Pi
GNU General Public License v3.0
7 stars 7 forks source link

Unable to load driver #3

Closed Cocoloco61 closed 5 years ago

Cocoloco61 commented 5 years ago

Hi, I build a weather station using the Raspberry pi weather station guide, all is working perfectly with the python3 code: upload to weather underground, store data to SQLite, etc.... I use a Raspberry 3b equipped with a real clock an battery. I follow your guide for the installation.

When I start weewx `sudo weewxd /etc/weewx/weewx.conf

The program stop`and /var/log/syslog look like that:

Sep 19 15:03:20 raspberrypi weewx[1457]: engine: Initializing weewx version 3.9.2 Sep 19 15:03:20 raspberrypi weewx[1457]: engine: Using Python 2.7.16 (default, Apr 6 2019, 01:42:57) #012[GCC 8.2.0] Sep 19 15:03:20 raspberrypi weewx[1457]: engine: Platform Linux-4.19.66-v7+-armv7l-with-debian-10.1 Sep 19 15:03:20 raspberrypi weewx[1457]: engine: Locale is 'en_GB.UTF-8' Sep 19 15:03:20 raspberrypi weewx[1457]: engine: Using configuration file /etc/weewx/weewx.conf Sep 19 15:03:20 raspberrypi weewx[1457]: engine: Loading station type BYOWS (user.byows_rpi) Sep 19 15:03:20 raspberrypi weewx[1457]: engine: Import of driver failed: int() can't convert non-string with explicit base (<type 'exceptions.TypeError'>) Sep 19 15:03:20 raspberrypi weewx[1457]: engine: Unable to load driver: int() can't convert non-string with explicit base Sep 19 15:03:20 raspberrypi weewx[1457]: ****

Exiting... I reinstall all the library that I use with python3 with pip to have them with python 2.7, all my wiring is operational, I don't know what to do do now. Thanks in advance for your time.

jardiamj commented 5 years ago

What do you have in your [BYOWS] of your weewx.conf file?

Cocoloco61 commented 5 years ago

Hi, params['bme280_address'] = int(stn_dict.get('bme280_address', 0x76), 16) Changed to: params['bme280_address'] = int(stn_dict.get('bme280_address', '0x76'), 16) and change the address to 0x77 because some of these chips have this adress. All working well now, thanks for your hard job, You are a Legende

jardiamj commented 5 years ago

Thanks! That is indeed missing the quotation marks, I'll fix it right away. I put this driver together but I don't have the hardware to test it, so if you find any other bugs please let me know. You can also pass the chip address through the weeWX.conf file as described in the readme file:

# [OPTIONAL]
    # Port and address for sensor bme280, the DEFAULT are port=1 address=0x77
    bme280_port = 1
    bme280_address = 0x77
Cocoloco61 commented 5 years ago

I can tell you that's working very well, Brilliant job. and with no hardware, impressive. Yes If I have any issues , I stay in touch with you.

bye

On Sat, 21 Sep 2019 at 21:54, Jardi Martinez notifications@github.com wrote:

Thanks! That is indeed missing the quotation marks, I'll fix it right away. I put this driver together but I don't have the hardware to test it, so if you find any other bugs please let me know. You can also pass the chip address through the weeWX.conf file as described in the readme file:

[OPTIONAL]

# Port and address for sensor bme280, the DEFAULT are port=1 address=0x77
bme280_port = 1
bme280_address = 0x77

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jardiamj/BYOWS_RPi/issues/3?email_source=notifications&email_token=ANHCTVYNEGL3XKNRQ56A5D3QK2C2DA5CNFSM4IYMAXS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7IZO7Q#issuecomment-533829502, or mute the thread https://github.com/notifications/unsubscribe-auth/ANHCTV5ZFI2GG6SEDASPZO3QK2C2DANCNFSM4IYMAXSQ .

jardiamj commented 5 years ago

I just wanted to let you know that I have fixed the typo and I also formatted the code with Black while at it.

Cocoloco61 commented 5 years ago

Black while? I do not catch that, can you please explain, I am still learning python3 lol my first language

Laurent Lasne 18 Grove Hill Kilkeel BT34 4XT NI

Le dim. 22 sept. 2019 à 22:41, Jardi Martinez notifications@github.com a écrit :

I just wanted to let you know that I have fixed the typo and I also formatted the code with Black while at it.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jardiamj/BYOWS_RPi/issues/3?email_source=notifications&email_token=ANHCTVZ5VCQ7N7FEIWFJ2S3QK7RALA5CNFSM4IYMAXS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7JP3AY#issuecomment-533921155, or mute the thread https://github.com/notifications/unsubscribe-auth/ANHCTV7ZMX7CHMCAVZ6RLH3QK7RALANCNFSM4IYMAXSQ .

jardiamj commented 5 years ago

Black is a code formatter: https://pypi.org/project/black What I meant to say is that while I was fixing the typo in my code I ran it through Black so it would format it to a subset of PEP 8 python code style. It's just something I have been doing lately with my code. Since you are learning Python it would be a good idea to take a look at it. Sorry for the confusion.