Giter Site home page Giter Site logo

python-pms7003's People

Contributors

markjb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python-pms7003's Issues

Error while execution

Hi,
When i print data it gives
data= b'\x00\x1c\x00,\x00I\x00M\x00\x1f\x002\x00> \x1c\t:\x01\xca\x00&\x00\x06\x00\x02\x97\x00\x04\x0b'

frameLength = ord(data[1]) + (ord(data[0])<<8)

the above line gives this error
TypeError: ord() expected a character, but string of length 2 found

Regarding wrong calculation.

Hi Mark,
In the meantime, it looks like your checksum calculation is wrong:

        # Calculate the payload checksum (not including the payload checksum bytes)
        inputChecksum = 0x42 + 0x4d
        for x in range(0, 27):
            inputChecksum = inputChecksum + data[x]

Here, range(0, 27) will only give you the first 27 indexes ([0, 1, ..., 26]).
You need the first 28 indexes, as the last
2 are the checksum.
Instead you can write the checksum calculation as:

        # Calculate the payload checksum (not including the payload checksum bytes)
        inputChecksum = 0x42 + 0x4d + sum(data[:-2])

Please let me know if i am wrong.
Thank you.

Units of Readings

Hi Mark,
I am getting this type of readings.

Date_Time | PM1 | PM2.5 | PM10
2019/02/14 09:52:35 | 260 | 2854 | 3936

Can you tell me what can be the unit of this readings?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.