ayeks / bme680_to_influxdb

Simple script that sends your BME680 temp, pressure, humidity and gas sensor data to InfluxDB.
MIT License
23 stars 15 forks source link

Script Error #15

Open Shaunkempson opened 1 year ago

Shaunkempson commented 1 year ago

Hello,

When running your script on RP4, seems to encounter issue with as follows:

~/bme680_to_influxdb $ python senddata.py “./config.ini” /home/pi/bme680_to_influxdb/senddata.py:22: SyntaxWarning: "is" with a literal. Did you mean "=="? if len(sys.argv) is 2: KeyError parsing config.ini file. Check file and its structure!

Can you assist me with this issue, script was working fine to what looks like a newer version of python being 3.9.2+

ayeks commented 1 year ago

Hey, I do not run the script myself anymore. Have you tried to replace the is with == in line 22 of senddata.py? https://github.com/ayeks/bme680_to_influxdb/blob/master/senddata.py#L22C1-L22C23

Please comment if it works and I can change it in my script.

Cheers Lars

Shaunkempson commented 1 year ago

Hello,

Thanks for getting back to me, and I am sorry for the very late reply I have been away.

I was in need of a re-image and followed your instructions again, this time the script is working. I had to run with nohup as the script would stop when I close the ssh session.

All is OK with getting it to run now with a small error when outputting to file, I get this.....

nohup: ignoring input and appending output to 'nohup.out' /home/pi/bme680_to_influxdb/senddata.py:22: SyntaxWarning: "is" with a literal. Did you mean "=="? if len(sys.argv) is 2:

so I will change the "2" to "==" and go from there.

The script is now running for around 30 hours then stopping. Pi is on and forced no power management and still fails over time on both LAN/WLAN interfaces, I guess I need to ask/learn for some error handling and see why

I will continue to troubleshoot why it stops after a day or so, if you have any suggestions pleae let me know, but let me take the opportunity to thank you for creating and sharing this, my wife loves it - when it is working

[image: image.png]

On Thu, Aug 17, 2023 at 4:27 PM Lars Lühr @.***> wrote:

Hey, I do not run the script myself anymore. Have you tried to replace the is with == in line 22 of senddata.py? https://github.com/ayeks/bme680_to_influxdb/blob/master/senddata.py#L22C1-L22C23

Please comment if it works and I can change it in my script.

Cheers Lars

— Reply to this email directly, view it on GitHub https://github.com/ayeks/bme680_to_influxdb/issues/15#issuecomment-1681856047, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7SUHC3XTU54V7DWZI7LY7DXVXIWZANCNFSM6AAAAAA2LJRZPY . You are receiving this because you are subscribed to this thread.Message ID: @.***>