1. 02 Jun, 2017 1 commit
    • Frank Heuer's avatar
      Added new functionality to the class and test.py. The constructor now accepts two parameters: · 09691a63
      Frank Heuer authored
      "timeout" lets you set the serial timeout for the call to serial.Serial()
      "unit_of_measure" lets return values in different units: microgram/cubic meter (mg/m³) named MassConcentrationEuropean or in particles / 0.01 cubic foot (pcs/0.01cft) named ParticleConcentrationImperial. The latter is calculated by assuming different mean sphere diameters of pm10 or pm2.5 particles. Have a look at http://ir.uiowa.edu/cgi/viewcontent.cgi?article=5915&context=etd for details. Thanks to Teus Hagen the idea and for coding this part.
      
      Also added more fine grained logging between standard levels DEBUG and INFO.
      
      test.py is new in most cases. It is now callable as a script with parameters. Calling "python test.py" without parameters in a command window will tell how to use. It is based on an idea of Teus Hagen.
      
      As a hole test.py and SDS011 class should now work with python2 and python3. Maybe you need to install enum34 (not
      as enum!) which is a back port of of 3.4 library module supporting IntEnum.
      
      Furthermore the exception file is no longer needed, only standard exceptions are used now and there are a lot of language corrections in comments.
      09691a63
  2. 03 Mar, 2017 2 commits
    • Frank Heuer's avatar
      Made clear, that one has to use python version 3 instead of version 2. Also... · f21bab07
      Frank Heuer authored
      Made clear, that one has to use python version 3 instead of version 2. Also explained how to fix a sensor that is stuck in dutycycle.
      f21bab07
    • Frank Heuer's avatar
      New method "reset" which sets the dutycycle, workstate, reportmode and so... · 118428d7
      Frank Heuer authored
      New method "reset" which sets the dutycycle, workstate, reportmode and so forth to the factory default, so that use of the sensor by other code will work. Other code often is not able to handle a sensor at startup that is in sleep mode.
      
      New property device_path that holds info of the device_path the instance is constructed with. One is able to identify the sensor if more than one sensor is in use.
      
      Added a new raise condition in the __send method when sensor is not responding.
      118428d7
  3. 12 Feb, 2017 2 commits
  4. 27 Dec, 2016 1 commit
  5. 16 Dec, 2016 1 commit
  6. 13 Dec, 2016 2 commits
  7. 09 Dec, 2016 7 commits