paulvha / sds011 Goto Github PK
View Code? Open in Web Editor NEWSDS011 for Linux ( Raspberry Pi & Ubuntu)
License: GNU General Public License v3.0
SDS011 for Linux ( Raspberry Pi & Ubuntu)
License: GNU General Public License v3.0
Hi,
I know this is outdated git but it still works fine. Just wake from sleep does not work.
While googling, found this::
`Solution:
In the current datasheet, it is specified that the proper wake-up procedure is to send a 19-byte sequence very similar to the SLEEP command. If you modify "sds011.cpp" by adding the struct below and changing the wakeup function similar to what I tried below then everything seems to work just fine!
Here's a link to the spec, refer to pages 7 and 8: [https://nettigo.pl/attachments/415]
static const byte WAKECMD[19] = {
0xAA, // head
0xB4, // command id
0x06, // data byte 1
0x01, // data byte 2 (set mode)
0x01, // data byte 3 (wake up)
0x00, // data byte 4
0x00, // data byte 5
0x00, // data byte 6
0x00, // data byte 7
0x00, // data byte 8
0x00, // data byte 9
0x00, // data byte 10
0x00, // data byte 11
0x00, // data byte 12
0x00, // data byte 13
0xFF, // data byte 14 (device id byte 1)
0xFF, // data byte 15 (device id byte 2)
0x06, // checksum
0xAB // tail
};
// --------------------------------------------------------
// SDS011:wakeup
// --------------------------------------------------------
void SDS011::wakeup() {
for (uint8_t i = 0; i < 19; i++) {
sds_data->write(WAKECMD[i]);
}
sds_data->flush();
while (sds_data->available() > 0) {
sds_data->read();
}
}`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.