Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

queue file read/write problem #1

Open
klaus-hildner opened this issue Sep 1, 2017 · 0 comments
Open

queue file read/write problem #1

klaus-hildner opened this issue Sep 1, 2017 · 0 comments

Comments

@klaus-hildner
Copy link

klaus-hildner commented Sep 1, 2017

Very useful and well maintainable code - thank you for sharing. - I have made amendments and run this as a system service and redirect stdout (>) and stderr (2>) to /mnt/ram (a ramdisk in a RasPi to further reduce flash wear) and caught the following error after about an hour of runtime - issue 1:

Traceback (most recent call last):
  File "sds-reader.py", line 229, in <module>
    loop(USBPORT)
  File "sds-reader.py", line 223, in loop
    uploader.postValues(reader.read(60))
  File "sds-reader.py", line 191, in postValues
    self.file_put_contents(filePath2,pickle.dumps(values))
  File "sds-reader.py", line 162, in file_put_contents
    with open(filename,'w') as f:
IOError: [Errno 13] Permission denied: 'pending.30c1.2017-09-01-14-25-09.pickle'

Issue 2: During an http 200 OK posting I get this message that I do not really understand (I have however increased the POST payload):

Posting 33680 bytes -> 200 OK
http-post: error. <type 'exceptions.ValueError'>
upload not ok... there are now 58 entries pending (/mnt/ram/30c1.pickle).

For sensor type SDS011, I had do divide the PM10 and PM2.5 values by 10.

On smartgart.com/pm10, I have started to aggregate the measurements with Yahoo JSON weather data to include weather condition (like rain), wind direction, wind speed, atmospheric pressure for the purpose of monitoring pollution from a nearby waste incineration plant, and in the future perhaps to try to correlate the values (like: if ... more incoming wind, less rain, higher atmospheric pressure ... then ... more PM10 dust).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant