mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-06-27 08:41:33 +02:00
Compare commits
518 Commits
3.0.3
...
fix/S88-Ca
Author | SHA1 | Date | |
---|---|---|---|
c17d5b5d22 | |||
4691500f5f | |||
c841476ca4 | |||
359394af53 | |||
b8e10f473e | |||
cb511903ef | |||
ebb3f01dcd | |||
2e0ba26c97 | |||
c1a4758c6c | |||
0370a8aa15 | |||
863a37132a | |||
612317d976 | |||
8873bacf55 | |||
bf2388b121 | |||
b3918bd1fb | |||
2a6fce674e | |||
2f0663ced0 | |||
3adf58537a | |||
e10c9ff854 | |||
12c6ec9910 | |||
d108b63a57 | |||
6e212714fc | |||
866684eb30 | |||
9d01479406 | |||
20245f2110 | |||
3890919f54 | |||
76e40fea8c | |||
c4024f49fb | |||
ca5fc8d65b | |||
fd2cef153e | |||
507b958fdf | |||
335c29ebb1 | |||
2907d6f14e | |||
c8d5b546ed | |||
b7cfdc4c4d | |||
994d281e02 | |||
39470384e4 | |||
c25ba764bf | |||
826ff00f42 | |||
520550037d | |||
90f336dee7 | |||
0d39643e76 | |||
21232ec49d | |||
b7339de31f | |||
013fb94307 | |||
e16373a64d | |||
f929623443 | |||
59587ce2b7 | |||
9ec74450a5 | |||
28096e9faf | |||
682378a47c | |||
a1861be7b7 | |||
99ddd24432 | |||
29491e4cbe | |||
87cc3fc45f | |||
7471d8079a | |||
8b0fe967f1 | |||
6f1cef4e67 | |||
02b63ff816 | |||
228bf83e92 | |||
d3534cda52 | |||
aafaa42a68 | |||
2e9ff0d7dd | |||
244b7814a6 | |||
28d27ee8fd | |||
753f22923c | |||
c45901706f | |||
663836e277 | |||
d39e10908d | |||
c52962d628 | |||
6b65efd3d6 | |||
8bb87a75ef | |||
1afcca25a1 | |||
17238cff86 | |||
03e2afbf54 | |||
104d58a8c0 | |||
7a988ea6c1 | |||
54ed83cb89 | |||
e461b92c9f | |||
db21648e91 | |||
a9654506f5 | |||
63f653d5cd | |||
b049a23657 | |||
d6766ef68b | |||
6c3259b94b | |||
b1aaa04421 | |||
2df78e9066 | |||
186f0d27ab | |||
e25aa87ecc | |||
1cc8941a5c | |||
9bf1495be7 | |||
73089b51f5 | |||
625e60a5bf | |||
88e3d0bd3f | |||
171821cfcf | |||
900a2da2ac | |||
fb57a112c9 | |||
ab69b686ec | |||
6746d25dc2 | |||
be150e105a | |||
ecadeeb156 | |||
219ff73132 | |||
0a9142204d | |||
81b13134d2 | |||
f3a9c722b2 | |||
3be3218115 | |||
5edb21cfe9 | |||
6cd587b008 | |||
6d01366887 | |||
1a347e9cfe | |||
6432e4451e | |||
97f0696002 | |||
e46e11c030 | |||
dc261f668d | |||
b5cced40d2 | |||
040bd28038 | |||
b0ae851427 | |||
01943f594d | |||
01a69668cc | |||
ed7b8df6fe | |||
6c1c914716 | |||
6a0d88ff10 | |||
9097eed137 | |||
c9b5e5f0d7 | |||
c12bac4ce3 | |||
9ae9b2ac9c | |||
7fb3e68b6d | |||
cf65a1f901 | |||
5fb27b6d1e | |||
7b9dac756b | |||
4b2a5f5540 | |||
4af77d532e | |||
812c2ab803 | |||
0ece16f434 | |||
df6cca3714 | |||
c8aa07ae20 | |||
a1d216ac77 | |||
a9d9c60dfa | |||
e58ce1cbea | |||
64827223ec | |||
bddd4fef25 | |||
0eba54fd28 | |||
a4176f966a | |||
2de54ca6a6 | |||
bfd20a73da | |||
3ebce4ac44 | |||
f08c8edd19 | |||
6b3e8e3096 | |||
beb17de7dc | |||
bccadd17d7 | |||
863b1f908e | |||
5a2c1bd1d0 | |||
dbc63194e6 | |||
57c33e4900 | |||
48f1a8042a | |||
fbd5779fe6 | |||
45a4d98267 | |||
0119a4d62a | |||
7560251deb | |||
31655b0a4f | |||
7d15c37ad9 | |||
411beda220 | |||
0e869d1c0c | |||
f25f816428 | |||
c8745e123b | |||
5ea01b8e9f | |||
a11eaea532 | |||
3b6859f483 | |||
bd237ed95d | |||
d24b20a734 | |||
227a4f76f7 | |||
adabb9baa4 | |||
935e7f365f | |||
d4ea03f39e | |||
89aefdda43 | |||
8a83e408d3 | |||
7a1a0337d1 | |||
6bdd4cb02f | |||
38bd758b69 | |||
6aa19ea3e6 | |||
da323b1a46 | |||
2ae90444bb | |||
21e802da33 | |||
e0869fbaf0 | |||
70662091ec | |||
960d2bad64 | |||
7abf7f5e6a | |||
6bad4fd04b | |||
a17f18b3db | |||
3da4900462 | |||
d2d81f6b4b | |||
0b12f56513 | |||
f7e811e34b | |||
037bb37184 | |||
fde510ba96 | |||
14b152a2a7 | |||
ef6b041529 | |||
11ecea1493 | |||
3e2e8b15eb | |||
4249a86fd5 | |||
4a58b0b1c7 | |||
5f93329e96 | |||
59d189e1d3 | |||
2e62abe2d7 | |||
7569b114bf | |||
3c1d0a862f | |||
4d883af77e | |||
e9224a5de0 | |||
af0fbadd80 | |||
79f6c040c7 | |||
f262866148 | |||
78a2a78020 | |||
65e759fb90 | |||
3fc7e4b55e | |||
5857388c2d | |||
5770b41fd4 | |||
d85d890878 | |||
9fbd31d0c8 | |||
c5b7c43293 | |||
7550ef7b0c | |||
805546b78e | |||
59880f4be5 | |||
ee7837a471 | |||
ebbf0adf2f | |||
d9551dc560 | |||
6ea0ab9272 | |||
6e54409512 | |||
f35bc4feaa | |||
c04ab90fd2 | |||
ed02f66ca2 | |||
4b94926651 | |||
f505b39247 | |||
9e44cd89d9 | |||
e7b95c0bde | |||
b72394b004 | |||
1544989fe6 | |||
d7b5e999c1 | |||
9b0210f7b5 | |||
3715266f8c | |||
a4eb607174 | |||
f55fa6a617 | |||
4f9f800cce | |||
cad5d1f0e7 | |||
55ede2b04d | |||
563bdfe4b2 | |||
e2154af85f | |||
9a2bbd7a57 | |||
a8c8246632 | |||
a71c038864 | |||
799217e724 | |||
b3f02f0a58 | |||
c640cf773e | |||
c145666fcb | |||
466bb0eb21 | |||
4612f4b793 | |||
45c7279866 | |||
5cb838af29 | |||
3201fd8d9c | |||
f23c7e9e31 | |||
5b18a8353d | |||
1e81c9b125 | |||
3dae4cb06d | |||
b4745ef55d | |||
348cb2663a | |||
1b69e8a599 | |||
d17ad3cbab | |||
a6d8936ea6 | |||
8b428855b0 | |||
22dc2136e4 | |||
f23f81f575 | |||
7a4255b2bb | |||
d844ab09fa | |||
31c60dcbec | |||
f0749783fe | |||
d34605a018 | |||
1bcb9bf5ee | |||
296bf49e5e | |||
e3dee42b4b | |||
279ccb8bfb | |||
a3c9727b02 | |||
1b886d9843 | |||
066e81b186 | |||
c98d078d4c | |||
cb98183e20 | |||
0e1734b35d | |||
da6326db0f | |||
ad1da129c0 | |||
8a90fe511b | |||
cca1ab69bb | |||
955172d3d3 | |||
4500f41ed3 | |||
7c2f8e5b9b | |||
fb84b53077 | |||
3359b1817b | |||
8eb8d4a1ec | |||
d2723de0f8 | |||
4493156739 | |||
0acb7d470d | |||
8428442dea | |||
f32d6b1bbe | |||
46600f59a3 | |||
01c42387ed | |||
f08438db46 | |||
221730160b | |||
d40b1d37a8 | |||
ecd3aa988f | |||
095787d1f2 | |||
d94d074abe | |||
cdef9822b3 | |||
29c1989e78 | |||
bc3872e631 | |||
7a182ebb12 | |||
5e6f801534 | |||
88808a2ad2 | |||
a4fc954712 | |||
1580cd51aa | |||
3efba24e24 | |||
940dd0167c | |||
6b4f86e7e4 | |||
e5a0c6bc7b | |||
b8fdb38db8 | |||
b2c55c38dc | |||
4fac3fddb8 | |||
c025bae3df | |||
e82b5f8369 | |||
1ec5d84043 | |||
26546a6079 | |||
5078b35341 | |||
a3cbca61ee | |||
6d7750d917 | |||
1c8d7b04e9 | |||
e12a154235 | |||
12f03aff30 | |||
5275f5a810 | |||
442f0fd942 | |||
9feac035eb | |||
21d984c95a | |||
b91a3058fc | |||
2d96fc28c5 | |||
7561017b3d | |||
2b891c0194 | |||
d5fc35df2f | |||
a91f6c1fa0 | |||
89802551a0 | |||
556a6fbd6d | |||
302bec9d37 | |||
e61cd9ba6a | |||
71b45fcdc1 | |||
a2b30a5467 | |||
4063536078 | |||
563fc062cb | |||
5534a2cf7e | |||
cb4ae82b1b | |||
8adca3a9ee | |||
5f15e29c76 | |||
6e1ac26187 | |||
ccee987d05 | |||
09cbbed856 | |||
e1115659e2 | |||
25ef1ced9e | |||
2ccddf0e19 | |||
9a1e0f4cdd | |||
86c6095362 | |||
1d6a0a06c0 | |||
bd1197971f | |||
c28a937384 | |||
b2195219ab | |||
cb7a6a2dfd | |||
51ff8f8df4 | |||
5b271f4ed9 | |||
4577082731 | |||
9a03fb2bd7 | |||
dfba4fa4b1 | |||
f681d4b2e8 | |||
dba385f5bb | |||
027ffeaa92 | |||
c1ab99ba8d | |||
8e032927c6 | |||
f52eab87d2 | |||
954a7751cc | |||
7d68b02f76 | |||
3788aa2746 | |||
260e904326 | |||
9055bbb690 | |||
5e20b9e8ec | |||
adce439ce7 | |||
dc875dd5a8 | |||
378688d2fa | |||
a2200795d7 | |||
3889aa660e | |||
efe68a54a4 | |||
a960d086e1 | |||
3537a3012c | |||
d255e6ad04 | |||
e47096feac | |||
063612e08f | |||
7cfa722684 | |||
53285ab4ff | |||
f46c66a77f | |||
9c8ae315a0 | |||
3ef438412f | |||
ce1373141a | |||
aceecde7b6 | |||
6926abd6f7 | |||
15dec40dfc | |||
4a36cf0c13 | |||
ecc92a6824 | |||
3d243cb8ca | |||
471448a0f1 | |||
ea3e976232 | |||
87f2463233 | |||
49c7877ec3 | |||
be1a9778e6 | |||
ed1d45cea1 | |||
db31b39ce2 | |||
d92d312b0c | |||
6837529096 | |||
b94ae9eff0 | |||
1810c0f355 | |||
eb0f45750d | |||
9ae8fb2355 | |||
512509c2e2 | |||
66815f590c | |||
f60e9bbe3e | |||
f361e3c9a9 | |||
e76dcf07c8 | |||
e6fe489be7 | |||
9ddb606a00 | |||
cd5ee2da18 | |||
4c42a9ddc8 | |||
78b1b0975c | |||
d99881aa46 | |||
df937fe65f | |||
dc742d3c92 | |||
a7b2ad526f | |||
bb804b9f6a | |||
1a00073cf6 | |||
469d07a2d6 | |||
6cf5e31843 | |||
3f1da6387b | |||
99b4858f1d | |||
4374c980ec | |||
ded7637b06 | |||
6a79ab6b5b | |||
7baff75524 | |||
d421c94647 | |||
d78205aa20 | |||
c1228bbd06 | |||
1eb43f684b | |||
4798e44cb7 | |||
a867e9af38 | |||
8fcf257726 | |||
a59d5a1bb8 | |||
b4d6006678 | |||
236c5bab84 | |||
852fdc4360 | |||
f7e85a92e8 | |||
e99fc2ecdc | |||
67785ed99b | |||
45ac4f116b | |||
173e3caf2f | |||
351af57591 | |||
0bda7a1c4b | |||
9a31c107fa | |||
5449fa15ea | |||
3e4e2affa8 | |||
d3a242a0b7 | |||
e5e2887c4d | |||
4eda2e4cb5 | |||
fcee721d58 | |||
7d12e63e34 | |||
8ff8b7929e | |||
66c53daed6 | |||
5de3a34dd0 | |||
b94112e22a | |||
99e925e7bd | |||
d8cba0d346 | |||
39de897621 | |||
9f1a793848 | |||
be9ba88d52 | |||
0084b6fb91 | |||
75b579bafa | |||
cf5ff99d8a | |||
ea204d90b1 | |||
13f6c2c747 | |||
760f827d0d | |||
8c8e0d4dea | |||
b749495bf4 | |||
7e3eabf09f | |||
e636876c9b | |||
68953d7390 | |||
1a52c2d9f8 | |||
6afcf6d4c3 | |||
af139331b1 | |||
e79a798b88 | |||
14fb790e2a | |||
2aab02940d | |||
da07067661 | |||
b2091114b3 | |||
e09128572c | |||
e16966d092 | |||
26a8b065bc | |||
589b98d97e | |||
cb4d9372f8 | |||
6cb7fa8a1b | |||
6cdbb8a0a3 | |||
781fb51c6f | |||
17646f3067 | |||
7a4b665bb5 | |||
571b36d05f | |||
23513cf88c | |||
b475c5c1ec | |||
ee9f26ee04 | |||
8c94cea764 | |||
7c63af5ba9 | |||
7c1eae83e4 | |||
e48ff0e41c | |||
c9e3a2a9b4 |
61
.github/workflows/check.yml
vendored
Normal file
61
.github/workflows/check.yml
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
compile:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
example:
|
||||
- "BASIC"
|
||||
- "DiyProIndoorV4_2"
|
||||
- "DiyProIndoorV3_3"
|
||||
- "TestCO2"
|
||||
- "TestPM"
|
||||
- "TestSht"
|
||||
- "OneOpenAir"
|
||||
fqbn:
|
||||
- "esp8266:esp8266:d1_mini"
|
||||
- "esp32:esp32:esp32c3"
|
||||
include:
|
||||
- fqbn: "esp8266:esp8266:d1_mini"
|
||||
core: "esp8266:esp8266@3.1.2"
|
||||
core_url: "https://arduino.esp8266.com/stable/package_esp8266com_index.json"
|
||||
- fqbn: "esp32:esp32:esp32c3"
|
||||
board_options: "JTAGAdapter=default,CDCOnBoot=cdc,PartitionScheme=min_spiffs,CPUFreq=160,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=verbose,EraseFlash=none"
|
||||
core: "esp32:esp32@2.0.11"
|
||||
exclude:
|
||||
- example: "BASIC"
|
||||
fqbn: "esp32:esp32:esp32c3"
|
||||
- example: "DiyProIndoorV4_2"
|
||||
fqbn: "esp32:esp32:esp32c3"
|
||||
- example: "DiyProIndoorV3_3"
|
||||
fqbn: "esp32:esp32:esp32c3"
|
||||
- example: "OneOpenAir"
|
||||
fqbn: "esp8266:esp8266:d1_mini"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run:
|
||||
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh |
|
||||
sh -s 0.35.3
|
||||
- run: bin/arduino-cli --verbose core install '${{ matrix.core }}'
|
||||
--additional-urls '${{ matrix.core_url }}'
|
||||
- run: bin/arduino-cli --verbose lib install
|
||||
WiFiManager@2.0.16-rc.2
|
||||
Arduino_JSON@0.2.0
|
||||
U8g2@2.34.22
|
||||
# In some cases, actions/checkout@v4 will check out a detached HEAD; for
|
||||
# example, this happens on pull request events, where an hypothetical
|
||||
# PR merge commit is checked out. This tends to confuse
|
||||
# `arduino-cli lib install --git-url`, making it fail with errors such as:
|
||||
# Error installing Git Library: Library install failed: object not found
|
||||
# Create and check out a dummy branch to work around this issue.
|
||||
- run: git checkout -b check
|
||||
- run: bin/arduino-cli --verbose lib install --git-url .
|
||||
env:
|
||||
ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL: "true"
|
||||
- run: bin/arduino-cli --verbose compile 'examples/${{ matrix.example }}'
|
||||
--fqbn '${{ matrix.fqbn }}' --board-options '${{ matrix.board_options }}'
|
||||
# TODO: at this point it would be a good idea to run some smoke tests on
|
||||
# the resulting image (e.g. that it boots successfully and sends metrics)
|
||||
# but that would either require a high fidelity device emulator, or a
|
||||
# "hardware lab" runner that is directly connected to a relevant device.
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,2 +1,5 @@
|
||||
.vscode
|
||||
*.DS_Store
|
||||
build
|
||||
.vscode
|
||||
/.idea/
|
||||
.pio
|
||||
|
231
Calibration-Logs/COM47_2025_01_06.14.06.08.294.txt
Normal file
231
Calibration-Logs/COM47_2025_01_06.14.06.08.294.txt
Normal file
@ -0,0 +1,231 @@
|
||||
14:06:10:414 -> No PM sensor detected on Serial1
|
||||
14:06:10:414 -> Firmware Mode: 0-1PS
|
||||
14:06:10:435 -> Set S8 AbcDays successful
|
||||
14:06:10:435 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
14:06:10:435 -> [ApiClient] Info: begin
|
||||
14:06:10:482 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
14:06:10:482 -> *wm:AutoConnect
|
||||
14:06:10:482 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
14:06:10:985 -> E (10415) wifi:sta is connecting, return error
|
||||
14:06:10:986 -> [ 10170][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
14:06:18:400 -> *wm:AutoConnect: SUCCESS
|
||||
14:06:18:401 -> *wm:STA IP Address: 192.168.100.127
|
||||
14:06:18:401 -> [WifiConnector] Info: Wait for configure portal
|
||||
14:06:18:401 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
14:06:18:417 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
14:06:21:033 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
14:06:21:033 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:06:21:033 -> [ApiClient] Info: DATA: {"wifi":-58,"boot":0}
|
||||
14:06:21:033 -> [ApiClient] Info: Return code: 200
|
||||
14:06:27:034 ->
|
||||
14:06:27:034 -> firmwareCheckForUpdate:
|
||||
14:06:27:034 -> firmwareCheckForUpdate: Perform
|
||||
14:06:27:034 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
14:06:27:625 -> Firmware update skipped, the server returned 400
|
||||
14:06:27:627 -> 3
|
||||
14:06:27:627 -> OTA message:
|
||||
14:06:27:627 ->
|
||||
14:06:28:212 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:06:28:212 -> [ApiClient] Info: Return code: 200
|
||||
14:06:28:213 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:06:28:213 -> [Configure] Info: Parse configure success
|
||||
14:06:28:214 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:06:28:276 -> CO2 (ppm): 0
|
||||
14:06:32:296 -> CO2 (ppm): 0
|
||||
14:06:36:317 -> CO2 (ppm): 448
|
||||
14:06:40:338 -> CO2 (ppm): 436
|
||||
14:06:44:359 -> CO2 (ppm): 425
|
||||
14:06:48:381 -> CO2 (ppm): 423
|
||||
14:06:52:401 -> CO2 (ppm): 420
|
||||
14:06:56:422 -> CO2 (ppm): 411
|
||||
14:07:00:443 -> CO2 (ppm): 409
|
||||
14:07:01:786 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:07:01:786 -> [ApiClient] Info: DATA: {"wifi":-57,"rco2":409,"boot":0,"bootCount":0}
|
||||
14:07:01:786 -> [ApiClient] Info: Return code: 200
|
||||
14:07:01:787 ->
|
||||
14:07:01:787 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:07:01:787 ->
|
||||
14:07:01:812 -> External watchdog feed!
|
||||
14:07:04:464 -> CO2 (ppm): 405
|
||||
14:07:08:485 -> CO2 (ppm): 405
|
||||
14:07:16:527 -> CO2 (ppm): 405
|
||||
14:07:16:527 -> CO2 (ppm): 405
|
||||
14:07:20:548 -> CO2 (ppm): 405
|
||||
14:07:24:569 -> CO2 (ppm): 404
|
||||
14:07:30:051 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:07:30:052 -> [ApiClient] Info: Return code: 200
|
||||
14:07:30:053 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:07:30:054 -> [Configure] Info: Parse configure success
|
||||
14:07:30:055 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:07:30:099 -> CO2 (ppm): 404
|
||||
14:07:34:120 -> CO2 (ppm): 403
|
||||
14:07:38:141 -> CO2 (ppm): 403
|
||||
14:07:42:161 -> CO2 (ppm): 402
|
||||
14:07:46:183 -> CO2 (ppm): 401
|
||||
14:07:50:203 -> CO2 (ppm): 401
|
||||
14:07:54:224 -> CO2 (ppm): 402
|
||||
14:07:58:245 -> CO2 (ppm): 403
|
||||
14:08:02:757 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:08:02:758 -> [ApiClient] Info: DATA: {"wifi":-70,"rco2":403,"boot":1,"bootCount":1}
|
||||
14:08:02:758 -> [ApiClient] Info: Return code: 200
|
||||
14:08:02:758 ->
|
||||
14:08:02:758 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:08:02:758 ->
|
||||
14:08:02:780 -> CO2 (ppm): 404
|
||||
14:08:02:805 -> External watchdog feed!
|
||||
14:08:06:801 -> CO2 (ppm): 403
|
||||
14:08:10:822 -> CO2 (ppm): 403
|
||||
14:08:14:843 -> CO2 (ppm): 402
|
||||
14:08:18:864 -> CO2 (ppm): 401
|
||||
14:08:22:885 -> CO2 (ppm): 401
|
||||
14:08:26:906 -> CO2 (ppm): 400
|
||||
14:08:30:768 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:08:30:768 -> [ApiClient] Info: Return code: 200
|
||||
14:08:30:769 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:08:30:771 -> [Configure] Info: Parse configure success
|
||||
14:08:30:771 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:08:30:927 -> CO2 (ppm): 398
|
||||
14:08:34:948 -> CO2 (ppm): 397
|
||||
14:08:38:968 -> CO2 (ppm): 397
|
||||
14:08:42:989 -> CO2 (ppm): 396
|
||||
14:08:47:010 -> CO2 (ppm): 396
|
||||
14:08:51:031 -> CO2 (ppm): 395
|
||||
14:08:55:052 -> CO2 (ppm): 395
|
||||
14:09:03:684 -> CO2 (ppm): 395
|
||||
14:09:03:684 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:09:03:684 -> [ApiClient] Info: DATA: {"wifi":-57,"rco2":395,"boot":2,"bootCount":2}
|
||||
14:09:03:684 -> [ApiClient] Info: Return code: 200
|
||||
14:09:03:685 ->
|
||||
14:09:03:686 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:09:03:686 ->
|
||||
14:09:03:707 -> CO2 (ppm): 395
|
||||
14:09:03:732 -> External watchdog feed!
|
||||
14:09:07:728 -> CO2 (ppm): 395
|
||||
14:09:11:797 -> CO2 (ppm): 394
|
||||
14:09:19:839 -> CO2 (ppm): 394
|
||||
14:09:19:839 -> CO2 (ppm): 396
|
||||
14:09:23:860 -> CO2 (ppm): 397
|
||||
14:09:27:881 -> CO2 (ppm): 397
|
||||
14:09:31:392 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:09:31:392 -> [ApiClient] Info: Return code: 200
|
||||
14:09:31:394 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:09:31:396 -> [Configure] Info: Parse configure success
|
||||
14:09:31:396 -> [Configure] Info: co2CalibrationRequested: True
|
||||
14:09:31:396 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:09:31:398 -> [StateMachine] Info: CO2 Calibration
|
||||
14:09:31:398 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
14:09:32:398 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
14:09:33:398 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
14:09:35:398 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
14:09:35:398 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
14:09:38:406 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:09:38:420 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:09:38:429 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:09:38:442 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:09:38:443 -> [StateMachine] Info: CO2 Calibration: success
|
||||
14:09:39:443 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
14:09:39:451 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:39:463 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:39:464 -> Flags: 0
|
||||
14:09:40:472 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:40:485 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:40:485 -> Flags: 0
|
||||
14:09:41:493 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:41:506 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:41:506 -> Flags: 0
|
||||
14:09:42:514 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:42:527 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:42:527 -> Flags: 0
|
||||
14:09:43:535 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:43:548 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:43:548 -> Flags: 0
|
||||
14:09:44:556 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:44:569 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:44:569 -> Flags: 0
|
||||
14:09:45:577 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:45:590 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:45:590 -> Flags: 0
|
||||
14:09:46:598 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:46:610 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:46:611 -> Flags: 0
|
||||
14:09:47:619 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:47:631 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:47:632 -> Flags: 0
|
||||
14:09:48:640 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:48:652 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:48:652 -> Flags: 0
|
||||
14:09:49:661 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:49:674 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:49:674 -> Flags: 0
|
||||
14:09:50:682 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:50:694 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:50:695 -> Flags: 0
|
||||
14:09:51:703 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:51:715 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:51:716 -> Flags: 0
|
||||
14:09:52:724 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:57:724 -> Get Acknowladgement Response > 0x00 0xFF
|
||||
14:09:57:724 -> Error getting acknowledgement flags!
|
||||
14:09:58:733 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:58:745 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:58:746 -> Flags: 0
|
||||
14:09:59:754 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:09:59:766 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:09:59:767 -> Flags: 0
|
||||
14:10:00:775 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:00:787 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:00:788 -> Flags: 0
|
||||
14:10:01:795 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:01:808 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:01:809 -> Flags: 0
|
||||
14:10:02:817 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:02:829 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:02:829 -> Flags: 0
|
||||
14:10:03:838 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:03:850 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:03:851 -> Flags: 0
|
||||
14:10:04:859 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:04:871 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:04:871 -> Flags: 0
|
||||
14:10:05:880 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:05:893 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:05:893 -> Flags: 0
|
||||
14:10:06:901 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:06:914 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:06:914 -> Flags: 0
|
||||
14:10:07:923 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:07:935 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:07:936 -> Flags: 0
|
||||
14:10:08:944 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:08:956 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:08:956 -> Flags: 0
|
||||
14:10:09:964 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:09:977 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:09:978 -> Flags: 0
|
||||
14:10:10:985 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:10:998 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:10:998 -> Flags: 0
|
||||
14:10:12:006 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:12:019 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:12:019 -> Flags: 0
|
||||
14:10:13:027 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:13:040 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:13:041 -> Flags: 0
|
||||
14:10:14:048 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:14:061 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:14:061 -> Flags: 0
|
||||
14:10:15:069 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:15:082 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:15:082 -> Flags: 0
|
||||
14:10:16:090 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:16:103 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:16:104 -> Flags: 0
|
||||
14:10:17:111 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:17:123 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:17:124 -> Flags: 0
|
||||
14:10:18:132 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:18:144 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:18:145 -> Flags: 0
|
||||
14:10:19:153 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:10:19:166 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:10:19:166 -> Flags: 0
|
400
Calibration-Logs/COM47_2025_01_06.14.10.30.950.txt
Normal file
400
Calibration-Logs/COM47_2025_01_06.14.10.30.950.txt
Normal file
@ -0,0 +1,400 @@
|
||||
14:10:32:936 -> No PM sensor detected on Serial0
|
||||
14:10:32:936 -> initializing PM sensor
|
||||
14:10:32:936 -> cleared 0 byte(s)
|
||||
14:10:32:936 -> setting active mode
|
||||
14:10:32:936 -> 7 byte(s) written
|
||||
14:10:36:936 -> No PM sensor detected on Serial1
|
||||
14:10:36:936 -> Firmware Mode: 0-1PS
|
||||
14:10:36:957 -> Set S8 AbcDays successful
|
||||
14:10:36:958 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
14:10:36:958 -> [ApiClient] Info: begin
|
||||
14:10:37:002 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
14:10:37:003 -> *wm:AutoConnect
|
||||
14:10:37:003 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
14:10:37:505 -> E (10413) wifi:sta is connecting, return error
|
||||
14:10:37:506 -> [ 10167][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
14:10:44:921 -> *wm:AutoConnect: SUCCESS
|
||||
14:10:44:921 -> *wm:STA IP Address: 192.168.100.127
|
||||
14:10:44:921 -> [WifiConnector] Info: Wait for configure portal
|
||||
14:10:44:921 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
14:10:44:934 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
14:10:47:498 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
14:10:47:498 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:10:47:498 -> [ApiClient] Info: DATA: {"wifi":-64,"boot":0}
|
||||
14:10:47:498 -> [ApiClient] Info: Return code: 200
|
||||
14:10:53:500 ->
|
||||
14:10:53:500 -> firmwareCheckForUpdate:
|
||||
14:10:53:500 -> firmwareCheckForUpdate: Perform
|
||||
14:10:53:501 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
14:10:54:326 -> Firmware update skipped, the server returned 400
|
||||
14:10:54:327 -> 3
|
||||
14:10:54:327 -> OTA message:
|
||||
14:10:54:327 ->
|
||||
14:10:54:950 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:10:54:950 -> [ApiClient] Info: Return code: 200
|
||||
14:10:54:951 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:10:54:953 -> [Configure] Info: Parse configure success
|
||||
14:10:54:954 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:10:59:968 -> Get CO2 failed: 1
|
||||
14:11:03:989 -> CO2 (ppm): 432
|
||||
14:11:08:011 -> CO2 (ppm): 420
|
||||
14:11:12:031 -> CO2 (ppm): 413
|
||||
14:11:16:052 -> CO2 (ppm): 409
|
||||
14:11:20:073 -> CO2 (ppm): 406
|
||||
14:11:24:094 -> CO2 (ppm): 401
|
||||
14:11:28:332 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:11:28:332 -> [ApiClient] Info: DATA: {"wifi":-56,"rco2":401,"boot":0,"bootCount":0}
|
||||
14:11:28:332 -> [ApiClient] Info: Return code: 200
|
||||
14:11:28:333 ->
|
||||
14:11:28:333 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:11:28:333 ->
|
||||
14:11:28:355 -> CO2 (ppm): 402
|
||||
14:11:28:380 -> External watchdog feed!
|
||||
14:11:32:376 -> CO2 (ppm): 395
|
||||
14:11:36:397 -> CO2 (ppm): 393
|
||||
14:11:40:418 -> CO2 (ppm): 393
|
||||
14:11:44:439 -> CO2 (ppm): 393
|
||||
14:11:48:460 -> CO2 (ppm): 393
|
||||
14:11:52:481 -> CO2 (ppm): 393
|
||||
14:11:55:569 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:11:55:569 -> [ApiClient] Info: Return code: 200
|
||||
14:11:55:570 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:11:55:572 -> [Configure] Info: Parse configure success
|
||||
14:11:55:572 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:11:56:501 -> CO2 (ppm): 393
|
||||
14:12:00:523 -> CO2 (ppm): 393
|
||||
14:12:04:543 -> CO2 (ppm): 392
|
||||
14:12:08:565 -> CO2 (ppm): 392
|
||||
14:12:12:585 -> CO2 (ppm): 392
|
||||
14:12:16:606 -> CO2 (ppm): 392
|
||||
14:12:20:627 -> CO2 (ppm): 392
|
||||
14:12:24:648 -> CO2 (ppm): 392
|
||||
14:12:29:363 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:12:29:363 -> [ApiClient] Info: DATA: {"wifi":-56,"rco2":392,"boot":1,"bootCount":1}
|
||||
14:12:29:363 -> [ApiClient] Info: Return code: 200
|
||||
14:12:29:364 ->
|
||||
14:12:29:364 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:12:29:364 ->
|
||||
14:12:29:386 -> CO2 (ppm): 392
|
||||
14:12:29:411 -> External watchdog feed!
|
||||
14:12:33:407 -> CO2 (ppm): 392
|
||||
14:12:37:428 -> CO2 (ppm): 392
|
||||
14:12:41:449 -> CO2 (ppm): 391
|
||||
14:12:45:470 -> CO2 (ppm): 391
|
||||
14:12:49:491 -> CO2 (ppm): 391
|
||||
14:12:53:512 -> CO2 (ppm): 391
|
||||
14:12:56:195 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:12:56:195 -> [ApiClient] Info: Return code: 200
|
||||
14:12:56:202 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:12:56:203 -> [Configure] Info: Parse configure success
|
||||
14:12:56:203 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:12:57:533 -> CO2 (ppm): 391
|
||||
14:13:01:553 -> CO2 (ppm): 391
|
||||
14:13:05:574 -> CO2 (ppm): 391
|
||||
14:13:09:596 -> CO2 (ppm): 391
|
||||
14:13:13:617 -> CO2 (ppm): 391
|
||||
14:13:17:638 -> CO2 (ppm): 391
|
||||
14:13:21:658 -> CO2 (ppm): 391
|
||||
14:13:25:679 -> CO2 (ppm): 392
|
||||
14:13:30:353 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:13:30:353 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":392,"boot":2,"bootCount":2}
|
||||
14:13:30:353 -> [ApiClient] Info: Return code: 200
|
||||
14:13:30:354 ->
|
||||
14:13:30:354 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:13:30:354 ->
|
||||
14:13:30:375 -> CO2 (ppm): 392
|
||||
14:13:30:400 -> External watchdog feed!
|
||||
14:13:34:396 -> CO2 (ppm): 392
|
||||
14:13:38:417 -> CO2 (ppm): 392
|
||||
14:13:42:438 -> CO2 (ppm): 392
|
||||
14:13:46:459 -> CO2 (ppm): 392
|
||||
14:13:50:480 -> CO2 (ppm): 393
|
||||
14:13:54:501 -> CO2 (ppm): 393
|
||||
14:13:56:811 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:13:56:811 -> [ApiClient] Info: Return code: 200
|
||||
14:13:56:813 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:13:56:814 -> [Configure] Info: Parse configure success
|
||||
14:13:56:815 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:13:58:522 -> CO2 (ppm): 393
|
||||
14:14:02:543 -> CO2 (ppm): 393
|
||||
14:14:06:564 -> CO2 (ppm): 392
|
||||
14:14:10:642 -> CO2 (ppm): 392
|
||||
14:14:14:663 -> CO2 (ppm): 392
|
||||
14:14:18:684 -> CO2 (ppm): 392
|
||||
14:14:22:705 -> CO2 (ppm): 392
|
||||
14:14:26:726 -> CO2 (ppm): 392
|
||||
14:14:31:321 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:14:31:321 -> [ApiClient] Info: DATA: {"wifi":-51,"rco2":392,"boot":3,"bootCount":3}
|
||||
14:14:31:321 -> [ApiClient] Info: Return code: 200
|
||||
14:14:31:322 ->
|
||||
14:14:31:322 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:14:31:322 ->
|
||||
14:14:31:342 -> CO2 (ppm): 392
|
||||
14:14:31:367 -> External watchdog feed!
|
||||
14:14:35:363 -> CO2 (ppm): 392
|
||||
14:14:39:384 -> CO2 (ppm): 392
|
||||
14:14:43:405 -> CO2 (ppm): 394
|
||||
14:14:47:426 -> CO2 (ppm): 398
|
||||
14:14:51:447 -> CO2 (ppm): 399
|
||||
14:14:55:468 -> CO2 (ppm): 399
|
||||
14:14:57:431 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:14:57:431 -> [ApiClient] Info: Return code: 200
|
||||
14:14:57:433 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:14:57:434 -> [Configure] Info: Parse configure success
|
||||
14:14:57:435 -> [Configure] Info: co2CalibrationRequested: True
|
||||
14:14:57:435 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:14:57:437 -> [StateMachine] Info: CO2 Calibration
|
||||
14:14:57:437 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
14:14:58:437 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
14:14:59:437 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
14:15:00:437 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
14:15:01:437 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
14:15:04:445 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:15:04:459 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:15:04:467 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:15:04:482 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:15:04:482 -> [StateMachine] Info: CO2 Calibration: success
|
||||
14:15:05:482 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
14:15:05:490 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:05:504 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:05:505 -> Flags: 0
|
||||
14:15:06:512 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:06:525 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:06:525 -> Flags: 0
|
||||
14:15:07:533 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:07:546 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:07:546 -> Flags: 0
|
||||
14:15:08:554 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:08:567 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:08:567 -> Flags: 0
|
||||
14:15:09:575 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:09:587 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:09:588 -> Flags: 0
|
||||
14:15:10:596 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:10:608 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:10:609 -> Flags: 0
|
||||
14:15:11:617 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:11:630 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:11:630 -> Flags: 0
|
||||
14:15:12:638 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:12:651 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:12:651 -> Flags: 0
|
||||
14:15:13:659 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:13:671 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:13:672 -> Flags: 0
|
||||
14:15:14:680 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:14:693 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:14:693 -> Flags: 0
|
||||
14:15:15:701 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:15:713 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:15:714 -> Flags: 0
|
||||
14:15:16:722 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:16:734 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:16:735 -> Flags: 0
|
||||
14:15:17:743 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:17:755 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:17:756 -> Flags: 0
|
||||
14:15:18:764 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:18:776 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:18:777 -> Flags: 0
|
||||
14:15:19:785 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:19:797 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:19:798 -> Flags: 0
|
||||
14:15:20:806 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:20:818 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:20:819 -> Flags: 0
|
||||
14:15:21:827 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:21:839 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:21:840 -> Flags: 0
|
||||
14:15:22:848 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:22:860 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:22:861 -> Flags: 0
|
||||
14:15:23:869 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:23:881 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:23:882 -> Flags: 0
|
||||
14:15:24:890 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:24:902 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:24:903 -> Flags: 0
|
||||
14:15:25:911 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:25:923 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:25:923 -> Flags: 0
|
||||
14:15:26:933 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:26:944 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:26:945 -> Flags: 0
|
||||
14:15:27:953 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:27:965 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:27:966 -> Flags: 0
|
||||
14:15:28:974 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:28:986 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:28:987 -> Flags: 0
|
||||
14:15:29:995 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:30:007 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:30:008 -> Flags: 0
|
||||
14:15:31:016 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:31:028 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:31:029 -> Flags: 0
|
||||
14:15:32:037 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:32:049 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:32:050 -> Flags: 0
|
||||
14:15:33:058 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:33:070 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:33:070 -> Flags: 0
|
||||
14:15:34:079 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:34:091 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:34:092 -> Flags: 0
|
||||
14:15:35:100 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:35:112 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:35:112 -> Flags: 0
|
||||
14:15:36:121 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:36:133 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:36:133 -> Flags: 0
|
||||
14:15:37:141 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:37:154 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:37:154 -> Flags: 0
|
||||
14:15:38:163 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:38:175 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:38:176 -> Flags: 0
|
||||
14:15:39:184 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:39:196 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:39:196 -> Flags: 0
|
||||
14:15:40:205 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:40:217 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:40:217 -> Flags: 0
|
||||
14:15:41:226 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:41:238 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:41:238 -> Flags: 0
|
||||
14:15:42:247 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:42:259 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:42:259 -> Flags: 0
|
||||
14:15:43:268 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:43:280 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:43:281 -> Flags: 0
|
||||
14:15:44:288 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:44:301 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:44:301 -> Flags: 0
|
||||
14:15:45:310 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:45:322 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:45:323 -> Flags: 0
|
||||
14:15:46:331 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:46:370 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:46:370 -> Flags: 0
|
||||
14:15:47:378 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:47:391 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:47:392 -> Flags: 0
|
||||
14:15:48:400 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:48:412 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:48:413 -> Flags: 0
|
||||
14:15:49:420 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:49:433 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:49:433 -> Flags: 0
|
||||
14:15:50:441 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:50:454 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:50:454 -> Flags: 0
|
||||
14:15:51:463 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:51:475 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:51:475 -> Flags: 0
|
||||
14:15:52:484 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:52:496 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:52:496 -> Flags: 0
|
||||
14:15:53:505 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:53:517 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:53:517 -> Flags: 0
|
||||
14:15:54:525 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:54:538 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:54:539 -> Flags: 0
|
||||
14:15:55:547 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:55:559 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:55:559 -> Flags: 0
|
||||
14:15:56:567 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:56:580 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:56:580 -> Flags: 0
|
||||
14:15:57:588 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:57:601 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:57:601 -> Flags: 0
|
||||
14:15:58:609 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:58:622 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:58:622 -> Flags: 0
|
||||
14:15:59:631 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:15:59:643 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:15:59:643 -> Flags: 0
|
||||
14:16:00:651 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:00:664 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:00:664 -> Flags: 0
|
||||
14:16:01:672 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:01:685 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:01:685 -> Flags: 0
|
||||
14:16:02:693 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:02:706 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:02:706 -> Flags: 0
|
||||
14:16:03:714 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:03:727 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:03:727 -> Flags: 0
|
||||
14:16:04:736 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:04:748 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:04:748 -> Flags: 0
|
||||
14:16:05:756 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:05:769 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:05:770 -> Flags: 0
|
||||
14:16:06:777 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:06:790 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:06:790 -> Flags: 0
|
||||
14:16:07:798 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:07:811 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:07:811 -> Flags: 0
|
||||
14:16:08:819 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:08:832 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:08:832 -> Flags: 0
|
||||
14:16:09:840 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:09:853 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:09:853 -> Flags: 0
|
||||
14:16:10:861 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:10:874 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:10:874 -> Flags: 0
|
||||
14:16:11:882 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:11:895 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:11:895 -> Flags: 0
|
||||
14:16:12:903 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:12:916 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:12:916 -> Flags: 0
|
||||
14:16:13:924 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:13:937 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:13:937 -> Flags: 0
|
||||
14:16:14:945 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:14:958 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:14:958 -> Flags: 0
|
||||
14:16:15:966 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:15:978 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:15:979 -> Flags: 0
|
||||
14:16:16:987 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:17:000 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:17:000 -> Flags: 0
|
||||
14:16:18:008 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:18:021 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:18:021 -> Flags: 0
|
||||
14:16:19:029 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:19:041 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:19:042 -> Flags: 0
|
||||
14:16:20:050 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:20:063 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:20:063 -> Flags: 0
|
||||
14:16:21:071 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:21:083 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:21:084 -> Flags: 0
|
||||
14:16:22:092 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:22:104 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:22:105 -> Flags: 0
|
||||
14:16:23:113 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:23:126 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:23:126 -> Flags: 0
|
||||
14:16:24:134 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:24:147 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:24:147 -> Flags: 0
|
||||
14:16:25:155 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:25:167 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:25:168 -> Flags: 0
|
||||
14:16:26:176 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:26:189 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:26:189 -> Flags: 0
|
||||
14:16:27:197 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:16:27:210 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:16:27:210 -> Flags: 0
|
251
Calibration-Logs/COM47_2025_01_06.14.16.35.882.txt
Normal file
251
Calibration-Logs/COM47_2025_01_06.14.16.35.882.txt
Normal file
@ -0,0 +1,251 @@
|
||||
14:16:36:451 -> Detected OPEN_AIR_OUTDOOR
|
||||
14:16:36:451 -> Firmware Version: 3.1.9-dirty
|
||||
14:16:36:597 -> Found S8 on Serial1
|
||||
14:16:36:597 -> Init SGP41 failuire
|
||||
14:16:36:597 -> SGP sensor not found
|
||||
14:16:36:597 -> Can not detect SGP run mode 'O-1PS'
|
||||
14:16:36:598 -> initializing PM sensor
|
||||
14:16:36:598 -> cleared 0 byte(s)
|
||||
14:16:36:598 -> setting active mode
|
||||
14:16:36:598 -> 7 byte(s) written
|
||||
14:16:40:598 -> No PM sensor detected on Serial0
|
||||
14:16:40:598 -> initializing PM sensor
|
||||
14:16:40:598 -> cleared 0 byte(s)
|
||||
14:16:40:598 -> setting active mode
|
||||
14:16:40:598 -> 7 byte(s) written
|
||||
14:16:44:597 -> No PM sensor detected on Serial1
|
||||
14:16:44:598 -> Firmware Mode: 0-1PS
|
||||
14:16:44:618 -> Set S8 AbcDays successful
|
||||
14:16:44:619 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
14:16:44:619 -> [ApiClient] Info: begin
|
||||
14:16:44:664 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
14:16:44:664 -> *wm:AutoConnect
|
||||
14:16:44:664 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
14:16:45:167 -> E (10413) wifi:sta is connecting, return error
|
||||
14:16:45:167 -> [ 10167][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
14:16:52:584 -> *wm:AutoConnect: SUCCESS
|
||||
14:16:52:584 -> *wm:STA IP Address: 192.168.100.127
|
||||
14:16:52:584 -> [WifiConnector] Info: Wait for configure portal
|
||||
14:16:52:584 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
14:16:52:597 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
14:16:52:598 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
14:16:55:092 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:16:55:092 -> [ApiClient] Info: DATA: {"wifi":-67,"boot":0}
|
||||
14:16:55:093 -> [ApiClient] Info: Return code: 200
|
||||
14:17:01:093 ->
|
||||
14:17:01:093 -> firmwareCheckForUpdate:
|
||||
14:17:01:093 -> firmwareCheckForUpdate: Perform
|
||||
14:17:01:094 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
14:17:01:737 -> Firmware update skipped, the server returned 400
|
||||
14:17:01:738 -> 3
|
||||
14:17:01:738 -> OTA message:
|
||||
14:17:01:738 ->
|
||||
14:17:02:371 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:17:02:371 -> [ApiClient] Info: Return code: 200
|
||||
14:17:02:372 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:17:02:374 -> [Configure] Info: Parse configure success
|
||||
14:17:02:375 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:17:07:390 -> Get CO2 failed: 1
|
||||
14:17:11:410 -> CO2 (ppm): 469
|
||||
14:17:19:479 -> CO2 (ppm): 448
|
||||
14:17:19:479 -> CO2 (ppm): 442
|
||||
14:17:27:521 -> CO2 (ppm): 428
|
||||
14:17:27:521 -> CO2 (ppm): 422
|
||||
14:17:31:542 -> CO2 (ppm): 423
|
||||
14:17:36:092 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:17:36:092 -> [ApiClient] Info: DATA: {"wifi":-56,"rco2":423,"boot":0,"bootCount":0}
|
||||
14:17:36:092 -> [ApiClient] Info: Return code: 200
|
||||
14:17:36:093 ->
|
||||
14:17:36:093 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:17:36:093 ->
|
||||
14:17:36:115 -> CO2 (ppm): 417
|
||||
14:17:36:140 -> External watchdog feed!
|
||||
14:17:40:136 -> CO2 (ppm): 418
|
||||
14:17:44:157 -> CO2 (ppm): 417
|
||||
14:17:48:178 -> CO2 (ppm): 417
|
||||
14:17:52:199 -> CO2 (ppm): 415
|
||||
14:17:56:220 -> CO2 (ppm): 414
|
||||
14:18:00:241 -> CO2 (ppm): 413
|
||||
14:18:02:980 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:18:02:980 -> [ApiClient] Info: Return code: 200
|
||||
14:18:02:981 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:18:02:983 -> [Configure] Info: Parse configure success
|
||||
14:18:02:984 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:18:04:262 -> CO2 (ppm): 410
|
||||
14:18:08:282 -> CO2 (ppm): 407
|
||||
14:18:12:303 -> CO2 (ppm): 406
|
||||
14:18:16:325 -> CO2 (ppm): 404
|
||||
14:18:20:345 -> CO2 (ppm): 404
|
||||
14:18:24:366 -> CO2 (ppm): 405
|
||||
14:18:28:387 -> CO2 (ppm): 407
|
||||
14:18:32:408 -> CO2 (ppm): 408
|
||||
14:18:37:079 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:18:37:079 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":408,"boot":1,"bootCount":1}
|
||||
14:18:37:079 -> [ApiClient] Info: Return code: 200
|
||||
14:18:37:080 ->
|
||||
14:18:37:080 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:18:37:080 ->
|
||||
14:18:37:103 -> CO2 (ppm): 408
|
||||
14:18:37:127 -> External watchdog feed!
|
||||
14:18:41:123 -> CO2 (ppm): 408
|
||||
14:18:45:144 -> CO2 (ppm): 407
|
||||
14:18:49:165 -> CO2 (ppm): 406
|
||||
14:18:53:186 -> CO2 (ppm): 406
|
||||
14:18:57:207 -> CO2 (ppm): 405
|
||||
14:19:01:228 -> CO2 (ppm): 404
|
||||
14:19:03:610 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:19:03:610 -> [ApiClient] Info: Return code: 200
|
||||
14:19:03:612 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:19:03:614 -> [Configure] Info: Parse configure success
|
||||
14:19:03:615 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:19:05:249 -> CO2 (ppm): 403
|
||||
14:19:09:269 -> CO2 (ppm): 402
|
||||
14:19:13:290 -> CO2 (ppm): 401
|
||||
14:19:17:311 -> CO2 (ppm): 400
|
||||
14:19:21:332 -> CO2 (ppm): 399
|
||||
14:19:29:374 -> CO2 (ppm): 398
|
||||
14:19:29:374 -> CO2 (ppm): 398
|
||||
14:19:33:395 -> CO2 (ppm): 397
|
||||
14:19:38:110 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:19:38:110 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":397,"boot":2,"bootCount":2}
|
||||
14:19:38:110 -> [ApiClient] Info: Return code: 200
|
||||
14:19:38:111 ->
|
||||
14:19:38:111 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:19:38:111 ->
|
||||
14:19:38:133 -> CO2 (ppm): 398
|
||||
14:19:38:158 -> External watchdog feed!
|
||||
14:19:42:154 -> CO2 (ppm): 397
|
||||
14:19:46:175 -> CO2 (ppm): 398
|
||||
14:19:54:217 -> CO2 (ppm): 397
|
||||
14:19:54:217 -> CO2 (ppm): 397
|
||||
14:19:58:238 -> CO2 (ppm): 396
|
||||
14:20:02:259 -> CO2 (ppm): 396
|
||||
14:20:04:259 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:20:04:259 -> [ApiClient] Info: Return code: 200
|
||||
14:20:04:260 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:20:04:262 -> [Configure] Info: Parse configure success
|
||||
14:20:04:262 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:20:10:300 -> CO2 (ppm): 396
|
||||
14:20:10:300 -> CO2 (ppm): 396
|
||||
14:20:14:322 -> CO2 (ppm): 405
|
||||
14:20:18:342 -> CO2 (ppm): 412
|
||||
14:20:22:363 -> CO2 (ppm): 415
|
||||
14:20:26:384 -> CO2 (ppm): 417
|
||||
14:20:30:405 -> CO2 (ppm): 418
|
||||
14:20:34:426 -> CO2 (ppm): 417
|
||||
14:20:39:140 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:20:39:140 -> [ApiClient] Info: DATA: {"wifi":-56,"rco2":417,"boot":3,"bootCount":3}
|
||||
14:20:39:140 -> [ApiClient] Info: Return code: 200
|
||||
14:20:39:141 ->
|
||||
14:20:39:141 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:20:39:141 ->
|
||||
14:20:39:163 -> CO2 (ppm): 413
|
||||
14:20:39:188 -> External watchdog feed!
|
||||
14:20:43:184 -> CO2 (ppm): 410
|
||||
14:20:47:205 -> CO2 (ppm): 408
|
||||
14:20:51:226 -> CO2 (ppm): 406
|
||||
14:20:55:247 -> CO2 (ppm): 404
|
||||
14:20:59:268 -> CO2 (ppm): 404
|
||||
14:21:03:289 -> CO2 (ppm): 403
|
||||
14:21:04:849 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:21:04:849 -> [ApiClient] Info: Return code: 200
|
||||
14:21:04:850 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:21:04:852 -> [Configure] Info: Parse configure success
|
||||
14:21:04:853 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:21:07:310 -> CO2 (ppm): 408
|
||||
14:21:11:331 -> CO2 (ppm): 414
|
||||
14:21:15:352 -> CO2 (ppm): 418
|
||||
14:21:19:373 -> CO2 (ppm): 420
|
||||
14:21:27:414 -> CO2 (ppm): 420
|
||||
14:21:27:414 -> CO2 (ppm): 420
|
||||
14:21:31:436 -> CO2 (ppm): 418
|
||||
14:21:35:456 -> CO2 (ppm): 417
|
||||
14:21:40:170 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:21:40:170 -> [ApiClient] Info: DATA: {"wifi":-57,"rco2":417,"boot":4,"bootCount":4}
|
||||
14:21:40:170 -> [ApiClient] Info: Return code: 200
|
||||
14:21:40:171 ->
|
||||
14:21:40:171 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:21:40:171 ->
|
||||
14:21:40:193 -> CO2 (ppm): 415
|
||||
14:21:40:218 -> External watchdog feed!
|
||||
14:21:44:214 -> CO2 (ppm): 413
|
||||
14:21:48:235 -> CO2 (ppm): 410
|
||||
14:21:52:256 -> CO2 (ppm): 409
|
||||
14:21:56:277 -> CO2 (ppm): 407
|
||||
14:22:00:298 -> CO2 (ppm): 405
|
||||
14:22:04:319 -> CO2 (ppm): 429
|
||||
14:22:05:564 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:22:05:564 -> [ApiClient] Info: Return code: 200
|
||||
14:22:05:566 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:22:05:567 -> [Configure] Info: Parse configure success
|
||||
14:22:05:567 -> [Configure] Info: co2CalibrationRequested: True
|
||||
14:22:05:568 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:22:05:570 -> [StateMachine] Info: CO2 Calibration
|
||||
14:22:05:570 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
14:22:06:570 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
14:22:07:570 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
14:22:08:570 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
14:22:09:570 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
14:22:12:578 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:22:12:592 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:22:12:600 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:22:12:614 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:22:12:614 -> [StateMachine] Info: CO2 Calibration: success
|
||||
14:22:13:614 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
14:22:13:622 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:13:636 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:13:636 -> Flags: 0
|
||||
14:22:14:644 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:14:656 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:14:657 -> Flags: 0
|
||||
14:22:15:665 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:15:677 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:15:678 -> Flags: 0
|
||||
14:22:16:686 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:16:699 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:16:699 -> Flags: 0
|
||||
14:22:17:707 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:17:720 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:17:720 -> Flags: 0
|
||||
14:22:18:728 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:18:741 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:18:741 -> Flags: 0
|
||||
14:22:19:749 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:19:762 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:19:762 -> Flags: 0
|
||||
14:22:20:770 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:20:783 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:20:783 -> Flags: 0
|
||||
14:22:21:791 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:21:804 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:21:804 -> Flags: 0
|
||||
14:22:22:812 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:22:825 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:22:826 -> Flags: 0
|
||||
14:22:23:833 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:23:846 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:23:846 -> Flags: 0
|
||||
14:22:24:854 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:24:866 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:24:867 -> Flags: 0
|
||||
14:22:25:875 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:25:887 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:25:888 -> Flags: 0
|
||||
14:22:26:896 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:26:908 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:26:909 -> Flags: 0
|
||||
14:22:27:917 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:27:929 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:27:930 -> Flags: 0
|
||||
14:22:28:938 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:28:950 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:28:951 -> Flags: 0
|
||||
14:22:29:959 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:29:971 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:29:972 -> Flags: 0
|
||||
14:22:30:980 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:30:992 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:30:993 -> Flags: 0
|
||||
14:22:32:001 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:22:32:013 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:22:32:013 -> Flags: 0
|
293
Calibration-Logs/COM47_2025_01_06.14.22.51.006.txt
Normal file
293
Calibration-Logs/COM47_2025_01_06.14.22.51.006.txt
Normal file
@ -0,0 +1,293 @@
|
||||
14:22:56:536 -> *wm:AutoConnect: SUCCESS
|
||||
14:22:56:536 -> *wm:STA IP Address: 192.168.100.127
|
||||
14:22:56:537 -> [WifiConnector] Info: Wait for configure portal
|
||||
14:22:56:537 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
14:22:56:550 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
14:22:56:550 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
14:22:59:122 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:22:59:122 -> [ApiClient] Info: DATA: {"wifi":-58,"boot":0}
|
||||
14:22:59:122 -> [ApiClient] Info: Return code: 200
|
||||
14:23:05:123 ->
|
||||
14:23:05:123 -> firmwareCheckForUpdate:
|
||||
14:23:05:123 -> firmwareCheckForUpdate: Perform
|
||||
14:23:05:124 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
14:23:05:767 -> Firmware update skipped, the server returned 400
|
||||
14:23:05:768 -> 3
|
||||
14:23:05:768 -> OTA message:
|
||||
14:23:05:768 ->
|
||||
14:23:06:391 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:23:06:391 -> [ApiClient] Info: Return code: 200
|
||||
14:23:06:392 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:23:06:393 -> [Configure] Info: Parse configure success
|
||||
14:23:06:394 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:23:11:409 -> Get CO2 failed: 1
|
||||
14:23:16:439 -> [StateMachine] Info: Setting S8 from off to 8 days successful
|
||||
14:23:16:465 -> CO2 (ppm): 0
|
||||
14:23:20:486 -> CO2 (ppm): 634
|
||||
14:23:24:507 -> CO2 (ppm): 582
|
||||
14:23:28:528 -> CO2 (ppm): 546
|
||||
14:23:32:548 -> CO2 (ppm): 515
|
||||
14:23:36:570 -> CO2 (ppm): 498
|
||||
14:23:39:977 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:23:39:977 -> [ApiClient] Info: DATA: {"wifi":-57,"rco2":498,"boot":0,"bootCount":0}
|
||||
14:23:39:977 -> [ApiClient] Info: Return code: 200
|
||||
14:23:39:978 ->
|
||||
14:23:39:979 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:23:39:979 ->
|
||||
14:23:40:003 -> External watchdog feed!
|
||||
14:23:40:591 -> CO2 (ppm): 478
|
||||
14:23:44:611 -> CO2 (ppm): 462
|
||||
14:23:48:633 -> CO2 (ppm): 456
|
||||
14:23:52:653 -> CO2 (ppm): 444
|
||||
14:23:56:674 -> CO2 (ppm): 443
|
||||
14:24:00:695 -> CO2 (ppm): 442
|
||||
14:24:04:716 -> CO2 (ppm): 438
|
||||
14:24:07:011 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:24:07:012 -> [ApiClient] Info: Return code: 200
|
||||
14:24:07:013 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:24:07:014 -> [Configure] Info: Parse configure success
|
||||
14:24:07:015 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:24:08:737 -> CO2 (ppm): 453
|
||||
14:24:12:758 -> CO2 (ppm): 485
|
||||
14:24:16:779 -> CO2 (ppm): 516
|
||||
14:24:20:800 -> CO2 (ppm): 533
|
||||
14:24:24:822 -> CO2 (ppm): 539
|
||||
14:24:28:842 -> CO2 (ppm): 536
|
||||
14:24:32:863 -> CO2 (ppm): 527
|
||||
14:24:36:884 -> CO2 (ppm): 516
|
||||
14:24:41:007 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:24:41:008 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":516,"boot":1,"bootCount":1}
|
||||
14:24:41:008 -> [ApiClient] Info: Return code: 200
|
||||
14:24:41:009 ->
|
||||
14:24:41:009 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:24:41:009 ->
|
||||
14:24:41:031 -> CO2 (ppm): 503
|
||||
14:24:41:055 -> External watchdog feed!
|
||||
14:24:45:052 -> CO2 (ppm): 490
|
||||
14:24:49:073 -> CO2 (ppm): 478
|
||||
14:24:53:093 -> CO2 (ppm): 466
|
||||
14:24:57:115 -> CO2 (ppm): 457
|
||||
14:25:01:135 -> CO2 (ppm): 447
|
||||
14:25:05:156 -> CO2 (ppm): 440
|
||||
14:25:07:641 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:25:07:641 -> [ApiClient] Info: Return code: 200
|
||||
14:25:07:642 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:25:07:643 -> [Configure] Info: Parse configure success
|
||||
14:25:07:644 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:25:09:177 -> CO2 (ppm): 433
|
||||
14:25:13:198 -> CO2 (ppm): 428
|
||||
14:25:17:219 -> CO2 (ppm): 424
|
||||
14:25:21:240 -> CO2 (ppm): 418
|
||||
14:25:25:261 -> CO2 (ppm): 414
|
||||
14:25:29:282 -> CO2 (ppm): 412
|
||||
14:25:33:303 -> CO2 (ppm): 410
|
||||
14:25:37:324 -> CO2 (ppm): 408
|
||||
14:25:42:048 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:25:42:048 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":408,"boot":2,"bootCount":2}
|
||||
14:25:42:062 -> [ApiClient] Info: Return code: 200
|
||||
14:25:42:063 ->
|
||||
14:25:42:063 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:25:42:063 ->
|
||||
14:25:42:072 -> CO2 (ppm): 405
|
||||
14:25:42:097 -> External watchdog feed!
|
||||
14:25:46:093 -> CO2 (ppm): 405
|
||||
14:25:50:114 -> CO2 (ppm): 406
|
||||
14:25:54:135 -> CO2 (ppm): 406
|
||||
14:25:58:156 -> CO2 (ppm): 405
|
||||
14:26:02:176 -> CO2 (ppm): 405
|
||||
14:26:06:197 -> CO2 (ppm): 404
|
||||
14:26:08:252 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:26:08:252 -> [ApiClient] Info: Return code: 200
|
||||
14:26:08:253 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:26:08:255 -> [Configure] Info: Parse configure success
|
||||
14:26:08:255 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:26:14:239 -> CO2 (ppm): 404
|
||||
14:26:14:239 -> CO2 (ppm): 403
|
||||
14:26:18:260 -> CO2 (ppm): 402
|
||||
14:26:26:302 -> CO2 (ppm): 403
|
||||
14:26:26:302 -> CO2 (ppm): 403
|
||||
14:26:30:323 -> CO2 (ppm): 403
|
||||
14:26:34:344 -> CO2 (ppm): 403
|
||||
14:26:38:365 -> CO2 (ppm): 403
|
||||
14:26:43:018 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:26:43:018 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":403,"boot":3,"bootCount":3}
|
||||
14:26:43:018 -> [ApiClient] Info: Return code: 200
|
||||
14:26:43:019 ->
|
||||
14:26:43:019 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:26:43:019 ->
|
||||
14:26:43:041 -> CO2 (ppm): 403
|
||||
14:26:43:066 -> External watchdog feed!
|
||||
14:26:47:062 -> CO2 (ppm): 403
|
||||
14:26:51:083 -> CO2 (ppm): 404
|
||||
14:26:55:103 -> CO2 (ppm): 445
|
||||
14:26:59:125 -> CO2 (ppm): 488
|
||||
14:27:03:145 -> CO2 (ppm): 524
|
||||
14:27:07:166 -> CO2 (ppm): 547
|
||||
14:27:08:871 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:27:08:871 -> [ApiClient] Info: Return code: 200
|
||||
14:27:08:873 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:27:08:874 -> [Configure] Info: Parse configure success
|
||||
14:27:08:875 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:27:11:187 -> CO2 (ppm): 563
|
||||
14:27:15:209 -> CO2 (ppm): 603
|
||||
14:27:19:229 -> CO2 (ppm): 654
|
||||
14:27:23:250 -> CO2 (ppm): 712
|
||||
14:27:27:271 -> CO2 (ppm): 746
|
||||
14:27:31:292 -> CO2 (ppm): 753
|
||||
14:27:35:313 -> CO2 (ppm): 741
|
||||
14:27:39:334 -> CO2 (ppm): 719
|
||||
14:27:43:946 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:27:43:946 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":719,"boot":4,"bootCount":4}
|
||||
14:27:43:946 -> [ApiClient] Info: Return code: 200
|
||||
14:27:43:968 ->
|
||||
14:27:43:968 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:27:43:968 ->
|
||||
14:27:43:968 -> CO2 (ppm): 692
|
||||
14:27:43:993 -> External watchdog feed!
|
||||
14:27:47:989 -> CO2 (ppm): 660
|
||||
14:27:52:010 -> CO2 (ppm): 630
|
||||
14:27:56:031 -> CO2 (ppm): 600
|
||||
14:28:00:052 -> CO2 (ppm): 574
|
||||
14:28:04:073 -> CO2 (ppm): 555
|
||||
14:28:08:094 -> CO2 (ppm): 548
|
||||
14:28:09:493 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:28:09:493 -> [ApiClient] Info: Return code: 200
|
||||
14:28:09:494 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:28:09:497 -> [Configure] Info: Parse configure success
|
||||
14:28:12:115 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:28:12:115 -> CO2 (ppm): 551
|
||||
14:28:16:136 -> CO2 (ppm): 553
|
||||
14:28:20:157 -> CO2 (ppm): 550
|
||||
14:28:24:178 -> CO2 (ppm): 543
|
||||
14:28:28:199 -> CO2 (ppm): 534
|
||||
14:28:32:220 -> CO2 (ppm): 523
|
||||
14:28:36:240 -> CO2 (ppm): 511
|
||||
14:28:40:261 -> CO2 (ppm): 498
|
||||
14:28:44:917 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:28:44:917 -> [ApiClient] Info: DATA: {"wifi":-53,"rco2":498,"boot":5,"bootCount":5}
|
||||
14:28:44:917 -> [ApiClient] Info: Return code: 200
|
||||
14:28:44:918 ->
|
||||
14:28:44:918 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:28:44:918 ->
|
||||
14:28:44:940 -> CO2 (ppm): 476
|
||||
14:28:44:965 -> External watchdog feed!
|
||||
14:28:48:961 -> CO2 (ppm): 466
|
||||
14:28:52:982 -> CO2 (ppm): 458
|
||||
14:28:57:003 -> CO2 (ppm): 450
|
||||
14:29:01:024 -> CO2 (ppm): 442
|
||||
14:29:05:045 -> CO2 (ppm): 435
|
||||
14:29:09:066 -> CO2 (ppm): 432
|
||||
14:29:10:114 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:29:10:114 -> [ApiClient] Info: Return code: 200
|
||||
14:29:10:115 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:29:10:117 -> [Configure] Info: Parse configure success
|
||||
14:29:10:117 -> [Configure] Info: co2CalibrationRequested: True
|
||||
14:29:10:118 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:29:10:119 -> [StateMachine] Info: CO2 Calibration
|
||||
14:29:10:120 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
14:29:11:119 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
14:29:12:119 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
14:29:13:119 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
14:29:14:119 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
14:29:17:128 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:29:17:141 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:29:17:150 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:29:17:164 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:29:17:165 -> [StateMachine] Info: CO2 Calibration: success
|
||||
14:29:18:165 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
14:29:18:173 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:18:186 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:18:186 -> Flags: 0
|
||||
14:29:19:195 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:19:207 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:19:208 -> Flags: 0
|
||||
14:29:20:215 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:20:228 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:20:228 -> Flags: 0
|
||||
14:29:21:237 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:21:249 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:21:249 -> Flags: 0
|
||||
14:29:22:258 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:22:270 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:22:270 -> Flags: 0
|
||||
14:29:23:279 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:23:291 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:23:291 -> Flags: 0
|
||||
14:29:24:300 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:24:312 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:24:313 -> Flags: 0
|
||||
14:29:25:320 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:25:333 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:25:333 -> Flags: 0
|
||||
14:29:26:341 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:26:354 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:26:354 -> Flags: 0
|
||||
14:29:27:362 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:27:375 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:27:375 -> Flags: 0
|
||||
14:29:28:384 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:28:396 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:28:396 -> Flags: 0
|
||||
14:29:29:404 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:29:417 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:29:417 -> Flags: 0
|
||||
14:29:30:425 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:30:438 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:30:438 -> Flags: 0
|
||||
14:29:31:446 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:31:459 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:31:459 -> Flags: 0
|
||||
14:29:32:468 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:32:480 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:32:480 -> Flags: 0
|
||||
14:29:33:489 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:33:501 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:33:501 -> Flags: 0
|
||||
14:29:34:509 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:34:522 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:34:522 -> Flags: 0
|
||||
14:29:35:530 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:35:543 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:35:543 -> Flags: 0
|
||||
14:29:36:551 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:36:564 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:36:564 -> Flags: 0
|
||||
14:29:37:574 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:37:585 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:37:585 -> Flags: 0
|
||||
14:29:38:594 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:38:606 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:38:606 -> Flags: 0
|
||||
14:29:39:614 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:39:627 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:39:627 -> Flags: 0
|
||||
14:29:40:635 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:40:650 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:40:650 -> Flags: 0
|
||||
14:29:41:656 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:41:669 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:41:675 -> Flags: 0
|
||||
14:29:42:677 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:42:690 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:42:690 -> Flags: 0
|
||||
14:29:43:698 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:43:711 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:43:711 -> Flags: 0
|
||||
14:29:44:719 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:44:732 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:44:732 -> Flags: 0
|
||||
14:29:45:740 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:45:753 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:45:753 -> Flags: 0
|
||||
14:29:46:761 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:46:774 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:46:774 -> Flags: 0
|
||||
14:29:47:782 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:47:795 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:47:795 -> Flags: 0
|
||||
14:29:48:803 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:48:816 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:48:816 -> Flags: 0
|
||||
14:29:49:824 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:29:49:837 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:29:49:838 -> Flags: 0
|
445
Calibration-Logs/COM47_2025_01_06.14.29.58.471.txt
Normal file
445
Calibration-Logs/COM47_2025_01_06.14.29.58.471.txt
Normal file
@ -0,0 +1,445 @@
|
||||
14:30:01:902 -> No PM sensor detected on Serial0
|
||||
14:30:01:902 -> initializing PM sensor
|
||||
14:30:01:902 -> cleared 0 byte(s)
|
||||
14:30:01:903 -> setting active mode
|
||||
14:30:01:903 -> 7 byte(s) written
|
||||
14:30:05:902 -> No PM sensor detected on Serial1
|
||||
14:30:05:902 -> Firmware Mode: 0-1PS
|
||||
14:30:05:922 -> Set S8 AbcDays successful
|
||||
14:30:05:923 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
14:30:05:923 -> [ApiClient] Info: begin
|
||||
14:30:05:968 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
14:30:05:968 -> *wm:AutoConnect
|
||||
14:30:05:968 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
14:30:06:471 -> E (10413) wifi:sta is connecting, return error
|
||||
14:30:06:472 -> [ 10167][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
14:30:13:787 -> *wm:AutoConnect: SUCCESS
|
||||
14:30:13:787 -> *wm:STA IP Address: 192.168.100.127
|
||||
14:30:13:787 -> [WifiConnector] Info: Wait for configure portal
|
||||
14:30:13:787 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
14:30:13:801 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
14:30:16:300 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
14:30:16:301 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:30:16:301 -> [ApiClient] Info: DATA: {"wifi":-56,"boot":0}
|
||||
14:30:16:301 -> [ApiClient] Info: Return code: 200
|
||||
14:30:22:301 ->
|
||||
14:30:22:301 -> firmwareCheckForUpdate:
|
||||
14:30:22:301 -> firmwareCheckForUpdate: Perform
|
||||
14:30:22:302 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
14:30:22:963 -> Firmware update skipped, the server returned 400
|
||||
14:30:22:965 -> 3
|
||||
14:30:22:965 -> OTA message:
|
||||
14:30:22:965 ->
|
||||
14:30:23:557 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:30:23:557 -> [ApiClient] Info: Return code: 200
|
||||
14:30:23:558 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:30:23:560 -> [Configure] Info: Parse configure success
|
||||
14:30:23:560 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:30:23:588 -> CO2 (ppm): 411
|
||||
14:30:27:608 -> CO2 (ppm): 407
|
||||
14:30:31:630 -> CO2 (ppm): 408
|
||||
14:30:35:650 -> CO2 (ppm): 406
|
||||
14:30:39:672 -> CO2 (ppm): 406
|
||||
14:30:43:692 -> CO2 (ppm): 406
|
||||
14:30:47:713 -> CO2 (ppm): 406
|
||||
14:30:51:734 -> CO2 (ppm): 406
|
||||
14:30:55:761 -> CO2 (ppm): 406
|
||||
14:30:57:334 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:30:57:335 -> [ApiClient] Info: DATA: {"wifi":-57,"rco2":406,"boot":0,"bootCount":0}
|
||||
14:30:57:335 -> [ApiClient] Info: Return code: 200
|
||||
14:30:57:335 ->
|
||||
14:30:57:335 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:30:57:335 ->
|
||||
14:30:57:352 -> External watchdog feed!
|
||||
14:30:59:776 -> CO2 (ppm): 406
|
||||
14:31:03:797 -> CO2 (ppm): 406
|
||||
14:31:07:818 -> CO2 (ppm): 406
|
||||
14:31:11:856 -> CO2 (ppm): 405
|
||||
14:31:15:860 -> CO2 (ppm): 405
|
||||
14:31:19:881 -> CO2 (ppm): 405
|
||||
14:31:24:154 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:31:24:154 -> [ApiClient] Info: Return code: 200
|
||||
14:31:24:156 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:31:24:157 -> [Configure] Info: Parse configure success
|
||||
14:31:24:158 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:31:24:202 -> CO2 (ppm): 405
|
||||
14:31:28:223 -> CO2 (ppm): 411
|
||||
14:31:32:244 -> CO2 (ppm): 424
|
||||
14:31:40:286 -> CO2 (ppm): 433
|
||||
14:31:40:286 -> CO2 (ppm): 438
|
||||
14:31:48:327 -> CO2 (ppm): 441
|
||||
14:31:48:327 -> CO2 (ppm): 441
|
||||
14:31:52:348 -> CO2 (ppm): 439
|
||||
14:31:56:368 -> CO2 (ppm): 437
|
||||
14:31:58:357 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:31:58:357 -> [ApiClient] Info: DATA: {"wifi":-61,"rco2":437,"boot":1,"bootCount":1}
|
||||
14:31:58:357 -> [ApiClient] Info: Return code: 200
|
||||
14:31:58:358 ->
|
||||
14:31:58:358 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:31:58:358 ->
|
||||
14:31:58:383 -> External watchdog feed!
|
||||
14:32:00:389 -> CO2 (ppm): 434
|
||||
14:32:04:410 -> CO2 (ppm): 430
|
||||
14:32:08:431 -> CO2 (ppm): 427
|
||||
14:32:12:452 -> CO2 (ppm): 424
|
||||
14:32:16:473 -> CO2 (ppm): 422
|
||||
14:32:20:494 -> CO2 (ppm): 419
|
||||
14:32:24:775 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:32:24:775 -> [ApiClient] Info: Return code: 200
|
||||
14:32:24:776 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:32:24:778 -> [Configure] Info: Parse configure success
|
||||
14:32:24:779 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:32:24:823 -> CO2 (ppm): 418
|
||||
14:32:28:844 -> CO2 (ppm): 416
|
||||
14:32:32:865 -> CO2 (ppm): 414
|
||||
14:32:36:886 -> CO2 (ppm): 412
|
||||
14:32:40:907 -> CO2 (ppm): 411
|
||||
14:32:44:928 -> CO2 (ppm): 410
|
||||
14:32:48:948 -> CO2 (ppm): 409
|
||||
14:32:56:991 -> CO2 (ppm): 408
|
||||
14:32:56:991 -> CO2 (ppm): 407
|
||||
14:32:59:387 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:32:59:387 -> [ApiClient] Info: DATA: {"wifi":-60,"rco2":407,"boot":2,"bootCount":2}
|
||||
14:32:59:388 -> [ApiClient] Info: Return code: 200
|
||||
14:32:59:389 ->
|
||||
14:32:59:389 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:32:59:389 ->
|
||||
14:32:59:413 -> External watchdog feed!
|
||||
14:33:01:011 -> CO2 (ppm): 407
|
||||
14:33:05:032 -> CO2 (ppm): 406
|
||||
14:33:09:053 -> CO2 (ppm): 405
|
||||
14:33:13:073 -> CO2 (ppm): 405
|
||||
14:33:17:094 -> CO2 (ppm): 405
|
||||
14:33:21:115 -> CO2 (ppm): 405
|
||||
14:33:25:394 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:33:25:394 -> [ApiClient] Info: Return code: 200
|
||||
14:33:25:396 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:33:25:397 -> [Configure] Info: Parse configure success
|
||||
14:33:25:398 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:33:25:442 -> CO2 (ppm): 404
|
||||
14:33:29:463 -> CO2 (ppm): 405
|
||||
14:33:33:484 -> CO2 (ppm): 405
|
||||
14:33:37:504 -> CO2 (ppm): 405
|
||||
14:33:41:525 -> CO2 (ppm): 405
|
||||
14:33:45:546 -> CO2 (ppm): 405
|
||||
14:33:49:568 -> CO2 (ppm): 405
|
||||
14:33:53:588 -> CO2 (ppm): 405
|
||||
14:33:57:609 -> CO2 (ppm): 405
|
||||
14:34:00:416 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:34:00:416 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":405,"boot":3,"bootCount":3}
|
||||
14:34:00:416 -> [ApiClient] Info: Return code: 200
|
||||
14:34:00:417 ->
|
||||
14:34:00:417 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:34:00:417 ->
|
||||
14:34:00:442 -> External watchdog feed!
|
||||
14:34:01:630 -> CO2 (ppm): 405
|
||||
14:34:05:651 -> CO2 (ppm): 404
|
||||
14:34:09:672 -> CO2 (ppm): 404
|
||||
14:34:13:693 -> CO2 (ppm): 404
|
||||
14:34:17:714 -> CO2 (ppm): 404
|
||||
14:34:26:015 -> CO2 (ppm): 404
|
||||
14:34:26:015 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:34:26:016 -> [ApiClient] Info: Return code: 200
|
||||
14:34:26:017 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:34:26:018 -> [Configure] Info: Parse configure success
|
||||
14:34:26:019 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:34:26:063 -> CO2 (ppm): 404
|
||||
14:34:30:084 -> CO2 (ppm): 403
|
||||
14:34:34:105 -> CO2 (ppm): 403
|
||||
14:34:42:147 -> CO2 (ppm): 403
|
||||
14:34:42:147 -> CO2 (ppm): 403
|
||||
14:34:46:168 -> CO2 (ppm): 403
|
||||
14:34:50:189 -> CO2 (ppm): 403
|
||||
14:34:54:209 -> CO2 (ppm): 403
|
||||
14:34:58:230 -> CO2 (ppm): 403
|
||||
14:35:01:448 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:35:01:449 -> [ApiClient] Info: DATA: {"wifi":-60,"rco2":403,"boot":4,"bootCount":4}
|
||||
14:35:01:449 -> [ApiClient] Info: Return code: 200
|
||||
14:35:01:450 ->
|
||||
14:35:01:450 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:35:01:450 ->
|
||||
14:35:01:475 -> External watchdog feed!
|
||||
14:35:02:251 -> CO2 (ppm): 403
|
||||
14:35:06:272 -> CO2 (ppm): 403
|
||||
14:35:10:293 -> CO2 (ppm): 403
|
||||
14:35:10:293 -> CO2 (ppm): 403
|
||||
14:35:10:293 -> CO2 (ppm): 403
|
||||
14:35:12:664 -> CO2 (ppm): 403
|
||||
14:35:16:960 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:35:16:960 -> [ApiClient] Info: Return code: 200
|
||||
14:35:16:962 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:35:16:963 -> [Configure] Info: Parse configure success
|
||||
14:35:16:963 -> [Configure] Info: co2CalibrationRequested: True
|
||||
14:35:16:964 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:35:16:966 -> [StateMachine] Info: CO2 Calibration
|
||||
14:35:16:966 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
14:35:17:966 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
14:35:18:966 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
14:35:19:966 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
14:35:20:966 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
14:35:23:974 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:35:23:988 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:35:23:996 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:35:24:011 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:35:24:011 -> [StateMachine] Info: CO2 Calibration: success
|
||||
14:35:25:019 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
14:35:25:019 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:35:25:032 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x20 0xAD 0x88
|
||||
14:35:25:032 -> Flags: 20
|
||||
14:35:25:032 -> Waiting getAcknowlagdement
|
||||
14:35:25:032 -> [StateMachine] Info: CO2 Calibration: finish after 0 sec
|
||||
14:35:27:075 -> CO2 (ppm): 401
|
||||
14:35:31:096 -> CO2 (ppm): 401
|
||||
14:35:40:112 -> Get CO2 failed: 1
|
||||
14:35:44:125 -> CO2 (ppm): 0
|
||||
14:35:48:146 -> CO2 (ppm): 577
|
||||
14:35:52:784 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:35:52:784 -> [ApiClient] Info: DATA: {"wifi":-50,"rco2":577,"boot":5,"bootCount":5}
|
||||
14:35:52:785 -> [ApiClient] Info: Return code: 200
|
||||
14:35:52:785 ->
|
||||
14:35:52:785 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:35:52:786 ->
|
||||
14:35:52:807 -> CO2 (ppm): 552
|
||||
14:35:52:833 -> External watchdog feed!
|
||||
14:35:56:828 -> CO2 (ppm): 525
|
||||
14:36:00:849 -> CO2 (ppm): 512
|
||||
14:36:04:871 -> CO2 (ppm): 493
|
||||
14:36:08:892 -> CO2 (ppm): 480
|
||||
14:36:12:912 -> CO2 (ppm): 468
|
||||
14:36:16:934 -> CO2 (ppm): 460
|
||||
14:36:20:955 -> CO2 (ppm): 447
|
||||
14:36:27:600 -> CO2 (ppm): 446
|
||||
14:36:27:600 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:36:27:601 -> [ApiClient] Info: Return code: 200
|
||||
14:36:27:602 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:36:27:603 -> [Configure] Info: Parse configure success
|
||||
14:36:27:604 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:36:28:996 -> CO2 (ppm): 445
|
||||
14:36:37:038 -> CO2 (ppm): 443
|
||||
14:36:37:038 -> CO2 (ppm): 437
|
||||
14:36:45:080 -> CO2 (ppm): 433
|
||||
14:36:45:080 -> CO2 (ppm): 429
|
||||
14:36:49:101 -> CO2 (ppm): 425
|
||||
14:36:53:768 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:36:53:768 -> [ApiClient] Info: DATA: {"wifi":-50,"rco2":425,"boot":6,"bootCount":6}
|
||||
14:36:53:768 -> [ApiClient] Info: Return code: 200
|
||||
14:36:53:768 ->
|
||||
14:36:53:768 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:36:53:768 ->
|
||||
14:36:53:787 -> CO2 (ppm): 420
|
||||
14:36:53:812 -> External watchdog feed!
|
||||
14:36:57:808 -> CO2 (ppm): 417
|
||||
14:37:01:828 -> CO2 (ppm): 416
|
||||
14:37:05:849 -> CO2 (ppm): 414
|
||||
14:37:09:870 -> CO2 (ppm): 413
|
||||
14:37:13:891 -> CO2 (ppm): 412
|
||||
14:37:17:912 -> CO2 (ppm): 410
|
||||
14:37:21:935 -> CO2 (ppm): 410
|
||||
14:37:25:954 -> CO2 (ppm): 410
|
||||
14:37:28:223 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:37:28:223 -> [ApiClient] Info: Return code: 200
|
||||
14:37:28:225 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:37:28:227 -> [Configure] Info: Parse configure success
|
||||
14:37:28:227 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:37:29:974 -> CO2 (ppm): 410
|
||||
14:37:33:996 -> CO2 (ppm): 410
|
||||
14:37:38:016 -> CO2 (ppm): 410
|
||||
14:37:42:037 -> CO2 (ppm): 410
|
||||
14:37:46:058 -> CO2 (ppm): 410
|
||||
14:37:50:079 -> CO2 (ppm): 411
|
||||
14:37:54:736 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:37:54:736 -> [ApiClient] Info: DATA: {"wifi":-51,"rco2":411,"boot":7,"bootCount":7}
|
||||
14:37:54:737 -> [ApiClient] Info: Return code: 200
|
||||
14:37:54:738 ->
|
||||
14:37:54:738 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:37:54:738 ->
|
||||
14:37:54:759 -> CO2 (ppm): 412
|
||||
14:37:54:784 -> External watchdog feed!
|
||||
14:37:58:780 -> CO2 (ppm): 412
|
||||
14:38:02:801 -> CO2 (ppm): 413
|
||||
14:38:06:822 -> CO2 (ppm): 413
|
||||
14:38:10:842 -> CO2 (ppm): 412
|
||||
14:38:14:863 -> CO2 (ppm): 412
|
||||
14:38:18:884 -> CO2 (ppm): 412
|
||||
14:38:22:905 -> CO2 (ppm): 411
|
||||
14:38:26:926 -> CO2 (ppm): 411
|
||||
14:38:28:842 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:38:28:842 -> [ApiClient] Info: Return code: 200
|
||||
14:38:28:843 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"14:38:28:844 -> [Configure] Info: Parse configure success
|
||||
pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:38:28:845 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:38:30:947 -> CO2 (ppm): 411
|
||||
14:38:34:968 -> CO2 (ppm): 410
|
||||
14:38:38:989 -> CO2 (ppm): 409
|
||||
14:38:43:010 -> CO2 (ppm): 409
|
||||
14:38:47:031 -> CO2 (ppm): 408
|
||||
14:38:51:052 -> CO2 (ppm): 407
|
||||
14:38:55:613 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:38:55:613 -> [ApiClient] Info: DATA: {"wifi":-53,"rco2":407,"boot":8,"bootCount":8}
|
||||
14:38:55:613 -> [ApiClient] Info: Return code: 200
|
||||
14:38:55:614 ->
|
||||
14:38:55:614 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:38:55:614 ->
|
||||
14:38:55:636 -> CO2 (ppm): 407
|
||||
14:38:55:665 -> External watchdog feed!
|
||||
14:38:59:657 -> CO2 (ppm): 407
|
||||
14:39:03:679 -> CO2 (ppm): 407
|
||||
14:39:07:700 -> CO2 (ppm): 407
|
||||
14:39:15:742 -> CO2 (ppm): 406
|
||||
14:39:15:742 -> CO2 (ppm): 406
|
||||
14:39:19:762 -> CO2 (ppm): 405
|
||||
14:39:23:783 -> CO2 (ppm): 405
|
||||
14:39:27:804 -> CO2 (ppm): 404
|
||||
14:39:29:462 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:39:29:462 -> [ApiClient] Info: Return code: 200
|
||||
14:39:29:463 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:39:29:465 -> [Configure] Info: Parse configure success
|
||||
14:39:29:465 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:39:31:825 -> CO2 (ppm): 405
|
||||
14:39:35:846 -> CO2 (ppm): 404
|
||||
14:39:39:867 -> CO2 (ppm): 404
|
||||
14:39:43:888 -> CO2 (ppm): 404
|
||||
14:39:47:909 -> CO2 (ppm): 404
|
||||
14:39:51:931 -> CO2 (ppm): 404
|
||||
14:39:56:548 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:39:56:548 -> [ApiClient] Info: DATA: {"wifi":-56,"rco2":404,"boot":9,"bootCount":9}
|
||||
14:39:56:548 -> [ApiClient] Info: Return code: 200
|
||||
14:39:56:549 ->
|
||||
14:39:56:549 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:39:56:549 ->
|
||||
14:39:56:570 -> CO2 (ppm): 404
|
||||
14:39:56:595 -> External watchdog feed!
|
||||
14:40:00:591 -> CO2 (ppm): 404
|
||||
14:40:04:612 -> CO2 (ppm): 404
|
||||
14:40:08:667 -> CO2 (ppm): 404
|
||||
14:40:12:688 -> CO2 (ppm): 404
|
||||
14:40:16:709 -> CO2 (ppm): 404
|
||||
14:40:20:730 -> CO2 (ppm): 404
|
||||
14:40:24:751 -> CO2 (ppm): 404
|
||||
14:40:28:772 -> CO2 (ppm): 404
|
||||
14:40:30:082 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:40:30:082 -> [ApiClient] Info: Return code: 200
|
||||
14:40:30:083 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:40:30:085 -> [Configure] Info: Parse configure success
|
||||
14:40:30:086 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:40:32:792 -> CO2 (ppm): 404
|
||||
14:40:36:813 -> CO2 (ppm): 404
|
||||
14:40:40:834 -> CO2 (ppm): 404
|
||||
14:40:44:855 -> CO2 (ppm): 404
|
||||
14:40:48:876 -> CO2 (ppm): 404
|
||||
14:40:52:898 -> CO2 (ppm): 404
|
||||
14:40:57:525 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:40:57:525 -> [ApiClient] Info: DATA: {"wifi":-53,"rco2":404,"boot":10,"bootCount":10}
|
||||
14:40:57:525 -> [ApiClient] Info: Return code: 200
|
||||
14:40:57:527 ->
|
||||
14:40:57:527 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:40:57:527 ->
|
||||
14:40:57:548 -> CO2 (ppm): 404
|
||||
14:40:57:573 -> External watchdog feed!
|
||||
14:41:01:569 -> CO2 (ppm): 408
|
||||
14:41:05:590 -> CO2 (ppm): 432
|
||||
14:41:09:611 -> CO2 (ppm): 458
|
||||
14:41:13:632 -> CO2 (ppm): 481
|
||||
14:41:17:653 -> CO2 (ppm): 501
|
||||
14:41:21:674 -> CO2 (ppm): 510
|
||||
14:41:25:695 -> CO2 (ppm): 512
|
||||
14:41:29:716 -> CO2 (ppm): 508
|
||||
14:41:30:715 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:41:30:715 -> [ApiClient] Info: Return code: 200
|
||||
14:41:30:716 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:41:30:717 -> [Configure] Info: Parse configure success
|
||||
14:41:30:717 -> [Configure] Info: co2CalibrationRequested: True
|
||||
14:41:30:717 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:41:30:719 -> [StateMachine] Info: CO2 Calibration
|
||||
14:41:30:719 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
14:41:31:720 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
14:41:32:720 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
14:41:33:720 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
14:41:34:720 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
14:41:37:728 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:41:37:741 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:41:37:750 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:41:37:763 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:41:37:763 -> [StateMachine] Info: CO2 Calibration: success
|
||||
14:41:38:764 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
14:41:38:772 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:38:784 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:38:784 -> Flags: 0
|
||||
14:41:39:793 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:39:805 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:39:805 -> Flags: 0
|
||||
14:41:40:814 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:40:826 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:40:827 -> Flags: 0
|
||||
14:41:41:834 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:41:847 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:41:847 -> Flags: 0
|
||||
14:41:42:855 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:42:868 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:42:868 -> Flags: 0
|
||||
14:41:43:876 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:43:889 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:43:889 -> Flags: 0
|
||||
14:41:44:898 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:44:910 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:44:910 -> Flags: 0
|
||||
14:41:45:918 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:45:931 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:45:931 -> Flags: 0
|
||||
14:41:46:939 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:46:952 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:46:952 -> Flags: 0
|
||||
14:41:47:960 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:47:973 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:47:973 -> Flags: 0
|
||||
14:41:48:981 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:48:994 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:48:994 -> Flags: 0
|
||||
14:41:50:002 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:50:015 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:50:015 -> Flags: 0
|
||||
14:41:51:023 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:51:036 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:51:036 -> Flags: 0
|
||||
14:41:52:044 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:52:057 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:52:057 -> Flags: 0
|
||||
14:41:53:066 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:53:078 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:53:078 -> Flags: 0
|
||||
14:41:54:087 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:54:099 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:54:099 -> Flags: 0
|
||||
14:41:55:108 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:55:120 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:55:120 -> Flags: 0
|
||||
14:41:56:128 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:56:141 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:56:141 -> Flags: 0
|
||||
14:41:57:149 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:57:162 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:57:162 -> Flags: 0
|
||||
14:41:58:170 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:58:183 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:58:183 -> Flags: 0
|
||||
14:41:59:192 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:41:59:204 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:41:59:204 -> Flags: 0
|
||||
14:42:00:213 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:42:00:225 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:42:00:225 -> Flags: 0
|
||||
14:42:01:233 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:42:01:239 -> Get Acknowladgement Response > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90
|
||||
14:42:01:239 -> Error getting acknowledgement flags!
|
||||
14:42:02:247 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:42:07:248 -> Get Acknowladgement Response > 0x05 0xFE
|
||||
14:42:07:249 -> Error getting acknowledgement flags!
|
||||
14:42:08:256 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:42:08:269 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:42:08:270 -> Flags: 0
|
||||
14:42:09:277 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:42:09:290 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:42:09:290 -> Flags: 0
|
||||
14:42:10:298 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:42:10:311 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:42:10:311 -> Flags: 0
|
250
Calibration-Logs/COM47_2025_01_06.14.46.24.137.txt
Normal file
250
Calibration-Logs/COM47_2025_01_06.14.46.24.137.txt
Normal file
@ -0,0 +1,250 @@
|
||||
14:46:28:033 -> No PM sensor detected on Serial0
|
||||
14:46:28:033 -> initializing PM sensor
|
||||
14:46:28:033 -> cleared 0 byte(s)
|
||||
14:46:28:034 -> setting active mode
|
||||
14:46:28:034 -> 7 byte(s) written
|
||||
14:46:32:033 -> No PM sensor detected on Serial1
|
||||
14:46:32:034 -> Firmware Mode: 0-1PS
|
||||
14:46:32:054 -> Set S8 AbcDays successful
|
||||
14:46:32:055 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
14:46:32:055 -> [ApiClient] Info: begin
|
||||
14:46:32:101 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
14:46:32:101 -> *wm:AutoConnect
|
||||
14:46:32:101 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
14:46:32:604 -> E (10414) wifi:sta is connecting, return error
|
||||
14:46:32:605 -> [ 10168][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
14:46:40:017 -> *wm:AutoConnect: SUCCESS
|
||||
14:46:40:018 -> *wm:STA IP Address: 192.168.100.127
|
||||
14:46:40:018 -> [WifiConnector] Info: Wait for configure portal
|
||||
14:46:40:018 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
14:46:40:031 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
14:46:42:613 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
14:46:42:614 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:46:42:614 -> [ApiClient] Info: DATA: {"wifi":-62,"boot":0}
|
||||
14:46:42:614 -> [ApiClient] Info: Return code: 200
|
||||
14:46:48:614 ->
|
||||
14:46:48:615 -> firmwareCheckForUpdate:
|
||||
14:46:48:615 -> firmwareCheckForUpdate: Perform
|
||||
14:46:48:615 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
14:46:49:207 -> Firmware update skipped, the server returned 400
|
||||
14:46:49:208 -> 3
|
||||
14:46:49:208 -> OTA message:
|
||||
14:46:49:208 ->
|
||||
14:46:49:780 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:46:49:780 -> [ApiClient] Info: Return code: 200
|
||||
14:46:49:781 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:46:49:782 -> [Configure] Info: Parse configure success
|
||||
14:46:49:783 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:46:54:798 -> Get CO2 failed: 1
|
||||
14:46:58:819 -> CO2 (ppm): 594
|
||||
14:47:02:840 -> CO2 (ppm): 556
|
||||
14:47:06:862 -> CO2 (ppm): 530
|
||||
14:47:10:882 -> CO2 (ppm): 508
|
||||
14:47:14:903 -> CO2 (ppm): 487
|
||||
14:47:18:924 -> CO2 (ppm): 475
|
||||
14:47:23:471 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:47:23:471 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":475,"boot":0,"bootCount":0}
|
||||
14:47:23:471 -> [ApiClient] Info: Return code: 200
|
||||
14:47:23:472 ->
|
||||
14:47:23:472 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:47:23:472 ->
|
||||
14:47:23:493 -> CO2 (ppm): 462
|
||||
14:47:23:518 -> External watchdog feed!
|
||||
14:47:27:514 -> CO2 (ppm): 457
|
||||
14:47:31:535 -> CO2 (ppm): 452
|
||||
14:47:35:556 -> CO2 (ppm): 452
|
||||
14:47:39:577 -> CO2 (ppm): 452
|
||||
14:47:43:598 -> CO2 (ppm): 452
|
||||
14:47:47:619 -> CO2 (ppm): 452
|
||||
14:47:50:400 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:47:50:402 -> [ApiClient] Info: Return code: 200
|
||||
14:47:50:402 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:47:50:403 -> [Configure] Info: Parse configure success
|
||||
14:47:50:404 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:47:51:640 -> CO2 (ppm): 450
|
||||
14:47:55:661 -> CO2 (ppm): 445
|
||||
14:47:59:682 -> CO2 (ppm): 442
|
||||
14:48:03:714 -> CO2 (ppm): 437
|
||||
14:48:07:723 -> CO2 (ppm): 433
|
||||
14:48:11:744 -> CO2 (ppm): 430
|
||||
14:48:15:765 -> CO2 (ppm): 428
|
||||
14:48:19:786 -> CO2 (ppm): 425
|
||||
14:48:24:450 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:48:24:451 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":425,"boot":1,"bootCount":1}
|
||||
14:48:24:451 -> [ApiClient] Info: Return code: 200
|
||||
14:48:24:451 ->
|
||||
14:48:24:452 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:48:24:452 ->
|
||||
14:48:24:473 -> CO2 (ppm): 420
|
||||
14:48:24:498 -> External watchdog feed!
|
||||
14:48:28:494 -> CO2 (ppm): 419
|
||||
14:48:32:515 -> CO2 (ppm): 419
|
||||
14:48:36:536 -> CO2 (ppm): 417
|
||||
14:48:44:578 -> CO2 (ppm): 416
|
||||
14:48:44:578 -> CO2 (ppm): 414
|
||||
14:48:48:598 -> CO2 (ppm): 414
|
||||
14:48:51:022 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:48:51:022 -> [ApiClient] Info: Return code: 200
|
||||
14:48:51:023 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:48:51:025 -> [Configure] Info: Parse configure success
|
||||
14:48:52:619 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:48:52:619 -> CO2 (ppm): 413
|
||||
14:48:56:640 -> CO2 (ppm): 412
|
||||
14:49:00:662 -> CO2 (ppm): 412
|
||||
14:49:04:682 -> CO2 (ppm): 410
|
||||
14:49:08:703 -> CO2 (ppm): 409
|
||||
14:49:12:724 -> CO2 (ppm): 409
|
||||
14:49:16:745 -> CO2 (ppm): 410
|
||||
14:49:20:766 -> CO2 (ppm): 409
|
||||
14:49:25:427 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:49:25:427 -> [ApiClient] Info: DATA: {"wifi":-53,"rco2":409,"boot":2,"bootCount":2}
|
||||
14:49:25:428 -> [ApiClient] Info: Return code: 200
|
||||
14:49:25:429 ->
|
||||
14:49:25:429 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:49:25:429 ->
|
||||
14:49:25:451 -> CO2 (ppm): 420
|
||||
14:49:25:476 -> External watchdog feed!
|
||||
14:49:29:472 -> CO2 (ppm): 442
|
||||
14:49:33:493 -> CO2 (ppm): 465
|
||||
14:49:37:514 -> CO2 (ppm): 483
|
||||
14:49:41:535 -> CO2 (ppm): 495
|
||||
14:49:45:556 -> CO2 (ppm): 499
|
||||
14:49:49:576 -> CO2 (ppm): 502
|
||||
14:49:51:651 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:49:51:651 -> [ApiClient] Info: Return code: 200
|
||||
14:49:51:652 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:49:51:653 -> [Configure] Info: Parse configure success
|
||||
14:49:51:654 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:49:53:598 -> CO2 (ppm): 526
|
||||
14:50:01:639 -> CO2 (ppm): 558
|
||||
14:50:01:639 -> CO2 (ppm): 582
|
||||
14:50:05:660 -> CO2 (ppm): 593
|
||||
14:50:09:681 -> CO2 (ppm): 594
|
||||
14:50:13:702 -> CO2 (ppm): 589
|
||||
14:50:17:723 -> CO2 (ppm): 577
|
||||
14:50:21:744 -> CO2 (ppm): 564
|
||||
14:50:26:458 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:50:26:458 -> [ApiClient] Info: DATA: {"wifi":-50,"rco2":564,"boot":3,"bootCount":3}
|
||||
14:50:26:458 -> [ApiClient] Info: Return code: 200
|
||||
14:50:26:459 ->
|
||||
14:50:26:459 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:50:26:459 ->
|
||||
14:50:26:481 -> CO2 (ppm): 550
|
||||
14:50:26:506 -> External watchdog feed!
|
||||
14:50:30:502 -> CO2 (ppm): 536
|
||||
14:50:34:523 -> CO2 (ppm): 522
|
||||
14:50:38:544 -> CO2 (ppm): 509
|
||||
14:50:42:565 -> CO2 (ppm): 496
|
||||
14:50:46:586 -> CO2 (ppm): 485
|
||||
14:50:50:606 -> CO2 (ppm): 477
|
||||
14:50:52:262 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:50:52:262 -> [ApiClient] Info: Return code: 200
|
||||
14:50:52:263 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:50:52:265 -> [Configure] Info: Parse configure success
|
||||
14:50:52:266 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:50:54:628 -> CO2 (ppm): 468
|
||||
14:50:58:648 -> CO2 (ppm): 461
|
||||
14:51:02:669 -> CO2 (ppm): 455
|
||||
14:51:06:691 -> CO2 (ppm): 449
|
||||
14:51:10:711 -> CO2 (ppm): 443
|
||||
14:51:14:732 -> CO2 (ppm): 439
|
||||
14:51:18:754 -> CO2 (ppm): 436
|
||||
14:51:22:775 -> CO2 (ppm): 432
|
||||
14:51:27:488 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:51:27:488 -> [ApiClient] Info: DATA: {"wifi":-53,"rco2":432,"boot":4,"bootCount":4}
|
||||
14:51:27:488 -> [ApiClient] Info: Return code: 200
|
||||
14:51:27:489 ->
|
||||
14:51:27:489 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:51:27:489 ->
|
||||
14:51:27:511 -> CO2 (ppm): 427
|
||||
14:51:27:536 -> External watchdog feed!
|
||||
14:51:31:532 -> CO2 (ppm): 424
|
||||
14:51:35:553 -> CO2 (ppm): 422
|
||||
14:51:39:574 -> CO2 (ppm): 421
|
||||
14:51:43:595 -> CO2 (ppm): 421
|
||||
14:51:47:616 -> CO2 (ppm): 419
|
||||
14:51:51:637 -> CO2 (ppm): 419
|
||||
14:51:52:882 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:51:52:882 -> [ApiClient] Info: Return code: 200
|
||||
14:51:52:884 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:51:52:885 -> [Configure] Info: Parse configure success
|
||||
14:51:52:886 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:51:55:658 -> CO2 (ppm): 418
|
||||
14:51:59:679 -> CO2 (ppm): 418
|
||||
14:52:03:700 -> CO2 (ppm): 417
|
||||
14:52:07:720 -> CO2 (ppm): 416
|
||||
14:52:11:742 -> CO2 (ppm): 415
|
||||
14:52:15:762 -> CO2 (ppm): 414
|
||||
14:52:19:783 -> CO2 (ppm): 413
|
||||
14:52:23:804 -> CO2 (ppm): 413
|
||||
14:52:28:458 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:52:28:458 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":413,"boot":5,"bootCount":5}
|
||||
14:52:28:458 -> [ApiClient] Info: Return code: 200
|
||||
14:52:28:459 ->
|
||||
14:52:28:459 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:52:28:459 ->
|
||||
14:52:28:481 -> CO2 (ppm): 412
|
||||
14:52:28:506 -> External watchdog feed!
|
||||
14:52:32:502 -> CO2 (ppm): 411
|
||||
14:52:36:523 -> CO2 (ppm): 411
|
||||
14:52:40:544 -> CO2 (ppm): 410
|
||||
14:52:44:565 -> CO2 (ppm): 410
|
||||
14:52:48:586 -> CO2 (ppm): 409
|
||||
14:52:52:607 -> CO2 (ppm): 409
|
||||
14:52:53:503 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:52:53:503 -> [ApiClient] Info: Return code: 200
|
||||
14:52:53:504 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:52:53:506 -> [Configure] Info: Parse configure success
|
||||
14:52:53:506 -> [Configure] Info: co2CalibrationRequested: True
|
||||
14:52:53:507 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:52:53:508 -> [StateMachine] Info: CO2 Calibration
|
||||
14:52:53:509 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
14:52:54:509 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
14:52:55:509 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
14:52:56:509 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
14:52:57:509 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
14:53:00:517 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:53:00:530 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
14:53:00:539 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:53:00:553 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
14:53:00:554 -> [StateMachine] Info: CO2 Calibration: success
|
||||
14:53:01:554 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
14:53:01:562 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:01:574 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:01:575 -> Flags: 0
|
||||
14:53:02:583 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:02:595 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:02:595 -> Flags: 0
|
||||
14:53:03:605 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:03:617 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:03:617 -> Flags: 0
|
||||
14:53:04:625 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:04:638 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:04:638 -> Flags: 0
|
||||
14:53:05:646 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:05:659 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:05:659 -> Flags: 0
|
||||
14:53:06:667 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:06:680 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:06:681 -> Flags: 0
|
||||
14:53:07:688 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:07:701 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:07:701 -> Flags: 0
|
||||
14:53:08:710 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:08:722 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:08:722 -> Flags: 0
|
||||
14:53:09:731 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:09:743 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:09:743 -> Flags: 0
|
||||
14:53:10:751 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:10:764 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:10:764 -> Flags: 0
|
||||
14:53:11:773 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:11:785 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:11:785 -> Flags: 0
|
||||
14:53:12:793 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:12:806 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:12:806 -> Flags: 0
|
||||
14:53:13:814 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
14:53:13:827 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
14:53:13:827 -> Flags: 0
|
292
Calibration-Logs/COM47_2025_01_06.14.53.28.439.txt
Normal file
292
Calibration-Logs/COM47_2025_01_06.14.53.28.439.txt
Normal file
@ -0,0 +1,292 @@
|
||||
14:53:30:502 -> No PM sensor detected on Serial0
|
||||
14:53:30:502 -> initializing PM sensor
|
||||
14:53:30:502 -> cleared 0 byte(s)
|
||||
14:53:30:503 -> setting active mode
|
||||
14:53:30:503 -> 7 byte(s) written
|
||||
14:53:34:501 -> No PM sensor detected on Serial1
|
||||
14:53:34:501 -> Firmware Mode: 0-1PS
|
||||
14:53:44:517 -> Set S8 AbcDays failure
|
||||
14:53:44:517 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
14:53:44:517 -> [ApiClient] Info: begin
|
||||
14:53:44:564 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
14:53:44:565 -> *wm:AutoConnect
|
||||
14:53:44:565 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
14:53:45:067 -> E (20635) wifi:sta is connecting, return error
|
||||
14:53:45:068 -> [ 20164][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
14:53:52:483 -> *wm:AutoConnect: SUCCESS
|
||||
14:53:52:484 -> *wm:STA IP Address: 192.168.100.127
|
||||
14:53:52:484 -> [WifiConnector] Info: Wait for configure portal
|
||||
14:53:52:484 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
14:53:52:497 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
14:53:52:497 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
14:53:54:987 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:53:54:987 -> [ApiClient] Info: DATA: {"wifi":-60,"boot":0}
|
||||
14:53:54:987 -> [ApiClient] Info: Return code: 200
|
||||
14:54:00:988 ->
|
||||
14:54:00:988 -> firmwareCheckForUpdate:
|
||||
14:54:00:988 -> firmwareCheckForUpdate: Perform
|
||||
14:54:00:989 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
14:54:01:633 -> Firmware update skipped, the server returned 400
|
||||
14:54:01:634 -> 3
|
||||
14:54:01:634 -> OTA message:
|
||||
14:54:01:634 ->
|
||||
14:54:02:214 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:54:02:214 -> [ApiClient] Info: Return code: 200
|
||||
14:54:02:215 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:54:02:217 -> [Configure] Info: Parse configure success
|
||||
14:54:02:218 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:54:07:232 -> Get CO2 failed: 1
|
||||
14:54:11:274 -> CO2 (ppm): 585
|
||||
14:54:15:294 -> CO2 (ppm): 556
|
||||
14:54:19:315 -> CO2 (ppm): 517
|
||||
14:54:23:336 -> CO2 (ppm): 497
|
||||
14:54:25:868 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:54:25:868 -> [ApiClient] Info: DATA: {"wifi":-56,"rco2":497,"boot":0,"bootCount":0}
|
||||
14:54:25:868 -> [ApiClient] Info: Return code: 200
|
||||
14:54:25:869 ->
|
||||
14:54:25:869 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:54:25:869 ->
|
||||
14:54:25:894 -> External watchdog feed!
|
||||
14:54:27:357 -> CO2 (ppm): 487
|
||||
14:54:35:399 -> CO2 (ppm): 472
|
||||
14:54:35:399 -> CO2 (ppm): 469
|
||||
14:54:39:420 -> CO2 (ppm): 464
|
||||
14:54:43:441 -> CO2 (ppm): 464
|
||||
14:54:47:462 -> CO2 (ppm): 462
|
||||
14:54:51:483 -> CO2 (ppm): 459
|
||||
14:54:55:504 -> CO2 (ppm): 455
|
||||
14:54:59:525 -> CO2 (ppm): 451
|
||||
14:55:02:834 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:55:02:834 -> [ApiClient] Info: Return code: 200
|
||||
14:55:02:835 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:55:02:836 -> [Configure] Info: Parse configure success
|
||||
14:55:02:837 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:55:03:545 -> CO2 (ppm): 449
|
||||
14:55:07:567 -> CO2 (ppm): 468
|
||||
14:55:11:587 -> CO2 (ppm): 484
|
||||
14:55:15:608 -> CO2 (ppm): 493
|
||||
14:55:19:629 -> CO2 (ppm): 497
|
||||
14:55:23:657 -> CO2 (ppm): 501
|
||||
14:55:26:899 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:55:26:900 -> [ApiClient] Info: DATA: {"wifi":-52,"rco2":501,"boot":1,"bootCount":1}
|
||||
14:55:26:900 -> [ApiClient] Info: Return code: 200
|
||||
14:55:26:900 ->
|
||||
14:55:26:900 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:55:26:900 ->
|
||||
14:55:26:925 -> External watchdog feed!
|
||||
14:55:27:671 -> CO2 (ppm): 501
|
||||
14:55:31:692 -> CO2 (ppm): 499
|
||||
14:55:35:713 -> CO2 (ppm): 495
|
||||
14:55:39:734 -> CO2 (ppm): 491
|
||||
14:55:43:755 -> CO2 (ppm): 485
|
||||
14:55:47:776 -> CO2 (ppm): 480
|
||||
14:55:51:797 -> CO2 (ppm): 473
|
||||
14:55:55:818 -> CO2 (ppm): 467
|
||||
14:55:59:839 -> CO2 (ppm): 460
|
||||
14:56:03:454 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:56:03:454 -> [ApiClient] Info: Return code: 200
|
||||
14:56:03:456 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:56:03:457 -> [Configure] Info: Parse configure success
|
||||
14:56:03:458 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:56:03:860 -> CO2 (ppm): 454
|
||||
14:56:07:880 -> CO2 (ppm): 447
|
||||
14:56:11:901 -> CO2 (ppm): 442
|
||||
14:56:15:923 -> CO2 (ppm): 438
|
||||
14:56:19:944 -> CO2 (ppm): 433
|
||||
14:56:23:965 -> CO2 (ppm): 430
|
||||
14:56:27:929 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:56:27:929 -> [ApiClient] Info: DATA: {"wifi":-50,"rco2":430,"boot":2,"bootCount":2}
|
||||
14:56:27:929 -> [ApiClient] Info: Return code: 200
|
||||
14:56:27:930 ->
|
||||
14:56:27:931 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:56:27:931 ->
|
||||
14:56:27:955 -> External watchdog feed!
|
||||
14:56:27:985 -> CO2 (ppm): 427
|
||||
14:56:32:006 -> CO2 (ppm): 424
|
||||
14:56:36:027 -> CO2 (ppm): 422
|
||||
14:56:40:048 -> CO2 (ppm): 420
|
||||
14:56:44:069 -> CO2 (ppm): 417
|
||||
14:56:52:111 -> CO2 (ppm): 417
|
||||
14:56:52:111 -> CO2 (ppm): 416
|
||||
14:56:56:133 -> CO2 (ppm): 415
|
||||
14:57:00:153 -> CO2 (ppm): 414
|
||||
14:57:04:075 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:57:04:075 -> [ApiClient] Info: Return code: 200
|
||||
14:57:04:077 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:57:04:078 -> [Configure] Info: Parse configure success
|
||||
14:57:04:079 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:57:04:174 -> CO2 (ppm): 414
|
||||
14:57:08:195 -> CO2 (ppm): 414
|
||||
14:57:12:216 -> CO2 (ppm): 415
|
||||
14:57:16:237 -> CO2 (ppm): 416
|
||||
14:57:20:258 -> CO2 (ppm): 415
|
||||
14:57:28:960 -> CO2 (ppm): 416
|
||||
14:57:28:960 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:57:28:961 -> [ApiClient] Info: DATA: {"wifi":-53,"rco2":416,"boot":3,"bootCount":3}
|
||||
14:57:28:961 -> [ApiClient] Info: Return code: 200
|
||||
14:57:28:962 ->
|
||||
14:57:28:962 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:57:28:962 ->
|
||||
14:57:28:984 -> CO2 (ppm): 416
|
||||
14:57:29:008 -> External watchdog feed!
|
||||
14:57:33:004 -> CO2 (ppm): 416
|
||||
14:57:37:026 -> CO2 (ppm): 416
|
||||
14:57:41:046 -> CO2 (ppm): 416
|
||||
14:57:45:067 -> CO2 (ppm): 416
|
||||
14:57:53:109 -> CO2 (ppm): 415
|
||||
14:57:53:109 -> CO2 (ppm): 415
|
||||
14:57:57:130 -> CO2 (ppm): 415
|
||||
14:58:01:151 -> CO2 (ppm): 414
|
||||
14:58:04:695 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:58:04:696 -> [ApiClient] Info: Return code: 200
|
||||
14:58:04:697 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:58:04:698 -> [Configure] Info: Parse configure success
|
||||
14:58:04:699 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:58:05:172 -> CO2 (ppm): 414
|
||||
14:58:09:193 -> CO2 (ppm): 413
|
||||
14:58:13:214 -> CO2 (ppm): 413
|
||||
14:58:17:235 -> CO2 (ppm): 413
|
||||
14:58:21:255 -> CO2 (ppm): 412
|
||||
14:58:25:277 -> CO2 (ppm): 422
|
||||
14:58:30:089 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:58:30:089 -> [ApiClient] Info: DATA: {"wifi":-52,"rco2":422,"boot":4,"bootCount":4}
|
||||
14:58:30:090 -> [ApiClient] Info: Return code: 200
|
||||
14:58:30:091 ->
|
||||
14:58:30:091 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:58:30:091 ->
|
||||
14:58:30:112 -> CO2 (ppm): 451
|
||||
14:58:30:137 -> External watchdog feed!
|
||||
14:58:34:134 -> CO2 (ppm): 482
|
||||
14:58:38:155 -> CO2 (ppm): 503
|
||||
14:58:42:175 -> CO2 (ppm): 517
|
||||
14:58:46:197 -> CO2 (ppm): 520
|
||||
14:58:50:217 -> CO2 (ppm): 519
|
||||
14:58:54:237 -> CO2 (ppm): 513
|
||||
14:58:58:258 -> CO2 (ppm): 506
|
||||
14:59:02:279 -> CO2 (ppm): 500
|
||||
14:59:05:317 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
14:59:05:317 -> [ApiClient] Info: Return code: 200
|
||||
14:59:05:319 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
14:59:05:320 -> [Configure] Info: Parse configure success
|
||||
14:59:05:321 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
14:59:06:299 -> CO2 (ppm): 492
|
||||
14:59:10:321 -> CO2 (ppm): 484
|
||||
14:59:14:342 -> CO2 (ppm): 475
|
||||
14:59:18:362 -> CO2 (ppm): 467
|
||||
14:59:22:384 -> CO2 (ppm): 460
|
||||
14:59:26:439 -> CO2 (ppm): 455
|
||||
14:59:31:051 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
14:59:31:051 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":455,"boot":5,"bootCount":5}
|
||||
14:59:31:051 -> [ApiClient] Info: Return code: 200
|
||||
14:59:31:052 ->
|
||||
14:59:31:052 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
14:59:31:052 ->
|
||||
14:59:31:074 -> CO2 (ppm): 447
|
||||
14:59:31:099 -> External watchdog feed!
|
||||
14:59:35:095 -> CO2 (ppm): 443
|
||||
14:59:39:116 -> CO2 (ppm): 438
|
||||
14:59:43:136 -> CO2 (ppm): 436
|
||||
14:59:47:157 -> CO2 (ppm): 433
|
||||
14:59:51:178 -> CO2 (ppm): 431
|
||||
14:59:55:199 -> CO2 (ppm): 431
|
||||
14:59:59:220 -> CO2 (ppm): 432
|
||||
15:00:03:241 -> CO2 (ppm): 432
|
||||
15:00:05:937 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:00:05:937 -> [ApiClient] Info: Return code: 200
|
||||
15:00:05:939 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:00:05:940 -> [Configure] Info: Parse configure success
|
||||
15:00:05:941 -> [Configure] Info: co2CalibrationRequested: True
|
||||
15:00:05:941 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:00:05:943 -> [StateMachine] Info: CO2 Calibration
|
||||
15:00:05:943 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
15:00:06:943 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
15:00:07:943 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
15:00:08:943 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
15:00:09:943 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
15:00:12:952 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
15:00:12:965 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
15:00:12:973 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
15:00:12:988 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
15:00:12:988 -> [StateMachine] Info: CO2 Calibration: success
|
||||
15:00:13:988 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
15:00:13:996 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:14:009 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:14:009 -> Flags: 0
|
||||
15:00:15:017 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:15:030 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:15:030 -> Flags: 0
|
||||
15:00:16:038 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:16:051 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:16:051 -> Flags: 0
|
||||
15:00:17:059 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:17:072 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:17:072 -> Flags: 0
|
||||
15:00:18:080 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:18:093 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:18:093 -> Flags: 0
|
||||
15:00:19:101 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:19:114 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:19:114 -> Flags: 0
|
||||
15:00:20:122 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:20:135 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:20:135 -> Flags: 0
|
||||
15:00:21:143 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:21:156 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:21:156 -> Flags: 0
|
||||
15:00:22:164 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:22:177 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:22:177 -> Flags: 0
|
||||
15:00:23:185 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:23:198 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:23:198 -> Flags: 0
|
||||
15:00:24:206 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:24:219 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:24:219 -> Flags: 0
|
||||
15:00:25:227 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:25:240 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:25:240 -> Flags: 0
|
||||
15:00:26:248 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:26:285 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:26:286 -> Flags: 0
|
||||
15:00:27:294 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:27:306 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:27:307 -> Flags: 0
|
||||
15:00:28:315 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:28:327 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:28:328 -> Flags: 0
|
||||
15:00:29:336 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:29:349 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:29:349 -> Flags: 0
|
||||
15:00:30:357 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:30:370 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:30:370 -> Flags: 0
|
||||
15:00:31:378 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:31:390 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:31:391 -> Flags: 0
|
||||
15:00:32:399 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:32:411 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:32:412 -> Flags: 0
|
||||
15:00:33:420 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:33:432 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:33:433 -> Flags: 0
|
||||
15:00:34:441 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:34:453 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:34:454 -> Flags: 0
|
||||
15:00:35:462 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:35:474 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:35:475 -> Flags: 0
|
||||
15:00:36:483 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:36:495 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:36:496 -> Flags: 0
|
||||
15:00:37:504 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:37:516 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:37:517 -> Flags: 0
|
||||
15:00:38:525 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:38:537 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:38:538 -> Flags: 0
|
||||
15:00:39:546 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:39:558 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:39:559 -> Flags: 0
|
||||
15:00:40:567 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:00:40:579 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:00:40:579 -> Flags: 0
|
225
Calibration-Logs/COM47_2025_01_06.15.01.39.512.txt
Normal file
225
Calibration-Logs/COM47_2025_01_06.15.01.39.512.txt
Normal file
@ -0,0 +1,225 @@
|
||||
15:01:40:282 -> Detected OPEN_AIR_OUTDOOR
|
||||
15:01:40:282 -> Firmware Version: 3.1.9-dirty
|
||||
15:01:40:428 -> Found S8 on Serial1
|
||||
15:01:40:429 -> Init SGP41 failuire
|
||||
15:01:40:429 -> SGP sensor not found
|
||||
15:01:40:429 -> Can not detect SGP run mode 'O-1PS'
|
||||
15:01:40:429 -> initializing PM sensor
|
||||
15:01:40:429 -> cleared 0 byte(s)
|
||||
15:01:40:429 -> setting active mode
|
||||
15:01:40:429 -> 7 byte(s) written
|
||||
15:01:44:429 -> No PM sensor detected on Serial0
|
||||
15:01:44:429 -> initializing PM sensor
|
||||
15:01:44:429 -> cleared 0 byte(s)
|
||||
15:01:44:429 -> setting active mode
|
||||
15:01:44:429 -> 7 byte(s) written
|
||||
15:01:48:428 -> No PM sensor detected on Serial1
|
||||
15:01:48:428 -> Firmware Mode: 0-1PS
|
||||
15:01:48:450 -> Set S8 AbcDays successful
|
||||
15:01:48:450 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
15:01:48:450 -> [ApiClient] Info: begin
|
||||
15:01:48:497 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
15:01:48:497 -> *wm:AutoConnect
|
||||
15:01:48:498 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
15:01:49:000 -> E (10415) wifi:sta is connecting, return error
|
||||
15:01:49:000 -> [ 10169][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
15:01:56:416 -> *wm:AutoConnect: SUCCESS
|
||||
15:01:56:416 -> *wm:STA IP Address: 192.168.100.127
|
||||
15:01:56:416 -> [WifiConnector] Info: Wait for configure portal
|
||||
15:01:56:416 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
15:01:56:429 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
15:01:58:980 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
15:01:58:981 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:01:58:981 -> [ApiClient] Info: DATA: {"wifi":-51,"boot":0}
|
||||
15:01:58:981 -> [ApiClient] Info: Return code: 200
|
||||
15:02:04:980 ->
|
||||
15:02:04:980 -> firmwareCheckForUpdate:
|
||||
15:02:04:980 -> firmwareCheckForUpdate: Perform
|
||||
15:02:04:981 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
15:02:05:632 -> Firmware update skipped, the server returned 400
|
||||
15:02:05:633 -> 3
|
||||
15:02:05:634 -> OTA message:
|
||||
15:02:05:634 ->
|
||||
15:02:06:256 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:02:06:256 -> [ApiClient] Info: Return code: 200
|
||||
15:02:06:265 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:02:06:266 -> [Configure] Info: Parse configure success
|
||||
15:02:06:266 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:02:06:288 -> CO2 (ppm): 617
|
||||
15:02:10:309 -> CO2 (ppm): 585
|
||||
15:02:14:330 -> CO2 (ppm): 557
|
||||
15:02:22:372 -> CO2 (ppm): 531
|
||||
15:02:22:372 -> CO2 (ppm): 529
|
||||
15:02:26:393 -> CO2 (ppm): 521
|
||||
15:02:30:413 -> CO2 (ppm): 511
|
||||
15:02:34:435 -> CO2 (ppm): 501
|
||||
15:02:38:455 -> CO2 (ppm): 491
|
||||
15:02:39:844 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:02:39:844 -> [ApiClient] Info: DATA: {"wifi":-52,"rco2":491,"boot":0,"bootCount":0}
|
||||
15:02:39:845 -> [ApiClient] Info: Return code: 200
|
||||
15:02:39:871 ->
|
||||
15:02:39:871 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:02:39:871 ->
|
||||
15:02:39:872 -> External watchdog feed!
|
||||
15:02:42:476 -> CO2 (ppm): 481
|
||||
15:02:46:496 -> CO2 (ppm): 472
|
||||
15:02:50:517 -> CO2 (ppm): 465
|
||||
15:02:54:594 -> CO2 (ppm): 457
|
||||
15:02:58:613 -> CO2 (ppm): 450
|
||||
15:03:02:633 -> CO2 (ppm): 440
|
||||
15:03:06:877 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:03:06:877 -> [ApiClient] Info: Return code: 200
|
||||
15:03:06:879 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:03:06:880 -> [Configure] Info: Parse configure success
|
||||
15:03:06:881 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:03:06:925 -> CO2 (ppm): 436
|
||||
15:03:10:946 -> CO2 (ppm): 433
|
||||
15:03:14:967 -> CO2 (ppm): 430
|
||||
15:03:18:988 -> CO2 (ppm): 436
|
||||
15:03:23:008 -> CO2 (ppm): 445
|
||||
15:03:27:029 -> CO2 (ppm): 455
|
||||
15:03:31:050 -> CO2 (ppm): 460
|
||||
15:03:35:071 -> CO2 (ppm): 463
|
||||
15:03:39:092 -> CO2 (ppm): 463
|
||||
15:03:40:875 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:03:40:875 -> [ApiClient] Info: DATA: {"wifi":-52,"rco2":463,"boot":1,"bootCount":1}
|
||||
15:03:40:875 -> [ApiClient] Info: Return code: 200
|
||||
15:03:40:876 ->
|
||||
15:03:40:876 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:03:40:876 ->
|
||||
15:03:40:900 -> External watchdog feed!
|
||||
15:03:43:113 -> CO2 (ppm): 460
|
||||
15:03:47:134 -> CO2 (ppm): 458
|
||||
15:03:51:155 -> CO2 (ppm): 453
|
||||
15:03:55:175 -> CO2 (ppm): 450
|
||||
15:03:59:196 -> CO2 (ppm): 446
|
||||
15:04:03:217 -> CO2 (ppm): 442
|
||||
15:04:07:497 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:04:07:497 -> [ApiClient] Info: Return code: 200
|
||||
15:04:07:499 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:04:07:500 -> [Configure] Info: Parse configure success
|
||||
15:04:07:501 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:04:07:545 -> CO2 (ppm): 437
|
||||
15:04:11:566 -> CO2 (ppm): 433
|
||||
15:04:15:587 -> CO2 (ppm): 430
|
||||
15:04:19:607 -> CO2 (ppm): 428
|
||||
15:04:23:628 -> CO2 (ppm): 425
|
||||
15:04:27:649 -> CO2 (ppm): 423
|
||||
15:04:31:670 -> CO2 (ppm): 421
|
||||
15:04:35:691 -> CO2 (ppm): 419
|
||||
15:04:39:712 -> CO2 (ppm): 418
|
||||
15:04:41:898 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:04:41:898 -> [ApiClient] Info: DATA: {"wifi":-52,"rco2":418,"boot":2,"bootCount":2}
|
||||
15:04:41:898 -> [ApiClient] Info: Return code: 200
|
||||
15:04:41:899 ->
|
||||
15:04:41:899 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:04:41:899 ->
|
||||
15:04:41:924 -> External watchdog feed!
|
||||
15:04:47:754 -> CO2 (ppm): 417
|
||||
15:04:47:754 -> CO2 (ppm): 415
|
||||
15:04:51:775 -> CO2 (ppm): 415
|
||||
15:04:55:796 -> CO2 (ppm): 414
|
||||
15:04:59:817 -> CO2 (ppm): 414
|
||||
15:05:03:838 -> CO2 (ppm): 413
|
||||
15:05:08:118 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:05:08:118 -> [ApiClient] Info: Return code: 200
|
||||
15:05:08:119 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:05:08:121 -> [Configure] Info: Parse configure success
|
||||
15:05:08:122 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:05:08:166 -> CO2 (ppm): 413
|
||||
15:05:12:187 -> CO2 (ppm): 412
|
||||
15:05:16:208 -> CO2 (ppm): 412
|
||||
15:05:20:229 -> CO2 (ppm): 412
|
||||
15:05:24:249 -> CO2 (ppm): 412
|
||||
15:05:28:271 -> CO2 (ppm): 413
|
||||
15:05:32:291 -> CO2 (ppm): 415
|
||||
15:05:36:312 -> CO2 (ppm): 418
|
||||
15:05:40:333 -> CO2 (ppm): 418
|
||||
15:05:42:937 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:05:42:937 -> [ApiClient] Info: DATA: {"wifi":-53,"rco2":418,"boot":3,"bootCount":3}
|
||||
15:05:42:938 -> [ApiClient] Info: Return code: 200
|
||||
15:05:42:939 ->
|
||||
15:05:42:939 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:05:42:939 ->
|
||||
15:05:42:963 -> External watchdog feed!
|
||||
15:05:44:354 -> CO2 (ppm): 420
|
||||
15:05:48:375 -> CO2 (ppm): 420
|
||||
15:05:56:416 -> CO2 (ppm): 420
|
||||
15:05:56:416 -> CO2 (ppm): 421
|
||||
15:06:00:437 -> CO2 (ppm): 421
|
||||
15:06:04:458 -> CO2 (ppm): 420
|
||||
15:06:08:741 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:06:08:741 -> [ApiClient] Info: Return code: 200
|
||||
15:06:08:742 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:06:08:744 -> [Configure] Info: Parse configure success
|
||||
15:06:08:744 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:06:08:789 -> CO2 (ppm): 420
|
||||
15:06:12:810 -> CO2 (ppm): 419
|
||||
15:06:16:831 -> CO2 (ppm): 418
|
||||
15:06:24:872 -> CO2 (ppm): 418
|
||||
15:06:24:872 -> CO2 (ppm): 417
|
||||
15:06:28:894 -> CO2 (ppm): 415
|
||||
15:06:32:915 -> CO2 (ppm): 415
|
||||
15:06:36:936 -> CO2 (ppm): 415
|
||||
15:06:40:957 -> CO2 (ppm): 415
|
||||
15:06:43:965 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:06:43:966 -> [ApiClient] Info: DATA: {"wifi":-53,"rco2":415,"boot":4,"bootCount":4}
|
||||
15:06:43:966 -> [ApiClient] Info: Return code: 200
|
||||
15:06:43:972 ->
|
||||
15:06:43:972 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:06:43:972 ->
|
||||
15:06:43:991 -> External watchdog feed!
|
||||
15:06:44:979 -> CO2 (ppm): 461
|
||||
15:06:49:000 -> CO2 (ppm): 498
|
||||
15:06:53:020 -> CO2 (ppm): 526
|
||||
15:06:57:041 -> CO2 (ppm): 543
|
||||
15:07:01:062 -> CO2 (ppm): 549
|
||||
15:07:05:083 -> CO2 (ppm): 548
|
||||
15:07:09:360 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:07:09:360 -> [ApiClient] Info: Return code: 200
|
||||
15:07:09:362 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:07:09:363 -> [Configure] Info: Parse configure success
|
||||
15:07:09:363 -> [Configure] Info: co2CalibrationRequested: True
|
||||
15:07:09:364 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:07:09:366 -> [StateMachine] Info: CO2 Calibration
|
||||
15:07:09:366 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
15:07:10:366 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
15:07:11:366 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
15:07:12:366 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
15:07:13:366 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
15:07:16:374 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
15:07:16:388 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
15:07:16:396 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
15:07:16:411 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
15:07:16:411 -> [StateMachine] Info: CO2 Calibration: success
|
||||
15:07:17:411 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
15:07:17:419 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:07:17:432 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:07:17:432 -> Flags: 0
|
||||
15:07:18:440 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:07:18:452 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:07:18:453 -> Flags: 0
|
||||
15:07:19:468 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:07:19:474 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:07:19:474 -> Flags: 0
|
||||
15:07:20:482 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:07:20:494 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:07:20:502 -> Flags: 0
|
||||
15:07:21:503 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:07:21:516 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:07:21:516 -> Flags: 0
|
||||
15:07:22:524 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:07:22:536 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:07:22:537 -> Flags: 0
|
||||
15:07:23:545 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:07:23:558 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:07:23:558 -> Flags: 0
|
||||
15:07:24:566 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:07:24:579 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:07:24:579 -> Flags: 0
|
||||
15:07:25:587 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:07:25:599 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:07:25:600 -> Flags: 0
|
||||
15:07:26:608 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:07:26:621 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:07:26:621 -> Flags: 0
|
216
Calibration-Logs/COM47_2025_01_06.15.07.34.421.txt
Normal file
216
Calibration-Logs/COM47_2025_01_06.15.07.34.421.txt
Normal file
@ -0,0 +1,216 @@
|
||||
15:07:35:085 -> Detected OPEN_AIR_OUTDOOR
|
||||
15:07:35:085 -> Firmware Version: 3.1.9-dirty
|
||||
15:07:35:231 -> Found S8 on Serial1
|
||||
15:07:35:233 -> Init SGP41 failuire
|
||||
15:07:35:233 -> SGP sensor not found
|
||||
15:07:35:233 -> Can not detect SGP run mode 'O-1PS'
|
||||
15:07:35:233 -> initializing PM sensor
|
||||
15:07:35:233 -> cleared 0 byte(s)
|
||||
15:07:35:233 -> setting active mode
|
||||
15:07:35:233 -> 7 byte(s) written
|
||||
15:07:39:231 -> No PM sensor detected on Serial0
|
||||
15:07:39:231 -> initializing PM sensor
|
||||
15:07:39:231 -> cleared 0 byte(s)
|
||||
15:07:39:231 -> setting active mode
|
||||
15:07:39:231 -> 7 byte(s) written
|
||||
15:07:43:231 -> No PM sensor detected on Serial1
|
||||
15:07:43:231 -> Firmware Mode: 0-1PS
|
||||
15:07:43:252 -> Set S8 AbcDays successful
|
||||
15:07:43:253 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
15:07:43:253 -> [ApiClient] Info: begin
|
||||
15:07:43:298 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
15:07:43:298 -> *wm:AutoConnect
|
||||
15:07:43:298 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
15:07:43:801 -> E (10413) wifi:sta is connecting, return error
|
||||
15:07:43:802 -> [ 10167][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
15:07:51:216 -> *wm:AutoConnect: SUCCESS
|
||||
15:07:51:216 -> *wm:STA IP Address: 192.168.100.127
|
||||
15:07:51:216 -> [WifiConnector] Info: Wait for configure portal
|
||||
15:07:51:216 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
15:07:51:231 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
15:07:51:231 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
15:07:53:804 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:07:53:804 -> [ApiClient] Info: DATA: {"wifi":-51,"boot":0}
|
||||
15:07:53:805 -> [ApiClient] Info: Return code: 200
|
||||
15:07:59:805 ->
|
||||
15:07:59:806 -> firmwareCheckForUpdate:
|
||||
15:07:59:806 -> firmwareCheckForUpdate: Perform
|
||||
15:07:59:806 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
15:08:00:449 -> Firmware update skipped, the server returned 400
|
||||
15:08:00:450 -> 3
|
||||
15:08:00:450 -> OTA message:
|
||||
15:08:00:450 ->
|
||||
15:08:01:075 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:08:01:075 -> [ApiClient] Info: Return code: 200
|
||||
15:08:01:076 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:08:01:077 -> [Configure] Info: Parse configure success
|
||||
15:08:01:078 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:08:01:106 -> CO2 (ppm): 608
|
||||
15:08:05:127 -> CO2 (ppm): 577
|
||||
15:08:09:148 -> CO2 (ppm): 556
|
||||
15:08:13:169 -> CO2 (ppm): 528
|
||||
15:08:17:190 -> CO2 (ppm): 527
|
||||
15:08:21:211 -> CO2 (ppm): 520
|
||||
15:08:25:232 -> CO2 (ppm): 511
|
||||
15:08:29:253 -> CO2 (ppm): 501
|
||||
15:08:33:274 -> CO2 (ppm): 491
|
||||
15:08:34:658 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:08:34:658 -> [ApiClient] Info: DATA: {"wifi":-52,"rco2":491,"boot":0,"bootCount":0}
|
||||
15:08:34:659 -> [ApiClient] Info: Return code: 200
|
||||
15:08:34:660 ->
|
||||
15:08:34:660 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:08:34:660 ->
|
||||
15:08:34:684 -> External watchdog feed!
|
||||
15:08:37:295 -> CO2 (ppm): 482
|
||||
15:08:41:316 -> CO2 (ppm): 474
|
||||
15:08:45:337 -> CO2 (ppm): 468
|
||||
15:08:49:396 -> CO2 (ppm): 460
|
||||
15:08:53:417 -> CO2 (ppm): 452
|
||||
15:08:57:438 -> CO2 (ppm): 442
|
||||
15:09:01:691 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:09:01:692 -> [ApiClient] Info: Return code: 200
|
||||
15:09:01:693 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:09:01:694 -> [Configure] Info: Parse configure success
|
||||
15:09:01:695 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:09:01:740 -> CO2 (ppm): 439
|
||||
15:09:05:761 -> CO2 (ppm): 437
|
||||
15:09:09:783 -> CO2 (ppm): 451
|
||||
15:09:13:803 -> CO2 (ppm): 472
|
||||
15:09:17:825 -> CO2 (ppm): 490
|
||||
15:09:21:846 -> CO2 (ppm): 503
|
||||
15:09:25:866 -> CO2 (ppm): 509
|
||||
15:09:29:887 -> CO2 (ppm): 509
|
||||
15:09:35:639 -> CO2 (ppm): 505
|
||||
15:09:35:639 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:09:35:639 -> [ApiClient] Info: DATA: {"wifi":-52,"rco2":505,"boot":1,"bootCount":1}
|
||||
15:09:35:639 -> [ApiClient] Info: Return code: 200
|
||||
15:09:35:640 ->
|
||||
15:09:35:641 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:09:35:641 ->
|
||||
15:09:35:665 -> External watchdog feed!
|
||||
15:09:37:929 -> CO2 (ppm): 500
|
||||
15:09:41:950 -> CO2 (ppm): 493
|
||||
15:09:45:971 -> CO2 (ppm): 485
|
||||
15:09:49:992 -> CO2 (ppm): 478
|
||||
15:09:54:013 -> CO2 (ppm): 472
|
||||
15:09:58:034 -> CO2 (ppm): 466
|
||||
15:10:02:313 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:10:02:313 -> [ApiClient] Info: Return code: 200
|
||||
15:10:02:315 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:10:02:316 -> [Configure] Info: Parse configure success
|
||||
15:10:02:317 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:10:02:362 -> CO2 (ppm): 460
|
||||
15:10:06:383 -> CO2 (ppm): 455
|
||||
15:10:10:403 -> CO2 (ppm): 451
|
||||
15:10:14:425 -> CO2 (ppm): 446
|
||||
15:10:18:446 -> CO2 (ppm): 442
|
||||
15:10:22:467 -> CO2 (ppm): 438
|
||||
15:10:26:487 -> CO2 (ppm): 434
|
||||
15:10:30:508 -> CO2 (ppm): 432
|
||||
15:10:34:529 -> CO2 (ppm): 428
|
||||
15:10:36:819 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:10:36:819 -> [ApiClient] Info: DATA: {"wifi":-52,"rco2":428,"boot":2,"bootCount":2}
|
||||
15:10:36:819 -> [ApiClient] Info: Return code: 200
|
||||
15:10:36:820 ->
|
||||
15:10:36:821 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:10:36:821 ->
|
||||
15:10:36:845 -> External watchdog feed!
|
||||
15:10:38:550 -> CO2 (ppm): 427
|
||||
15:10:42:571 -> CO2 (ppm): 425
|
||||
15:10:46:592 -> CO2 (ppm): 423
|
||||
15:10:50:613 -> CO2 (ppm): 421
|
||||
15:10:54:634 -> CO2 (ppm): 418
|
||||
15:10:58:655 -> CO2 (ppm): 417
|
||||
15:11:02:933 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:11:02:933 -> [ApiClient] Info: Return code: 200
|
||||
15:11:02:934 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:11:02:936 -> [Configure] Info: Parse configure success
|
||||
15:11:02:937 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:11:02:981 -> CO2 (ppm): 416
|
||||
15:11:07:001 -> CO2 (ppm): 417
|
||||
15:11:11:022 -> CO2 (ppm): 416
|
||||
15:11:15:042 -> CO2 (ppm): 416
|
||||
15:11:19:063 -> CO2 (ppm): 416
|
||||
15:11:27:105 -> CO2 (ppm): 416
|
||||
15:11:27:105 -> CO2 (ppm): 416
|
||||
15:11:31:126 -> CO2 (ppm): 416
|
||||
15:11:35:147 -> CO2 (ppm): 417
|
||||
15:11:37:792 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:11:37:792 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":417,"boot":3,"bootCount":3}
|
||||
15:11:37:792 -> [ApiClient] Info: Return code: 200
|
||||
15:11:37:793 ->
|
||||
15:11:37:793 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:11:37:793 ->
|
||||
15:11:37:818 -> External watchdog feed!
|
||||
15:11:39:168 -> CO2 (ppm): 420
|
||||
15:11:43:189 -> CO2 (ppm): 426
|
||||
15:11:47:210 -> CO2 (ppm): 430
|
||||
15:11:51:231 -> CO2 (ppm): 434
|
||||
15:11:55:252 -> CO2 (ppm): 436
|
||||
15:11:59:273 -> CO2 (ppm): 437
|
||||
15:12:03:554 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:12:03:555 -> [ApiClient] Info: Return code: 200
|
||||
15:12:03:555 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:12:03:557 -> [Configure] Info: Parse configure success
|
||||
15:12:03:558 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:12:03:602 -> CO2 (ppm): 437
|
||||
15:12:07:623 -> CO2 (ppm): 438
|
||||
15:12:11:643 -> CO2 (ppm): 437
|
||||
15:12:15:665 -> CO2 (ppm): 437
|
||||
15:12:19:686 -> CO2 (ppm): 435
|
||||
15:12:23:707 -> CO2 (ppm): 433
|
||||
15:12:27:727 -> CO2 (ppm): 431
|
||||
15:12:31:748 -> CO2 (ppm): 428
|
||||
15:12:35:769 -> CO2 (ppm): 427
|
||||
15:12:38:780 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:12:38:781 -> [ApiClient] Info: DATA: {"wifi":-51,"rco2":427,"boot":4,"bootCount":4}
|
||||
15:12:38:781 -> [ApiClient] Info: Return code: 200
|
||||
15:12:38:781 ->
|
||||
15:12:38:781 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:12:38:781 ->
|
||||
15:12:38:806 -> External watchdog feed!
|
||||
15:12:39:790 -> CO2 (ppm): 425
|
||||
15:12:43:811 -> CO2 (ppm): 424
|
||||
15:12:47:832 -> CO2 (ppm): 424
|
||||
15:12:51:853 -> CO2 (ppm): 428
|
||||
15:12:55:877 -> CO2 (ppm): 456
|
||||
15:12:59:895 -> CO2 (ppm): 501
|
||||
15:13:04:175 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:13:04:175 -> [ApiClient] Info: Return code: 200
|
||||
15:13:04:176 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:13:04:178 -> [Configure] Info: Parse configure success
|
||||
15:13:04:178 -> [Configure] Info: co2CalibrationRequested: True
|
||||
15:13:04:179 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:13:04:180 -> [StateMachine] Info: CO2 Calibration
|
||||
15:13:04:181 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
15:13:05:181 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
15:13:06:181 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
15:13:07:181 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
15:13:08:181 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
15:13:11:189 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
15:13:11:202 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
15:13:11:211 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
15:13:11:224 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
15:13:11:225 -> [StateMachine] Info: CO2 Calibration: success
|
||||
15:13:12:225 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
15:13:12:233 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:13:12:245 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:13:12:246 -> Flags: 0
|
||||
15:13:13:254 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:13:13:266 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:13:13:267 -> Flags: 0
|
||||
15:13:14:275 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:13:14:288 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:13:14:288 -> Flags: 0
|
||||
15:13:15:296 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:13:15:308 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:13:15:309 -> Flags: 0
|
||||
15:13:16:317 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:13:16:329 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:13:16:330 -> Flags: 0
|
||||
15:13:17:338 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:13:17:350 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:13:17:351 -> Flags: 0
|
||||
15:13:18:359 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:13:18:371 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:13:18:372 -> Flags: 0
|
257
Calibration-Logs/COM47_2025_01_06.15.13.27.887.txt
Normal file
257
Calibration-Logs/COM47_2025_01_06.15.13.27.887.txt
Normal file
@ -0,0 +1,257 @@
|
||||
15:13:31:259 -> No PM sensor detected on Serial0
|
||||
15:13:31:259 -> initializing PM sensor
|
||||
15:13:31:259 -> cleared 0 byte(s)
|
||||
15:13:31:260 -> setting active mode
|
||||
15:13:31:260 -> 7 byte(s) written
|
||||
15:13:35:259 -> No PM sensor detected on Serial1
|
||||
15:13:35:259 -> Firmware Mode: 0-1PS
|
||||
15:13:35:280 -> Set S8 AbcDays successful
|
||||
15:13:35:280 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
15:13:35:280 -> [ApiClient] Info: begin
|
||||
15:13:35:326 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
15:13:35:327 -> *wm:AutoConnect
|
||||
15:13:35:327 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
15:13:35:829 -> E (10414) wifi:sta is connecting, return error
|
||||
15:13:35:830 -> [ 10168][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
15:13:43:346 -> *wm:AutoConnect: SUCCESS
|
||||
15:13:43:346 -> *wm:STA IP Address: 192.168.100.127
|
||||
15:13:43:346 -> [WifiConnector] Info: Wait for configure portal
|
||||
15:13:43:347 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
15:13:43:360 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
15:13:45:896 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
15:13:45:897 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:13:45:897 -> [ApiClient] Info: DATA: {"wifi":-58,"boot":0}
|
||||
15:13:45:897 -> [ApiClient] Info: Return code: 200
|
||||
15:13:51:897 ->
|
||||
15:13:51:897 -> firmwareCheckForUpdate:
|
||||
15:13:51:897 -> firmwareCheckForUpdate: Perform
|
||||
15:13:51:898 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
15:13:52:543 -> Firmware update skipped, the server returned 400
|
||||
15:13:52:544 -> 3
|
||||
15:13:52:544 -> OTA message:
|
||||
15:13:52:544 ->
|
||||
15:13:53:122 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:13:53:122 -> [ApiClient] Info: Return code: 200
|
||||
15:13:53:123 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:13:53:125 -> [Configure] Info: Parse configure success
|
||||
15:13:53:125 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:13:53:153 -> CO2 (ppm): 0
|
||||
15:13:57:175 -> CO2 (ppm): 491
|
||||
15:14:01:196 -> CO2 (ppm): 479
|
||||
15:14:05:217 -> CO2 (ppm): 466
|
||||
15:14:09:238 -> CO2 (ppm): 457
|
||||
15:14:13:259 -> CO2 (ppm): 455
|
||||
15:14:21:300 -> CO2 (ppm): 447
|
||||
15:14:21:300 -> CO2 (ppm): 444
|
||||
15:14:25:321 -> CO2 (ppm): 438
|
||||
15:14:25:684 -> External watchdog feed!
|
||||
15:14:26:709 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:14:26:709 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":438,"boot":0,"bootCount":0}
|
||||
15:14:26:710 -> [ApiClient] Info: Return code: 200
|
||||
15:14:26:711 ->
|
||||
15:14:26:711 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:14:26:711 ->
|
||||
15:14:29:342 -> CO2 (ppm): 438
|
||||
15:14:33:363 -> CO2 (ppm): 437
|
||||
15:14:37:428 -> CO2 (ppm): 437
|
||||
15:14:41:449 -> CO2 (ppm): 436
|
||||
15:14:45:470 -> CO2 (ppm): 433
|
||||
15:14:49:491 -> CO2 (ppm): 432
|
||||
15:14:53:765 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:14:53:766 -> [ApiClient] Info: Return code: 200
|
||||
15:14:53:766 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:14:53:768 -> [Configure] Info: Parse configure success
|
||||
15:14:53:769 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:14:53:812 -> CO2 (ppm): 429
|
||||
15:15:01:855 -> CO2 (ppm): 428
|
||||
15:15:01:855 -> CO2 (ppm): 425
|
||||
15:15:05:875 -> CO2 (ppm): 422
|
||||
15:15:09:896 -> CO2 (ppm): 421
|
||||
15:15:13:917 -> CO2 (ppm): 420
|
||||
15:15:17:938 -> CO2 (ppm): 419
|
||||
15:15:21:959 -> CO2 (ppm): 418
|
||||
15:15:25:707 -> External watchdog feed!
|
||||
15:15:25:980 -> CO2 (ppm): 418
|
||||
15:15:27:739 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:15:27:739 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":418,"boot":1,"bootCount":1}
|
||||
15:15:27:739 -> [ApiClient] Info: Return code: 200
|
||||
15:15:27:740 ->
|
||||
15:15:27:740 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:15:27:740 ->
|
||||
15:15:30:001 -> CO2 (ppm): 419
|
||||
15:15:34:022 -> CO2 (ppm): 419
|
||||
15:15:38:043 -> CO2 (ppm): 420
|
||||
15:15:42:064 -> CO2 (ppm): 420
|
||||
15:15:46:085 -> CO2 (ppm): 419
|
||||
15:15:50:106 -> CO2 (ppm): 418
|
||||
15:15:54:496 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:15:54:496 -> [ApiClient] Info: Return code: 200
|
||||
15:15:54:498 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:15:54:499 -> [Configure] Info: Parse configure success
|
||||
15:15:54:544 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:15:54:544 -> CO2 (ppm): 418
|
||||
15:15:58:565 -> CO2 (ppm): 417
|
||||
15:16:02:585 -> CO2 (ppm): 417
|
||||
15:16:06:606 -> CO2 (ppm): 416
|
||||
15:16:10:627 -> CO2 (ppm): 417
|
||||
15:16:14:648 -> CO2 (ppm): 417
|
||||
15:16:18:669 -> CO2 (ppm): 417
|
||||
15:16:22:690 -> CO2 (ppm): 417
|
||||
15:16:25:730 -> External watchdog feed!
|
||||
15:16:26:711 -> CO2 (ppm): 417
|
||||
15:16:28:769 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:16:28:769 -> [ApiClient] Info: DATA: {"wifi":-53,"rco2":417,"boot":2,"bootCount":2}
|
||||
15:16:28:769 -> [ApiClient] Info: Return code: 200
|
||||
15:16:28:770 ->
|
||||
15:16:28:770 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:16:28:770 ->
|
||||
15:16:30:732 -> CO2 (ppm): 417
|
||||
15:16:34:753 -> CO2 (ppm): 417
|
||||
15:16:38:774 -> CO2 (ppm): 417
|
||||
15:16:42:795 -> CO2 (ppm): 417
|
||||
15:16:46:816 -> CO2 (ppm): 417
|
||||
15:16:50:837 -> CO2 (ppm): 418
|
||||
15:16:55:085 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:16:55:085 -> [ApiClient] Info: Return code: 200
|
||||
15:16:55:086 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:16:55:088 -> [Configure] Info: Parse configure success
|
||||
15:16:55:089 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:16:55:132 -> CO2 (ppm): 418
|
||||
15:16:59:154 -> CO2 (ppm): 418
|
||||
15:17:03:174 -> CO2 (ppm): 418
|
||||
15:17:07:195 -> CO2 (ppm): 420
|
||||
15:17:11:215 -> CO2 (ppm): 423
|
||||
15:17:15:236 -> CO2 (ppm): 427
|
||||
15:17:19:257 -> CO2 (ppm): 434
|
||||
15:17:23:278 -> CO2 (ppm): 451
|
||||
15:17:25:755 -> External watchdog feed!
|
||||
15:17:27:300 -> CO2 (ppm): 502
|
||||
15:17:29:729 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:17:29:729 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":502,"boot":3,"bootCount":3}
|
||||
15:17:29:729 -> [ApiClient] Info: Return code: 200
|
||||
15:17:29:730 ->
|
||||
15:17:29:730 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:17:29:730 ->
|
||||
15:17:31:320 -> CO2 (ppm): 580
|
||||
15:17:35:341 -> CO2 (ppm): 677
|
||||
15:17:39:362 -> CO2 (ppm): 771
|
||||
15:17:43:383 -> CO2 (ppm): 850
|
||||
15:17:47:404 -> CO2 (ppm): 910
|
||||
15:17:51:425 -> CO2 (ppm): 962
|
||||
15:17:55:705 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:17:55:705 -> [ApiClient] Info: Return code: 200
|
||||
15:17:55:707 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:17:55:708 -> [Configure] Info: Parse configure success
|
||||
15:17:55:709 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:17:55:754 -> CO2 (ppm): 1006
|
||||
15:17:59:775 -> CO2 (ppm): 1008
|
||||
15:18:03:796 -> CO2 (ppm): 983
|
||||
15:18:07:817 -> CO2 (ppm): 943
|
||||
15:18:11:838 -> CO2 (ppm): 888
|
||||
15:18:15:859 -> CO2 (ppm): 831
|
||||
15:18:19:880 -> CO2 (ppm): 774
|
||||
15:18:23:901 -> CO2 (ppm): 721
|
||||
15:18:25:777 -> External watchdog feed!
|
||||
15:18:27:922 -> CO2 (ppm): 675
|
||||
15:18:30:726 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:18:30:727 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":675,"boot":4,"bootCount":4}
|
||||
15:18:30:727 -> [ApiClient] Info: Return code: 200
|
||||
15:18:30:728 ->
|
||||
15:18:30:728 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:18:30:728 ->
|
||||
15:18:31:943 -> CO2 (ppm): 634
|
||||
15:18:35:964 -> CO2 (ppm): 597
|
||||
15:18:39:984 -> CO2 (ppm): 564
|
||||
15:18:44:005 -> CO2 (ppm): 538
|
||||
15:18:48:026 -> CO2 (ppm): 514
|
||||
15:18:52:047 -> CO2 (ppm): 495
|
||||
15:18:56:326 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:18:56:326 -> [ApiClient] Info: Return code: 200
|
||||
15:18:56:328 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:18:56:329 -> [Configure] Info: Parse configure success
|
||||
15:18:56:330 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:18:56:374 -> CO2 (ppm): 480
|
||||
15:19:00:395 -> CO2 (ppm): 467
|
||||
15:19:04:416 -> CO2 (ppm): 457
|
||||
15:19:08:437 -> CO2 (ppm): 447
|
||||
15:19:12:458 -> CO2 (ppm): 440
|
||||
15:19:16:479 -> CO2 (ppm): 433
|
||||
15:19:20:500 -> CO2 (ppm): 429
|
||||
15:19:24:521 -> CO2 (ppm): 425
|
||||
15:19:25:800 -> External watchdog feed!
|
||||
15:19:28:542 -> CO2 (ppm): 422
|
||||
15:19:31:706 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:19:31:706 -> [ApiClient] Info: DATA: {"wifi":-56,"rco2":422,"boot":5,"bootCount":5}
|
||||
15:19:31:707 -> [ApiClient] Info: Return code: 200
|
||||
15:19:31:708 ->
|
||||
15:19:31:708 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:19:31:708 ->
|
||||
15:19:32:607 -> CO2 (ppm): 419
|
||||
15:19:36:627 -> CO2 (ppm): 415
|
||||
15:19:40:648 -> CO2 (ppm): 412
|
||||
15:19:44:670 -> CO2 (ppm): 410
|
||||
15:19:48:690 -> CO2 (ppm): 408
|
||||
15:19:52:712 -> CO2 (ppm): 408
|
||||
15:19:57:457 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:19:57:458 -> [ApiClient] Info: Return code: 200
|
||||
15:19:57:459 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:19:57:460 -> [Configure] Info: Parse configure success
|
||||
15:19:57:461 -> [Configure] Info: co2CalibrationRequested: True
|
||||
15:19:57:461 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:19:57:463 -> [StateMachine] Info: CO2 Calibration
|
||||
15:19:57:463 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
15:19:58:463 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
15:19:59:463 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
15:20:00:463 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
15:20:01:463 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
15:20:04:471 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
15:20:04:520 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
15:20:04:529 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
15:20:04:543 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
15:20:04:543 -> [StateMachine] Info: CO2 Calibration: success
|
||||
15:20:05:543 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
15:20:05:552 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:05:564 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:05:564 -> Flags: 0
|
||||
15:20:06:572 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:06:585 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:06:585 -> Flags: 0
|
||||
15:20:07:593 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:07:606 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:07:606 -> Flags: 0
|
||||
15:20:08:614 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:08:627 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:08:627 -> Flags: 0
|
||||
15:20:09:635 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:09:648 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:09:648 -> Flags: 0
|
||||
15:20:10:657 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:10:669 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:10:669 -> Flags: 0
|
||||
15:20:11:677 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:11:690 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:11:690 -> Flags: 0
|
||||
15:20:12:698 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:12:711 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:12:711 -> Flags: 0
|
||||
15:20:13:719 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:13:732 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:13:732 -> Flags: 0
|
||||
15:20:14:740 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:14:753 -> Get Acknowladgement Response > 15:20:14:753 -> Flags: 0
|
||||
15:20:15:761 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:15:774 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:15:774 -> Flags: 0
|
||||
15:20:16:782 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:16:795 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:16:795 -> Flags: 0
|
||||
15:20:17:803 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:17:816 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:17:816 -> Flags: 0
|
||||
15:20:18:824 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:18:837 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:18:837 -> Flags: 0
|
||||
15:20:19:845 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:20:19:858 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:20:19:858 -> Flags: 0
|
279
Calibration-Logs/COM47_2025_01_06.15.35.51.271.txt
Normal file
279
Calibration-Logs/COM47_2025_01_06.15.35.51.271.txt
Normal file
@ -0,0 +1,279 @@
|
||||
15:35:52:096 -> Detected OPEN_AIR_OUTDOOR
|
||||
15:35:52:096 -> Firmware Version: 3.1.9-dirty
|
||||
15:35:52:241 -> Found S8 on Serial1
|
||||
15:35:52:242 -> Init SGP41 failuire
|
||||
15:35:52:242 -> SGP sensor not found
|
||||
15:35:52:242 -> Can not detect SGP run mode 'O-1PS'
|
||||
15:35:52:242 -> initializing PM sensor
|
||||
15:35:52:243 -> cleared 0 byte(s)
|
||||
15:35:52:243 -> setting active mode
|
||||
15:35:52:243 -> 7 byte(s) written
|
||||
15:35:56:242 -> No PM sensor detected on Serial0
|
||||
15:35:56:242 -> initializing PM sensor
|
||||
15:35:56:242 -> cleared 0 byte(s)
|
||||
15:35:56:242 -> setting active mode
|
||||
15:35:56:242 -> 7 byte(s) written
|
||||
15:36:00:242 -> No PM sensor detected on Serial1
|
||||
15:36:00:242 -> Firmware Mode: 0-1PS
|
||||
15:36:00:263 -> Set S8 AbcDays successful
|
||||
15:36:00:264 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
15:36:00:264 -> [ApiClient] Info: begin
|
||||
15:36:00:309 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
15:36:00:309 -> *wm:AutoConnect
|
||||
15:36:00:309 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
15:36:00:812 -> E (10413) wifi:sta is connecting, return error
|
||||
15:36:00:812 -> [ 10167][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
15:36:08:326 -> *wm:AutoConnect: SUCCESS
|
||||
15:36:08:326 -> *wm:STA IP Address: 192.168.100.127
|
||||
15:36:08:326 -> [WifiConnector] Info: Wait for configure portal
|
||||
15:36:08:326 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
15:36:08:339 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
15:36:08:340 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
15:36:11:073 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:36:11:073 -> [ApiClient] Info: DATA: {"wifi":-55,"boot":0}
|
||||
15:36:11:074 -> [ApiClient] Info: Return code: 200
|
||||
15:36:17:074 ->
|
||||
15:36:17:074 -> firmwareCheckForUpdate:
|
||||
15:36:17:074 -> firmwareCheckForUpdate: Perform
|
||||
15:36:17:075 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-dirty
|
||||
15:36:17:721 -> Firmware update skipped, the server returned 400
|
||||
15:36:17:722 -> 3
|
||||
15:36:17:722 -> OTA message:
|
||||
15:36:17:722 ->
|
||||
15:36:18:347 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:36:18:347 -> [ApiClient] Info: Return code: 200
|
||||
15:36:18:348 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:36:18:349 -> [Configure] Info: Parse configure success
|
||||
15:36:18:351 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:36:18:378 -> CO2 (ppm): 495
|
||||
15:36:22:399 -> CO2 (ppm): 481
|
||||
15:36:26:420 -> CO2 (ppm): 473
|
||||
15:36:30:441 -> CO2 (ppm): 463
|
||||
15:36:34:501 -> CO2 (ppm): 463
|
||||
15:36:38:522 -> CO2 (ppm): 466
|
||||
15:36:42:543 -> CO2 (ppm): 469
|
||||
15:36:46:564 -> CO2 (ppm): 468
|
||||
15:36:50:585 -> CO2 (ppm): 464
|
||||
15:36:51:629 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:36:51:629 -> [ApiClient] Info: DATA: {"wifi":-56,"rco2":464,"boot":0,"bootCount":0}
|
||||
15:36:51:629 -> [ApiClient] Info: Return code: 200
|
||||
15:36:51:630 ->
|
||||
15:36:51:630 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:36:51:630 ->
|
||||
15:36:51:655 -> External watchdog feed!
|
||||
15:36:54:606 -> CO2 (ppm): 460
|
||||
15:36:58:627 -> CO2 (ppm): 455
|
||||
15:37:02:648 -> CO2 (ppm): 452
|
||||
15:37:06:668 -> CO2 (ppm): 447
|
||||
15:37:10:688 -> CO2 (ppm): 444
|
||||
15:37:14:709 -> CO2 (ppm): 440
|
||||
15:37:18:964 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:37:18:965 -> [ApiClient] Info: Return code: 200
|
||||
15:37:18:966 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:37:18:967 -> [Configure] Info: Parse configure success
|
||||
15:37:18:968 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:37:19:012 -> CO2 (ppm): 436
|
||||
15:37:23:033 -> CO2 (ppm): 432
|
||||
15:37:31:075 -> CO2 (ppm): 429
|
||||
15:37:31:075 -> CO2 (ppm): 426
|
||||
15:37:35:096 -> CO2 (ppm): 425
|
||||
15:37:39:117 -> CO2 (ppm): 423
|
||||
15:37:43:138 -> CO2 (ppm): 421
|
||||
15:37:47:159 -> CO2 (ppm): 420
|
||||
15:37:51:179 -> CO2 (ppm): 420
|
||||
15:37:52:659 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:37:52:659 -> [ApiClient] Info: DATA: {"wifi":-53,"rco2":420,"boot":1,"bootCount":1}
|
||||
15:37:52:659 -> [ApiClient] Info: Return code: 200
|
||||
15:37:52:659 ->
|
||||
15:37:52:660 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:37:52:660 ->
|
||||
15:37:52:685 -> External watchdog feed!
|
||||
15:37:55:201 -> CO2 (ppm): 419
|
||||
15:37:59:222 -> CO2 (ppm): 420
|
||||
15:38:03:242 -> CO2 (ppm): 431
|
||||
15:38:07:263 -> CO2 (ppm): 477
|
||||
15:38:11:285 -> CO2 (ppm): 498
|
||||
15:38:15:307 -> CO2 (ppm): 507
|
||||
15:38:19:589 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:38:19:589 -> [ApiClient] Info: Return code: 200
|
||||
15:38:19:590 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:38:19:592 -> [Configure] Info: Parse configure success
|
||||
15:38:19:592 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:38:19:636 -> CO2 (ppm): 506
|
||||
15:38:23:658 -> CO2 (ppm): 501
|
||||
15:38:27:678 -> CO2 (ppm): 495
|
||||
15:38:31:700 -> CO2 (ppm): 488
|
||||
15:38:35:720 -> CO2 (ppm): 479
|
||||
15:38:39:742 -> CO2 (ppm): 471
|
||||
15:38:43:762 -> CO2 (ppm): 463
|
||||
15:38:47:783 -> CO2 (ppm): 457
|
||||
15:38:51:804 -> CO2 (ppm): 451
|
||||
15:38:53:685 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:38:53:685 -> [ApiClient] Info: DATA: {"wifi":-54,"rco2":451,"boot":2,"bootCount":2}
|
||||
15:38:53:685 -> [ApiClient] Info: Return code: 200
|
||||
15:38:53:686 ->
|
||||
15:38:53:686 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:38:53:686 ->
|
||||
15:38:53:711 -> External watchdog feed!
|
||||
15:38:55:825 -> CO2 (ppm): 445
|
||||
15:38:59:846 -> CO2 (ppm): 440
|
||||
15:39:03:867 -> CO2 (ppm): 436
|
||||
15:39:07:887 -> CO2 (ppm): 434
|
||||
15:39:11:908 -> CO2 (ppm): 431
|
||||
15:39:15:929 -> CO2 (ppm): 428
|
||||
15:39:20:208 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:39:20:208 -> [ApiClient] Info: Return code: 200
|
||||
15:39:20:209 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:39:20:210 -> [Configure] Info: Parse configure success
|
||||
15:39:20:211 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:39:24:277 -> CO2 (ppm): 426
|
||||
15:39:24:277 -> CO2 (ppm): 425
|
||||
15:39:28:297 -> CO2 (ppm): 424
|
||||
15:39:32:318 -> CO2 (ppm): 424
|
||||
15:39:36:339 -> CO2 (ppm): 425
|
||||
15:39:40:360 -> CO2 (ppm): 423
|
||||
15:39:44:381 -> CO2 (ppm): 423
|
||||
15:39:48:402 -> CO2 (ppm): 422
|
||||
15:39:52:423 -> CO2 (ppm): 421
|
||||
15:39:54:655 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:39:54:655 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":421,"boot":3,"bootCount":3}
|
||||
15:39:54:655 -> [ApiClient] Info: Return code: 200
|
||||
15:39:54:656 ->
|
||||
15:39:54:656 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:39:54:656 ->
|
||||
15:39:54:680 -> External watchdog feed!
|
||||
15:39:56:444 -> CO2 (ppm): 421
|
||||
15:40:00:465 -> CO2 (ppm): 421
|
||||
15:40:04:486 -> CO2 (ppm): 420
|
||||
15:40:08:507 -> CO2 (ppm): 420
|
||||
15:40:16:549 -> CO2 (ppm): 419
|
||||
15:40:16:549 -> CO2 (ppm): 418
|
||||
15:40:20:828 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:40:20:828 -> [ApiClient] Info: Return code: 200
|
||||
15:40:20:830 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:40:20:831 -> [Configure] Info: Parse configure success
|
||||
15:40:20:876 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:40:20:876 -> CO2 (ppm): 418
|
||||
15:40:24:897 -> CO2 (ppm): 417
|
||||
15:40:28:928 -> CO2 (ppm): 417
|
||||
15:40:32:939 -> CO2 (ppm): 417
|
||||
15:40:36:960 -> CO2 (ppm): 417
|
||||
15:40:40:981 -> CO2 (ppm): 417
|
||||
15:40:45:002 -> CO2 (ppm): 417
|
||||
15:40:49:023 -> CO2 (ppm): 417
|
||||
15:40:53:043 -> CO2 (ppm): 417
|
||||
15:40:55:588 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:40:55:588 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":417,"boot":4,"bootCount":4}
|
||||
15:40:55:588 -> [ApiClient] Info: Return code: 200
|
||||
15:40:55:589 ->
|
||||
15:40:55:589 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:40:55:590 ->
|
||||
15:40:55:614 -> External watchdog feed!
|
||||
15:40:57:064 -> CO2 (ppm): 416
|
||||
15:41:01:085 -> CO2 (ppm): 416
|
||||
15:41:05:107 -> CO2 (ppm): 417
|
||||
15:41:09:127 -> CO2 (ppm): 416
|
||||
15:41:13:148 -> CO2 (ppm): 416
|
||||
15:41:17:169 -> CO2 (ppm): 416
|
||||
15:41:21:448 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:41:21:448 -> [ApiClient] Info: Return code: 200
|
||||
15:41:21:450 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:41:21:451 -> [Configure] Info: Parse configure success
|
||||
15:41:21:452 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:41:21:496 -> CO2 (ppm): 415
|
||||
15:41:25:517 -> CO2 (ppm): 415
|
||||
15:41:29:538 -> CO2 (ppm): 415
|
||||
15:41:33:559 -> CO2 (ppm): 420
|
||||
15:41:37:580 -> CO2 (ppm): 435
|
||||
15:41:41:601 -> CO2 (ppm): 472
|
||||
15:41:45:621 -> CO2 (ppm): 509
|
||||
15:41:49:684 -> CO2 (ppm): 524
|
||||
15:41:53:704 -> CO2 (ppm): 529
|
||||
15:41:56:574 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:41:56:574 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":529,"boot":5,"bootCount":5}
|
||||
15:41:56:574 -> [ApiClient] Info: Return code: 200
|
||||
15:41:56:600 ->
|
||||
15:41:56:600 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:41:56:600 ->
|
||||
15:41:56:600 -> External watchdog feed!
|
||||
15:41:57:725 -> CO2 (ppm): 524
|
||||
15:42:01:746 -> CO2 (ppm): 518
|
||||
15:42:05:767 -> CO2 (ppm): 510
|
||||
15:42:09:788 -> CO2 (ppm): 501
|
||||
15:42:13:809 -> CO2 (ppm): 490
|
||||
15:42:17:830 -> CO2 (ppm): 480
|
||||
15:42:22:068 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:42:22:068 -> [ApiClient] Info: Return code: 200
|
||||
15:42:22:070 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:42:22:071 -> [Configure] Info: Parse configure success
|
||||
15:42:22:072 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:42:22:116 -> CO2 (ppm): 469
|
||||
15:42:26:137 -> CO2 (ppm): 460
|
||||
15:42:30:158 -> CO2 (ppm): 453
|
||||
15:42:34:179 -> CO2 (ppm): 446
|
||||
15:42:38:200 -> CO2 (ppm): 442
|
||||
15:42:42:220 -> CO2 (ppm): 437
|
||||
15:42:46:241 -> CO2 (ppm): 434
|
||||
15:42:50:262 -> CO2 (ppm): 431
|
||||
15:42:54:283 -> CO2 (ppm): 430
|
||||
15:42:57:601 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
15:42:57:601 -> [ApiClient] Info: DATA: {"wifi":-55,"rco2":430,"boot":6,"bootCount":6}
|
||||
15:42:57:601 -> [ApiClient] Info: Return code: 200
|
||||
15:42:57:602 ->
|
||||
15:42:57:602 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
15:42:57:602 ->
|
||||
15:42:57:626 -> External watchdog feed!
|
||||
15:42:58:304 -> CO2 (ppm): 434
|
||||
15:43:02:325 -> CO2 (ppm): 439
|
||||
15:43:06:345 -> CO2 (ppm): 444
|
||||
15:43:10:366 -> CO2 (ppm): 447
|
||||
15:43:14:387 -> CO2 (ppm): 449
|
||||
15:43:18:408 -> CO2 (ppm): 483
|
||||
15:43:22:745 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
15:43:22:746 -> [ApiClient] Info: Return code: 200
|
||||
15:43:22:747 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
15:43:22:748 -> [Configure] Info: Parse configure success
|
||||
15:43:22:748 -> [Configure] Info: co2CalibrationRequested: True
|
||||
15:43:22:749 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
15:43:22:751 -> [StateMachine] Info: CO2 Calibration
|
||||
15:43:22:751 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
15:43:23:751 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
15:43:24:751 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
15:43:25:751 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
15:43:26:751 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
15:43:29:759 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
15:43:29:772 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
15:43:29:781 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
15:43:29:794 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
15:43:29:801 -> [StateMachine] Info: CO2 Calibration: success
|
||||
15:43:30:795 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
15:43:30:803 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:43:30:815 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:43:30:816 -> Flags: 0
|
||||
15:43:31:824 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:43:31:842 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:43:31:842 -> Flags: 0
|
||||
15:43:32:845 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:43:32:860 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:43:32:860 -> Flags: 0
|
||||
15:43:33:866 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:43:33:878 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:43:33:884 -> Flags: 0
|
||||
15:43:34:887 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:43:34:899 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:43:34:900 -> Flags: 0
|
||||
15:43:35:908 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:43:35:920 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:43:35:921 -> Flags: 0
|
||||
15:43:36:929 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:43:36:941 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:43:36:942 -> Flags: 0
|
||||
15:43:37:950 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:43:37:962 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:43:37:963 -> Flags: 0
|
||||
15:43:38:971 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:43:38:983 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:43:38:984 -> Flags: 0
|
||||
15:43:39:992 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
15:43:40:004 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
15:43:40:005 -> Flags: 0
|
631
Calibration-Logs/COM47_2025_01_06.16.20.28.657.txt
Normal file
631
Calibration-Logs/COM47_2025_01_06.16.20.28.657.txt
Normal file
@ -0,0 +1,631 @@
|
||||
16:20:28:694 -> Found S8 on Serial1
|
||||
16:20:28:694 -> Init SGP41 failuire
|
||||
16:20:28:694 -> SGP sensor not found
|
||||
16:20:28:694 -> Can not detect SGP run mode 'O-1PS'
|
||||
16:20:28:695 -> initializing PM sensor
|
||||
16:20:28:695 -> cleared 0 byte(s)
|
||||
16:20:28:695 -> setting active mode
|
||||
16:20:28:695 -> 7 byte(s) written
|
||||
16:20:32:695 -> No PM sensor detected on Serial0
|
||||
16:20:32:695 -> initializing PM sensor
|
||||
16:20:32:695 -> cleared 0 byte(s)
|
||||
16:20:32:695 -> setting active mode
|
||||
16:20:32:695 -> 7 byte(s) written
|
||||
16:20:36:695 -> No PM sensor detected on Serial1
|
||||
16:20:36:695 -> Firmware Mode: 0-1PS
|
||||
16:20:36:715 -> Set S8 AbcDays successful
|
||||
16:20:36:716 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
16:20:36:716 -> [ApiClient] Info: begin
|
||||
16:20:36:761 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
16:20:36:761 -> *wm:AutoConnect
|
||||
16:20:36:761 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
16:20:37:264 -> E (10414) wifi:sta is connecting, return error
|
||||
16:20:37:265 -> [ 10167][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
16:20:44:678 -> *wm:AutoConnect: SUCCESS
|
||||
16:20:44:679 -> *wm:STA IP Address: 192.168.100.127
|
||||
16:20:44:679 -> [WifiConnector] Info: Wait for configure portal
|
||||
16:20:44:680 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
16:20:44:692 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
16:20:47:282 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
16:20:47:282 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:20:47:282 -> [ApiClient] Info: DATA: {"wifi":-61,"boot":0}
|
||||
16:20:47:282 -> [ApiClient] Info: Return code: 200
|
||||
16:20:53:283 ->
|
||||
16:20:53:283 -> firmwareCheckForUpdate:
|
||||
16:20:53:283 -> firmwareCheckForUpdate: Perform
|
||||
16:20:53:283 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-1-g4691500-dirty
|
||||
16:20:53:934 -> Firmware update skipped, the server returned 400
|
||||
16:20:53:935 -> 3
|
||||
16:20:53:936 -> OTA message:
|
||||
16:20:53:936 ->
|
||||
16:20:54:559 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:20:54:559 -> [ApiClient] Info: Return code: 200
|
||||
16:20:54:560 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:20:54:561 -> [Configure] Info: Parse configure success
|
||||
16:20:54:562 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:20:54:590 -> CO2 (ppm): 337
|
||||
16:20:58:612 -> CO2 (ppm): 317
|
||||
16:21:02:632 -> CO2 (ppm): 302
|
||||
16:21:06:653 -> CO2 (ppm): 285
|
||||
16:21:10:674 -> CO2 (ppm): 283
|
||||
16:21:14:695 -> CO2 (ppm): 283
|
||||
16:21:22:737 -> CO2 (ppm): 282
|
||||
16:21:22:737 -> CO2 (ppm): 308
|
||||
16:21:26:810 -> CO2 (ppm): 329
|
||||
16:21:27:120 -> External watchdog feed!
|
||||
16:21:28:145 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:21:28:145 -> [ApiClient] Info: DATA: {"wifi":-61,"rco2":329,"boot":0,"bootCount":0}
|
||||
16:21:28:146 -> [ApiClient] Info: Return code: 200
|
||||
16:21:28:147 ->
|
||||
16:21:28:147 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:21:28:147 ->
|
||||
16:21:30:831 -> CO2 (ppm): 340
|
||||
16:21:34:852 -> CO2 (ppm): 337
|
||||
16:21:38:873 -> CO2 (ppm): 328
|
||||
16:21:42:893 -> CO2 (ppm): 317
|
||||
16:21:46:915 -> CO2 (ppm): 307
|
||||
16:21:50:935 -> CO2 (ppm): 296
|
||||
16:21:55:178 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:21:55:179 -> [ApiClient] Info: Return code: 200
|
||||
16:21:55:186 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:21:55:186 -> [Configure] Info: Parse configure success
|
||||
16:21:55:186 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:21:55:226 -> CO2 (ppm): 286
|
||||
16:21:59:247 -> CO2 (ppm): 278
|
||||
16:22:03:274 -> CO2 (ppm): 270
|
||||
16:22:07:289 -> CO2 (ppm): 271
|
||||
16:22:15:331 -> CO2 (ppm): 273
|
||||
16:22:15:331 -> CO2 (ppm): 271
|
||||
16:22:19:352 -> CO2 (ppm): 270
|
||||
16:22:23:373 -> CO2 (ppm): 267
|
||||
16:22:27:143 -> External watchdog feed!
|
||||
16:22:27:394 -> CO2 (ppm): 263
|
||||
16:22:29:106 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:22:29:106 -> [ApiClient] Info: DATA: {"wifi":-61,"rco2":263,"boot":1,"bootCount":1}
|
||||
16:22:29:106 -> [ApiClient] Info: Return code: 200
|
||||
16:22:29:107 ->
|
||||
16:22:29:107 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:22:29:107 ->
|
||||
16:22:31:414 -> CO2 (ppm): 261
|
||||
16:22:35:435 -> CO2 (ppm): 260
|
||||
16:22:39:456 -> CO2 (ppm): 257
|
||||
16:22:43:477 -> CO2 (ppm): 254
|
||||
16:22:47:498 -> CO2 (ppm): 252
|
||||
16:22:51:519 -> CO2 (ppm): 251
|
||||
16:22:55:799 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:22:55:799 -> [ApiClient] Info: Return code: 200
|
||||
16:22:55:801 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:22:55:803 -> [Configure] Info: Parse configure success
|
||||
16:22:55:804 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:22:55:847 -> CO2 (ppm): 251
|
||||
16:22:59:867 -> CO2 (ppm): 255
|
||||
16:23:03:888 -> CO2 (ppm): 255
|
||||
16:23:07:909 -> CO2 (ppm): 254
|
||||
16:23:11:930 -> CO2 (ppm): 253
|
||||
16:23:15:951 -> CO2 (ppm): 252
|
||||
16:23:19:971 -> CO2 (ppm): 250
|
||||
16:23:23:992 -> CO2 (ppm): 248
|
||||
16:23:27:166 -> External watchdog feed!
|
||||
16:23:28:013 -> CO2 (ppm): 246
|
||||
16:23:30:657 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:23:30:658 -> [ApiClient] Info: DATA: {"wifi":-59,"rco2":246,"boot":2,"bootCount":2}
|
||||
16:23:30:658 -> [ApiClient] Info: Return code: 200
|
||||
16:23:30:659 ->
|
||||
16:23:30:659 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:23:30:659 ->
|
||||
16:23:32:034 -> CO2 (ppm): 245
|
||||
16:23:36:055 -> CO2 (ppm): 245
|
||||
16:23:40:075 -> CO2 (ppm): 244
|
||||
16:23:44:097 -> CO2 (ppm): 243
|
||||
16:23:52:138 -> CO2 (ppm): 242
|
||||
16:23:52:138 -> CO2 (ppm): 241
|
||||
16:23:56:419 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:23:56:419 -> [ApiClient] Info: Return code: 200
|
||||
16:23:56:420 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:23:56:422 -> [Configure] Info: Parse configure success
|
||||
16:23:56:422 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:23:56:466 -> CO2 (ppm): 241
|
||||
16:24:00:487 -> CO2 (ppm): 240
|
||||
16:24:04:508 -> CO2 (ppm): 240
|
||||
16:24:08:529 -> CO2 (ppm): 239
|
||||
16:24:12:550 -> CO2 (ppm): 238
|
||||
16:24:16:571 -> CO2 (ppm): 238
|
||||
16:24:20:592 -> CO2 (ppm): 238
|
||||
16:24:24:613 -> CO2 (ppm): 238
|
||||
16:24:27:189 -> External watchdog feed!
|
||||
16:24:28:634 -> CO2 (ppm): 237
|
||||
16:24:31:576 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:24:31:576 -> [ApiClient] Info: DATA: {"wifi":-63,"rco2":237,"boot":3,"bootCount":3}
|
||||
16:24:31:577 -> [ApiClient] Info: Return code: 200
|
||||
16:24:31:577 ->
|
||||
16:24:31:577 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:24:31:577 ->
|
||||
16:24:32:655 -> CO2 (ppm): 237
|
||||
16:24:36:676 -> CO2 (ppm): 237
|
||||
16:24:40:697 -> CO2 (ppm): 237
|
||||
16:24:44:718 -> CO2 (ppm): 237
|
||||
16:24:48:739 -> CO2 (ppm): 237
|
||||
16:24:52:760 -> CO2 (ppm): 237
|
||||
16:24:57:040 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:24:57:041 -> [ApiClient] Info: Return code: 200
|
||||
16:24:57:042 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:24:57:044 -> [Configure] Info: Parse configure success
|
||||
16:24:57:044 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:24:57:088 -> CO2 (ppm): 237
|
||||
16:25:01:109 -> CO2 (ppm): 237
|
||||
16:25:05:130 -> CO2 (ppm): 237
|
||||
16:25:09:151 -> CO2 (ppm): 237
|
||||
16:25:13:179 -> CO2 (ppm): 236
|
||||
16:25:17:193 -> CO2 (ppm): 237
|
||||
16:25:21:214 -> CO2 (ppm): 237
|
||||
16:25:25:234 -> CO2 (ppm): 238
|
||||
16:25:27:212 -> External watchdog feed!
|
||||
16:25:29:255 -> CO2 (ppm): 238
|
||||
16:25:32:573 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:25:32:574 -> [ApiClient] Info: DATA: {"wifi":-64,"rco2":238,"boot":4,"bootCount":4}
|
||||
16:25:32:574 -> [ApiClient] Info: Return code: 200
|
||||
16:25:32:574 ->
|
||||
16:25:32:574 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:25:32:574 ->
|
||||
16:25:33:276 -> CO2 (ppm): 238
|
||||
16:25:41:318 -> CO2 (ppm): 239
|
||||
16:25:41:318 -> CO2 (ppm): 239
|
||||
16:25:45:339 -> CO2 (ppm): 239
|
||||
16:25:49:360 -> CO2 (ppm): 239
|
||||
16:25:53:381 -> CO2 (ppm): 240
|
||||
16:25:57:660 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:25:57:660 -> [ApiClient] Info: Return code: 200
|
||||
16:25:57:662 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:25:57:663 -> [Configure] Info: Parse configure success
|
||||
16:25:57:664 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:25:57:708 -> CO2 (ppm): 239
|
||||
16:26:01:729 -> CO2 (ppm): 239
|
||||
16:26:05:750 -> CO2 (ppm): 239
|
||||
16:26:09:771 -> CO2 (ppm): 238
|
||||
16:26:13:792 -> CO2 (ppm): 237
|
||||
16:26:17:811 -> CO2 (ppm): 237
|
||||
16:26:21:832 -> CO2 (ppm): 237
|
||||
16:26:25:853 -> CO2 (ppm): 237
|
||||
16:26:27:235 -> External watchdog feed!
|
||||
16:26:29:874 -> CO2 (ppm): 237
|
||||
16:26:33:604 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:26:33:604 -> [ApiClient] Info: DATA: {"wifi":-60,"rco2":237,"boot":5,"bootCount":5}
|
||||
16:26:33:605 -> [ApiClient] Info: Return code: 200
|
||||
16:26:33:605 ->
|
||||
16:26:33:605 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:26:33:605 ->
|
||||
16:26:33:895 -> CO2 (ppm): 237
|
||||
16:26:37:916 -> CO2 (ppm): 237
|
||||
16:26:41:937 -> CO2 (ppm): 237
|
||||
16:26:45:958 -> CO2 (ppm): 237
|
||||
16:26:49:979 -> CO2 (ppm): 237
|
||||
16:26:54:000 -> CO2 (ppm): 236
|
||||
16:26:58:281 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:26:58:281 -> [ApiClient] Info: Return code: 200
|
||||
16:26:58:283 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:26:58:284 -> [Configure] Info: Parse configure success
|
||||
16:26:58:285 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:26:58:329 -> CO2 (ppm): 236
|
||||
16:27:02:350 -> CO2 (ppm): 236
|
||||
16:27:06:371 -> CO2 (ppm): 236
|
||||
16:27:10:392 -> CO2 (ppm): 236
|
||||
16:27:14:413 -> CO2 (ppm): 236
|
||||
16:27:18:434 -> CO2 (ppm): 236
|
||||
16:27:22:455 -> CO2 (ppm): 236
|
||||
16:27:26:476 -> CO2 (ppm): 236
|
||||
16:27:27:258 -> External watchdog feed!
|
||||
16:27:30:496 -> CO2 (ppm): 236
|
||||
16:27:34:568 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:27:34:568 -> [ApiClient] Info: DATA: {"wifi":-59,"rco2":236,"boot":6,"bootCount":6}
|
||||
16:27:34:569 -> [ApiClient] Info: Return code: 200
|
||||
16:27:34:570 ->
|
||||
16:27:34:570 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:27:34:570 ->
|
||||
16:27:34:591 -> CO2 (ppm): 236
|
||||
16:27:38:613 -> CO2 (ppm): 237
|
||||
16:27:42:633 -> CO2 (ppm): 237
|
||||
16:27:46:654 -> CO2 (ppm): 239
|
||||
16:27:50:674 -> CO2 (ppm): 243
|
||||
16:27:54:695 -> CO2 (ppm): 244
|
||||
16:27:58:935 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:27:58:935 -> [ApiClient] Info: Return code: 200
|
||||
16:27:58:937 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:27:58:939 -> [Configure] Info: Parse configure success
|
||||
16:27:58:939 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:27:58:983 -> CO2 (ppm): 245
|
||||
16:28:03:004 -> CO2 (ppm): 247
|
||||
16:28:07:025 -> CO2 (ppm): 248
|
||||
16:28:11:046 -> CO2 (ppm): 248
|
||||
16:28:15:067 -> CO2 (ppm): 247
|
||||
16:28:19:088 -> CO2 (ppm): 247
|
||||
16:28:23:109 -> CO2 (ppm): 246
|
||||
16:28:27:130 -> CO2 (ppm): 245
|
||||
16:28:27:282 -> External watchdog feed!
|
||||
16:28:31:151 -> CO2 (ppm): 282
|
||||
16:28:35:666 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:28:35:667 -> [ApiClient] Info: DATA: {"wifi":-60,"rco2":282,"boot":7,"bootCount":7}
|
||||
16:28:35:667 -> [ApiClient] Info: Return code: 200
|
||||
16:28:35:670 ->
|
||||
16:28:35:670 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:28:35:670 ->
|
||||
16:28:35:702 -> CO2 (ppm): 327
|
||||
16:28:39:709 -> CO2 (ppm): 354
|
||||
16:28:43:729 -> CO2 (ppm): 362
|
||||
16:28:47:750 -> CO2 (ppm): 359
|
||||
16:28:51:771 -> CO2 (ppm): 352
|
||||
16:28:55:792 -> CO2 (ppm): 342
|
||||
16:28:59:523 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:28:59:523 -> [ApiClient] Info: Return code: 200
|
||||
16:28:59:525 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:28:59:526 -> [Configure] Info: Parse configure success
|
||||
16:28:59:526 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:28:59:813 -> CO2 (ppm): 340
|
||||
16:29:03:841 -> CO2 (ppm): 347
|
||||
16:29:07:855 -> CO2 (ppm): 347
|
||||
16:29:11:876 -> CO2 (ppm): 341
|
||||
16:29:15:897 -> CO2 (ppm): 332
|
||||
16:29:19:918 -> CO2 (ppm): 356
|
||||
16:29:23:939 -> CO2 (ppm): 383
|
||||
16:29:27:305 -> External watchdog feed!
|
||||
16:29:27:960 -> CO2 (ppm): 395
|
||||
16:29:31:981 -> CO2 (ppm): 394
|
||||
16:29:36:719 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:29:36:719 -> [ApiClient] Info: DATA: {"wifi":-61,"rco2":394,"boot":8,"bootCount":8}
|
||||
16:29:36:720 -> [ApiClient] Info: Return code: 200
|
||||
16:29:36:721 ->
|
||||
16:29:36:721 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:29:36:721 ->
|
||||
16:29:36:742 -> CO2 (ppm): 371
|
||||
16:29:40:763 -> CO2 (ppm): 356
|
||||
16:29:44:783 -> CO2 (ppm): 343
|
||||
16:29:48:804 -> CO2 (ppm): 330
|
||||
16:29:52:825 -> CO2 (ppm): 317
|
||||
16:29:56:846 -> CO2 (ppm): 306
|
||||
16:30:00:755 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:30:00:755 -> [ApiClient] Info: Return code: 200
|
||||
16:30:00:757 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:30:00:758 -> [Configure] Info: Parse configure success
|
||||
16:30:00:759 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:30:00:867 -> CO2 (ppm): 309
|
||||
16:30:04:888 -> CO2 (ppm): 314
|
||||
16:30:08:909 -> CO2 (ppm): 313
|
||||
16:30:12:930 -> CO2 (ppm): 308
|
||||
16:30:16:951 -> CO2 (ppm): 301
|
||||
16:30:20:972 -> CO2 (ppm): 304
|
||||
16:30:24:993 -> CO2 (ppm): 309
|
||||
16:30:27:328 -> External watchdog feed!
|
||||
16:30:29:014 -> CO2 (ppm): 307
|
||||
16:30:33:035 -> CO2 (ppm): 302
|
||||
16:30:37:724 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:30:37:725 -> [ApiClient] Info: DATA: {"wifi":-60,"rco2":302,"boot":9,"bootCount":9}
|
||||
16:30:37:725 -> [ApiClient] Info: Return code: 200
|
||||
16:30:37:726 ->
|
||||
16:30:37:726 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:30:37:726 ->
|
||||
16:30:37:747 -> CO2 (ppm): 295
|
||||
16:30:41:768 -> CO2 (ppm): 288
|
||||
16:30:45:789 -> CO2 (ppm): 281
|
||||
16:30:49:812 -> CO2 (ppm): 275
|
||||
16:30:53:831 -> CO2 (ppm): 270
|
||||
16:30:57:852 -> CO2 (ppm): 264
|
||||
16:31:01:379 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:31:01:380 -> [ApiClient] Info: Return code: 200
|
||||
16:31:01:381 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:31:01:382 -> [Configure] Info: Parse configure success
|
||||
16:31:01:382 -> [Configure] Info: co2CalibrationRequested: True
|
||||
16:31:01:382 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:31:01:384 -> [StateMachine] Info: CO2 Calibration
|
||||
16:31:01:386 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
16:31:02:385 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
16:31:03:384 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
16:31:04:384 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
16:31:05:384 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
16:31:08:393 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
16:31:08:406 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
16:31:08:415 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
16:31:08:428 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
16:31:08:429 -> [StateMachine] Info: CO2 Calibration: success
|
||||
16:31:09:428 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
16:31:09:437 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:09:449 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:09:450 -> Flags: 0
|
||||
16:31:10:458 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:10:470 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:10:471 -> Flags: 0
|
||||
16:31:11:479 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:11:491 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:11:492 -> Flags: 0
|
||||
16:31:12:499 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:12:512 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:12:513 -> Flags: 0
|
||||
16:31:13:520 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:13:537 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:13:537 -> Flags: 0
|
||||
16:31:14:541 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:14:565 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:14:566 -> Flags: 0
|
||||
16:31:15:562 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:15:575 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:15:576 -> Flags: 0
|
||||
16:31:16:583 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:16:596 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:16:596 -> Flags: 0
|
||||
16:31:17:604 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:17:617 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:17:619 -> Flags: 0
|
||||
16:31:18:625 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:18:638 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:18:638 -> Flags: 0
|
||||
16:31:19:646 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:19:659 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:19:660 -> Flags: 0
|
||||
16:31:20:667 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:20:680 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:20:680 -> Flags: 0
|
||||
16:31:21:688 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:21:701 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:21:702 -> Flags: 0
|
||||
16:31:22:709 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:22:722 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:22:722 -> Flags: 0
|
||||
16:31:23:730 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:23:743 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:23:744 -> Flags: 0
|
||||
16:31:24:751 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:24:764 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:24:764 -> Flags: 0
|
||||
16:31:25:772 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:25:785 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:25:785 -> Flags: 0
|
||||
16:31:26:793 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:26:806 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:26:808 -> Flags: 0
|
||||
16:31:27:814 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:27:827 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:27:828 -> Flags: 0
|
||||
16:31:28:835 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:28:848 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:28:848 -> Flags: 0
|
||||
16:31:29:856 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:29:869 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:29:870 -> Flags: 0
|
||||
16:31:30:877 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:30:890 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:30:890 -> Flags: 0
|
||||
16:31:31:898 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:31:911 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:31:911 -> Flags: 0
|
||||
16:31:32:919 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:32:932 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:32:933 -> Flags: 0
|
||||
16:31:33:940 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:33:953 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:33:954 -> Flags: 0
|
||||
16:31:34:969 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:34:974 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:34:974 -> Flags: 0
|
||||
16:31:35:982 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:36:016 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:36:017 -> Flags: 0
|
||||
16:31:37:003 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:37:016 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:37:017 -> Flags: 0
|
||||
16:31:38:024 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:38:037 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:38:037 -> Flags: 0
|
||||
16:31:39:045 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:39:058 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:39:058 -> Flags: 0
|
||||
16:31:40:066 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:40:078 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:40:079 -> Flags: 0
|
||||
16:31:41:087 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:41:099 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:41:100 -> Flags: 0
|
||||
16:31:42:108 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:42:121 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:42:122 -> Flags: 0
|
||||
16:31:43:129 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:43:141 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:43:142 -> Flags: 0
|
||||
16:31:44:150 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:44:162 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:44:163 -> Flags: 0
|
||||
16:31:45:171 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:45:184 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:45:184 -> Flags: 0
|
||||
16:31:46:192 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:46:205 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:46:205 -> Flags: 0
|
||||
16:31:47:213 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:47:226 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:47:226 -> Flags: 0
|
||||
16:31:48:234 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:48:246 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:48:247 -> Flags: 0
|
||||
16:31:49:255 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:49:267 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:49:268 -> Flags: 0
|
||||
16:31:50:276 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:50:288 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:50:289 -> Flags: 0
|
||||
16:31:51:297 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:51:310 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:51:311 -> Flags: 0
|
||||
16:31:52:318 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:52:330 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:52:331 -> Flags: 0
|
||||
16:31:53:339 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:53:351 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:53:353 -> Flags: 0
|
||||
16:31:54:360 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:54:372 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:54:373 -> Flags: 0
|
||||
16:31:55:381 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:55:393 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:55:394 -> Flags: 0
|
||||
16:31:56:402 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:56:414 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:56:414 -> Flags: 0
|
||||
16:31:57:423 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:57:435 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:57:435 -> Flags: 0
|
||||
16:31:58:451 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:58:456 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:58:457 -> Flags: 0
|
||||
16:31:59:465 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:31:59:477 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:31:59:497 -> Flags: 0
|
||||
16:32:00:486 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:00:498 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:00:499 -> Flags: 0
|
||||
16:32:01:506 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:01:519 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:01:519 -> Flags: 0
|
||||
16:32:02:527 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:02:540 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:02:540 -> Flags: 0
|
||||
16:32:03:549 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:03:561 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:03:562 -> Flags: 0
|
||||
16:32:04:569 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:04:583 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:04:583 -> Flags: 0
|
||||
16:32:05:591 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:05:603 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:05:604 -> Flags: 0
|
||||
16:32:06:611 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:06:624 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:06:624 -> Flags: 0
|
||||
16:32:07:633 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:07:645 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:07:646 -> Flags: 0
|
||||
16:32:08:654 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:08:666 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:08:668 -> Flags: 0
|
||||
16:32:09:675 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:09:687 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:09:687 -> Flags: 0
|
||||
16:32:10:696 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:10:708 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:10:709 -> Flags: 0
|
||||
16:32:11:716 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:11:729 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:11:730 -> Flags: 0
|
||||
16:32:12:737 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:12:750 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:12:750 -> Flags: 0
|
||||
16:32:13:758 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:13:771 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:13:772 -> Flags: 0
|
||||
16:32:14:780 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:14:792 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:14:793 -> Flags: 0
|
||||
16:32:15:801 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:15:813 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:15:814 -> Flags: 0
|
||||
16:32:16:822 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:16:835 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:16:836 -> Flags: 0
|
||||
16:32:17:843 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:17:855 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:17:856 -> Flags: 0
|
||||
16:32:18:864 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:18:876 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:18:877 -> Flags: 0
|
||||
16:32:19:885 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:19:897 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:19:898 -> Flags: 0
|
||||
16:32:20:906 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:20:929 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:20:929 -> Flags: 0
|
||||
16:32:21:926 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:21:939 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:21:941 -> Flags: 0
|
||||
16:32:22:947 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:22:960 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:22:961 -> Flags: 0
|
||||
16:32:23:969 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:23:981 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:23:982 -> Flags: 0
|
||||
16:32:24:989 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:25:002 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:25:003 -> Flags: 0
|
||||
16:32:26:010 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:26:023 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:26:024 -> Flags: 0
|
||||
16:32:27:031 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:27:044 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:27:045 -> Flags: 0
|
||||
16:32:28:053 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:28:065 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:28:066 -> Flags: 0
|
||||
16:32:29:073 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:29:086 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:29:087 -> Flags: 0
|
||||
16:32:30:094 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:30:107 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:30:108 -> Flags: 0
|
||||
16:32:31:116 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:31:128 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:31:130 -> Flags: 0
|
||||
16:32:32:136 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:32:149 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:32:150 -> Flags: 0
|
||||
16:32:33:157 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:33:170 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:33:171 -> Flags: 0
|
||||
16:32:34:178 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:34:191 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:34:192 -> Flags: 0
|
||||
16:32:35:199 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:35:212 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:35:212 -> Flags: 0
|
||||
16:32:36:221 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:36:233 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:36:233 -> Flags: 0
|
||||
16:32:37:241 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:37:254 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:37:255 -> Flags: 0
|
||||
16:32:38:262 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:38:275 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:38:275 -> Flags: 0
|
||||
16:32:39:283 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:39:296 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:39:296 -> Flags: 0
|
||||
16:32:40:304 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:40:317 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:40:317 -> Flags: 0
|
||||
16:32:41:325 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:41:338 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:41:339 -> Flags: 0
|
||||
16:32:42:346 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:42:359 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:42:359 -> Flags: 0
|
||||
16:32:43:367 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:43:380 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:43:380 -> Flags: 0
|
||||
16:32:44:396 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:44:401 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:44:401 -> Flags: 0
|
||||
16:32:45:409 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:45:422 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:45:422 -> Flags: 0
|
||||
16:32:46:430 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:46:443 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:46:443 -> Flags: 0
|
||||
16:32:47:451 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:47:464 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:47:465 -> Flags: 0
|
||||
16:32:48:472 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:48:485 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:48:485 -> Flags: 0
|
||||
16:32:49:493 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:49:505 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:49:506 -> Flags: 0
|
||||
16:32:50:514 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:50:527 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:50:527 -> Flags: 0
|
||||
16:32:51:535 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:32:51:547 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:32:51:548 -> Flags: 0
|
232
Calibration-Logs/COM47_2025_01_06.16.32.58.888.txt
Normal file
232
Calibration-Logs/COM47_2025_01_06.16.32.58.888.txt
Normal file
@ -0,0 +1,232 @@
|
||||
16:32:59:558 -> Detected OPEN_AIR_OUTDOOR
|
||||
16:32:59:559 -> Firmware Version: 3.1.9-1-g4691500-dirty
|
||||
16:32:59:704 -> Found S8 on Serial1
|
||||
16:32:59:704 -> Init SGP41 failuire
|
||||
16:32:59:704 -> SGP sensor not found
|
||||
16:32:59:704 -> Can not detect SGP run mode 'O-1PS'
|
||||
16:32:59:705 -> initializing PM sensor
|
||||
16:32:59:705 -> cleared 0 byte(s)
|
||||
16:32:59:705 -> setting active mode
|
||||
16:32:59:705 -> 7 byte(s) written
|
||||
16:33:03:705 -> No PM sensor detected on Serial0
|
||||
16:33:03:705 -> initializing PM sensor
|
||||
16:33:03:705 -> cleared 0 byte(s)
|
||||
16:33:03:705 -> setting active mode
|
||||
16:33:03:705 -> 7 byte(s) written
|
||||
16:33:07:705 -> No PM sensor detected on Serial1
|
||||
16:33:07:705 -> Firmware Mode: 0-1PS
|
||||
16:33:07:726 -> Set S8 AbcDays successful
|
||||
16:33:07:726 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
16:33:07:726 -> [ApiClient] Info: begin
|
||||
16:33:07:771 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
16:33:07:771 -> *wm:AutoConnect
|
||||
16:33:07:772 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
16:33:08:274 -> E (10414) wifi:sta is connecting, return error
|
||||
16:33:08:275 -> [ 10167][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
16:33:15:690 -> *wm:AutoConnect: SUCCESS
|
||||
16:33:15:690 -> *wm:STA IP Address: 192.168.100.127
|
||||
16:33:15:692 -> [WifiConnector] Info: Wait for configure portal
|
||||
16:33:15:692 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
16:33:15:704 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
16:33:18:046 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
16:33:18:047 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:33:18:047 -> [ApiClient] Info: DATA: {"wifi":-59,"boot":0}
|
||||
16:33:18:047 -> [ApiClient] Info: Return code: 200
|
||||
16:33:24:047 ->
|
||||
16:33:24:048 -> firmwareCheckForUpdate:
|
||||
16:33:24:048 -> firmwareCheckForUpdate: Perform
|
||||
16:33:24:048 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-1-g4691500-dirty
|
||||
16:33:24:678 -> Firmware update skipped, the server returned 400
|
||||
16:33:24:679 -> 3
|
||||
16:33:24:679 -> OTA message:
|
||||
16:33:24:679 ->
|
||||
16:33:25:252 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:33:25:252 -> [ApiClient] Info: Return code: 200
|
||||
16:33:25:254 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:33:25:256 -> [Configure] Info: Parse configure success
|
||||
16:33:25:256 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:33:25:284 -> CO2 (ppm): 367
|
||||
16:33:29:305 -> CO2 (ppm): 347
|
||||
16:33:33:325 -> CO2 (ppm): 333
|
||||
16:33:37:346 -> CO2 (ppm): 309
|
||||
16:33:41:367 -> CO2 (ppm): 307
|
||||
16:33:45:388 -> CO2 (ppm): 301
|
||||
16:33:49:409 -> CO2 (ppm): 293
|
||||
16:33:53:430 -> CO2 (ppm): 284
|
||||
16:33:57:450 -> CO2 (ppm): 276
|
||||
16:33:58:130 -> External watchdog feed!
|
||||
16:33:59:077 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:33:59:078 -> [ApiClient] Info: DATA: {"wifi":-59,"rco2":276,"boot":0,"bootCount":0}
|
||||
16:33:59:078 -> [ApiClient] Info: Return code: 200
|
||||
16:33:59:079 ->
|
||||
16:33:59:079 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:33:59:079 ->
|
||||
16:34:01:471 -> CO2 (ppm): 269
|
||||
16:34:05:492 -> CO2 (ppm): 263
|
||||
16:34:09:512 -> CO2 (ppm): 257
|
||||
16:34:13:533 -> CO2 (ppm): 253
|
||||
16:34:17:554 -> CO2 (ppm): 248
|
||||
16:34:21:574 -> CO2 (ppm): 246
|
||||
16:34:25:895 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:34:25:895 -> [ApiClient] Info: Return code: 200
|
||||
16:34:25:897 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:34:25:898 -> [Configure] Info: Parse configure success
|
||||
16:34:25:899 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:34:25:943 -> CO2 (ppm): 249
|
||||
16:34:29:964 -> CO2 (ppm): 249
|
||||
16:34:33:985 -> CO2 (ppm): 248
|
||||
16:34:38:006 -> CO2 (ppm): 246
|
||||
16:34:42:026 -> CO2 (ppm): 246
|
||||
16:34:46:048 -> CO2 (ppm): 244
|
||||
16:34:50:068 -> CO2 (ppm): 243
|
||||
16:34:54:090 -> CO2 (ppm): 242
|
||||
16:34:58:111 -> CO2 (ppm): 241
|
||||
16:34:58:153 -> External watchdog feed!
|
||||
16:35:00:013 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:35:00:013 -> [ApiClient] Info: DATA: {"wifi":-57,"rco2":241,"boot":1,"bootCount":1}
|
||||
16:35:00:013 -> [ApiClient] Info: Return code: 200
|
||||
16:35:00:014 ->
|
||||
16:35:00:014 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:35:00:014 ->
|
||||
16:35:06:152 -> CO2 (ppm): 240
|
||||
16:35:06:152 -> CO2 (ppm): 239
|
||||
16:35:10:173 -> CO2 (ppm): 238
|
||||
16:35:14:193 -> CO2 (ppm): 238
|
||||
16:35:18:214 -> CO2 (ppm): 237
|
||||
16:35:22:235 -> CO2 (ppm): 238
|
||||
16:35:26:492 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:35:26:493 -> [ApiClient] Info: Return code: 200
|
||||
16:35:26:495 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:35:26:496 -> [Configure] Info: Parse configure success
|
||||
16:35:26:496 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:35:26:541 -> CO2 (ppm): 238
|
||||
16:35:30:561 -> CO2 (ppm): 239
|
||||
16:35:34:582 -> CO2 (ppm): 238
|
||||
16:35:38:603 -> CO2 (ppm): 238
|
||||
16:35:42:624 -> CO2 (ppm): 238
|
||||
16:35:46:645 -> CO2 (ppm): 238
|
||||
16:35:50:666 -> CO2 (ppm): 238
|
||||
16:35:58:177 -> CO2 (ppm): 238
|
||||
16:35:58:177 -> External watchdog feed!
|
||||
16:35:58:708 -> CO2 (ppm): 238
|
||||
16:36:01:001 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:36:01:002 -> [ApiClient] Info: DATA: {"wifi":-57,"rco2":238,"boot":2,"bootCount":2}
|
||||
16:36:01:002 -> [ApiClient] Info: Return code: 200
|
||||
16:36:01:003 ->
|
||||
16:36:01:003 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:36:01:003 ->
|
||||
16:36:02:729 -> CO2 (ppm): 239
|
||||
16:36:06:750 -> CO2 (ppm): 240
|
||||
16:36:10:770 -> CO2 (ppm): 240
|
||||
16:36:18:812 -> CO2 (ppm): 240
|
||||
16:36:18:812 -> CO2 (ppm): 240
|
||||
16:36:22:833 -> CO2 (ppm): 240
|
||||
16:36:27:113 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:36:27:113 -> [ApiClient] Info: Return code: 200
|
||||
16:36:27:114 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:36:27:116 -> [Configure] Info: Parse configure success
|
||||
16:36:27:116 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:36:27:160 -> CO2 (ppm): 253
|
||||
16:36:31:181 -> CO2 (ppm): 263
|
||||
16:36:35:202 -> CO2 (ppm): 267
|
||||
16:36:39:223 -> CO2 (ppm): 267
|
||||
16:36:43:244 -> CO2 (ppm): 266
|
||||
16:36:47:265 -> CO2 (ppm): 264
|
||||
16:36:51:287 -> CO2 (ppm): 262
|
||||
16:36:55:307 -> CO2 (ppm): 259
|
||||
16:36:58:200 -> External watchdog feed!
|
||||
16:36:59:328 -> CO2 (ppm): 256
|
||||
16:37:01:982 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:37:01:982 -> [ApiClient] Info: DATA: {"wifi":-60,"rco2":256,"boot":3,"bootCount":3}
|
||||
16:37:01:983 -> [ApiClient] Info: Return code: 200
|
||||
16:37:01:984 ->
|
||||
16:37:01:984 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:37:01:984 ->
|
||||
16:37:03:349 -> CO2 (ppm): 257
|
||||
16:37:07:370 -> CO2 (ppm): 257
|
||||
16:37:11:391 -> CO2 (ppm): 268
|
||||
16:37:15:412 -> CO2 (ppm): 291
|
||||
16:37:19:433 -> CO2 (ppm): 306
|
||||
16:37:23:472 -> CO2 (ppm): 313
|
||||
16:37:27:728 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:37:27:728 -> [ApiClient] Info: Return code: 200
|
||||
16:37:27:729 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:37:27:731 -> [Configure] Info: Parse configure success
|
||||
16:37:27:731 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:37:27:775 -> CO2 (ppm): 316
|
||||
16:37:31:796 -> CO2 (ppm): 314
|
||||
16:37:35:817 -> CO2 (ppm): 315
|
||||
16:37:43:859 -> CO2 (ppm): 314
|
||||
16:37:43:859 -> CO2 (ppm): 309
|
||||
16:37:47:880 -> CO2 (ppm): 304
|
||||
16:37:55:922 -> CO2 (ppm): 297
|
||||
16:37:55:922 -> CO2 (ppm): 290
|
||||
16:37:58:223 -> External watchdog feed!
|
||||
16:37:59:943 -> CO2 (ppm): 283
|
||||
16:38:03:062 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:38:03:062 -> [ApiClient] Info: DATA: {"wifi":-60,"rco2":283,"boot":4,"bootCount":4}
|
||||
16:38:03:062 -> [ApiClient] Info: Return code: 200
|
||||
16:38:03:063 ->
|
||||
16:38:03:064 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:38:03:064 ->
|
||||
16:38:03:964 -> CO2 (ppm): 276
|
||||
16:38:07:985 -> CO2 (ppm): 270
|
||||
16:38:12:006 -> CO2 (ppm): 264
|
||||
16:38:16:027 -> CO2 (ppm): 260
|
||||
16:38:20:048 -> CO2 (ppm): 263
|
||||
16:38:24:069 -> CO2 (ppm): 271
|
||||
16:38:28:375 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:38:28:375 -> [ApiClient] Info: Return code: 200
|
||||
16:38:28:376 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:38:28:378 -> [Configure] Info: Parse configure success
|
||||
16:38:28:379 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:38:28:423 -> CO2 (ppm): 273
|
||||
16:38:32:443 -> CO2 (ppm): 279
|
||||
16:38:36:469 -> CO2 (ppm): 292
|
||||
16:38:40:485 -> CO2 (ppm): 305
|
||||
16:38:44:560 -> CO2 (ppm): 310
|
||||
16:38:48:581 -> CO2 (ppm): 308
|
||||
16:38:52:602 -> CO2 (ppm): 296
|
||||
16:38:56:623 -> CO2 (ppm): 312
|
||||
16:38:58:246 -> External watchdog feed!
|
||||
16:39:00:644 -> CO2 (ppm): 326
|
||||
16:39:04:092 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:39:04:092 -> [ApiClient] Info: DATA: {"wifi":-65,"rco2":326,"boot":5,"bootCount":5}
|
||||
16:39:04:092 -> [ApiClient] Info: Return code: 200
|
||||
16:39:04:093 ->
|
||||
16:39:04:093 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:39:04:093 ->
|
||||
16:39:04:665 -> CO2 (ppm): 333
|
||||
16:39:12:707 -> CO2 (ppm): 334
|
||||
16:39:12:707 -> CO2 (ppm): 329
|
||||
16:39:16:728 -> CO2 (ppm): 321
|
||||
16:39:20:749 -> CO2 (ppm): 312
|
||||
16:39:24:770 -> CO2 (ppm): 302
|
||||
16:39:29:015 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:39:29:015 -> [ApiClient] Info: Return code: 200
|
||||
16:39:29:016 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:39:29:018 -> [Configure] Info: Parse configure success
|
||||
16:39:29:018 -> [Configure] Info: co2CalibrationRequested: True
|
||||
16:39:29:019 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:39:29:020 -> [StateMachine] Info: CO2 Calibration
|
||||
16:39:29:021 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
16:39:30:021 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
16:39:31:021 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
16:39:32:021 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
16:39:33:021 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
16:39:36:029 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
16:39:36:043 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
16:39:36:052 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
16:39:36:065 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
16:39:36:066 -> [StateMachine] Info: CO2 Calibration: success
|
||||
16:39:37:066 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
16:39:37:074 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:39:37:086 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:39:37:087 -> Flags: 0
|
||||
16:39:38:095 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:39:38:107 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:39:38:107 -> Flags: 0
|
||||
16:39:39:116 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:39:39:128 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:39:39:129 -> Flags: 0
|
||||
16:39:40:137 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
313
Calibration-Logs/COM47_2025_01_06.16.39.42.786.txt
Normal file
313
Calibration-Logs/COM47_2025_01_06.16.39.42.786.txt
Normal file
@ -0,0 +1,313 @@
|
||||
16:39:43:641 -> Detected OPEN_AIR_OUTDOOR
|
||||
16:39:43:641 -> Firmware Version: 3.1.9-1-g4691500-dirty
|
||||
16:39:43:787 -> Found S8 on Serial1
|
||||
16:39:43:787 -> Init SGP41 failuire
|
||||
16:39:43:787 -> SGP sensor not found
|
||||
16:39:43:787 -> Can not detect SGP run mode 'O-1PS'
|
||||
16:39:43:788 -> initializing PM sensor
|
||||
16:39:43:788 -> cleared 0 byte(s)
|
||||
16:39:43:788 -> setting active mode
|
||||
16:39:43:788 -> 7 byte(s) written
|
||||
16:39:47:788 -> No PM sensor detected on Serial0
|
||||
16:39:47:788 -> initializing PM sensor
|
||||
16:39:47:788 -> cleared 0 byte(s)
|
||||
16:39:47:788 -> setting active mode
|
||||
16:39:47:788 -> 7 byte(s) written
|
||||
16:39:51:788 -> No PM sensor detected on Serial1
|
||||
16:39:51:789 -> Firmware Mode: 0-1PS
|
||||
16:39:51:809 -> Set S8 AbcDays successful
|
||||
16:39:51:809 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
16:39:51:809 -> [ApiClient] Info: begin
|
||||
16:39:51:854 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
16:39:51:855 -> *wm:AutoConnect
|
||||
16:39:51:855 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
16:39:52:358 -> *wm:[ERROR] wifi begin failed
|
||||
16:39:55:359 -> *wm:AutoConnect: SUCCESS
|
||||
16:39:55:359 -> *wm:STA IP Address: 192.168.100.127
|
||||
16:39:55:359 -> [WifiConnector] Info: Wait for configure portal
|
||||
16:39:55:359 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
16:39:55:373 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
16:39:55:373 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
16:39:59:401 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:39:59:402 -> [ApiClient] Info: DATA: {"wifi":-86,"boot":0}
|
||||
16:39:59:402 -> [ApiClient] Info: Return code: 200
|
||||
16:40:05:402 ->
|
||||
16:40:05:402 -> firmwareCheckForUpdate:
|
||||
16:40:05:402 -> firmwareCheckForUpdate: Perform
|
||||
16:40:05:402 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-1-g4691500-dirty
|
||||
16:40:06:564 -> Firmware update skipped, the server returned 400
|
||||
16:40:06:566 -> 3
|
||||
16:40:06:567 -> OTA message:
|
||||
16:40:06:567 ->
|
||||
16:40:11:567 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:40:11:567 -> [ApiClient] Info: Return code: -1
|
||||
16:40:27:093 -> CO2 (ppm): 252
|
||||
16:40:31:113 -> CO2 (ppm): 250
|
||||
16:40:35:135 -> CO2 (ppm): 248
|
||||
16:40:39:156 -> CO2 (ppm): 246
|
||||
16:40:43:543 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:40:43:543 -> [ApiClient] Info: DATA: {"wifi":-82,"rco2":246,"boot":0,"bootCount":0}
|
||||
16:40:43:543 -> [ApiClient] Info: Return code: 200
|
||||
16:40:43:544 ->
|
||||
16:40:43:544 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:40:43:545 ->
|
||||
16:40:43:565 -> CO2 (ppm): 245
|
||||
16:40:43:590 -> External watchdog feed!
|
||||
16:40:47:586 -> CO2 (ppm): 244
|
||||
16:40:51:607 -> CO2 (ppm): 243
|
||||
16:40:55:628 -> CO2 (ppm): 242
|
||||
16:40:59:649 -> CO2 (ppm): 241
|
||||
16:41:03:670 -> CO2 (ppm): 241
|
||||
16:41:07:691 -> CO2 (ppm): 240
|
||||
16:41:12:313 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:41:12:313 -> [ApiClient] Info: Return code: 200
|
||||
16:41:12:315 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:41:12:316 -> [Configure] Info: Parse configure success
|
||||
16:41:12:317 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:41:12:361 -> CO2 (ppm): 241
|
||||
16:41:20:403 -> CO2 (ppm): 240
|
||||
16:41:20:403 -> CO2 (ppm): 239
|
||||
16:41:24:423 -> CO2 (ppm): 238
|
||||
16:41:28:443 -> CO2 (ppm): 238
|
||||
16:41:32:464 -> CO2 (ppm): 238
|
||||
16:41:36:485 -> CO2 (ppm): 238
|
||||
16:41:44:875 -> CO2 (ppm): 239
|
||||
16:41:44:875 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:41:44:876 -> [ApiClient] Info: DATA: {"wifi":-84,"rco2":239,"boot":1,"bootCount":1}
|
||||
16:41:44:876 -> [ApiClient] Info: Return code: 200
|
||||
16:41:44:877 ->
|
||||
16:41:44:877 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:41:44:877 ->
|
||||
16:41:44:899 -> CO2 (ppm): 247
|
||||
16:41:44:923 -> External watchdog feed!
|
||||
16:41:48:920 -> CO2 (ppm): 273
|
||||
16:41:52:940 -> CO2 (ppm): 287
|
||||
16:41:56:961 -> CO2 (ppm): 294
|
||||
16:42:00:982 -> CO2 (ppm): 295
|
||||
16:42:05:003 -> CO2 (ppm): 294
|
||||
16:42:09:024 -> CO2 (ppm): 289
|
||||
16:42:13:362 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:42:13:362 -> [ApiClient] Info: Return code: 200
|
||||
16:42:13:363 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:42:13:364 -> [Configure] Info: Parse configure success
|
||||
16:42:13:365 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:42:13:409 -> CO2 (ppm): 284
|
||||
16:42:17:480 -> CO2 (ppm): 280
|
||||
16:42:21:501 -> CO2 (ppm): 287
|
||||
16:42:25:522 -> CO2 (ppm): 296
|
||||
16:42:29:543 -> CO2 (ppm): 294
|
||||
16:42:33:564 -> CO2 (ppm): 289
|
||||
16:42:37:585 -> CO2 (ppm): 283
|
||||
16:42:41:606 -> CO2 (ppm): 278
|
||||
16:42:46:424 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:42:46:424 -> [ApiClient] Info: DATA: {"wifi":-83,"rco2":278,"boot":2,"bootCount":2}
|
||||
16:42:46:426 -> [ApiClient] Info: Return code: 200
|
||||
16:42:46:426 ->
|
||||
16:42:46:426 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:42:46:426 ->
|
||||
16:42:46:447 -> CO2 (ppm): 274
|
||||
16:42:46:472 -> External watchdog feed!
|
||||
16:42:50:468 -> CO2 (ppm): 272
|
||||
16:42:54:489 -> CO2 (ppm): 268
|
||||
16:42:58:509 -> CO2 (ppm): 264
|
||||
16:43:02:531 -> CO2 (ppm): 260
|
||||
16:43:06:552 -> CO2 (ppm): 257
|
||||
16:43:10:572 -> CO2 (ppm): 254
|
||||
16:43:14:063 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:43:14:063 -> [ApiClient] Info: Return code: 200
|
||||
16:43:14:064 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:43:14:066 -> [Configure] Info: Parse configure success
|
||||
16:43:14:066 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:43:14:593 -> CO2 (ppm): 252
|
||||
16:43:18:614 -> CO2 (ppm): 250
|
||||
16:43:22:635 -> CO2 (ppm): 249
|
||||
16:43:26:656 -> CO2 (ppm): 248
|
||||
16:43:30:677 -> CO2 (ppm): 248
|
||||
16:43:34:698 -> CO2 (ppm): 248
|
||||
16:43:38:719 -> CO2 (ppm): 247
|
||||
16:43:42:740 -> CO2 (ppm): 245
|
||||
16:43:47:548 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:43:47:548 -> [ApiClient] Info: DATA: {"wifi":-82,"rco2":245,"boot":3,"bootCount":3}
|
||||
16:43:47:550 -> [ApiClient] Info: Return code: 200
|
||||
16:43:47:550 ->
|
||||
16:43:47:550 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:43:47:550 ->
|
||||
16:43:47:570 -> CO2 (ppm): 244
|
||||
16:43:47:597 -> External watchdog feed!
|
||||
16:43:51:591 -> CO2 (ppm): 242
|
||||
16:43:55:612 -> CO2 (ppm): 240
|
||||
16:43:59:651 -> CO2 (ppm): 240
|
||||
16:44:03:654 -> CO2 (ppm): 240
|
||||
16:44:07:675 -> CO2 (ppm): 239
|
||||
16:44:11:696 -> CO2 (ppm): 239
|
||||
16:44:14:686 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:44:14:687 -> [ApiClient] Info: Return code: 200
|
||||
16:44:14:688 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:44:14:689 -> [Configure] Info: Parse configure success
|
||||
16:44:14:690 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:44:15:716 -> CO2 (ppm): 238
|
||||
16:44:19:737 -> CO2 (ppm): 238
|
||||
16:44:23:759 -> CO2 (ppm): 274
|
||||
16:44:27:779 -> CO2 (ppm): 314
|
||||
16:44:31:800 -> CO2 (ppm): 343
|
||||
16:44:39:844 -> CO2 (ppm): 352
|
||||
16:44:39:844 -> CO2 (ppm): 351
|
||||
16:44:43:863 -> CO2 (ppm): 347
|
||||
16:44:48:678 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:44:48:679 -> [ApiClient] Info: DATA: {"wifi":-83,"rco2":347,"boot":4,"bootCount":4}
|
||||
16:44:48:679 -> [ApiClient] Info: Return code: 200
|
||||
16:44:48:680 ->
|
||||
16:44:48:680 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:44:48:680 ->
|
||||
16:44:48:715 -> CO2 (ppm): 340
|
||||
16:44:48:725 -> External watchdog feed!
|
||||
16:44:52:721 -> CO2 (ppm): 330
|
||||
16:44:56:764 -> CO2 (ppm): 318
|
||||
16:45:00:785 -> CO2 (ppm): 307
|
||||
16:45:04:805 -> CO2 (ppm): 288
|
||||
16:45:08:826 -> CO2 (ppm): 280
|
||||
16:45:12:847 -> CO2 (ppm): 273
|
||||
16:45:15:303 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:45:15:303 -> [ApiClient] Info: Return code: 200
|
||||
16:45:15:321 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:45:15:322 -> [Configure] Info: Parse configure success
|
||||
16:45:15:322 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:45:16:867 -> CO2 (ppm): 267
|
||||
16:45:24:910 -> CO2 (ppm): 262
|
||||
16:45:24:910 -> CO2 (ppm): 257
|
||||
16:45:28:930 -> CO2 (ppm): 253
|
||||
16:45:32:950 -> CO2 (ppm): 250
|
||||
16:45:36:971 -> CO2 (ppm): 248
|
||||
16:45:40:992 -> CO2 (ppm): 247
|
||||
16:45:45:013 -> CO2 (ppm): 246
|
||||
16:45:49:916 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:45:49:916 -> [ApiClient] Info: DATA: {"wifi":-83,"rco2":246,"boot":5,"bootCount":5}
|
||||
16:45:49:917 -> [ApiClient] Info: Return code: 200
|
||||
16:45:49:917 ->
|
||||
16:45:49:917 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:45:49:917 ->
|
||||
16:45:49:938 -> CO2 (ppm): 247
|
||||
16:45:49:963 -> External watchdog feed!
|
||||
16:45:53:959 -> CO2 (ppm): 247
|
||||
16:45:57:980 -> CO2 (ppm): 247
|
||||
16:46:02:001 -> CO2 (ppm): 247
|
||||
16:46:10:043 -> CO2 (ppm): 246
|
||||
16:46:10:043 -> CO2 (ppm): 246
|
||||
16:46:14:064 -> CO2 (ppm): 246
|
||||
16:46:16:023 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:46:16:024 -> [ApiClient] Info: Return code: 200
|
||||
16:46:16:025 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:46:16:026 -> [Configure] Info: Parse configure success
|
||||
16:46:16:027 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:46:18:085 -> CO2 (ppm): 246
|
||||
16:46:22:106 -> CO2 (ppm): 247
|
||||
16:46:26:127 -> CO2 (ppm): 247
|
||||
16:46:30:148 -> CO2 (ppm): 247
|
||||
16:46:34:169 -> CO2 (ppm): 246
|
||||
16:46:38:190 -> CO2 (ppm): 246
|
||||
16:46:42:211 -> CO2 (ppm): 247
|
||||
16:46:46:232 -> CO2 (ppm): 246
|
||||
16:46:50:874 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:46:50:874 -> [ApiClient] Info: DATA: {"wifi":-83,"rco2":246,"boot":6,"bootCount":6}
|
||||
16:46:50:875 -> [ApiClient] Info: Return code: 200
|
||||
16:46:50:876 ->
|
||||
16:46:50:876 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:46:50:876 ->
|
||||
16:46:50:896 -> CO2 (ppm): 255
|
||||
16:46:50:921 -> External watchdog feed!
|
||||
16:46:54:918 -> CO2 (ppm): 257
|
||||
16:46:58:938 -> CO2 (ppm): 257
|
||||
16:47:02:959 -> CO2 (ppm): 301
|
||||
16:47:11:001 -> CO2 (ppm): 340
|
||||
16:47:11:001 -> CO2 (ppm): 357
|
||||
16:47:15:022 -> CO2 (ppm): 363
|
||||
16:47:16:647 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:47:16:647 -> [ApiClient] Info: Return code: 200
|
||||
16:47:16:649 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:47:16:650 -> [Configure] Info: Parse configure success
|
||||
16:47:16:651 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:47:19:043 -> CO2 (ppm): 362
|
||||
16:47:23:064 -> CO2 (ppm): 358
|
||||
16:47:27:085 -> CO2 (ppm): 351
|
||||
16:47:31:106 -> CO2 (ppm): 341
|
||||
16:47:39:148 -> CO2 (ppm): 330
|
||||
16:47:39:148 -> CO2 (ppm): 319
|
||||
16:47:43:169 -> CO2 (ppm): 308
|
||||
16:47:47:190 -> CO2 (ppm): 297
|
||||
16:47:51:825 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:47:51:825 -> [ApiClient] Info: DATA: {"wifi":-83,"rco2":297,"boot":7,"bootCount":7}
|
||||
16:47:51:826 -> [ApiClient] Info: Return code: 200
|
||||
16:47:51:848 ->
|
||||
16:47:51:848 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:47:51:848 ->
|
||||
16:47:51:848 -> CO2 (ppm): 288
|
||||
16:47:51:873 -> External watchdog feed!
|
||||
16:47:55:869 -> CO2 (ppm): 281
|
||||
16:47:59:947 -> CO2 (ppm): 276
|
||||
16:48:03:968 -> CO2 (ppm): 270
|
||||
16:48:07:989 -> CO2 (ppm): 261
|
||||
16:48:16:031 -> CO2 (ppm): 257
|
||||
16:48:16:031 -> CO2 (ppm): 254
|
||||
16:48:17:265 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:48:17:265 -> [ApiClient] Info: Return code: 200
|
||||
16:48:17:266 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:48:17:268 -> [Configure] Info: Parse configure success
|
||||
16:48:17:268 -> [Configure] Info: co2CalibrationRequested: True
|
||||
16:48:17:269 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:48:17:271 -> [StateMachine] Info: CO2 Calibration
|
||||
16:48:17:271 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
16:48:18:271 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
16:48:19:271 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
16:48:20:271 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
16:48:21:271 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
16:48:24:279 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
16:48:24:292 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
16:48:24:301 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
16:48:24:315 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
16:48:24:315 -> [StateMachine] Info: CO2 Calibration: success
|
||||
16:48:25:316 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
16:48:25:324 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:25:336 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:25:337 -> Flags: 0
|
||||
16:48:26:345 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:26:357 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:26:357 -> Flags: 0
|
||||
16:48:27:366 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:27:378 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:27:379 -> Flags: 0
|
||||
16:48:28:387 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:28:399 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:28:399 -> Flags: 0
|
||||
16:48:29:408 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:29:420 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:29:420 -> Flags: 0
|
||||
16:48:30:428 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:30:441 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:30:442 -> Flags: 0
|
||||
16:48:31:450 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:31:462 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:31:462 -> Flags: 0
|
||||
16:48:32:470 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:32:483 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:32:483 -> Flags: 0
|
||||
16:48:33:492 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:33:504 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:33:505 -> Flags: 0
|
||||
16:48:34:513 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:39:513 -> Get Acknowladgement Response >
|
||||
16:48:39:514 -> Error getting acknowledgement flags!
|
||||
16:48:40:521 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:45:522 -> Get Acknowladgement Response > 0xFF
|
||||
16:48:45:522 -> Error getting acknowledgement flags!
|
||||
16:48:46:531 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:46:543 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:46:543 -> Flags: 0
|
||||
16:48:47:552 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:47:564 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:47:564 -> Flags: 0
|
||||
16:48:48:572 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:48:585 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:48:585 -> Flags: 0
|
||||
16:48:49:594 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
16:48:49:606 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
16:48:49:606 -> Flags: 0
|
364
Calibration-Logs/COM47_2025_01_06.16.50.00.922.txt
Normal file
364
Calibration-Logs/COM47_2025_01_06.16.50.00.922.txt
Normal file
@ -0,0 +1,364 @@
|
||||
16:50:04:699 -> No PM sensor detected on Serial0
|
||||
16:50:04:699 -> initializing PM sensor
|
||||
16:50:04:699 -> cleared 0 byte(s)
|
||||
16:50:04:699 -> setting active mode
|
||||
16:50:04:699 -> 7 byte(s) written
|
||||
16:50:08:699 -> No PM sensor detected on Serial1
|
||||
16:50:08:699 -> Firmware Mode: 0-1PS
|
||||
16:50:08:721 -> Set S8 AbcDays successful
|
||||
16:50:08:721 -> [ApiClient] Info: Init apiRoot: http://hw.airgradient.com
|
||||
16:50:08:721 -> [ApiClient] Info: begin
|
||||
16:50:08:766 -> [WifiConnector] Info: Connecting to WiFi...
|
||||
16:50:08:766 -> *wm:AutoConnect
|
||||
16:50:08:767 -> *wm:Connecting to SAVED AP: ag-diamond_2.4GHz
|
||||
16:50:09:269 -> E (10415) wifi:sta is connecting, return error
|
||||
16:50:09:270 -> [ 10168][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
|
||||
16:50:17:484 -> *wm:AutoConnect: SUCCESS
|
||||
16:50:17:485 -> *wm:STA IP Address: 192.168.100.127
|
||||
16:50:17:485 -> [WifiConnector] Info: Wait for configure portal
|
||||
16:50:17:485 -> [WifiConnector] Info: WiFi Connected: ag-diamond_2.4GHz IP: 192.168.100.127
|
||||
16:50:17:498 -> [LocalServer] Info: Init: airgradient_d83bda1b86c8.local
|
||||
16:50:20:031 -> MQTT is not configured, skipping initialization of MQTT client
|
||||
16:50:20:032 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:50:20:032 -> [ApiClient] Info: DATA: {"wifi":-61,"boot":0}
|
||||
16:50:20:032 -> [ApiClient] Info: Return code: 200
|
||||
16:50:26:033 ->
|
||||
16:50:26:033 -> firmwareCheckForUpdate:
|
||||
16:50:26:033 -> firmwareCheckForUpdate: Perform
|
||||
16:50:26:033 -> checking for new OTA update @ http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/generic/os/firmware.bin?current_firmware=3.1.9-1-g4691500-dirty
|
||||
16:50:26:883 -> Firmware update skipped, the server returned 400
|
||||
16:50:26:884 -> 3
|
||||
16:50:26:884 -> OTA message:
|
||||
16:50:26:884 ->
|
||||
16:50:28:014 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:50:28:014 -> [ApiClient] Info: Return code: 200
|
||||
16:50:28:015 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:50:28:016 -> [Configure] Info: Parse configure success
|
||||
16:50:28:017 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:50:32:066 -> CO2 (ppm): 451
|
||||
16:50:32:066 -> CO2 (ppm): 449
|
||||
16:50:36:087 -> CO2 (ppm): 453
|
||||
16:50:40:108 -> CO2 (ppm): 453
|
||||
16:50:44:128 -> CO2 (ppm): 452
|
||||
16:50:48:149 -> CO2 (ppm): 450
|
||||
16:50:52:170 -> CO2 (ppm): 447
|
||||
16:50:56:195 -> CO2 (ppm): 443
|
||||
16:51:00:064 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:51:00:064 -> [ApiClient] Info: DATA: {"wifi":-61,"rco2":443,"boot":0,"bootCount":0}
|
||||
16:51:00:065 -> [ApiClient] Info: Return code: 200
|
||||
16:51:00:065 ->
|
||||
16:51:00:065 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:51:00:065 ->
|
||||
16:51:00:090 -> External watchdog feed!
|
||||
16:51:00:212 -> CO2 (ppm): 440
|
||||
16:51:04:234 -> CO2 (ppm): 438
|
||||
16:51:08:254 -> CO2 (ppm): 436
|
||||
16:51:12:275 -> CO2 (ppm): 433
|
||||
16:51:16:296 -> CO2 (ppm): 432
|
||||
16:51:20:317 -> CO2 (ppm): 431
|
||||
16:51:24:338 -> CO2 (ppm): 431
|
||||
16:51:28:639 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:51:28:639 -> [ApiClient] Info: Return code: 200
|
||||
16:51:28:641 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:51:28:642 -> [Configure] Info: Parse configure success
|
||||
16:51:28:643 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:51:28:687 -> CO2 (ppm): 432
|
||||
16:51:32:708 -> CO2 (ppm): 432
|
||||
16:51:36:729 -> CO2 (ppm): 433
|
||||
16:51:40:749 -> CO2 (ppm): 433
|
||||
16:51:44:771 -> CO2 (ppm): 433
|
||||
16:51:48:792 -> CO2 (ppm): 434
|
||||
16:51:52:813 -> CO2 (ppm): 435
|
||||
16:52:03:145 -> CO2 (ppm): 435
|
||||
16:52:03:145 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:52:03:146 -> [ApiClient] Info: DATA: {"wifi":-71,"rco2":435,"boot":1,"bootCount":1}
|
||||
16:52:03:146 -> [ApiClient] Info: Return code: 200
|
||||
16:52:03:146 ->
|
||||
16:52:03:147 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:52:03:147 ->
|
||||
16:52:03:168 -> CO2 (ppm): 433
|
||||
16:52:03:193 -> External watchdog feed!
|
||||
16:52:07:189 -> CO2 (ppm): 433
|
||||
16:52:11:210 -> CO2 (ppm): 433
|
||||
16:52:15:231 -> CO2 (ppm): 433
|
||||
16:52:19:252 -> CO2 (ppm): 431
|
||||
16:52:23:273 -> CO2 (ppm): 430
|
||||
16:52:27:294 -> CO2 (ppm): 429
|
||||
16:52:29:269 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:52:29:269 -> [ApiClient] Info: Return code: 200
|
||||
16:52:29:271 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:52:29:272 -> [Configure] Info: Parse configure success
|
||||
16:52:29:273 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:52:31:315 -> CO2 (ppm): 428
|
||||
16:52:35:336 -> CO2 (ppm): 428
|
||||
16:52:39:357 -> CO2 (ppm): 427
|
||||
16:52:43:378 -> CO2 (ppm): 426
|
||||
16:52:47:399 -> CO2 (ppm): 425
|
||||
16:52:51:420 -> CO2 (ppm): 425
|
||||
16:52:55:441 -> CO2 (ppm): 425
|
||||
16:52:59:462 -> CO2 (ppm): 425
|
||||
16:53:04:172 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:53:04:172 -> [ApiClient] Info: DATA: {"wifi":-68,"rco2":425,"boot":2,"bootCount":2}
|
||||
16:53:04:173 -> [ApiClient] Info: Return code: 200
|
||||
16:53:04:174 ->
|
||||
16:53:04:174 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:53:04:174 ->
|
||||
16:53:04:199 -> CO2 (ppm): 425
|
||||
16:53:04:220 -> External watchdog feed!
|
||||
16:53:08:216 -> CO2 (ppm): 425
|
||||
16:53:12:237 -> CO2 (ppm): 425
|
||||
16:53:16:258 -> CO2 (ppm): 425
|
||||
16:53:20:279 -> CO2 (ppm): 425
|
||||
16:53:24:300 -> CO2 (ppm): 424
|
||||
16:53:28:321 -> CO2 (ppm): 423
|
||||
16:53:29:880 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:53:29:880 -> [ApiClient] Info: Return code: 200
|
||||
16:53:29:882 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:53:29:883 -> [Configure] Info: Parse configure success
|
||||
16:53:29:884 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:53:32:342 -> CO2 (ppm): 423
|
||||
16:53:36:363 -> CO2 (ppm): 422
|
||||
16:53:40:384 -> CO2 (ppm): 421
|
||||
16:53:48:425 -> CO2 (ppm): 421
|
||||
16:53:48:425 -> CO2 (ppm): 420
|
||||
16:53:52:446 -> CO2 (ppm): 419
|
||||
16:53:56:467 -> CO2 (ppm): 418
|
||||
16:54:00:488 -> CO2 (ppm): 417
|
||||
16:54:05:200 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:54:05:200 -> [ApiClient] Info: DATA: {"wifi":-64,"rco2":417,"boot":3,"bootCount":3}
|
||||
16:54:05:200 -> [ApiClient] Info: Return code: 200
|
||||
16:54:05:201 ->
|
||||
16:54:05:201 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:54:05:201 ->
|
||||
16:54:05:222 -> CO2 (ppm): 417
|
||||
16:54:05:247 -> External watchdog feed!
|
||||
16:54:09:244 -> CO2 (ppm): 416
|
||||
16:54:13:264 -> CO2 (ppm): 416
|
||||
16:54:17:286 -> CO2 (ppm): 416
|
||||
16:54:21:307 -> CO2 (ppm): 416
|
||||
16:54:25:328 -> CO2 (ppm): 416
|
||||
16:54:29:348 -> CO2 (ppm): 416
|
||||
16:54:30:498 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:54:30:499 -> [ApiClient] Info: Return code: 200
|
||||
16:54:30:500 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":Unit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:54:30:502 -> [Configure] Info: Parse configure success
|
||||
true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperature16:54:30:503 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:54:33:369 -> CO2 (ppm): 416
|
||||
16:54:37:390 -> CO2 (ppm): 416
|
||||
16:54:45:432 -> CO2 (ppm): 416
|
||||
16:54:45:432 -> CO2 (ppm): 415
|
||||
16:54:49:453 -> CO2 (ppm): 415
|
||||
16:54:53:474 -> CO2 (ppm): 415
|
||||
16:54:57:495 -> CO2 (ppm): 415
|
||||
16:55:01:516 -> CO2 (ppm): 415
|
||||
16:55:06:177 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:55:06:177 -> [ApiClient] Info: DATA: {"wifi":-63,"rco2":415,"boot":4,"bootCount":4}
|
||||
16:55:06:177 -> [ApiClient] Info: Return code: 200
|
||||
16:55:06:178 ->
|
||||
16:55:06:178 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:55:06:178 ->
|
||||
16:55:06:210 -> CO2 (ppm): 414
|
||||
16:55:06:235 -> External watchdog feed!
|
||||
16:55:14:253 -> CO2 (ppm): 414
|
||||
16:55:14:253 -> CO2 (ppm): 414
|
||||
16:55:18:268 -> CO2 (ppm): 414
|
||||
16:55:22:290 -> CO2 (ppm): 414
|
||||
16:55:26:311 -> CO2 (ppm): 413
|
||||
16:55:30:332 -> CO2 (ppm): 413
|
||||
16:55:31:115 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:55:31:115 -> [ApiClient] Info: Return code: 200
|
||||
16:55:31:121 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:55:31:122 -> [Configure] Info: Parse configure success
|
||||
16:55:31:122 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:55:34:353 -> CO2 (ppm): 413
|
||||
16:55:38:374 -> CO2 (ppm): 413
|
||||
16:55:42:395 -> CO2 (ppm): 413
|
||||
16:55:50:436 -> CO2 (ppm): 413
|
||||
16:55:50:436 -> CO2 (ppm): 412
|
||||
16:55:54:457 -> CO2 (ppm): 413
|
||||
16:55:58:478 -> CO2 (ppm): 413
|
||||
16:56:02:499 -> CO2 (ppm): 413
|
||||
16:56:07:160 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:56:07:160 -> [ApiClient] Info: DATA: {"wifi":-63,"rco2":413,"boot":5,"bootCount":5}
|
||||
16:56:07:160 -> [ApiClient] Info: Return code: 200
|
||||
16:56:07:161 ->
|
||||
16:56:07:161 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:56:07:161 ->
|
||||
16:56:07:183 -> CO2 (ppm): 412
|
||||
16:56:07:208 -> External watchdog feed!
|
||||
16:56:11:204 -> CO2 (ppm): 412
|
||||
16:56:15:225 -> CO2 (ppm): 412
|
||||
16:56:19:251 -> CO2 (ppm): 412
|
||||
16:56:23:272 -> CO2 (ppm): 412
|
||||
16:56:27:293 -> CO2 (ppm): 412
|
||||
16:56:31:743 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:56:31:743 -> [ApiClient] Info: Return code: 200
|
||||
16:56:31:744 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:56:31:746 -> [Configure] Info: Parse configure success
|
||||
16:56:31:747 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:56:31:790 -> CO2 (ppm): 418
|
||||
16:56:35:812 -> CO2 (ppm): 429
|
||||
16:56:39:834 -> CO2 (ppm): 438
|
||||
16:56:43:854 -> CO2 (ppm): 441
|
||||
16:56:51:896 -> CO2 (ppm): 442
|
||||
16:56:51:896 -> CO2 (ppm): 440
|
||||
16:56:55:917 -> CO2 (ppm): 438
|
||||
16:56:59:937 -> CO2 (ppm): 435
|
||||
16:57:03:958 -> CO2 (ppm): 439
|
||||
16:57:08:199 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:57:08:199 -> [ApiClient] Info: DATA: {"wifi":-60,"rco2":439,"boot":6,"bootCount":6}
|
||||
16:57:08:200 -> [ApiClient] Info: Return code: 200
|
||||
16:57:08:200 ->
|
||||
16:57:08:201 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:57:08:201 ->
|
||||
16:57:08:222 -> CO2 (ppm): 457
|
||||
16:57:08:247 -> External watchdog feed!
|
||||
16:57:12:243 -> CO2 (ppm): 476
|
||||
16:57:20:285 -> CO2 (ppm): 482
|
||||
16:57:20:285 -> CO2 (ppm): 481
|
||||
16:57:24:306 -> CO2 (ppm): 477
|
||||
16:57:28:326 -> CO2 (ppm): 470
|
||||
16:57:32:358 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:57:32:358 -> [ApiClient] Info: Return code: 200
|
||||
16:57:32:360 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:57:32:361 -> [Configure] Info: Parse configure success
|
||||
16:57:32:362 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:57:32:405 -> CO2 (ppm): 463
|
||||
16:57:36:426 -> CO2 (ppm): 457
|
||||
16:57:40:447 -> CO2 (ppm): 450
|
||||
16:57:44:468 -> CO2 (ppm): 466
|
||||
16:57:48:489 -> CO2 (ppm): 517
|
||||
16:57:52:510 -> CO2 (ppm): 564
|
||||
16:57:56:531 -> CO2 (ppm): 634
|
||||
16:58:00:552 -> CO2 (ppm): 721
|
||||
16:58:04:573 -> CO2 (ppm): 788
|
||||
16:58:09:090 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:58:09:090 -> [ApiClient] Info: DATA: {"wifi":-56,"rco2":788,"boot":7,"bootCount":7}
|
||||
16:58:09:090 -> [ApiClient] Info: Return code: 200
|
||||
16:58:09:091 ->
|
||||
16:58:09:092 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:58:09:092 ->
|
||||
16:58:09:113 -> CO2 (ppm): 812
|
||||
16:58:09:138 -> External watchdog feed!
|
||||
16:58:13:134 -> CO2 (ppm): 805
|
||||
16:58:17:155 -> CO2 (ppm): 781
|
||||
16:58:21:176 -> CO2 (ppm): 749
|
||||
16:58:25:197 -> CO2 (ppm): 713
|
||||
16:58:29:218 -> CO2 (ppm): 676
|
||||
16:58:32:991 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:58:32:991 -> [ApiClient] Info: Return code: 200
|
||||
16:58:32:992 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:58:32:992 -> [Configure] Info: Parse configure success
|
||||
16:58:32:992 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:58:33:239 -> CO2 (ppm): 640
|
||||
16:58:37:259 -> CO2 (ppm): 609
|
||||
16:58:41:280 -> CO2 (ppm): 579
|
||||
16:58:45:301 -> CO2 (ppm): 553
|
||||
16:58:49:322 -> CO2 (ppm): 530
|
||||
16:58:53:343 -> CO2 (ppm): 510
|
||||
16:58:57:364 -> CO2 (ppm): 493
|
||||
16:59:01:385 -> CO2 (ppm): 479
|
||||
16:59:05:406 -> CO2 (ppm): 468
|
||||
16:59:10:084 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
16:59:10:084 -> [ApiClient] Info: DATA: {"wifi":-58,"rco2":468,"boot":8,"bootCount":8}
|
||||
16:59:10:084 -> [ApiClient] Info: Return code: 200
|
||||
16:59:10:085 ->
|
||||
16:59:10:085 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
16:59:10:085 ->
|
||||
16:59:10:106 -> CO2 (ppm): 449
|
||||
16:59:10:131 -> External watchdog feed!
|
||||
16:59:18:148 -> CO2 (ppm): 443
|
||||
16:59:18:148 -> CO2 (ppm): 436
|
||||
16:59:22:169 -> CO2 (ppm): 431
|
||||
16:59:26:190 -> CO2 (ppm): 427
|
||||
16:59:30:211 -> CO2 (ppm): 424
|
||||
16:59:33:602 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
16:59:33:603 -> [ApiClient] Info: Return code: 200
|
||||
16:59:33:604 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":false,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
16:59:33:605 -> [Configure] Info: Parse configure success
|
||||
16:59:33:606 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
16:59:34:232 -> CO2 (ppm): 422
|
||||
16:59:38:253 -> CO2 (ppm): 421
|
||||
16:59:42:274 -> CO2 (ppm): 420
|
||||
16:59:46:295 -> CO2 (ppm): 419
|
||||
16:59:50:315 -> CO2 (ppm): 418
|
||||
16:59:54:336 -> CO2 (ppm): 416
|
||||
16:59:58:358 -> CO2 (ppm): 416
|
||||
17:00:02:378 -> CO2 (ppm): 415
|
||||
17:00:06:399 -> CO2 (ppm): 415
|
||||
17:00:11:082 -> [ApiClient] Info: POST: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/measures
|
||||
17:00:11:082 -> [ApiClient] Info: DATA: {"wifi":-57,"rco2":415,"boot":9,"bootCount":9}
|
||||
17:00:11:082 -> [ApiClient] Info: Return code: 200
|
||||
17:00:11:083 ->
|
||||
17:00:11:084 -> Online mode and isPostToAirGradient = true: watchdog reset
|
||||
17:00:11:084 ->
|
||||
17:00:11:105 -> CO2 (ppm): 416
|
||||
17:00:11:130 -> External watchdog feed!
|
||||
17:00:15:126 -> CO2 (ppm): 416
|
||||
17:00:19:147 -> CO2 (ppm): 416
|
||||
17:00:23:168 -> CO2 (ppm): 417
|
||||
17:00:31:210 -> CO2 (ppm): 417
|
||||
17:00:31:210 -> CO2 (ppm): 415
|
||||
17:00:34:222 -> [ApiClient] Info: GET: http://hw.airgradient.com/sensors/airgradient:d83bda1b86c8/one/config
|
||||
17:00:34:222 -> [ApiClient] Info: Return code: 200
|
||||
17:00:34:224 -> [Configure] Info: Parse configure: {"country":"CH","pmStandard":"ugm3","co2CalibrationRequested":true,"ledBarTestRequested":false,"ledBarMode":"pm","displayMode":"on","placeOpen":true,"abcDays":8,"tvocLearningOffset":12,"noxLearningOffset":12,"temperatureUnit":"c","targetFirmware":"3.1.9","ledBarBrightness":100,"displayBrightness":100,"corrections":{"pm02":{"correctionAlgorithm":"none","slr":null}},"model":"O-1PST"}
|
||||
17:00:34:226 -> [Configure] Info: Parse configure success
|
||||
17:00:34:226 -> [Configure] Info: co2CalibrationRequested: True
|
||||
17:00:34:226 -> [Configure] Info: Detected new firmware version: 3.1.9
|
||||
17:00:34:228 -> [StateMachine] Info: CO2 Calibration
|
||||
17:00:34:228 -> [StateMachine] Info: Start CO2 calib after 5 sec
|
||||
17:00:35:228 -> [StateMachine] Info: Start CO2 calib after 4 sec
|
||||
17:00:36:228 -> [StateMachine] Info: Start CO2 calib after 3 sec
|
||||
17:00:37:228 -> [StateMachine] Info: Start CO2 calib after 2 sec
|
||||
17:00:38:228 -> [StateMachine] Info: Start CO2 calib after 1 sec
|
||||
17:00:41:236 -> Clear Acknowladgement Command > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
17:00:41:250 -> Clear Acknowladgement Response > 0xFE 0x06 0x00 0x00 0x00 0x00 0x9D 0xC5
|
||||
17:00:41:258 -> Send Calibration Command > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
17:00:41:271 -> Send Calibration Response > 0xFE 0x06 0x00 0x01 0x7C 0x06 0x6C 0xC7
|
||||
17:00:41:272 -> [StateMachine] Info: CO2 Calibration: success
|
||||
17:00:42:272 -> [StateMachine] Info: CO2 Calibration: Wait for calibration finish...
|
||||
17:00:42:280 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:42:292 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:42:293 -> Flags: 0
|
||||
17:00:43:301 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:43:313 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:43:314 -> Flags: 0
|
||||
17:00:44:322 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:44:334 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:44:335 -> Flags: 0
|
||||
17:00:45:343 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:45:355 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:45:356 -> Flags: 0
|
||||
17:00:46:364 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:46:376 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:46:377 -> Flags: 0
|
||||
17:00:47:385 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:47:397 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:47:397 -> Flags: 0
|
||||
17:00:48:406 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:48:418 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:48:419 -> Flags: 0
|
||||
17:00:49:427 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:49:439 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:49:440 -> Flags: 0
|
||||
17:00:50:448 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:50:460 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:50:461 -> Flags: 0
|
||||
17:00:51:469 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:51:481 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:51:482 -> Flags: 0
|
||||
17:00:52:490 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:52:502 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:52:503 -> Flags: 0
|
||||
17:00:53:511 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:53:524 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:53:524 -> Flags: 0
|
||||
17:00:54:532 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:54:544 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:54:545 -> Flags: 0
|
||||
17:00:55:553 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:55:565 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:55:565 -> Flags: 0
|
||||
17:00:56:574 -> Get Acknowladgement Command > 0xFE 0x03 0x00 0x00 0x00 0x01 0x90 0x05
|
||||
17:00:56:586 -> Get Acknowladgement Response > 0xFE 0x03 0x02 0x00 0x00 0xAC 0x50
|
||||
17:00:56:586 -> Flags: 0
|
21750
Calibration-Logs/COM47_2025_01_06.17.01.03.165.txt
Normal file
21750
Calibration-Logs/COM47_2025_01_06.17.01.03.165.txt
Normal file
File diff suppressed because it is too large
Load Diff
6570
Calibration-Logs/COM47_2025_01_07.09.21.01.097.txt
Normal file
6570
Calibration-Logs/COM47_2025_01_07.09.21.01.097.txt
Normal file
File diff suppressed because it is too large
Load Diff
7733
Calibration-Logs/COM47_2025_01_07.11.41.59.101.txt
Normal file
7733
Calibration-Logs/COM47_2025_01_07.11.41.59.101.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -24,6 +24,10 @@ If you have an older version of the AirGradient PCB not mentioned in the example
|
||||
|
||||
If you have any questions or problems, check out [our forum](https://forum.airgradient.com/).
|
||||
|
||||
## Documentation
|
||||
|
||||
Local server API documentation is available in [/docs/local-server.md](/docs/local-server.md) and AirGradient server API on [https://api.airgradient.com/public/docs/api/v1/](https://api.airgradient.com/public/docs/api/v1/).
|
||||
|
||||
## The following libraries have been integrated into this library for ease of use
|
||||
|
||||
- [Adafruit BusIO](https://github.com/adafruit/Adafruit_BusIO)
|
||||
@ -35,7 +39,9 @@ If you have any questions or problems, check out [our forum](https://forum.airgr
|
||||
- [Sensirion Core](https://github.com/Sensirion/arduino-core/)
|
||||
- [Sensirion I2C SGP41](https://github.com/Sensirion/arduino-i2c-sgp41)
|
||||
- [Sensirion I2C SHT](https://github.com/Sensirion/arduino-sht)
|
||||
- [PMS](https://github.com/fu-hsi/pms)
|
||||
- [WiFiManager](https://github.com/tzapu/WiFiManager)
|
||||
- [Arduino_JSON](https://github.com/arduino-libraries/Arduino_JSON)
|
||||
- [PubSubClient](https://github.com/knolleary/pubsubclient)
|
||||
|
||||
## License
|
||||
CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
|
||||
|
137
docs/local-server.md
Normal file
137
docs/local-server.md
Normal file
@ -0,0 +1,137 @@
|
||||
## Local Server API
|
||||
|
||||
From [firmware version 3.0.10](firmwares) onwards, the AirGradient ONE and Open Air monitors have below API available.
|
||||
|
||||
#### Discovery
|
||||
|
||||
The monitors run a mDNS discovery. So within the same network, the monitor can be accessed through:
|
||||
|
||||
http://airgradient_{{serialnumber}}.local
|
||||
|
||||
|
||||
The following requests are possible:
|
||||
|
||||
#### Get Current Air Quality (GET)
|
||||
|
||||
With the path "/measures/current" you can get the current air quality data.
|
||||
|
||||
http://airgradient_ecda3b1eaaaf.local/measures/current
|
||||
|
||||
“ecda3b1eaaaf” being the serial number of your monitor.
|
||||
|
||||
You get the following response:
|
||||
```json
|
||||
{
|
||||
"wifi": -46,
|
||||
"serialno": "ecda3b1eaaaf",
|
||||
"rco2": 447,
|
||||
"pm01": 3,
|
||||
"pm02": 7,
|
||||
"pm10": 8,
|
||||
"pm003Count": 442,
|
||||
"atmp": 25.87,
|
||||
"atmpCompensated": 24.47,
|
||||
"rhum": 43,
|
||||
"rhumCompensated": 49,
|
||||
"tvocIndex": 100,
|
||||
"tvocRaw": 33051,
|
||||
"noxIndex": 1,
|
||||
"noxRaw": 16307,
|
||||
"boot": 6,
|
||||
"bootCount": 6,
|
||||
"ledMode": "pm",
|
||||
"firmware": "3.1.3",
|
||||
"model": "I-9PSL",
|
||||
"monitorDisplayCompensatedValues": true
|
||||
}
|
||||
```
|
||||
|
||||
| Properties | Type | Explanation |
|
||||
|-----------------------------------|---------|----------------------------------------------------------------------------------------|
|
||||
| `serialno` | String | Serial Number of the monitor |
|
||||
| `wifi` | Number | WiFi signal strength |
|
||||
| `pm01` | Number | PM1 in ug/m3 |
|
||||
| `pm02` | Number | PM2.5 in ug/m3 |
|
||||
| `pm10` | Number | PM10 in ug/m3 |
|
||||
| `pm02Compensated` | Number | PM2.5 in ug/m3 with correction applied (from fw version 3.1.4 onwards) |
|
||||
| `rco2` | Number | CO2 in ppm |
|
||||
| `pm003Count` | Number | Particle count per dL |
|
||||
| `atmp` | Number | Temperature in Degrees Celsius |
|
||||
| `atmpCompensated` | Number | Temperature in Degrees Celsius with correction applied |
|
||||
| `rhum` | Number | Relative Humidity |
|
||||
| `rhumCompensated` | Number | Relative Humidity with correction applied |
|
||||
| `tvocIndex` | Number | Senisiron VOC Index |
|
||||
| `tvocRaw` | Number | VOC raw value |
|
||||
| `noxIndex` | Number | Senisirion NOx Index |
|
||||
| `noxRaw` | Number | NOx raw value |
|
||||
| `boot` | Number | Counts every measurement cycle. Low boot counts indicate restarts. |
|
||||
| `bootCount` | Number | Same as boot property. Required for Home Assistant compatability. Will be depreciated. |
|
||||
| `ledMode` | String | Current configuration of the LED mode |
|
||||
| `firmware` | String | Current firmware version |
|
||||
| `model` | String | Current model name |
|
||||
| `monitorDisplayCompensatedValues` | Boolean | Switching Display of AirGradient ONE to Compensated / Non Compensated Values |
|
||||
|
||||
Compensated values apply correction algorithms to make the sensor values more accurate. Temperature and relative humidity correction is only applied on the outdoor monitor Open Air but the properties _compensated will still be send also for the indoor monitor AirGradient ONE.
|
||||
|
||||
#### Get Configuration Parameters (GET)
|
||||
With the path "/config" you can get the current configuration.
|
||||
```json
|
||||
{
|
||||
"country": "TH",
|
||||
"pmStandard": "ugm3",
|
||||
"ledBarMode": "pm",
|
||||
"abcDays": 7,
|
||||
"tvocLearningOffset": 12,
|
||||
"noxLearningOffset": 12,
|
||||
"mqttBrokerUrl": "",
|
||||
"temperatureUnit": "c",
|
||||
"configurationControl": "local",
|
||||
"postDataToAirGradient": true,
|
||||
"ledBarBrightness": 100,
|
||||
"displayBrightness": 100,
|
||||
"offlineMode": false,
|
||||
"model": "I-9PSL",
|
||||
"monitorDisplayCompensatedValues": true
|
||||
}
|
||||
```
|
||||
|
||||
#### Set Configuration Parameters (PUT)
|
||||
|
||||
Configuration parameters can be changed with a put request to the monitor, e.g.
|
||||
|
||||
Example to force CO2 calibration
|
||||
|
||||
```curl -X PUT -H "Content-Type: application/json" -d '{"co2CalibrationRequested":true}' http://airgradient_84fce612eff4.local/config ```
|
||||
|
||||
Example to set monitor to Celsius
|
||||
|
||||
```curl -X PUT -H "Content-Type: application/json" -d '{"temperatureUnit":"c"}' http://airgradient_84fce612eff4.local/config ```
|
||||
|
||||
If you use command prompt on Windows, you need to escape the quotes:
|
||||
|
||||
``` -d "{\"param\":\"value\"}" ```
|
||||
|
||||
#### Avoiding Conflicts with Configuration on AirGradient Server
|
||||
If the monitor is set up on the AirGradient dashboard, it will also receive configurations from there. In case you do not want this, please set `configurationControl` to `local`. In case you set it to `cloud` and want to change it to `local`, you need to make a factory reset.
|
||||
|
||||
#### Configuration Parameters (GET/PUT)
|
||||
|
||||
| Properties | Description | Type | Accepted Values | Example |
|
||||
|-----------------------------------|:-----------------------------------------------------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
|
||||
| `country` | Country where the device is. | String | Country code as [ALPHA-2 notation](https://www.iban.com/country-codes) | `{"country": "TH"}` |
|
||||
| `model` | Hardware identifier (only GET). | String | I-9PSL-DE | `{"model": "I-9PSL-DE"}` |
|
||||
| `pmStandard` | Particle matter standard used on the display. | String | `ugm3`: ug/m3 <br> `us-aqi`: USAQI | `{"pmStandard": "ugm3"}` |
|
||||
| `ledBarMode` | Mode in which the led bar can be set. | String | `co2`: LED bar displays CO2 <br>`pm`: LED bar displays PM <br>`off`: Turn off LED bar | `{"ledBarMode": "off"}` |
|
||||
| `displayBrightness` | Brightness of the Display. | Number | 0-100 | `{"displayBrightness": 50}` |
|
||||
| `ledBarBrightness` | Brightness of the LEDBar. | Number | 0-100 | `{"ledBarBrightness": 40}` |
|
||||
| `abcDays` | Number of days for CO2 automatic baseline calibration. | Number | Maximum 200 days. Default 8 days. | `{"abcDays": 8}` |
|
||||
| `mqttBrokerUrl` | MQTT broker URL. | String | | `{"mqttBrokerUrl": "mqtt://192.168.0.18:1883"}` |
|
||||
| `temperatureUnit` | Temperature unit shown on the display. | String | `c` or `C`: Degree Celsius °C <br>`f` or `F`: Degree Fahrenheit °F | `{"temperatureUnit": "c"}` |
|
||||
| `configurationControl` | The configuration source of the device. | String | `both`: Accept local and cloud configuration <br>`local`: Accept only local configuration <br>`cloud`: Accept only cloud configuration | `{"configurationControl": "both"}` |
|
||||
| `postDataToAirGradient` | Send data to AirGradient cloud. | Boolean | `true`: Enabled <br>`false`: Disabled | `{"postDataToAirGradient": true}` |
|
||||
| `co2CalibrationRequested` | Can be set to trigger a calibration. | Boolean | `true`: CO2 calibration (400ppm) will be triggered | `{"co2CalibrationRequested": true}` |
|
||||
| `ledBarTestRequested` | Can be set to trigger a test. | Boolean | `true` : LEDs will run test sequence | `{"ledBarTestRequested": true}` |
|
||||
| `noxLearningOffset` | Set NOx learning gain offset. | Number | 0-720 (default 12) | `{"noxLearningOffset": 12}` |
|
||||
| `tvocLearningOffset` | Set VOC learning gain offset. | Number | 0-720 (default 12) | `{"tvocLearningOffset": 12}` |
|
||||
| `offlineMode` | Set monitor to run without WiFi. | Boolean | `false`: Disabled (default) <br> `true`: Enabled | `{"offlineMode": true}` |
|
||||
| `monitorDisplayCompensatedValues` | Set the display show the PM value with/without compensate value (From [3.1.9]()) | Boolean | `false`: Without compensate (default) <br> `true`: with compensate | `{"monitorDisplayCompensatedValues": false }` |
|
22
docs/ota-updates.md
Normal file
22
docs/ota-updates.md
Normal file
@ -0,0 +1,22 @@
|
||||
## OTA Updates
|
||||
|
||||
From [firmware version 3.1.1](https://github.com/airgradienthq/arduino/tree/3.1.1) onwards, the AirGradient ONE and Open Air monitors support over the air (OTA) updates.
|
||||
|
||||
#### Mechanism
|
||||
|
||||
Upon compilation of an official release the git tag (GIT_VERSION) is compiled into the binary.
|
||||
|
||||
The device attempts to update to the latest version on startup and in regular intervals using URL
|
||||
|
||||
http://hw.airgradient.com/sensors/{deviceId}/generic/os/firmware.bin?current_firmware={GIT_VERSION}
|
||||
|
||||
If does pass the version it is currently running on along to the server through URL parameter 'current_firmware'.
|
||||
This allows the server to identify if the device is already running on the latest version or should update.
|
||||
|
||||
The following scenarios are possible
|
||||
|
||||
1. The device is already on the latest firmware. Then the server returns a 304 with a short explanation text in the body saying this.
|
||||
2. The device reports a firmware unknown to the server. A 400 with an empty payload is returned in this case and the update is not performed. This case is relevant for local changes. The GIT_VERSION then defaults to "snapshot" which is unknown to the server.
|
||||
3. There is an update available. A 200 along with the binary data of the new version is returned and the update is performed.
|
||||
|
||||
More information about the implementation details are available here: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/ota.html
|
577
examples/BASIC/BASIC.ino
Normal file
577
examples/BASIC/BASIC.ino
Normal file
@ -0,0 +1,577 @@
|
||||
/*
|
||||
This is the code for the AirGradient DIY BASIC Air Quality Monitor with an D1
|
||||
ESP8266 Microcontroller.
|
||||
|
||||
It is an air quality monitor for PM2.5, CO2, Temperature and Humidity with a
|
||||
small display and can send data over Wifi.
|
||||
|
||||
Open source air quality monitors and kits are available:
|
||||
Indoor Monitor: https://www.airgradient.com/indoor/
|
||||
Outdoor Monitor: https://www.airgradient.com/outdoor/
|
||||
|
||||
Build Instructions:
|
||||
https://www.airgradient.com/documentation/diy-v4/
|
||||
|
||||
Please make sure you have esp8266 board manager installed. Tested with
|
||||
version 3.1.2.
|
||||
|
||||
Set board to "LOLIN(WEMOS) D1 R2 & mini"
|
||||
|
||||
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
||||
can be set through the AirGradient dashboard.
|
||||
|
||||
If you have any questions please visit our forum at
|
||||
https://forum.airgradient.com/
|
||||
|
||||
CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
|
||||
|
||||
*/
|
||||
|
||||
#include "AgApiClient.h"
|
||||
#include "AgConfigure.h"
|
||||
#include "AgSchedule.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include "LocalServer.h"
|
||||
#include "OpenMetrics.h"
|
||||
#include "MqttClient.h"
|
||||
#include <AirGradient.h>
|
||||
#include <ESP8266HTTPClient.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266mDNS.h>
|
||||
#include <WiFiClient.h>
|
||||
|
||||
#define LED_BAR_ANIMATION_PERIOD 100 /** ms */
|
||||
#define DISP_UPDATE_INTERVAL 2500 /** ms */
|
||||
#define SERVER_CONFIG_SYNC_INTERVAL 60000 /** ms */
|
||||
#define SERVER_SYNC_INTERVAL 60000 /** ms */
|
||||
#define MQTT_SYNC_INTERVAL 60000 /** ms */
|
||||
#define SENSOR_CO2_CALIB_COUNTDOWN_MAX 5 /** sec */
|
||||
#define SENSOR_TVOC_UPDATE_INTERVAL 1000 /** ms */
|
||||
#define SENSOR_CO2_UPDATE_INTERVAL 4000 /** ms */
|
||||
#define SENSOR_PM_UPDATE_INTERVAL 2000 /** ms */
|
||||
#define SENSOR_TEMP_HUM_UPDATE_INTERVAL 2000 /** ms */
|
||||
#define DISPLAY_DELAY_SHOW_CONTENT_MS 2000 /** ms */
|
||||
#define FIRMWARE_CHECK_FOR_UPDATE_MS (60 * 60 * 1000) /** ms */
|
||||
|
||||
static AirGradient ag(DIY_BASIC);
|
||||
static Configuration configuration(Serial);
|
||||
static AgApiClient apiClient(Serial, configuration);
|
||||
static Measurements measurements;
|
||||
static OledDisplay oledDisplay(configuration, measurements, Serial);
|
||||
static StateMachine stateMachine(oledDisplay, Serial, measurements,
|
||||
configuration);
|
||||
static WifiConnector wifiConnector(oledDisplay, Serial, stateMachine,
|
||||
configuration);
|
||||
static OpenMetrics openMetrics(measurements, configuration, wifiConnector,
|
||||
apiClient);
|
||||
static LocalServer localServer(Serial, openMetrics, measurements, configuration,
|
||||
wifiConnector);
|
||||
static MqttClient mqttClient(Serial);
|
||||
|
||||
static int getCO2FailCount = 0;
|
||||
static AgFirmwareMode fwMode = FW_MODE_I_BASIC_40PS;
|
||||
|
||||
static String fwNewVersion;
|
||||
|
||||
static void boardInit(void);
|
||||
static void failedHandler(String msg);
|
||||
static void configurationUpdateSchedule(void);
|
||||
static void appDispHandler(void);
|
||||
static void oledDisplaySchedule(void);
|
||||
static void updateTvoc(void);
|
||||
static void updatePm(void);
|
||||
static void sendDataToServer(void);
|
||||
static void tempHumUpdate(void);
|
||||
static void co2Update(void);
|
||||
static void mdnsInit(void);
|
||||
static void initMqtt(void);
|
||||
static void factoryConfigReset(void);
|
||||
static void wdgFeedUpdate(void);
|
||||
static bool sgp41Init(void);
|
||||
static void wifiFactoryConfigure(void);
|
||||
static void mqttHandle(void);
|
||||
|
||||
AgSchedule dispLedSchedule(DISP_UPDATE_INTERVAL, oledDisplaySchedule);
|
||||
AgSchedule configSchedule(SERVER_CONFIG_SYNC_INTERVAL,
|
||||
configurationUpdateSchedule);
|
||||
AgSchedule agApiPostSchedule(SERVER_SYNC_INTERVAL, sendDataToServer);
|
||||
AgSchedule co2Schedule(SENSOR_CO2_UPDATE_INTERVAL, co2Update);
|
||||
AgSchedule pmsSchedule(SENSOR_PM_UPDATE_INTERVAL, updatePm);
|
||||
AgSchedule tempHumSchedule(SENSOR_TEMP_HUM_UPDATE_INTERVAL, tempHumUpdate);
|
||||
AgSchedule tvocSchedule(SENSOR_TVOC_UPDATE_INTERVAL, updateTvoc);
|
||||
AgSchedule watchdogFeedSchedule(60000, wdgFeedUpdate);
|
||||
AgSchedule mqttSchedule(MQTT_SYNC_INTERVAL, mqttHandle);
|
||||
|
||||
void setup() {
|
||||
/** Serial for print debug message */
|
||||
Serial.begin(115200);
|
||||
delay(100); /** For bester show log */
|
||||
|
||||
/** Print device ID into log */
|
||||
Serial.println("Serial nr: " + ag.deviceId());
|
||||
|
||||
/** Initialize local configure */
|
||||
configuration.begin();
|
||||
|
||||
/** Init I2C */
|
||||
Wire.begin(ag.getI2cSdaPin(), ag.getI2cSclPin());
|
||||
delay(1000);
|
||||
|
||||
configuration.setAirGradient(&ag);
|
||||
oledDisplay.setAirGradient(&ag);
|
||||
stateMachine.setAirGradient(&ag);
|
||||
wifiConnector.setAirGradient(&ag);
|
||||
apiClient.setAirGradient(&ag);
|
||||
openMetrics.setAirGradient(&ag);
|
||||
localServer.setAirGraident(&ag);
|
||||
|
||||
/** Example set custom API root URL */
|
||||
// apiClient.setApiRoot("https://example.custom.api");
|
||||
|
||||
/** Init sensor */
|
||||
boardInit();
|
||||
|
||||
/** Connecting wifi */
|
||||
bool connectToWifi = false;
|
||||
|
||||
connectToWifi = !configuration.isOfflineMode();
|
||||
if (connectToWifi) {
|
||||
apiClient.begin();
|
||||
|
||||
if (wifiConnector.connect()) {
|
||||
if (wifiConnector.isConnected()) {
|
||||
mdnsInit();
|
||||
localServer.begin();
|
||||
initMqtt();
|
||||
sendDataToAg();
|
||||
|
||||
apiClient.fetchServerConfiguration();
|
||||
configSchedule.update();
|
||||
if (apiClient.isFetchConfigureFailed()) {
|
||||
if (apiClient.isNotAvailableOnDashboard()) {
|
||||
stateMachine.displaySetAddToDashBoard();
|
||||
stateMachine.displayHandle(
|
||||
AgStateMachineWiFiOkServerOkSensorConfigFailed);
|
||||
} else {
|
||||
stateMachine.displayClearAddToDashBoard();
|
||||
}
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
} else {
|
||||
if (wifiConnector.isConfigurePorttalTimeout()) {
|
||||
oledDisplay.showRebooting();
|
||||
delay(2500);
|
||||
oledDisplay.setText("", "", "");
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/** Set offline mode without saving, cause wifi is not configured */
|
||||
if (wifiConnector.hasConfigurated() == false) {
|
||||
Serial.println("Set offline mode cause wifi is not configurated");
|
||||
configuration.setOfflineModeWithoutSave(true);
|
||||
}
|
||||
|
||||
/** Show display Warning up */
|
||||
String sn = "SN:" + ag.deviceId();
|
||||
oledDisplay.setText("Warming Up", sn.c_str(), "");
|
||||
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
|
||||
Serial.println("Display brightness: " +
|
||||
String(configuration.getDisplayBrightness()));
|
||||
oledDisplay.setBrightness(configuration.getDisplayBrightness());
|
||||
|
||||
appDispHandler();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
/** Handle schedule */
|
||||
dispLedSchedule.run();
|
||||
configSchedule.run();
|
||||
agApiPostSchedule.run();
|
||||
|
||||
if (configuration.hasSensorS8) {
|
||||
co2Schedule.run();
|
||||
}
|
||||
if (configuration.hasSensorPMS1) {
|
||||
pmsSchedule.run();
|
||||
ag.pms5003.handle();
|
||||
}
|
||||
if (configuration.hasSensorSHT) {
|
||||
tempHumSchedule.run();
|
||||
}
|
||||
if (configuration.hasSensorSGP) {
|
||||
tvocSchedule.run();
|
||||
}
|
||||
|
||||
watchdogFeedSchedule.run();
|
||||
|
||||
/** Check for handle WiFi reconnect */
|
||||
wifiConnector.handle();
|
||||
|
||||
/** factory reset handle */
|
||||
// factoryConfigReset();
|
||||
|
||||
/** check that local configura changed then do some action */
|
||||
configUpdateHandle();
|
||||
|
||||
localServer._handle();
|
||||
|
||||
if (configuration.hasSensorSGP) {
|
||||
ag.sgp41.handle();
|
||||
}
|
||||
|
||||
MDNS.update();
|
||||
|
||||
mqttSchedule.run();
|
||||
mqttClient.handle();
|
||||
}
|
||||
|
||||
static void co2Update(void) {
|
||||
int value = ag.s8.getCo2();
|
||||
if (utils::isValidCO2(value)) {
|
||||
measurements.CO2 = value;
|
||||
getCO2FailCount = 0;
|
||||
Serial.printf("CO2 (ppm): %d\r\n", measurements.CO2);
|
||||
} else {
|
||||
getCO2FailCount++;
|
||||
Serial.printf("Get CO2 failed: %d\r\n", getCO2FailCount);
|
||||
if (getCO2FailCount >= 3) {
|
||||
measurements.CO2 = utils::getInvalidCO2();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void mdnsInit(void) {
|
||||
Serial.println("mDNS init");
|
||||
if (!MDNS.begin(localServer.getHostname().c_str())) {
|
||||
Serial.println("Init mDNS failed");
|
||||
return;
|
||||
}
|
||||
|
||||
MDNS.addService("_airgradient", "_tcp", 80);
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "model",
|
||||
AgFirmwareModeName(fwMode));
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "serialno", ag.deviceId());
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "fw_ver", ag.getVersion());
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "vendor", "AirGradient");
|
||||
|
||||
MDNS.announce();
|
||||
}
|
||||
|
||||
static void initMqtt(void) {
|
||||
String mqttUri = configuration.getMqttBrokerUri();
|
||||
if (mqttUri.isEmpty()) {
|
||||
Serial.println(
|
||||
"MQTT is not configured, skipping initialization of MQTT client");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mqttClient.begin(mqttUri)) {
|
||||
Serial.println("Successfully connected to MQTT broker");
|
||||
} else {
|
||||
Serial.println("Connection to MQTT broker failed");
|
||||
}
|
||||
}
|
||||
|
||||
static void wdgFeedUpdate(void) {
|
||||
ag.watchdog.reset();
|
||||
Serial.println("External watchdog feed!");
|
||||
}
|
||||
|
||||
static bool sgp41Init(void) {
|
||||
ag.sgp41.setNoxLearningOffset(configuration.getNoxLearningOffset());
|
||||
ag.sgp41.setTvocLearningOffset(configuration.getTvocLearningOffset());
|
||||
if (ag.sgp41.begin(Wire)) {
|
||||
Serial.println("Init SGP41 success");
|
||||
configuration.hasSensorSGP = true;
|
||||
return true;
|
||||
} else {
|
||||
Serial.println("Init SGP41 failuire");
|
||||
configuration.hasSensorSGP = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void wifiFactoryConfigure(void) {
|
||||
WiFi.persistent(true);
|
||||
WiFi.begin("airgradient", "cleanair");
|
||||
WiFi.persistent(false);
|
||||
oledDisplay.setText("Configure WiFi", "connect to", "\'airgradient\'");
|
||||
delay(2500);
|
||||
oledDisplay.setText("Rebooting...", "", "");
|
||||
delay(2500);
|
||||
oledDisplay.setText("", "", "");
|
||||
ESP.restart();
|
||||
}
|
||||
|
||||
static void mqttHandle(void) {
|
||||
if(mqttClient.isConnected() == false) {
|
||||
mqttClient.connect(String("airgradient-") + ag.deviceId());
|
||||
}
|
||||
|
||||
if (mqttClient.isConnected()) {
|
||||
String payload = measurements.toString(true, fwMode, wifiConnector.RSSI(),
|
||||
&ag, &configuration);
|
||||
String topic = "airgradient/readings/" + ag.deviceId();
|
||||
if (mqttClient.publish(topic.c_str(), payload.c_str(), payload.length())) {
|
||||
Serial.println("MQTT sync success");
|
||||
} else {
|
||||
Serial.println("MQTT sync failure");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sendDataToAg() {
|
||||
/** Change oledDisplay and led state */
|
||||
stateMachine.displayHandle(AgStateMachineWiFiOkServerConnecting);
|
||||
|
||||
delay(1500);
|
||||
if (apiClient.sendPing(wifiConnector.RSSI(), measurements.bootCount)) {
|
||||
stateMachine.displayHandle(AgStateMachineWiFiOkServerConnected);
|
||||
} else {
|
||||
stateMachine.displayHandle(AgStateMachineWiFiOkServerConnectFailed);
|
||||
}
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
|
||||
void dispSensorNotFound(String ss) {
|
||||
oledDisplay.setText("Sensor", ss.c_str(), "not found");
|
||||
delay(2000);
|
||||
}
|
||||
|
||||
static void boardInit(void) {
|
||||
/** Display init */
|
||||
oledDisplay.begin();
|
||||
|
||||
/** Show boot display */
|
||||
Serial.println("Firmware Version: " + ag.getVersion());
|
||||
|
||||
if (ag.isBasic()) {
|
||||
oledDisplay.setText("DIY Basic", ag.getVersion().c_str(), "");
|
||||
} else {
|
||||
oledDisplay.setText("AirGradient ONE",
|
||||
"FW Version: ", ag.getVersion().c_str());
|
||||
}
|
||||
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
|
||||
ag.watchdog.begin();
|
||||
|
||||
/** Show message init sensor */
|
||||
oledDisplay.setText("Sensor", "init...", "");
|
||||
|
||||
/** Init sensor SGP41 */
|
||||
configuration.hasSensorSGP = false;
|
||||
// if (sgp41Init() == false) {
|
||||
// dispSensorNotFound("SGP41");
|
||||
// }
|
||||
|
||||
/** Init SHT */
|
||||
if (ag.sht.begin(Wire) == false) {
|
||||
Serial.println("SHTx sensor not found");
|
||||
configuration.hasSensorSHT = false;
|
||||
dispSensorNotFound("SHT");
|
||||
}
|
||||
|
||||
/** Init S8 CO2 sensor */
|
||||
if (ag.s8.begin(&Serial) == false) {
|
||||
Serial.println("CO2 S8 sensor not found");
|
||||
configuration.hasSensorS8 = false;
|
||||
dispSensorNotFound("S8");
|
||||
}
|
||||
|
||||
/** Init PMS5003 */
|
||||
configuration.hasSensorPMS1 = true;
|
||||
configuration.hasSensorPMS2 = false;
|
||||
if (ag.pms5003.begin(&Serial) == false) {
|
||||
Serial.println("PMS sensor not found");
|
||||
configuration.hasSensorPMS1 = false;
|
||||
|
||||
dispSensorNotFound("PMS");
|
||||
}
|
||||
|
||||
/** Set S8 CO2 abc days period */
|
||||
if (configuration.hasSensorS8) {
|
||||
if (ag.s8.setAbcPeriod(configuration.getCO2CalibrationAbcDays() * 24)) {
|
||||
Serial.println("Set S8 AbcDays successful");
|
||||
} else {
|
||||
Serial.println("Set S8 AbcDays failure");
|
||||
}
|
||||
}
|
||||
|
||||
localServer.setFwMode(fwMode);
|
||||
}
|
||||
|
||||
static void failedHandler(String msg) {
|
||||
while (true) {
|
||||
Serial.println(msg);
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
static void configurationUpdateSchedule(void) {
|
||||
if (apiClient.fetchServerConfiguration()) {
|
||||
configUpdateHandle();
|
||||
}
|
||||
}
|
||||
|
||||
static void configUpdateHandle() {
|
||||
if (configuration.isUpdated() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
stateMachine.executeCo2Calibration();
|
||||
|
||||
String mqttUri = configuration.getMqttBrokerUri();
|
||||
if (mqttClient.isCurrentUri(mqttUri) == false) {
|
||||
mqttClient.end();
|
||||
initMqtt();
|
||||
}
|
||||
|
||||
if (configuration.hasSensorSGP) {
|
||||
if (configuration.noxLearnOffsetChanged() ||
|
||||
configuration.tvocLearnOffsetChanged()) {
|
||||
ag.sgp41.end();
|
||||
|
||||
int oldTvocOffset = ag.sgp41.getTvocLearningOffset();
|
||||
int oldNoxOffset = ag.sgp41.getNoxLearningOffset();
|
||||
bool result = sgp41Init();
|
||||
const char *resultStr = "successful";
|
||||
if (!result) {
|
||||
resultStr = "failure";
|
||||
}
|
||||
if (oldTvocOffset != configuration.getTvocLearningOffset()) {
|
||||
Serial.printf("Setting tvocLearningOffset from %d to %d hours %s\r\n",
|
||||
oldTvocOffset, configuration.getTvocLearningOffset(),
|
||||
resultStr);
|
||||
}
|
||||
if (oldNoxOffset != configuration.getNoxLearningOffset()) {
|
||||
Serial.printf("Setting noxLearningOffset from %d to %d hours %s\r\n",
|
||||
oldNoxOffset, configuration.getNoxLearningOffset(),
|
||||
resultStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (configuration.isDisplayBrightnessChanged()) {
|
||||
oledDisplay.setBrightness(configuration.getDisplayBrightness());
|
||||
}
|
||||
|
||||
appDispHandler();
|
||||
}
|
||||
|
||||
static void appDispHandler(void) {
|
||||
AgStateMachineState state = AgStateMachineNormal;
|
||||
|
||||
/** Only show display status on online mode. */
|
||||
if (configuration.isOfflineMode() == false) {
|
||||
if (wifiConnector.isConnected() == false) {
|
||||
state = AgStateMachineWiFiLost;
|
||||
} else if (apiClient.isFetchConfigureFailed()) {
|
||||
state = AgStateMachineSensorConfigFailed;
|
||||
if (apiClient.isNotAvailableOnDashboard()) {
|
||||
stateMachine.displaySetAddToDashBoard();
|
||||
} else {
|
||||
stateMachine.displayClearAddToDashBoard();
|
||||
}
|
||||
} else if (apiClient.isPostToServerFailed()) {
|
||||
state = AgStateMachineServerLost;
|
||||
}
|
||||
}
|
||||
stateMachine.displayHandle(state);
|
||||
}
|
||||
|
||||
static void oledDisplaySchedule(void) {
|
||||
|
||||
appDispHandler();
|
||||
}
|
||||
|
||||
static void updateTvoc(void) {
|
||||
measurements.TVOC = ag.sgp41.getTvocIndex();
|
||||
measurements.TVOCRaw = ag.sgp41.getTvocRaw();
|
||||
measurements.NOx = ag.sgp41.getNoxIndex();
|
||||
measurements.NOxRaw = ag.sgp41.getNoxRaw();
|
||||
|
||||
Serial.println();
|
||||
Serial.printf("TVOC index: %d\r\n", measurements.TVOC);
|
||||
Serial.printf("TVOC raw: %d\r\n", measurements.TVOCRaw);
|
||||
Serial.printf("NOx index: %d\r\n", measurements.NOx);
|
||||
Serial.printf("NOx raw: %d\r\n", measurements.NOxRaw);
|
||||
}
|
||||
|
||||
static void updatePm(void) {
|
||||
if (ag.pms5003.connected()) {
|
||||
measurements.pm01_1 = ag.pms5003.getPm01Ae();
|
||||
measurements.pm25_1 = ag.pms5003.getPm25Ae();
|
||||
measurements.pm10_1 = ag.pms5003.getPm10Ae();
|
||||
measurements.pm03PCount_1 = ag.pms5003.getPm03ParticleCount();
|
||||
|
||||
Serial.println();
|
||||
Serial.printf("PM1 ug/m3: %d\r\n", measurements.pm01_1);
|
||||
Serial.printf("PM2.5 ug/m3: %d\r\n", measurements.pm25_1);
|
||||
Serial.printf("PM10 ug/m3: %d\r\n", measurements.pm10_1);
|
||||
Serial.printf("PM0.3 Count: %d\r\n", measurements.pm03PCount_1);
|
||||
Serial.printf("PM firmware version: %d\r\n", ag.pms5003.getFirmwareVersion());
|
||||
ag.pms5003.resetFailCount();
|
||||
} else {
|
||||
ag.pms5003.updateFailCount();
|
||||
Serial.printf("PMS read failed %d times\r\n", ag.pms5003.getFailCount());
|
||||
if (ag.pms5003.getFailCount() >= PMS_FAIL_COUNT_SET_INVALID) {
|
||||
measurements.pm01_1 = utils::getInvalidPmValue();
|
||||
measurements.pm25_1 = utils::getInvalidPmValue();
|
||||
measurements.pm10_1 = utils::getInvalidPmValue();
|
||||
measurements.pm03PCount_1 = utils::getInvalidPmValue();
|
||||
}
|
||||
|
||||
if(ag.pms5003.getFailCount() >= ag.pms5003.getFailCountMax()) {
|
||||
Serial.printf("PMS failure count reach to max set %d, restarting...", ag.pms5003.getFailCountMax());
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sendDataToServer(void) {
|
||||
/** Ignore send data to server if postToAirGradient disabled */
|
||||
if (configuration.isPostDataToAirGradient() == false ||
|
||||
configuration.isOfflineMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
||||
&ag, &configuration);
|
||||
if (apiClient.postToServer(syncData)) {
|
||||
Serial.println();
|
||||
Serial.println(
|
||||
"Online mode and isPostToAirGradient = true: watchdog reset");
|
||||
Serial.println();
|
||||
}
|
||||
measurements.bootCount++;
|
||||
}
|
||||
|
||||
static void tempHumUpdate(void) {
|
||||
delay(100);
|
||||
if (ag.sht.measure()) {
|
||||
measurements.Temperature = ag.sht.getTemperature();
|
||||
measurements.Humidity = ag.sht.getRelativeHumidity();
|
||||
|
||||
Serial.printf("Temperature in C: %0.2f\r\n", measurements.Temperature);
|
||||
Serial.printf("Relative Humidity: %d\r\n", measurements.Humidity);
|
||||
Serial.printf("Temperature compensated in C: %0.2f\r\n",
|
||||
measurements.Temperature);
|
||||
Serial.printf("Relative Humidity compensated: %d\r\n",
|
||||
measurements.Humidity);
|
||||
|
||||
// Update compensation temperature and humidity for SGP41
|
||||
if (configuration.hasSensorSGP) {
|
||||
ag.sgp41.setCompensationTemperatureHumidity(measurements.Temperature,
|
||||
measurements.Humidity);
|
||||
}
|
||||
} else {
|
||||
Serial.println("SHT read failed");
|
||||
measurements.Temperature = utils::getInvalidTemperature();
|
||||
measurements.Humidity = utils::getInvalidHumidity();
|
||||
}
|
||||
}
|
61
examples/BASIC/LocalServer.cpp
Normal file
61
examples/BASIC/LocalServer.cpp
Normal file
@ -0,0 +1,61 @@
|
||||
#include "LocalServer.h"
|
||||
|
||||
LocalServer::LocalServer(Stream &log, OpenMetrics &openMetrics,
|
||||
Measurements &measure, Configuration &config,
|
||||
WifiConnector &wifiConnector)
|
||||
: PrintLog(log, "LocalServer"), openMetrics(openMetrics), measure(measure),
|
||||
config(config), wifiConnector(wifiConnector), server(80) {}
|
||||
|
||||
LocalServer::~LocalServer() {}
|
||||
|
||||
bool LocalServer::begin(void) {
|
||||
server.on("/measures/current", HTTP_GET, [this]() { _GET_measure(); });
|
||||
server.on(openMetrics.getApi(), HTTP_GET, [this]() { _GET_metrics(); });
|
||||
server.on("/config", HTTP_GET, [this]() { _GET_config(); });
|
||||
server.on("/config", HTTP_PUT, [this]() { _PUT_config(); });
|
||||
server.begin();
|
||||
logInfo("Init: " + getHostname() + ".local");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void LocalServer::setAirGraident(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
String LocalServer::getHostname(void) {
|
||||
return "airgradient_" + ag->deviceId();
|
||||
}
|
||||
|
||||
void LocalServer::_handle(void) { server.handleClient(); }
|
||||
|
||||
void LocalServer::_GET_config(void) {
|
||||
if(ag->isOne()) {
|
||||
server.send(200, "application/json", config.toString());
|
||||
} else {
|
||||
server.send(200, "application/json", config.toString(fwMode));
|
||||
}
|
||||
}
|
||||
|
||||
void LocalServer::_PUT_config(void) {
|
||||
String data = server.arg(0);
|
||||
String response = "";
|
||||
int statusCode = 400; // Status code for data invalid
|
||||
if (config.parse(data, true)) {
|
||||
statusCode = 200;
|
||||
response = "Success";
|
||||
} else {
|
||||
response = config.getFailedMesage();
|
||||
}
|
||||
server.send(statusCode, "text/plain", response);
|
||||
}
|
||||
|
||||
void LocalServer::_GET_metrics(void) {
|
||||
server.send(200, openMetrics.getApiContentType(), openMetrics.getPayload());
|
||||
}
|
||||
|
||||
void LocalServer::_GET_measure(void) {
|
||||
server.send(
|
||||
200, "application/json",
|
||||
measure.toString(true, fwMode, wifiConnector.RSSI(), ag, &config));
|
||||
}
|
||||
|
||||
void LocalServer::setFwMode(AgFirmwareMode fwMode) { this->fwMode = fwMode; }
|
38
examples/BASIC/LocalServer.h
Normal file
38
examples/BASIC/LocalServer.h
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef _LOCAL_SERVER_H_
|
||||
#define _LOCAL_SERVER_H_
|
||||
|
||||
#include "AgConfigure.h"
|
||||
#include "AgValue.h"
|
||||
#include "AirGradient.h"
|
||||
#include "OpenMetrics.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
|
||||
class LocalServer : public PrintLog {
|
||||
private:
|
||||
AirGradient *ag;
|
||||
OpenMetrics &openMetrics;
|
||||
Measurements &measure;
|
||||
Configuration &config;
|
||||
WifiConnector &wifiConnector;
|
||||
ESP8266WebServer server;
|
||||
AgFirmwareMode fwMode;
|
||||
|
||||
public:
|
||||
LocalServer(Stream &log, OpenMetrics &openMetrics, Measurements &measure,
|
||||
Configuration &config, WifiConnector& wifiConnector);
|
||||
~LocalServer();
|
||||
|
||||
bool begin(void);
|
||||
void setAirGraident(AirGradient *ag);
|
||||
String getHostname(void);
|
||||
void setFwMode(AgFirmwareMode fwMode);
|
||||
void _handle(void);
|
||||
void _GET_config(void);
|
||||
void _PUT_config(void);
|
||||
void _GET_metrics(void);
|
||||
void _GET_measure(void);
|
||||
};
|
||||
|
||||
#endif /** _LOCAL_SERVER_H_ */
|
186
examples/BASIC/OpenMetrics.cpp
Normal file
186
examples/BASIC/OpenMetrics.cpp
Normal file
@ -0,0 +1,186 @@
|
||||
#include "OpenMetrics.h"
|
||||
|
||||
OpenMetrics::OpenMetrics(Measurements &measure, Configuration &config,
|
||||
WifiConnector &wifiConnector, AgApiClient &apiClient)
|
||||
: measure(measure), config(config), wifiConnector(wifiConnector),
|
||||
apiClient(apiClient) {}
|
||||
|
||||
OpenMetrics::~OpenMetrics() {}
|
||||
|
||||
void OpenMetrics::setAirGradient(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
const char *OpenMetrics::getApiContentType(void) {
|
||||
return "application/openmetrics-text; version=1.0.0; charset=utf-8";
|
||||
}
|
||||
|
||||
const char *OpenMetrics::getApi(void) { return "/metrics"; }
|
||||
|
||||
String OpenMetrics::getPayload(void) {
|
||||
String response;
|
||||
String current_metric_name;
|
||||
const auto add_metric = [&](const String &name, const String &help,
|
||||
const String &type, const String &unit = "") {
|
||||
current_metric_name = "airgradient_" + name;
|
||||
if (!unit.isEmpty())
|
||||
current_metric_name += "_" + unit;
|
||||
response += "# HELP " + current_metric_name + " " + help + "\n";
|
||||
response += "# TYPE " + current_metric_name + " " + type + "\n";
|
||||
if (!unit.isEmpty())
|
||||
response += "# UNIT " + current_metric_name + " " + unit + "\n";
|
||||
};
|
||||
const auto add_metric_point = [&](const String &labels, const String &value) {
|
||||
response += current_metric_name + "{" + labels + "} " + value + "\n";
|
||||
};
|
||||
|
||||
add_metric("info", "AirGradient device information", "info");
|
||||
add_metric_point("airgradient_serial_number=\"" + ag->deviceId() +
|
||||
"\",airgradient_device_type=\"" + ag->getBoardName() +
|
||||
"\",airgradient_library_version=\"" + ag->getVersion() +
|
||||
"\"",
|
||||
"1");
|
||||
|
||||
add_metric("config_ok",
|
||||
"1 if the AirGradient device was able to successfully fetch its "
|
||||
"configuration from the server",
|
||||
"gauge");
|
||||
add_metric_point("", apiClient.isFetchConfigureFailed() ? "0" : "1");
|
||||
|
||||
add_metric(
|
||||
"post_ok",
|
||||
"1 if the AirGradient device was able to successfully send to the server",
|
||||
"gauge");
|
||||
add_metric_point("", apiClient.isPostToServerFailed() ? "0" : "1");
|
||||
|
||||
add_metric(
|
||||
"wifi_rssi",
|
||||
"WiFi signal strength from the AirGradient device perspective, in dBm",
|
||||
"gauge", "dbm");
|
||||
add_metric_point("", String(wifiConnector.RSSI()));
|
||||
|
||||
if (config.hasSensorS8 && measure.CO2 >= 0) {
|
||||
add_metric("co2",
|
||||
"Carbon dioxide concentration as measured by the AirGradient S8 "
|
||||
"sensor, in parts per million",
|
||||
"gauge", "ppm");
|
||||
add_metric_point("", String(measure.CO2));
|
||||
}
|
||||
|
||||
float _temp = utils::getInvalidTemperature();
|
||||
float _hum = utils::getInvalidHumidity();
|
||||
int pm01 = utils::getInvalidPmValue();
|
||||
int pm25 = utils::getInvalidPmValue();
|
||||
int pm10 = utils::getInvalidPmValue();
|
||||
int pm03PCount = utils::getInvalidPmValue();
|
||||
int atmpCompensated = utils::getInvalidTemperature();
|
||||
int ahumCompensated = utils::getInvalidHumidity();
|
||||
|
||||
if (config.hasSensorSHT) {
|
||||
_temp = measure.Temperature;
|
||||
_hum = measure.Humidity;
|
||||
atmpCompensated = _temp;
|
||||
ahumCompensated = _hum;
|
||||
}
|
||||
|
||||
if (config.hasSensorPMS1) {
|
||||
pm01 = measure.pm01_1;
|
||||
pm25 = measure.pm25_1;
|
||||
pm10 = measure.pm10_1;
|
||||
pm03PCount = measure.pm03PCount_1;
|
||||
}
|
||||
|
||||
if (config.hasSensorPMS1) {
|
||||
if (utils::isValidPm(pm01)) {
|
||||
add_metric("pm1",
|
||||
"PM1.0 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm01));
|
||||
}
|
||||
if (utils::isValidPm(pm25)) {
|
||||
add_metric("pm2d5",
|
||||
"PM2.5 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm25));
|
||||
}
|
||||
if (utils::isValidPm(pm10)) {
|
||||
add_metric("pm10",
|
||||
"PM10 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm10));
|
||||
}
|
||||
if (utils::isValidPm03Count(pm03PCount)) {
|
||||
add_metric("pm0d3",
|
||||
"PM0.3 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in number of particules per 100 milliliters",
|
||||
"gauge", "p100ml");
|
||||
add_metric_point("", String(pm03PCount));
|
||||
}
|
||||
}
|
||||
|
||||
if (config.hasSensorSGP) {
|
||||
if (utils::isValidVOC(measure.TVOC)) {
|
||||
add_metric("tvoc_index",
|
||||
"The processed Total Volatile Organic Compounds (TVOC) index "
|
||||
"as measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.TVOC));
|
||||
}
|
||||
if (utils::isValidVOC(measure.TVOCRaw)) {
|
||||
add_metric("tvoc_raw",
|
||||
"The raw input value to the Total Volatile Organic Compounds "
|
||||
"(TVOC) index as measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.TVOCRaw));
|
||||
}
|
||||
if (utils::isValidNOx(measure.NOx)) {
|
||||
add_metric("nox_index",
|
||||
"The processed Nitrous Oxide (NOx) index as measured by the "
|
||||
"AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.NOx));
|
||||
}
|
||||
if (utils::isValidNOx(measure.NOxRaw)) {
|
||||
add_metric("nox_raw",
|
||||
"The raw input value to the Nitrous Oxide (NOx) index as "
|
||||
"measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.NOxRaw));
|
||||
}
|
||||
}
|
||||
|
||||
if (utils::isValidTemperature(_temp)) {
|
||||
add_metric(
|
||||
"temperature",
|
||||
"The ambient temperature as measured by the AirGradient SHT / PMS "
|
||||
"sensor, in degrees Celsius",
|
||||
"gauge", "celsius");
|
||||
add_metric_point("", String(_temp));
|
||||
}
|
||||
if (utils::isValidTemperature(atmpCompensated)) {
|
||||
add_metric("temperature_compensated",
|
||||
"The compensated ambient temperature as measured by the "
|
||||
"AirGradient SHT / PMS "
|
||||
"sensor, in degrees Celsius",
|
||||
"gauge", "celsius");
|
||||
add_metric_point("", String(atmpCompensated));
|
||||
}
|
||||
if (utils::isValidHumidity(_hum)) {
|
||||
add_metric(
|
||||
"humidity",
|
||||
"The relative humidity as measured by the AirGradient SHT sensor",
|
||||
"gauge", "percent");
|
||||
add_metric_point("", String(_hum));
|
||||
}
|
||||
if (utils::isValidHumidity(ahumCompensated)) {
|
||||
add_metric("humidity_compensated",
|
||||
"The compensated relative humidity as measured by the "
|
||||
"AirGradient SHT / PMS sensor",
|
||||
"gauge", "percent");
|
||||
add_metric_point("", String(ahumCompensated));
|
||||
}
|
||||
|
||||
response += "# EOF\n";
|
||||
return response;
|
||||
}
|
28
examples/BASIC/OpenMetrics.h
Normal file
28
examples/BASIC/OpenMetrics.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef _OPEN_METRICS_H_
|
||||
#define _OPEN_METRICS_H_
|
||||
|
||||
#include "AgConfigure.h"
|
||||
#include "AgValue.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include "AirGradient.h"
|
||||
#include "AgApiClient.h"
|
||||
|
||||
class OpenMetrics {
|
||||
private:
|
||||
AirGradient *ag;
|
||||
Measurements &measure;
|
||||
Configuration &config;
|
||||
WifiConnector &wifiConnector;
|
||||
AgApiClient &apiClient;
|
||||
|
||||
public:
|
||||
OpenMetrics(Measurements &measure, Configuration &conig,
|
||||
WifiConnector &wifiConnector, AgApiClient& apiClient);
|
||||
~OpenMetrics();
|
||||
void setAirGradient(AirGradient *ag);
|
||||
const char *getApiContentType(void);
|
||||
const char* getApi(void);
|
||||
String getPayload(void);
|
||||
};
|
||||
|
||||
#endif /** _OPEN_METRICS_H_ */
|
@ -1,667 +0,0 @@
|
||||
/*
|
||||
This is the code for the AirGradient DIY BASIC Air Quality Monitor with an D1
|
||||
ESP8266 Microcontroller.
|
||||
|
||||
It is an air quality monitor for PM2.5, CO2, Temperature and Humidity with a
|
||||
small display and can send data over Wifi.
|
||||
|
||||
Open source air quality monitors and kits are available:
|
||||
Indoor Monitor: https://www.airgradient.com/indoor/
|
||||
Outdoor Monitor: https://www.airgradient.com/outdoor/
|
||||
|
||||
Build Instructions:
|
||||
https://www.airgradient.com/documentation/diy-v4/
|
||||
|
||||
Following libraries need to be installed:
|
||||
“WifiManager by tzapu, tablatronix” tested with version 2.0.16-rc.2
|
||||
"Arduino_JSON" by Arduino version 0.2.0
|
||||
"U8g2" by oliver version 2.34.22
|
||||
|
||||
Please make sure you have esp8266 board manager installed. Tested with
|
||||
version 3.1.2.
|
||||
|
||||
Set board to "LOLIN(WEMOS) D1 R2 & mini"
|
||||
|
||||
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
||||
can be set through the AirGradient dashboard.
|
||||
|
||||
If you have any questions please visit our forum at
|
||||
https://forum.airgradient.com/
|
||||
|
||||
CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
|
||||
|
||||
*/
|
||||
|
||||
#include <AirGradient.h>
|
||||
#include <Arduino_JSON.h>
|
||||
#include <ESP8266HTTPClient.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <WiFiManager.h>
|
||||
|
||||
#define WIFI_CONNECT_COUNTDOWN_MAX 180 /** sec */
|
||||
#define WIFI_CONNECT_RETRY_MS 10000 /** ms */
|
||||
#define LED_BAR_COUNT_INIT_VALUE (-1) /** */
|
||||
#define LED_BAR_ANIMATION_PERIOD 100 /** ms */
|
||||
#define DISP_UPDATE_INTERVAL 5000 /** ms */
|
||||
#define SERVER_CONFIG_UPDATE_INTERVAL 30000 /** ms */
|
||||
#define SERVER_SYNC_INTERVAL 60000 /** ms */
|
||||
#define SENSOR_CO2_CALIB_COUNTDOWN_MAX 5 /** sec */
|
||||
#define SENSOR_TVOC_UPDATE_INTERVAL 1000 /** ms */
|
||||
#define SENSOR_CO2_UPDATE_INTERVAL 5000 /** ms */
|
||||
#define SENSOR_PM_UPDATE_INTERVAL 5000 /** ms */
|
||||
#define SENSOR_TEMP_HUM_UPDATE_INTERVAL 5000 /** ms */
|
||||
#define DISPLAY_DELAY_SHOW_CONTENT_MS 2000 /** ms */
|
||||
#define WIFI_HOTSPOT_PASSWORD_DEFAULT \
|
||||
"cleanair" /** default WiFi AP password \
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Use use LED bar state
|
||||
*/
|
||||
typedef enum {
|
||||
UseLedBarOff, /** Don't use LED bar */
|
||||
UseLedBarPM, /** Use LED bar for PMS */
|
||||
UseLedBarCO2, /** Use LED bar for CO2 */
|
||||
} UseLedBar;
|
||||
|
||||
/**
|
||||
* @brief Schedule handle with timing period
|
||||
*
|
||||
*/
|
||||
class AgSchedule {
|
||||
public:
|
||||
AgSchedule(int period, void (*handler)(void))
|
||||
: period(period), handler(handler) {}
|
||||
void run(void) {
|
||||
uint32_t ms = (uint32_t)(millis() - count);
|
||||
if (ms >= period) {
|
||||
/** Call handler */
|
||||
handler();
|
||||
|
||||
Serial.printf("[AgSchedule] handle 0x%08x, period: %d(ms)\r\n",
|
||||
(unsigned int)handler, period);
|
||||
|
||||
/** Update period time */
|
||||
count = millis();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
void (*handler)(void);
|
||||
int period;
|
||||
int count;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief AirGradient server configuration and sync data
|
||||
*
|
||||
*/
|
||||
class AgServer {
|
||||
public:
|
||||
void begin(void) {
|
||||
inF = false;
|
||||
inUSAQI = false;
|
||||
configFailed = false;
|
||||
serverFailed = false;
|
||||
memset(models, 0, sizeof(models));
|
||||
memset(mqttBroker, 0, sizeof(mqttBroker));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get server configuration
|
||||
*
|
||||
* @param id Device ID
|
||||
* @return true Success
|
||||
* @return false Failure
|
||||
*/
|
||||
bool pollServerConfig(String id) {
|
||||
String uri =
|
||||
"http://hw.airgradient.com/sensors/airgradient:" + id + "/one/config";
|
||||
|
||||
/** Init http client */
|
||||
WiFiClient wifiClient;
|
||||
HTTPClient client;
|
||||
if (client.begin(wifiClient, uri) == false) {
|
||||
configFailed = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Get */
|
||||
int retCode = client.GET();
|
||||
if (retCode != 200) {
|
||||
client.end();
|
||||
configFailed = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/** clear failed */
|
||||
configFailed = false;
|
||||
|
||||
/** Get response string */
|
||||
String respContent = client.getString();
|
||||
client.end();
|
||||
Serial.println("Get server config: " + respContent);
|
||||
|
||||
/** Parse JSON */
|
||||
JSONVar root = JSON.parse(respContent);
|
||||
if (JSON.typeof(root) == "undefined") {
|
||||
/** JSON invalid */
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Get "country" */
|
||||
if (JSON.typeof_(root["country"]) == "string") {
|
||||
String country = root["country"];
|
||||
if (country == "US") {
|
||||
inF = true;
|
||||
} else {
|
||||
inF = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Get "pmStandard" */
|
||||
if (JSON.typeof_(root["pmStandard"]) == "string") {
|
||||
String standard = root["pmStandard"];
|
||||
if (standard == "ugm3") {
|
||||
inUSAQI = false;
|
||||
} else {
|
||||
inUSAQI = true;
|
||||
}
|
||||
}
|
||||
|
||||
/** Get "co2CalibrationRequested" */
|
||||
if (JSON.typeof_(root["co2CalibrationRequested"]) == "boolean") {
|
||||
co2Calib = root["co2CalibrationRequested"];
|
||||
}
|
||||
|
||||
/** Get "ledBarMode" */
|
||||
if (JSON.typeof_(root["ledBarMode"]) == "string") {
|
||||
String mode = root["ledBarMode"];
|
||||
if (mode == "co2") {
|
||||
ledBarMode = UseLedBarCO2;
|
||||
} else if (mode == "pm") {
|
||||
ledBarMode = UseLedBarPM;
|
||||
} else if (mode == "off") {
|
||||
ledBarMode = UseLedBarOff;
|
||||
} else {
|
||||
ledBarMode = UseLedBarOff;
|
||||
}
|
||||
}
|
||||
|
||||
/** Get model */
|
||||
if (JSON.typeof_(root["model"]) == "string") {
|
||||
String model = root["model"];
|
||||
if (model.length()) {
|
||||
int len =
|
||||
model.length() < sizeof(models) ? model.length() : sizeof(models);
|
||||
memset(models, 0, sizeof(models));
|
||||
memcpy(models, model.c_str(), len);
|
||||
}
|
||||
}
|
||||
|
||||
/** Get "mqttBrokerUrl" */
|
||||
if (JSON.typeof_(root["mqttBrokerUrl"]) == "string") {
|
||||
String mqtt = root["mqttBrokerUrl"];
|
||||
if (mqtt.length()) {
|
||||
int len = mqtt.length() < sizeof(mqttBroker) ? mqtt.length()
|
||||
: sizeof(mqttBroker);
|
||||
memset(mqttBroker, 0, sizeof(mqttBroker));
|
||||
memcpy(mqttBroker, mqtt.c_str(), len);
|
||||
}
|
||||
}
|
||||
|
||||
/** Get 'abcDays' */
|
||||
if (JSON.typeof_(root["abcDays"]) == "number") {
|
||||
co2AbcCalib = root["abcDays"];
|
||||
} else {
|
||||
co2AbcCalib = -1;
|
||||
}
|
||||
|
||||
/** Show configuration */
|
||||
showServerConfig();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool postToServer(String id, String payload) {
|
||||
/**
|
||||
* @brief Only post data if WiFi is connected
|
||||
*/
|
||||
if (WiFi.isConnected() == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Serial.printf("Post payload: %s\r\n", payload.c_str());
|
||||
|
||||
String uri =
|
||||
"http://hw.airgradient.com/sensors/airgradient:" + id + "/measures";
|
||||
|
||||
WiFiClient wifiClient;
|
||||
HTTPClient client;
|
||||
if (client.begin(wifiClient, uri.c_str()) == false) {
|
||||
return false;
|
||||
}
|
||||
client.addHeader("content-type", "application/json");
|
||||
int retCode = client.POST(payload);
|
||||
client.end();
|
||||
|
||||
if ((retCode == 200) || (retCode == 429)) {
|
||||
serverFailed = false;
|
||||
return true;
|
||||
}
|
||||
serverFailed = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get temperature configuration unit
|
||||
*
|
||||
* @return true F unit
|
||||
* @return false C Unit
|
||||
*/
|
||||
bool isTemperatureUnitF(void) { return inF; }
|
||||
|
||||
/**
|
||||
* @brief Get PMS standard unit
|
||||
*
|
||||
* @return true USAQI
|
||||
* @return false ugm3
|
||||
*/
|
||||
bool isPMSinUSAQI(void) { return inUSAQI; }
|
||||
|
||||
/**
|
||||
* @brief Get status of get server coniguration is failed
|
||||
*
|
||||
* @return true Failed
|
||||
* @return false Success
|
||||
*/
|
||||
bool isConfigFailed(void) { return configFailed; }
|
||||
|
||||
/**
|
||||
* @brief Get status of post server configuration is failed
|
||||
*
|
||||
* @return true Failed
|
||||
* @return false Success
|
||||
*/
|
||||
bool isServerFailed(void) { return serverFailed; }
|
||||
|
||||
/**
|
||||
* @brief Get request calibration CO2
|
||||
*
|
||||
* @return true Requested. If result = true, it's clear after function call
|
||||
* @return false Not-requested
|
||||
*/
|
||||
bool isCo2Calib(void) {
|
||||
bool ret = co2Calib;
|
||||
if (ret) {
|
||||
co2Calib = false;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the Co2 auto calib period
|
||||
*
|
||||
* @return int days, -1 if invalid.
|
||||
*/
|
||||
int getCo2Abccalib(void) { return co2AbcCalib; }
|
||||
|
||||
/**
|
||||
* @brief Get device configuration model name
|
||||
*
|
||||
* @return String Model name, empty string if server failed
|
||||
*/
|
||||
String getModelName(void) { return String(models); }
|
||||
|
||||
/**
|
||||
* @brief Get mqttBroker url
|
||||
*
|
||||
* @return String Broker url, empty if server failed
|
||||
*/
|
||||
String getMqttBroker(void) { return String(mqttBroker); }
|
||||
|
||||
/**
|
||||
* @brief Show server configuration parameter
|
||||
*/
|
||||
void showServerConfig(void) {
|
||||
Serial.println("Server configuration: ");
|
||||
Serial.printf(" inF: %s\r\n", inF ? "true" : "false");
|
||||
Serial.printf(" inUSAQI: %s\r\n", inUSAQI ? "true" : "false");
|
||||
Serial.printf(" useRGBLedBar: %d\r\n", (int)ledBarMode);
|
||||
Serial.printf(" Model: %s\r\n", models);
|
||||
Serial.printf(" Mqtt Broker: %s\r\n", mqttBroker);
|
||||
Serial.printf(" S8 calib period: %d\r\n", co2AbcCalib);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get server config led bar mode
|
||||
*
|
||||
* @return UseLedBar
|
||||
*/
|
||||
UseLedBar getLedBarMode(void) { return ledBarMode; }
|
||||
|
||||
private:
|
||||
bool inF; /** Temperature unit, true: F, false: C */
|
||||
bool inUSAQI; /** PMS unit, true: USAQI, false: ugm3 */
|
||||
bool configFailed; /** Flag indicate get server configuration failed */
|
||||
bool serverFailed; /** Flag indicate post data to server failed */
|
||||
bool co2Calib; /** Is co2Ppmcalibration requset */
|
||||
int co2AbcCalib = -1; /** update auto calibration number of day */
|
||||
UseLedBar ledBarMode = UseLedBarCO2; /** */
|
||||
char models[20]; /** */
|
||||
char mqttBroker[256]; /** */
|
||||
};
|
||||
AgServer agServer;
|
||||
|
||||
/** Create airgradient instance for 'DIY_BASIC' board */
|
||||
AirGradient ag = AirGradient(DIY_BASIC);
|
||||
|
||||
static int co2Ppm = -1;
|
||||
static int pm25 = -1;
|
||||
static float temp = -1;
|
||||
static int hum = -1;
|
||||
static long val;
|
||||
static String wifiSSID = "";
|
||||
static bool wifiHasConfig = false; /** */
|
||||
|
||||
static void boardInit(void);
|
||||
static void failedHandler(String msg);
|
||||
static void co2Calibration(void);
|
||||
static void serverConfigPoll(void);
|
||||
static void co2Poll(void);
|
||||
static void pmPoll(void);
|
||||
static void tempHumPoll(void);
|
||||
static void sendDataToServer(void);
|
||||
static void dispHandler(void);
|
||||
static String getDevId(void);
|
||||
static void updateWiFiConnect(void);
|
||||
|
||||
AgSchedule configSchedule(SERVER_CONFIG_UPDATE_INTERVAL, serverConfigPoll);
|
||||
AgSchedule serverSchedule(SERVER_SYNC_INTERVAL, sendDataToServer);
|
||||
AgSchedule dispSchedule(DISP_UPDATE_INTERVAL, dispHandler);
|
||||
AgSchedule co2Schedule(SENSOR_CO2_UPDATE_INTERVAL, co2Poll);
|
||||
AgSchedule pmsSchedule(SENSOR_PM_UPDATE_INTERVAL, pmPoll);
|
||||
AgSchedule tempHumSchedule(SENSOR_TEMP_HUM_UPDATE_INTERVAL, tempHumPoll);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
/** Init I2C */
|
||||
Wire.begin(ag.getI2cSdaPin(), ag.getI2cSclPin());
|
||||
delay(1000);
|
||||
|
||||
/** Board init */
|
||||
boardInit();
|
||||
|
||||
/** Init AirGradient server */
|
||||
agServer.begin();
|
||||
|
||||
/** Show boot display */
|
||||
displayShowText("DIY basic", "Lib:" + ag.getVersion(), "");
|
||||
delay(2000);
|
||||
|
||||
/** WiFi connect */
|
||||
connectToWifi();
|
||||
if (WiFi.status() == WL_CONNECTED) {
|
||||
wifiHasConfig = true;
|
||||
sendPing();
|
||||
|
||||
agServer.pollServerConfig(getDevId());
|
||||
if (agServer.isCo2Calib()) {
|
||||
co2Calibration();
|
||||
}
|
||||
}
|
||||
|
||||
/** Show serial number display */
|
||||
ag.display.clear();
|
||||
ag.display.setCursor(1, 1);
|
||||
ag.display.setText("Warm Up");
|
||||
ag.display.setCursor(1, 15);
|
||||
ag.display.setText("Serial#");
|
||||
ag.display.setCursor(1, 29);
|
||||
String id = getNormalizedMac();
|
||||
Serial.println("Device id: " + id);
|
||||
String id1 = id.substring(0, 9);
|
||||
String id2 = id.substring(9, 12);
|
||||
ag.display.setText("\'" + id1);
|
||||
ag.display.setCursor(1, 40);
|
||||
ag.display.setText(id2 + "\'");
|
||||
ag.display.show();
|
||||
|
||||
delay(5000);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
configSchedule.run();
|
||||
serverSchedule.run();
|
||||
dispSchedule.run();
|
||||
co2Schedule.run();
|
||||
pmsSchedule.run();
|
||||
tempHumSchedule.run();
|
||||
|
||||
updateWiFiConnect();
|
||||
}
|
||||
|
||||
static void sendPing() {
|
||||
JSONVar root;
|
||||
root["wifi"] = WiFi.RSSI();
|
||||
root["boot"] = 0;
|
||||
|
||||
// delay(1500);
|
||||
if (agServer.postToServer(getDevId(), JSON.stringify(root))) {
|
||||
// Ping Server succses
|
||||
} else {
|
||||
// Ping server failed
|
||||
}
|
||||
// delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
|
||||
void displayShowText(String ln1, String ln2, String ln3) {
|
||||
char buf[9];
|
||||
ag.display.clear();
|
||||
|
||||
ag.display.setCursor(1, 1);
|
||||
ag.display.setText(ln1);
|
||||
ag.display.setCursor(1, 19);
|
||||
ag.display.setText(ln2);
|
||||
ag.display.setCursor(1, 37);
|
||||
ag.display.setText(ln3);
|
||||
|
||||
ag.display.show();
|
||||
}
|
||||
|
||||
// Wifi Manager
|
||||
void connectToWifi() {
|
||||
WiFiManager wifiManager;
|
||||
wifiSSID = "AG-" + String(ESP.getChipId(), HEX);
|
||||
wifiManager.setConfigPortalBlocking(false);
|
||||
wifiManager.setConfigPortalTimeout(WIFI_CONNECT_COUNTDOWN_MAX);
|
||||
wifiManager.autoConnect(wifiSSID.c_str(), WIFI_HOTSPOT_PASSWORD_DEFAULT);
|
||||
|
||||
uint32_t lastTime = millis();
|
||||
int count = WIFI_CONNECT_COUNTDOWN_MAX;
|
||||
displayShowText(String(WIFI_CONNECT_COUNTDOWN_MAX) + " sec",
|
||||
"SSID:", wifiSSID);
|
||||
while (wifiManager.getConfigPortalActive()) {
|
||||
wifiManager.process();
|
||||
uint32_t ms = (uint32_t)(millis() - lastTime);
|
||||
if (ms >= 1000) {
|
||||
lastTime = millis();
|
||||
displayShowText(String(count) + " sec", "SSID:", wifiSSID);
|
||||
count--;
|
||||
|
||||
// Timeout
|
||||
if (count == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!WiFi.isConnected()) {
|
||||
displayShowText("Booting", "offline", "mode");
|
||||
Serial.println("failed to connect and hit timeout");
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
}
|
||||
|
||||
static void boardInit(void) {
|
||||
/** Init SHT sensor */
|
||||
if (ag.sht.begin(Wire) == false) {
|
||||
failedHandler("SHT init failed");
|
||||
}
|
||||
|
||||
/** CO2 init */
|
||||
if (ag.s8.begin(&Serial) == false) {
|
||||
failedHandler("SenseAirS8 init failed");
|
||||
}
|
||||
|
||||
/** PMS init */
|
||||
if (ag.pms5003.begin(&Serial) == false) {
|
||||
failedHandler("PMS5003 init failed");
|
||||
}
|
||||
|
||||
/** Display init */
|
||||
ag.display.begin(Wire);
|
||||
ag.display.setTextColor(1);
|
||||
}
|
||||
|
||||
static void failedHandler(String msg) {
|
||||
while (true) {
|
||||
Serial.println(msg);
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
static void co2Calibration(void) {
|
||||
/** Count down for co2CalibCountdown secs */
|
||||
for (int i = 0; i < SENSOR_CO2_CALIB_COUNTDOWN_MAX; i++) {
|
||||
displayShowText("CO2 calib", "after",
|
||||
String(SENSOR_CO2_CALIB_COUNTDOWN_MAX - i) + " sec");
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
if (ag.s8.setBaselineCalibration()) {
|
||||
displayShowText("Calib", "success", "");
|
||||
delay(1000);
|
||||
displayShowText("Wait for", "finish", "...");
|
||||
int count = 0;
|
||||
while (ag.s8.isBaseLineCalibrationDone() == false) {
|
||||
delay(1000);
|
||||
count++;
|
||||
}
|
||||
displayShowText("Finish", "after", String(count) + " sec");
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
} else {
|
||||
displayShowText("Calib", "failure!!!", "");
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
}
|
||||
|
||||
static void serverConfigPoll(void) {
|
||||
if (agServer.pollServerConfig(getDevId())) {
|
||||
if (agServer.isCo2Calib()) {
|
||||
co2Calibration();
|
||||
}
|
||||
if (agServer.getCo2Abccalib() > 0) {
|
||||
if (ag.s8.setAutoCalib(agServer.getCo2Abccalib() * 24) == false) {
|
||||
Serial.println("Set S8 auto calib failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void co2Poll() {
|
||||
co2Ppm = ag.s8.getCo2();
|
||||
Serial.printf("CO2 index: %d\r\n", co2Ppm);
|
||||
}
|
||||
|
||||
void pmPoll() {
|
||||
if (ag.pms5003.readData()) {
|
||||
pm25 = ag.pms5003.getPm25Ae();
|
||||
Serial.printf("PMS2.5: %d\r\n", pm25);
|
||||
} else {
|
||||
pm25 = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static void tempHumPoll() {
|
||||
if (ag.sht.measure()) {
|
||||
temp = ag.sht.getTemperature();
|
||||
hum = ag.sht.getRelativeHumidity();
|
||||
Serial.printf("Temperature: %0.2f\r\n", temp);
|
||||
Serial.printf(" Humidity: %d\r\n", hum);
|
||||
} else {
|
||||
Serial.println("Meaure SHT failed");
|
||||
}
|
||||
}
|
||||
|
||||
static void sendDataToServer() {
|
||||
JSONVar root;
|
||||
root["wifi"] = WiFi.RSSI();
|
||||
if (co2Ppm >= 0) {
|
||||
root["rco2"] = co2Ppm;
|
||||
}
|
||||
if (pm25 >= 0) {
|
||||
root["pm02"] = pm25;
|
||||
}
|
||||
if (temp >= 0) {
|
||||
root["atmp"] = temp;
|
||||
}
|
||||
if (hum >= 0) {
|
||||
root["rhum"] = hum;
|
||||
}
|
||||
|
||||
if (agServer.postToServer(getDevId(), JSON.stringify(root)) == false) {
|
||||
Serial.println("Post to server failed");
|
||||
}
|
||||
}
|
||||
|
||||
static void dispHandler() {
|
||||
String ln1 = "";
|
||||
String ln2 = "";
|
||||
String ln3 = "";
|
||||
|
||||
if (agServer.isPMSinUSAQI()) {
|
||||
ln1 = "AQI:" + String(ag.pms5003.convertPm25ToUsAqi(pm25));
|
||||
} else {
|
||||
ln1 = "PM :" + String(pm25) + " ug";
|
||||
}
|
||||
ln2 = "CO2:" + String(co2Ppm);
|
||||
|
||||
if (agServer.isTemperatureUnitF()) {
|
||||
ln3 = String((temp * 9 / 5) + 32).substring(0, 4) + " " + String(hum) + "%";
|
||||
} else {
|
||||
ln3 = String(temp).substring(0, 4) + " " + String(hum) + "%";
|
||||
}
|
||||
displayShowText(ln1, ln2, ln3);
|
||||
}
|
||||
|
||||
static String getDevId(void) { return getNormalizedMac(); }
|
||||
|
||||
/**
|
||||
* @brief WiFi reconnect handler
|
||||
*/
|
||||
static void updateWiFiConnect(void) {
|
||||
static uint32_t lastRetry;
|
||||
if (wifiHasConfig == false) {
|
||||
return;
|
||||
}
|
||||
if (WiFi.isConnected()) {
|
||||
lastRetry = millis();
|
||||
return;
|
||||
}
|
||||
uint32_t ms = (uint32_t)(millis() - lastRetry);
|
||||
if (ms >= WIFI_CONNECT_RETRY_MS) {
|
||||
lastRetry = millis();
|
||||
WiFi.reconnect();
|
||||
|
||||
Serial.printf("Re-Connect WiFi\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
String getNormalizedMac() {
|
||||
String mac = WiFi.macAddress();
|
||||
mac.replace(":", "");
|
||||
mac.toLowerCase();
|
||||
return mac;
|
||||
}
|
629
examples/DiyProIndoorV3_3/DiyProIndoorV3_3.ino
Normal file
629
examples/DiyProIndoorV3_3/DiyProIndoorV3_3.ino
Normal file
@ -0,0 +1,629 @@
|
||||
/*
|
||||
This is the code for the AirGradient DIY PRO 3.3 Air Quality Monitor with an D1
|
||||
ESP8266 Microcontroller.
|
||||
|
||||
It is an air quality monitor for PM2.5, CO2, Temperature and Humidity with a
|
||||
small display and can send data over Wifi.
|
||||
|
||||
Open source air quality monitors and kits are available:
|
||||
Indoor Monitor: https://www.airgradient.com/indoor/
|
||||
Outdoor Monitor: https://www.airgradient.com/outdoor/
|
||||
|
||||
Build Instructions:
|
||||
https://www.airgradient.com/documentation/diy-v4/
|
||||
|
||||
Please make sure you have esp8266 board manager installed. Tested with
|
||||
version 3.1.2.
|
||||
|
||||
Set board to "LOLIN(WEMOS) D1 R2 & mini"
|
||||
|
||||
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
||||
can be set through the AirGradient dashboard.
|
||||
|
||||
If you have any questions please visit our forum at
|
||||
https://forum.airgradient.com/
|
||||
|
||||
CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
|
||||
|
||||
*/
|
||||
|
||||
#include "AgApiClient.h"
|
||||
#include "AgConfigure.h"
|
||||
#include "AgSchedule.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include "LocalServer.h"
|
||||
#include "OpenMetrics.h"
|
||||
#include "MqttClient.h"
|
||||
#include <AirGradient.h>
|
||||
#include <ESP8266HTTPClient.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266mDNS.h>
|
||||
#include <WiFiClient.h>
|
||||
|
||||
#define LED_BAR_ANIMATION_PERIOD 100 /** ms */
|
||||
#define DISP_UPDATE_INTERVAL 2500 /** ms */
|
||||
#define SERVER_CONFIG_SYNC_INTERVAL 60000 /** ms */
|
||||
#define SERVER_SYNC_INTERVAL 60000 /** ms */
|
||||
#define MQTT_SYNC_INTERVAL 60000 /** ms */
|
||||
#define SENSOR_CO2_CALIB_COUNTDOWN_MAX 5 /** sec */
|
||||
#define SENSOR_TVOC_UPDATE_INTERVAL 1000 /** ms */
|
||||
#define SENSOR_CO2_UPDATE_INTERVAL 4000 /** ms */
|
||||
#define SENSOR_PM_UPDATE_INTERVAL 2000 /** ms */
|
||||
#define SENSOR_TEMP_HUM_UPDATE_INTERVAL 2000 /** ms */
|
||||
#define DISPLAY_DELAY_SHOW_CONTENT_MS 2000 /** ms */
|
||||
#define FIRMWARE_CHECK_FOR_UPDATE_MS (60 * 60 * 1000) /** ms */
|
||||
|
||||
static AirGradient ag(DIY_PRO_INDOOR_V3_3);
|
||||
static Configuration configuration(Serial);
|
||||
static AgApiClient apiClient(Serial, configuration);
|
||||
static Measurements measurements;
|
||||
static OledDisplay oledDisplay(configuration, measurements, Serial);
|
||||
static StateMachine stateMachine(oledDisplay, Serial, measurements,
|
||||
configuration);
|
||||
static WifiConnector wifiConnector(oledDisplay, Serial, stateMachine,
|
||||
configuration);
|
||||
static OpenMetrics openMetrics(measurements, configuration, wifiConnector,
|
||||
apiClient);
|
||||
static LocalServer localServer(Serial, openMetrics, measurements, configuration,
|
||||
wifiConnector);
|
||||
static MqttClient mqttClient(Serial);
|
||||
|
||||
static int getCO2FailCount = 0;
|
||||
static AgFirmwareMode fwMode = FW_MODE_I_33PS;
|
||||
|
||||
static String fwNewVersion;
|
||||
|
||||
static void boardInit(void);
|
||||
static void failedHandler(String msg);
|
||||
static void configurationUpdateSchedule(void);
|
||||
static void appDispHandler(void);
|
||||
static void oledDisplaySchedule(void);
|
||||
static void updateTvoc(void);
|
||||
static void updatePm(void);
|
||||
static void sendDataToServer(void);
|
||||
static void tempHumUpdate(void);
|
||||
static void co2Update(void);
|
||||
static void mdnsInit(void);
|
||||
static void initMqtt(void);
|
||||
static void factoryConfigReset(void);
|
||||
static void wdgFeedUpdate(void);
|
||||
static bool sgp41Init(void);
|
||||
static void wifiFactoryConfigure(void);
|
||||
static void mqttHandle(void);
|
||||
|
||||
AgSchedule dispLedSchedule(DISP_UPDATE_INTERVAL, oledDisplaySchedule);
|
||||
AgSchedule configSchedule(SERVER_CONFIG_SYNC_INTERVAL,
|
||||
configurationUpdateSchedule);
|
||||
AgSchedule agApiPostSchedule(SERVER_SYNC_INTERVAL, sendDataToServer);
|
||||
AgSchedule co2Schedule(SENSOR_CO2_UPDATE_INTERVAL, co2Update);
|
||||
AgSchedule pmsSchedule(SENSOR_PM_UPDATE_INTERVAL, updatePm);
|
||||
AgSchedule tempHumSchedule(SENSOR_TEMP_HUM_UPDATE_INTERVAL, tempHumUpdate);
|
||||
AgSchedule tvocSchedule(SENSOR_TVOC_UPDATE_INTERVAL, updateTvoc);
|
||||
AgSchedule watchdogFeedSchedule(60000, wdgFeedUpdate);
|
||||
AgSchedule mqttSchedule(MQTT_SYNC_INTERVAL, mqttHandle);
|
||||
|
||||
void setup() {
|
||||
/** Serial for print debug message */
|
||||
Serial.begin(115200);
|
||||
delay(100); /** For bester show log */
|
||||
|
||||
/** Print device ID into log */
|
||||
Serial.println("Serial nr: " + ag.deviceId());
|
||||
|
||||
/** Initialize local configure */
|
||||
configuration.begin();
|
||||
|
||||
/** Init I2C */
|
||||
Wire.begin(ag.getI2cSdaPin(), ag.getI2cSclPin());
|
||||
delay(1000);
|
||||
|
||||
configuration.setAirGradient(&ag);
|
||||
oledDisplay.setAirGradient(&ag);
|
||||
stateMachine.setAirGradient(&ag);
|
||||
wifiConnector.setAirGradient(&ag);
|
||||
apiClient.setAirGradient(&ag);
|
||||
openMetrics.setAirGradient(&ag);
|
||||
localServer.setAirGraident(&ag);
|
||||
|
||||
/** Example set custom API root URL */
|
||||
// apiClient.setApiRoot("https://example.custom.api");
|
||||
|
||||
/** Init sensor */
|
||||
boardInit();
|
||||
|
||||
/** Connecting wifi */
|
||||
bool connectToWifi = false;
|
||||
|
||||
connectToWifi = !configuration.isOfflineMode();
|
||||
if (connectToWifi) {
|
||||
apiClient.begin();
|
||||
|
||||
if (wifiConnector.connect()) {
|
||||
if (wifiConnector.isConnected()) {
|
||||
mdnsInit();
|
||||
localServer.begin();
|
||||
initMqtt();
|
||||
sendDataToAg();
|
||||
|
||||
apiClient.fetchServerConfiguration();
|
||||
configSchedule.update();
|
||||
if (apiClient.isFetchConfigureFailed()) {
|
||||
if (apiClient.isNotAvailableOnDashboard()) {
|
||||
stateMachine.displaySetAddToDashBoard();
|
||||
stateMachine.displayHandle(
|
||||
AgStateMachineWiFiOkServerOkSensorConfigFailed);
|
||||
} else {
|
||||
stateMachine.displayClearAddToDashBoard();
|
||||
}
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
} else {
|
||||
if (wifiConnector.isConfigurePorttalTimeout()) {
|
||||
oledDisplay.showRebooting();
|
||||
delay(2500);
|
||||
oledDisplay.setText("", "", "");
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/** Set offline mode without saving, cause wifi is not configured */
|
||||
if (wifiConnector.hasConfigurated() == false) {
|
||||
Serial.println("Set offline mode cause wifi is not configurated");
|
||||
configuration.setOfflineModeWithoutSave(true);
|
||||
}
|
||||
|
||||
/** Show display Warning up */
|
||||
oledDisplay.setText("Warming Up", "Serial Number:", ag.deviceId().c_str());
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
|
||||
Serial.println("Display brightness: " +
|
||||
String(configuration.getDisplayBrightness()));
|
||||
oledDisplay.setBrightness(configuration.getDisplayBrightness());
|
||||
|
||||
appDispHandler();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
/** Handle schedule */
|
||||
dispLedSchedule.run();
|
||||
configSchedule.run();
|
||||
agApiPostSchedule.run();
|
||||
|
||||
if (configuration.hasSensorS8) {
|
||||
co2Schedule.run();
|
||||
}
|
||||
if (configuration.hasSensorPMS1) {
|
||||
pmsSchedule.run();
|
||||
ag.pms5003.handle();
|
||||
}
|
||||
if (configuration.hasSensorSHT) {
|
||||
tempHumSchedule.run();
|
||||
}
|
||||
if (configuration.hasSensorSGP) {
|
||||
tvocSchedule.run();
|
||||
}
|
||||
|
||||
watchdogFeedSchedule.run();
|
||||
|
||||
/** Check for handle WiFi reconnect */
|
||||
wifiConnector.handle();
|
||||
|
||||
/** factory reset handle */
|
||||
// factoryConfigReset();
|
||||
|
||||
/** check that local configura changed then do some action */
|
||||
configUpdateHandle();
|
||||
|
||||
localServer._handle();
|
||||
|
||||
if (configuration.hasSensorSGP) {
|
||||
ag.sgp41.handle();
|
||||
}
|
||||
|
||||
MDNS.update();
|
||||
|
||||
mqttSchedule.run();
|
||||
mqttClient.handle();
|
||||
}
|
||||
|
||||
static void co2Update(void) {
|
||||
int value = ag.s8.getCo2();
|
||||
if (utils::isValidCO2(value)) {
|
||||
measurements.CO2 = value;
|
||||
getCO2FailCount = 0;
|
||||
Serial.printf("CO2 (ppm): %d\r\n", measurements.CO2);
|
||||
} else {
|
||||
getCO2FailCount++;
|
||||
Serial.printf("Get CO2 failed: %d\r\n", getCO2FailCount);
|
||||
if (getCO2FailCount >= 3) {
|
||||
measurements.CO2 = utils::getInvalidCO2();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void mdnsInit(void) {
|
||||
Serial.println("mDNS init");
|
||||
if (!MDNS.begin(localServer.getHostname().c_str())) {
|
||||
Serial.println("Init mDNS failed");
|
||||
return;
|
||||
}
|
||||
|
||||
MDNS.addService("_airgradient", "_tcp", 80);
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "model",
|
||||
AgFirmwareModeName(fwMode));
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "serialno", ag.deviceId());
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "fw_ver", ag.getVersion());
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "vendor", "AirGradient");
|
||||
|
||||
MDNS.announce();
|
||||
}
|
||||
|
||||
static void initMqtt(void) {
|
||||
String mqttUri = configuration.getMqttBrokerUri();
|
||||
if (mqttUri.isEmpty()) {
|
||||
Serial.println(
|
||||
"MQTT is not configured, skipping initialization of MQTT client");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mqttClient.begin(mqttUri)) {
|
||||
Serial.println("Successfully connected to MQTT broker");
|
||||
} else {
|
||||
Serial.println("Connection to MQTT broker failed");
|
||||
}
|
||||
}
|
||||
|
||||
static void factoryConfigReset(void) {
|
||||
#if 0
|
||||
if (ag.button.getState() == ag.button.BUTTON_PRESSED) {
|
||||
if (factoryBtnPressTime == 0) {
|
||||
factoryBtnPressTime = millis();
|
||||
} else {
|
||||
uint32_t ms = (uint32_t)(millis() - factoryBtnPressTime);
|
||||
if (ms >= 2000) {
|
||||
// Show display message: For factory keep for x seconds
|
||||
if (ag.isOne() || ag.isPro4_2()) {
|
||||
oledDisplay.setText("Factory reset", "keep pressed", "for 8 sec");
|
||||
} else {
|
||||
Serial.println("Factory reset, keep pressed for 8 sec");
|
||||
}
|
||||
|
||||
int count = 7;
|
||||
while (ag.button.getState() == ag.button.BUTTON_PRESSED) {
|
||||
delay(1000);
|
||||
String str = "for " + String(count) + " sec";
|
||||
oledDisplay.setText("Factory reset", "keep pressed", str.c_str());
|
||||
|
||||
count--;
|
||||
if (count == 0) {
|
||||
/** Stop MQTT task first */
|
||||
// if (mqttTask) {
|
||||
// vTaskDelete(mqttTask);
|
||||
// mqttTask = NULL;
|
||||
// }
|
||||
|
||||
/** Reset WIFI */
|
||||
// WiFi.enableSTA(true); // Incase offline mode
|
||||
// WiFi.disconnect(true, true);
|
||||
wifiConnector.reset();
|
||||
|
||||
/** Reset local config */
|
||||
configuration.reset();
|
||||
|
||||
oledDisplay.setText("Factory reset", "successful", "");
|
||||
|
||||
delay(3000);
|
||||
oledDisplay.setText("", "", "");
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
|
||||
/** Show current content cause reset ignore */
|
||||
factoryBtnPressTime = 0;
|
||||
appDispHandler();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (factoryBtnPressTime != 0) {
|
||||
appDispHandler();
|
||||
}
|
||||
factoryBtnPressTime = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void wdgFeedUpdate(void) {
|
||||
ag.watchdog.reset();
|
||||
Serial.println("External watchdog feed!");
|
||||
}
|
||||
|
||||
static bool sgp41Init(void) {
|
||||
ag.sgp41.setNoxLearningOffset(configuration.getNoxLearningOffset());
|
||||
ag.sgp41.setTvocLearningOffset(configuration.getTvocLearningOffset());
|
||||
if (ag.sgp41.begin(Wire)) {
|
||||
Serial.println("Init SGP41 success");
|
||||
configuration.hasSensorSGP = true;
|
||||
return true;
|
||||
} else {
|
||||
Serial.println("Init SGP41 failuire");
|
||||
configuration.hasSensorSGP = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void wifiFactoryConfigure(void) {
|
||||
WiFi.persistent(true);
|
||||
WiFi.begin("airgradient", "cleanair");
|
||||
WiFi.persistent(false);
|
||||
oledDisplay.setText("Configure WiFi", "connect to", "\'airgradient\'");
|
||||
delay(2500);
|
||||
oledDisplay.setText("Rebooting...", "", "");
|
||||
delay(2500);
|
||||
oledDisplay.setText("", "", "");
|
||||
ESP.restart();
|
||||
}
|
||||
|
||||
static void mqttHandle(void) {
|
||||
if(mqttClient.isConnected() == false) {
|
||||
mqttClient.connect(String("airgradient-") + ag.deviceId());
|
||||
}
|
||||
|
||||
if (mqttClient.isConnected()) {
|
||||
String payload = measurements.toString(true, fwMode, wifiConnector.RSSI(),
|
||||
&ag, &configuration);
|
||||
String topic = "airgradient/readings/" + ag.deviceId();
|
||||
if (mqttClient.publish(topic.c_str(), payload.c_str(), payload.length())) {
|
||||
Serial.println("MQTT sync success");
|
||||
} else {
|
||||
Serial.println("MQTT sync failure");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sendDataToAg() {
|
||||
/** Change oledDisplay and led state */
|
||||
stateMachine.displayHandle(AgStateMachineWiFiOkServerConnecting);
|
||||
|
||||
delay(1500);
|
||||
if (apiClient.sendPing(wifiConnector.RSSI(), measurements.bootCount)) {
|
||||
stateMachine.displayHandle(AgStateMachineWiFiOkServerConnected);
|
||||
} else {
|
||||
stateMachine.displayHandle(AgStateMachineWiFiOkServerConnectFailed);
|
||||
}
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
|
||||
void dispSensorNotFound(String ss) {
|
||||
ss = ss + " not found";
|
||||
oledDisplay.setText("Sensor init", "Error:", ss.c_str());
|
||||
delay(2000);
|
||||
}
|
||||
|
||||
static void boardInit(void) {
|
||||
/** Display init */
|
||||
oledDisplay.begin();
|
||||
|
||||
/** Show boot display */
|
||||
Serial.println("Firmware Version: " + ag.getVersion());
|
||||
|
||||
oledDisplay.setText("AirGradient ONE",
|
||||
"FW Version: ", ag.getVersion().c_str());
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
|
||||
ag.watchdog.begin();
|
||||
|
||||
/** Show message init sensor */
|
||||
oledDisplay.setText("Sensor", "initializing...", "");
|
||||
|
||||
/** Init sensor SGP41 */
|
||||
if (sgp41Init() == false) {
|
||||
dispSensorNotFound("SGP41");
|
||||
}
|
||||
|
||||
/** Init SHT */
|
||||
if (ag.sht.begin(Wire) == false) {
|
||||
Serial.println("SHTx sensor not found");
|
||||
configuration.hasSensorSHT = false;
|
||||
dispSensorNotFound("SHT");
|
||||
}
|
||||
|
||||
/** Init S8 CO2 sensor */
|
||||
if (ag.s8.begin(&Serial) == false) {
|
||||
Serial.println("CO2 S8 sensor not found");
|
||||
configuration.hasSensorS8 = false;
|
||||
dispSensorNotFound("S8");
|
||||
}
|
||||
|
||||
/** Init PMS5003 */
|
||||
configuration.hasSensorPMS1 = true;
|
||||
configuration.hasSensorPMS2 = false;
|
||||
if (ag.pms5003.begin(&Serial) == false) {
|
||||
Serial.println("PMS sensor not found");
|
||||
configuration.hasSensorPMS1 = false;
|
||||
|
||||
dispSensorNotFound("PMS");
|
||||
}
|
||||
|
||||
/** Set S8 CO2 abc days period */
|
||||
if (configuration.hasSensorS8) {
|
||||
if (ag.s8.setAbcPeriod(configuration.getCO2CalibrationAbcDays() * 24)) {
|
||||
Serial.println("Set S8 AbcDays successful");
|
||||
} else {
|
||||
Serial.println("Set S8 AbcDays failure");
|
||||
}
|
||||
}
|
||||
|
||||
localServer.setFwMode(FW_MODE_I_33PS);
|
||||
}
|
||||
|
||||
static void failedHandler(String msg) {
|
||||
while (true) {
|
||||
Serial.println(msg);
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
static void configurationUpdateSchedule(void) {
|
||||
if (apiClient.fetchServerConfiguration()) {
|
||||
configUpdateHandle();
|
||||
}
|
||||
}
|
||||
|
||||
static void configUpdateHandle() {
|
||||
if (configuration.isUpdated() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
stateMachine.executeCo2Calibration();
|
||||
|
||||
String mqttUri = configuration.getMqttBrokerUri();
|
||||
if (mqttClient.isCurrentUri(mqttUri) == false) {
|
||||
mqttClient.end();
|
||||
initMqtt();
|
||||
}
|
||||
|
||||
if (configuration.hasSensorSGP) {
|
||||
if (configuration.noxLearnOffsetChanged() ||
|
||||
configuration.tvocLearnOffsetChanged()) {
|
||||
ag.sgp41.end();
|
||||
|
||||
int oldTvocOffset = ag.sgp41.getTvocLearningOffset();
|
||||
int oldNoxOffset = ag.sgp41.getNoxLearningOffset();
|
||||
bool result = sgp41Init();
|
||||
const char *resultStr = "successful";
|
||||
if (!result) {
|
||||
resultStr = "failure";
|
||||
}
|
||||
if (oldTvocOffset != configuration.getTvocLearningOffset()) {
|
||||
Serial.printf("Setting tvocLearningOffset from %d to %d hours %s\r\n",
|
||||
oldTvocOffset, configuration.getTvocLearningOffset(),
|
||||
resultStr);
|
||||
}
|
||||
if (oldNoxOffset != configuration.getNoxLearningOffset()) {
|
||||
Serial.printf("Setting noxLearningOffset from %d to %d hours %s\r\n",
|
||||
oldNoxOffset, configuration.getNoxLearningOffset(),
|
||||
resultStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (configuration.isDisplayBrightnessChanged()) {
|
||||
oledDisplay.setBrightness(configuration.getDisplayBrightness());
|
||||
}
|
||||
|
||||
appDispHandler();
|
||||
}
|
||||
|
||||
static void appDispHandler(void) {
|
||||
AgStateMachineState state = AgStateMachineNormal;
|
||||
|
||||
/** Only show display status on online mode. */
|
||||
if (configuration.isOfflineMode() == false) {
|
||||
if (wifiConnector.isConnected() == false) {
|
||||
state = AgStateMachineWiFiLost;
|
||||
} else if (apiClient.isFetchConfigureFailed()) {
|
||||
state = AgStateMachineSensorConfigFailed;
|
||||
if (apiClient.isNotAvailableOnDashboard()) {
|
||||
stateMachine.displaySetAddToDashBoard();
|
||||
} else {
|
||||
stateMachine.displayClearAddToDashBoard();
|
||||
}
|
||||
} else if (apiClient.isPostToServerFailed()) {
|
||||
state = AgStateMachineServerLost;
|
||||
}
|
||||
}
|
||||
stateMachine.displayHandle(state);
|
||||
}
|
||||
|
||||
static void oledDisplaySchedule(void) {
|
||||
|
||||
appDispHandler();
|
||||
}
|
||||
|
||||
static void updateTvoc(void) {
|
||||
measurements.TVOC = ag.sgp41.getTvocIndex();
|
||||
measurements.TVOCRaw = ag.sgp41.getTvocRaw();
|
||||
measurements.NOx = ag.sgp41.getNoxIndex();
|
||||
measurements.NOxRaw = ag.sgp41.getNoxRaw();
|
||||
|
||||
Serial.println();
|
||||
Serial.printf("TVOC index: %d\r\n", measurements.TVOC);
|
||||
Serial.printf("TVOC raw: %d\r\n", measurements.TVOCRaw);
|
||||
Serial.printf("NOx index: %d\r\n", measurements.NOx);
|
||||
Serial.printf("NOx raw: %d\r\n", measurements.NOxRaw);
|
||||
}
|
||||
|
||||
static void updatePm(void) {
|
||||
if (ag.pms5003.connected()) {
|
||||
measurements.pm01_1 = ag.pms5003.getPm01Ae();
|
||||
measurements.pm25_1 = ag.pms5003.getPm25Ae();
|
||||
measurements.pm10_1 = ag.pms5003.getPm10Ae();
|
||||
measurements.pm03PCount_1 = ag.pms5003.getPm03ParticleCount();
|
||||
|
||||
Serial.println();
|
||||
Serial.printf("PM1 ug/m3: %d\r\n", measurements.pm01_1);
|
||||
Serial.printf("PM2.5 ug/m3: %d\r\n", measurements.pm25_1);
|
||||
Serial.printf("PM10 ug/m3: %d\r\n", measurements.pm10_1);
|
||||
Serial.printf("PM0.3 Count: %d\r\n", measurements.pm03PCount_1);
|
||||
Serial.printf("PM firmware version: %d\r\n", ag.pms5003.getFirmwareVersion());
|
||||
ag.pms5003.resetFailCount();
|
||||
} else {
|
||||
ag.pms5003.updateFailCount();
|
||||
Serial.printf("PMS read failed %d times\r\n", ag.pms5003.getFailCount());
|
||||
if (ag.pms5003.getFailCount() >= PMS_FAIL_COUNT_SET_INVALID) {
|
||||
measurements.pm01_1 = utils::getInvalidPmValue();
|
||||
measurements.pm25_1 = utils::getInvalidPmValue();
|
||||
measurements.pm10_1 = utils::getInvalidPmValue();
|
||||
measurements.pm03PCount_1 = utils::getInvalidPmValue();
|
||||
}
|
||||
|
||||
if(ag.pms5003.getFailCount() >= ag.pms5003.getFailCountMax()) {
|
||||
Serial.printf("PMS failure count reach to max set %d, restarting...", ag.pms5003.getFailCountMax());
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sendDataToServer(void) {
|
||||
/** Ignore send data to server if postToAirGradient disabled */
|
||||
if (configuration.isPostDataToAirGradient() == false ||
|
||||
configuration.isOfflineMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
||||
&ag, &configuration);
|
||||
if (apiClient.postToServer(syncData)) {
|
||||
Serial.println();
|
||||
Serial.println(
|
||||
"Online mode and isPostToAirGradient = true: watchdog reset");
|
||||
Serial.println();
|
||||
}
|
||||
measurements.bootCount++;
|
||||
}
|
||||
|
||||
static void tempHumUpdate(void) {
|
||||
delay(100);
|
||||
if (ag.sht.measure()) {
|
||||
measurements.Temperature = ag.sht.getTemperature();
|
||||
measurements.Humidity = ag.sht.getRelativeHumidity();
|
||||
|
||||
Serial.printf("Temperature in C: %0.2f\r\n", measurements.Temperature);
|
||||
Serial.printf("Relative Humidity: %d\r\n", measurements.Humidity);
|
||||
Serial.printf("Temperature compensated in C: %0.2f\r\n",
|
||||
measurements.Temperature);
|
||||
Serial.printf("Relative Humidity compensated: %d\r\n",
|
||||
measurements.Humidity);
|
||||
|
||||
// Update compensation temperature and humidity for SGP41
|
||||
if (configuration.hasSensorSGP) {
|
||||
ag.sgp41.setCompensationTemperatureHumidity(measurements.Temperature,
|
||||
measurements.Humidity);
|
||||
}
|
||||
} else {
|
||||
Serial.println("SHT read failed");
|
||||
measurements.Temperature = utils::getInvalidTemperature();
|
||||
measurements.Humidity = utils::getInvalidHumidity();
|
||||
}
|
||||
}
|
61
examples/DiyProIndoorV3_3/LocalServer.cpp
Normal file
61
examples/DiyProIndoorV3_3/LocalServer.cpp
Normal file
@ -0,0 +1,61 @@
|
||||
#include "LocalServer.h"
|
||||
|
||||
LocalServer::LocalServer(Stream &log, OpenMetrics &openMetrics,
|
||||
Measurements &measure, Configuration &config,
|
||||
WifiConnector &wifiConnector)
|
||||
: PrintLog(log, "LocalServer"), openMetrics(openMetrics), measure(measure),
|
||||
config(config), wifiConnector(wifiConnector), server(80) {}
|
||||
|
||||
LocalServer::~LocalServer() {}
|
||||
|
||||
bool LocalServer::begin(void) {
|
||||
server.on("/measures/current", HTTP_GET, [this]() { _GET_measure(); });
|
||||
server.on(openMetrics.getApi(), HTTP_GET, [this]() { _GET_metrics(); });
|
||||
server.on("/config", HTTP_GET, [this]() { _GET_config(); });
|
||||
server.on("/config", HTTP_PUT, [this]() { _PUT_config(); });
|
||||
server.begin();
|
||||
logInfo("Init: " + getHostname() + ".local");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void LocalServer::setAirGraident(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
String LocalServer::getHostname(void) {
|
||||
return "airgradient_" + ag->deviceId();
|
||||
}
|
||||
|
||||
void LocalServer::_handle(void) { server.handleClient(); }
|
||||
|
||||
void LocalServer::_GET_config(void) {
|
||||
if(ag->isOne()) {
|
||||
server.send(200, "application/json", config.toString());
|
||||
} else {
|
||||
server.send(200, "application/json", config.toString(fwMode));
|
||||
}
|
||||
}
|
||||
|
||||
void LocalServer::_PUT_config(void) {
|
||||
String data = server.arg(0);
|
||||
String response = "";
|
||||
int statusCode = 400; // Status code for data invalid
|
||||
if (config.parse(data, true)) {
|
||||
statusCode = 200;
|
||||
response = "Success";
|
||||
} else {
|
||||
response = config.getFailedMesage();
|
||||
}
|
||||
server.send(statusCode, "text/plain", response);
|
||||
}
|
||||
|
||||
void LocalServer::_GET_metrics(void) {
|
||||
server.send(200, openMetrics.getApiContentType(), openMetrics.getPayload());
|
||||
}
|
||||
|
||||
void LocalServer::_GET_measure(void) {
|
||||
server.send(
|
||||
200, "application/json",
|
||||
measure.toString(true, fwMode, wifiConnector.RSSI(), ag, &config));
|
||||
}
|
||||
|
||||
void LocalServer::setFwMode(AgFirmwareMode fwMode) { this->fwMode = fwMode; }
|
38
examples/DiyProIndoorV3_3/LocalServer.h
Normal file
38
examples/DiyProIndoorV3_3/LocalServer.h
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef _LOCAL_SERVER_H_
|
||||
#define _LOCAL_SERVER_H_
|
||||
|
||||
#include "AgConfigure.h"
|
||||
#include "AgValue.h"
|
||||
#include "AirGradient.h"
|
||||
#include "OpenMetrics.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
|
||||
class LocalServer : public PrintLog {
|
||||
private:
|
||||
AirGradient *ag;
|
||||
OpenMetrics &openMetrics;
|
||||
Measurements &measure;
|
||||
Configuration &config;
|
||||
WifiConnector &wifiConnector;
|
||||
ESP8266WebServer server;
|
||||
AgFirmwareMode fwMode;
|
||||
|
||||
public:
|
||||
LocalServer(Stream &log, OpenMetrics &openMetrics, Measurements &measure,
|
||||
Configuration &config, WifiConnector& wifiConnector);
|
||||
~LocalServer();
|
||||
|
||||
bool begin(void);
|
||||
void setAirGraident(AirGradient *ag);
|
||||
String getHostname(void);
|
||||
void setFwMode(AgFirmwareMode fwMode);
|
||||
void _handle(void);
|
||||
void _GET_config(void);
|
||||
void _PUT_config(void);
|
||||
void _GET_metrics(void);
|
||||
void _GET_measure(void);
|
||||
};
|
||||
|
||||
#endif /** _LOCAL_SERVER_H_ */
|
186
examples/DiyProIndoorV3_3/OpenMetrics.cpp
Normal file
186
examples/DiyProIndoorV3_3/OpenMetrics.cpp
Normal file
@ -0,0 +1,186 @@
|
||||
#include "OpenMetrics.h"
|
||||
|
||||
OpenMetrics::OpenMetrics(Measurements &measure, Configuration &config,
|
||||
WifiConnector &wifiConnector, AgApiClient &apiClient)
|
||||
: measure(measure), config(config), wifiConnector(wifiConnector),
|
||||
apiClient(apiClient) {}
|
||||
|
||||
OpenMetrics::~OpenMetrics() {}
|
||||
|
||||
void OpenMetrics::setAirGradient(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
const char *OpenMetrics::getApiContentType(void) {
|
||||
return "application/openmetrics-text; version=1.0.0; charset=utf-8";
|
||||
}
|
||||
|
||||
const char *OpenMetrics::getApi(void) { return "/metrics"; }
|
||||
|
||||
String OpenMetrics::getPayload(void) {
|
||||
String response;
|
||||
String current_metric_name;
|
||||
const auto add_metric = [&](const String &name, const String &help,
|
||||
const String &type, const String &unit = "") {
|
||||
current_metric_name = "airgradient_" + name;
|
||||
if (!unit.isEmpty())
|
||||
current_metric_name += "_" + unit;
|
||||
response += "# HELP " + current_metric_name + " " + help + "\n";
|
||||
response += "# TYPE " + current_metric_name + " " + type + "\n";
|
||||
if (!unit.isEmpty())
|
||||
response += "# UNIT " + current_metric_name + " " + unit + "\n";
|
||||
};
|
||||
const auto add_metric_point = [&](const String &labels, const String &value) {
|
||||
response += current_metric_name + "{" + labels + "} " + value + "\n";
|
||||
};
|
||||
|
||||
add_metric("info", "AirGradient device information", "info");
|
||||
add_metric_point("airgradient_serial_number=\"" + ag->deviceId() +
|
||||
"\",airgradient_device_type=\"" + ag->getBoardName() +
|
||||
"\",airgradient_library_version=\"" + ag->getVersion() +
|
||||
"\"",
|
||||
"1");
|
||||
|
||||
add_metric("config_ok",
|
||||
"1 if the AirGradient device was able to successfully fetch its "
|
||||
"configuration from the server",
|
||||
"gauge");
|
||||
add_metric_point("", apiClient.isFetchConfigureFailed() ? "0" : "1");
|
||||
|
||||
add_metric(
|
||||
"post_ok",
|
||||
"1 if the AirGradient device was able to successfully send to the server",
|
||||
"gauge");
|
||||
add_metric_point("", apiClient.isPostToServerFailed() ? "0" : "1");
|
||||
|
||||
add_metric(
|
||||
"wifi_rssi",
|
||||
"WiFi signal strength from the AirGradient device perspective, in dBm",
|
||||
"gauge", "dbm");
|
||||
add_metric_point("", String(wifiConnector.RSSI()));
|
||||
|
||||
if (config.hasSensorS8 && measure.CO2 >= 0) {
|
||||
add_metric("co2",
|
||||
"Carbon dioxide concentration as measured by the AirGradient S8 "
|
||||
"sensor, in parts per million",
|
||||
"gauge", "ppm");
|
||||
add_metric_point("", String(measure.CO2));
|
||||
}
|
||||
|
||||
float _temp = utils::getInvalidTemperature();
|
||||
float _hum = utils::getInvalidHumidity();
|
||||
int pm01 = utils::getInvalidPmValue();
|
||||
int pm25 = utils::getInvalidPmValue();
|
||||
int pm10 = utils::getInvalidPmValue();
|
||||
int pm03PCount = utils::getInvalidPmValue();
|
||||
int atmpCompensated = utils::getInvalidTemperature();
|
||||
int ahumCompensated = utils::getInvalidHumidity();
|
||||
|
||||
if (config.hasSensorSHT) {
|
||||
_temp = measure.Temperature;
|
||||
_hum = measure.Humidity;
|
||||
atmpCompensated = _temp;
|
||||
ahumCompensated = _hum;
|
||||
}
|
||||
|
||||
if (config.hasSensorPMS1) {
|
||||
pm01 = measure.pm01_1;
|
||||
pm25 = measure.pm25_1;
|
||||
pm10 = measure.pm10_1;
|
||||
pm03PCount = measure.pm03PCount_1;
|
||||
}
|
||||
|
||||
if (config.hasSensorPMS1) {
|
||||
if (utils::isValidPm(pm01)) {
|
||||
add_metric("pm1",
|
||||
"PM1.0 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm01));
|
||||
}
|
||||
if (utils::isValidPm(pm25)) {
|
||||
add_metric("pm2d5",
|
||||
"PM2.5 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm25));
|
||||
}
|
||||
if (utils::isValidPm(pm10)) {
|
||||
add_metric("pm10",
|
||||
"PM10 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm10));
|
||||
}
|
||||
if (utils::isValidPm03Count(pm03PCount)) {
|
||||
add_metric("pm0d3",
|
||||
"PM0.3 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in number of particules per 100 milliliters",
|
||||
"gauge", "p100ml");
|
||||
add_metric_point("", String(pm03PCount));
|
||||
}
|
||||
}
|
||||
|
||||
if (config.hasSensorSGP) {
|
||||
if (utils::isValidVOC(measure.TVOC)) {
|
||||
add_metric("tvoc_index",
|
||||
"The processed Total Volatile Organic Compounds (TVOC) index "
|
||||
"as measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.TVOC));
|
||||
}
|
||||
if (utils::isValidVOC(measure.TVOCRaw)) {
|
||||
add_metric("tvoc_raw",
|
||||
"The raw input value to the Total Volatile Organic Compounds "
|
||||
"(TVOC) index as measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.TVOCRaw));
|
||||
}
|
||||
if (utils::isValidNOx(measure.NOx)) {
|
||||
add_metric("nox_index",
|
||||
"The processed Nitrous Oxide (NOx) index as measured by the "
|
||||
"AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.NOx));
|
||||
}
|
||||
if (utils::isValidNOx(measure.NOxRaw)) {
|
||||
add_metric("nox_raw",
|
||||
"The raw input value to the Nitrous Oxide (NOx) index as "
|
||||
"measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.NOxRaw));
|
||||
}
|
||||
}
|
||||
|
||||
if (utils::isValidTemperature(_temp)) {
|
||||
add_metric(
|
||||
"temperature",
|
||||
"The ambient temperature as measured by the AirGradient SHT / PMS "
|
||||
"sensor, in degrees Celsius",
|
||||
"gauge", "celsius");
|
||||
add_metric_point("", String(_temp));
|
||||
}
|
||||
if (utils::isValidTemperature(atmpCompensated)) {
|
||||
add_metric("temperature_compensated",
|
||||
"The compensated ambient temperature as measured by the "
|
||||
"AirGradient SHT / PMS "
|
||||
"sensor, in degrees Celsius",
|
||||
"gauge", "celsius");
|
||||
add_metric_point("", String(atmpCompensated));
|
||||
}
|
||||
if (utils::isValidHumidity(_hum)) {
|
||||
add_metric(
|
||||
"humidity",
|
||||
"The relative humidity as measured by the AirGradient SHT sensor",
|
||||
"gauge", "percent");
|
||||
add_metric_point("", String(_hum));
|
||||
}
|
||||
if (utils::isValidHumidity(ahumCompensated)) {
|
||||
add_metric("humidity_compensated",
|
||||
"The compensated relative humidity as measured by the "
|
||||
"AirGradient SHT / PMS sensor",
|
||||
"gauge", "percent");
|
||||
add_metric_point("", String(ahumCompensated));
|
||||
}
|
||||
|
||||
response += "# EOF\n";
|
||||
return response;
|
||||
}
|
28
examples/DiyProIndoorV3_3/OpenMetrics.h
Normal file
28
examples/DiyProIndoorV3_3/OpenMetrics.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef _OPEN_METRICS_H_
|
||||
#define _OPEN_METRICS_H_
|
||||
|
||||
#include "AgConfigure.h"
|
||||
#include "AgValue.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include "AirGradient.h"
|
||||
#include "AgApiClient.h"
|
||||
|
||||
class OpenMetrics {
|
||||
private:
|
||||
AirGradient *ag;
|
||||
Measurements &measure;
|
||||
Configuration &config;
|
||||
WifiConnector &wifiConnector;
|
||||
AgApiClient &apiClient;
|
||||
|
||||
public:
|
||||
OpenMetrics(Measurements &measure, Configuration &conig,
|
||||
WifiConnector &wifiConnector, AgApiClient& apiClient);
|
||||
~OpenMetrics();
|
||||
void setAirGradient(AirGradient *ag);
|
||||
const char *getApiContentType(void);
|
||||
const char* getApi(void);
|
||||
String getPayload(void);
|
||||
};
|
||||
|
||||
#endif /** _OPEN_METRICS_H_ */
|
670
examples/DiyProIndoorV4_2/DiyProIndoorV4_2.ino
Normal file
670
examples/DiyProIndoorV4_2/DiyProIndoorV4_2.ino
Normal file
@ -0,0 +1,670 @@
|
||||
/*
|
||||
This is the code for the AirGradient DIY PRO 4.2 Air Quality Monitor with an D1
|
||||
ESP8266 Microcontroller.
|
||||
|
||||
It is an air quality monitor for PM2.5, CO2, Temperature and Humidity with a
|
||||
small display and can send data over Wifi.
|
||||
|
||||
Open source air quality monitors and kits are available:
|
||||
Indoor Monitor: https://www.airgradient.com/indoor/
|
||||
Outdoor Monitor: https://www.airgradient.com/outdoor/
|
||||
|
||||
Build Instructions:
|
||||
https://www.airgradient.com/documentation/diy-v4/
|
||||
|
||||
Please make sure you have esp8266 board manager installed. Tested with
|
||||
version 3.1.2.
|
||||
|
||||
Set board to "LOLIN(WEMOS) D1 R2 & mini"
|
||||
|
||||
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
||||
can be set through the AirGradient dashboard.
|
||||
|
||||
If you have any questions please visit our forum at
|
||||
https://forum.airgradient.com/
|
||||
|
||||
CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
|
||||
|
||||
*/
|
||||
|
||||
#include "AgApiClient.h"
|
||||
#include "AgConfigure.h"
|
||||
#include "AgSchedule.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include "LocalServer.h"
|
||||
#include "OpenMetrics.h"
|
||||
#include "MqttClient.h"
|
||||
#include <AirGradient.h>
|
||||
#include <ESP8266HTTPClient.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266mDNS.h>
|
||||
#include <WiFiClient.h>
|
||||
|
||||
#define LED_BAR_ANIMATION_PERIOD 100 /** ms */
|
||||
#define DISP_UPDATE_INTERVAL 2500 /** ms */
|
||||
#define SERVER_CONFIG_SYNC_INTERVAL 60000 /** ms */
|
||||
#define SERVER_SYNC_INTERVAL 60000 /** ms */
|
||||
#define MQTT_SYNC_INTERVAL 60000 /** ms */
|
||||
#define SENSOR_CO2_CALIB_COUNTDOWN_MAX 5 /** sec */
|
||||
#define SENSOR_TVOC_UPDATE_INTERVAL 1000 /** ms */
|
||||
#define SENSOR_CO2_UPDATE_INTERVAL 4000 /** ms */
|
||||
#define SENSOR_PM_UPDATE_INTERVAL 2000 /** ms */
|
||||
#define SENSOR_TEMP_HUM_UPDATE_INTERVAL 2000 /** ms */
|
||||
#define DISPLAY_DELAY_SHOW_CONTENT_MS 2000 /** ms */
|
||||
#define FIRMWARE_CHECK_FOR_UPDATE_MS (60 * 60 * 1000) /** ms */
|
||||
|
||||
static AirGradient ag(DIY_PRO_INDOOR_V4_2);
|
||||
static Configuration configuration(Serial);
|
||||
static AgApiClient apiClient(Serial, configuration);
|
||||
static Measurements measurements;
|
||||
static OledDisplay oledDisplay(configuration, measurements, Serial);
|
||||
static StateMachine stateMachine(oledDisplay, Serial, measurements,
|
||||
configuration);
|
||||
static WifiConnector wifiConnector(oledDisplay, Serial, stateMachine,
|
||||
configuration);
|
||||
static OpenMetrics openMetrics(measurements, configuration, wifiConnector,
|
||||
apiClient);
|
||||
static LocalServer localServer(Serial, openMetrics, measurements, configuration,
|
||||
wifiConnector);
|
||||
static MqttClient mqttClient(Serial);
|
||||
|
||||
static uint32_t factoryBtnPressTime = 0;
|
||||
static int getCO2FailCount = 0;
|
||||
static AgFirmwareMode fwMode = FW_MODE_I_42PS;
|
||||
|
||||
static String fwNewVersion;
|
||||
|
||||
static void boardInit(void);
|
||||
static void failedHandler(String msg);
|
||||
static void configurationUpdateSchedule(void);
|
||||
static void appDispHandler(void);
|
||||
static void oledDisplaySchedule(void);
|
||||
static void updateTvoc(void);
|
||||
static void updatePm(void);
|
||||
static void sendDataToServer(void);
|
||||
static void tempHumUpdate(void);
|
||||
static void co2Update(void);
|
||||
static void mdnsInit(void);
|
||||
static void initMqtt(void);
|
||||
static void factoryConfigReset(void);
|
||||
static void wdgFeedUpdate(void);
|
||||
static bool sgp41Init(void);
|
||||
static void wifiFactoryConfigure(void);
|
||||
static void mqttHandle(void);
|
||||
|
||||
AgSchedule dispLedSchedule(DISP_UPDATE_INTERVAL, oledDisplaySchedule);
|
||||
AgSchedule configSchedule(SERVER_CONFIG_SYNC_INTERVAL,
|
||||
configurationUpdateSchedule);
|
||||
AgSchedule agApiPostSchedule(SERVER_SYNC_INTERVAL, sendDataToServer);
|
||||
AgSchedule co2Schedule(SENSOR_CO2_UPDATE_INTERVAL, co2Update);
|
||||
AgSchedule pmsSchedule(SENSOR_PM_UPDATE_INTERVAL, updatePm);
|
||||
AgSchedule tempHumSchedule(SENSOR_TEMP_HUM_UPDATE_INTERVAL, tempHumUpdate);
|
||||
AgSchedule tvocSchedule(SENSOR_TVOC_UPDATE_INTERVAL, updateTvoc);
|
||||
AgSchedule watchdogFeedSchedule(60000, wdgFeedUpdate);
|
||||
AgSchedule mqttSchedule(MQTT_SYNC_INTERVAL, mqttHandle);
|
||||
|
||||
void setup() {
|
||||
/** Serial for print debug message */
|
||||
Serial.begin(115200);
|
||||
delay(100); /** For bester show log */
|
||||
|
||||
/** Print device ID into log */
|
||||
Serial.println("Serial nr: " + ag.deviceId());
|
||||
|
||||
/** Initialize local configure */
|
||||
configuration.begin();
|
||||
|
||||
/** Init I2C */
|
||||
Wire.begin(ag.getI2cSdaPin(), ag.getI2cSclPin());
|
||||
delay(1000);
|
||||
|
||||
configuration.setAirGradient(&ag);
|
||||
oledDisplay.setAirGradient(&ag);
|
||||
stateMachine.setAirGradient(&ag);
|
||||
wifiConnector.setAirGradient(&ag);
|
||||
apiClient.setAirGradient(&ag);
|
||||
openMetrics.setAirGradient(&ag);
|
||||
localServer.setAirGraident(&ag);
|
||||
|
||||
/** Example set custom API root URL */
|
||||
// apiClient.setApiRoot("https://example.custom.api");
|
||||
|
||||
/** Init sensor */
|
||||
boardInit();
|
||||
|
||||
/** Connecting wifi */
|
||||
bool connectToWifi = false;
|
||||
|
||||
/** Show message confirm offline mode, should me perform if LED bar button
|
||||
* test pressed */
|
||||
|
||||
oledDisplay.setText(
|
||||
"Press now for",
|
||||
configuration.isOfflineMode() ? "online mode" : "offline mode", "");
|
||||
uint32_t startTime = millis();
|
||||
while (true) {
|
||||
if (ag.button.getState() == ag.button.BUTTON_PRESSED) {
|
||||
configuration.setOfflineMode(!configuration.isOfflineMode());
|
||||
|
||||
oledDisplay.setText(
|
||||
"Offline Mode",
|
||||
configuration.isOfflineMode() ? " = True" : " = False", "");
|
||||
delay(1000);
|
||||
break;
|
||||
}
|
||||
uint32_t periodMs = (uint32_t)(millis() - startTime);
|
||||
if (periodMs >= 3000) {
|
||||
Serial.println("Set for offline mode timeout");
|
||||
break;
|
||||
}
|
||||
|
||||
delay(1);
|
||||
}
|
||||
connectToWifi = !configuration.isOfflineMode();
|
||||
|
||||
if (connectToWifi) {
|
||||
apiClient.begin();
|
||||
|
||||
if (wifiConnector.connect()) {
|
||||
if (wifiConnector.isConnected()) {
|
||||
mdnsInit();
|
||||
localServer.begin();
|
||||
initMqtt();
|
||||
sendDataToAg();
|
||||
|
||||
apiClient.fetchServerConfiguration();
|
||||
configSchedule.update();
|
||||
if (apiClient.isFetchConfigureFailed()) {
|
||||
if (apiClient.isNotAvailableOnDashboard()) {
|
||||
stateMachine.displaySetAddToDashBoard();
|
||||
stateMachine.displayHandle(
|
||||
AgStateMachineWiFiOkServerOkSensorConfigFailed);
|
||||
} else {
|
||||
stateMachine.displayClearAddToDashBoard();
|
||||
}
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
} else {
|
||||
if (wifiConnector.isConfigurePorttalTimeout()) {
|
||||
oledDisplay.showRebooting();
|
||||
delay(2500);
|
||||
oledDisplay.setText("", "", "");
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/** Set offline mode without saving, cause wifi is not configured */
|
||||
if (wifiConnector.hasConfigurated() == false) {
|
||||
Serial.println("Set offline mode cause wifi is not configurated");
|
||||
configuration.setOfflineModeWithoutSave(true);
|
||||
}
|
||||
|
||||
/** Show display Warning up */
|
||||
oledDisplay.setText("Warming Up", "Serial Number:", ag.deviceId().c_str());
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
|
||||
Serial.println("Display brightness: " +
|
||||
String(configuration.getDisplayBrightness()));
|
||||
oledDisplay.setBrightness(configuration.getDisplayBrightness());
|
||||
|
||||
appDispHandler();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
/** Handle schedule */
|
||||
dispLedSchedule.run();
|
||||
configSchedule.run();
|
||||
agApiPostSchedule.run();
|
||||
|
||||
if (configuration.hasSensorS8) {
|
||||
co2Schedule.run();
|
||||
}
|
||||
if (configuration.hasSensorPMS1) {
|
||||
pmsSchedule.run();
|
||||
ag.pms5003.handle();
|
||||
}
|
||||
if (configuration.hasSensorSHT) {
|
||||
tempHumSchedule.run();
|
||||
}
|
||||
if (configuration.hasSensorSGP) {
|
||||
tvocSchedule.run();
|
||||
}
|
||||
|
||||
watchdogFeedSchedule.run();
|
||||
|
||||
/** Check for handle WiFi reconnect */
|
||||
wifiConnector.handle();
|
||||
|
||||
/** factory reset handle */
|
||||
factoryConfigReset();
|
||||
|
||||
/** check that local configura changed then do some action */
|
||||
configUpdateHandle();
|
||||
|
||||
localServer._handle();
|
||||
|
||||
if (configuration.hasSensorSGP) {
|
||||
ag.sgp41.handle();
|
||||
}
|
||||
|
||||
MDNS.update();
|
||||
|
||||
mqttSchedule.run();
|
||||
mqttClient.handle();
|
||||
}
|
||||
|
||||
static void co2Update(void) {
|
||||
int value = ag.s8.getCo2();
|
||||
if (utils::isValidCO2(value)) {
|
||||
measurements.CO2 = value;
|
||||
getCO2FailCount = 0;
|
||||
Serial.printf("CO2 (ppm): %d\r\n", measurements.CO2);
|
||||
} else {
|
||||
getCO2FailCount++;
|
||||
Serial.printf("Get CO2 failed: %d\r\n", getCO2FailCount);
|
||||
if (getCO2FailCount >= 3) {
|
||||
measurements.CO2 = utils::getInvalidCO2();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void mdnsInit(void) {
|
||||
Serial.println("mDNS init");
|
||||
if (!MDNS.begin(localServer.getHostname().c_str())) {
|
||||
Serial.println("Init mDNS failed");
|
||||
return;
|
||||
}
|
||||
|
||||
MDNS.addService("_airgradient", "_tcp", 80);
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "model",
|
||||
AgFirmwareModeName(fwMode));
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "serialno", ag.deviceId());
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "fw_ver", ag.getVersion());
|
||||
MDNS.addServiceTxt("_airgradient", "_tcp", "vendor", "AirGradient");
|
||||
|
||||
MDNS.announce();
|
||||
}
|
||||
|
||||
static void initMqtt(void) {
|
||||
String mqttUri = configuration.getMqttBrokerUri();
|
||||
if (mqttUri.isEmpty()) {
|
||||
Serial.println(
|
||||
"MQTT is not configured, skipping initialization of MQTT client");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mqttClient.begin(mqttUri)) {
|
||||
Serial.println("Successfully connected to MQTT broker");
|
||||
} else {
|
||||
Serial.println("Connection to MQTT broker failed");
|
||||
}
|
||||
}
|
||||
|
||||
static void factoryConfigReset(void) {
|
||||
if (ag.button.getState() == ag.button.BUTTON_PRESSED) {
|
||||
if (factoryBtnPressTime == 0) {
|
||||
factoryBtnPressTime = millis();
|
||||
} else {
|
||||
uint32_t ms = (uint32_t)(millis() - factoryBtnPressTime);
|
||||
if (ms >= 2000) {
|
||||
// Show display message: For factory keep for x seconds
|
||||
if (ag.isOne() || ag.isPro4_2()) {
|
||||
oledDisplay.setText("Factory reset", "keep pressed", "for 8 sec");
|
||||
} else {
|
||||
Serial.println("Factory reset, keep pressed for 8 sec");
|
||||
}
|
||||
|
||||
int count = 7;
|
||||
while (ag.button.getState() == ag.button.BUTTON_PRESSED) {
|
||||
delay(1000);
|
||||
String str = "for " + String(count) + " sec";
|
||||
oledDisplay.setText("Factory reset", "keep pressed", str.c_str());
|
||||
|
||||
count--;
|
||||
if (count == 0) {
|
||||
/** Stop MQTT task first */
|
||||
// if (mqttTask) {
|
||||
// vTaskDelete(mqttTask);
|
||||
// mqttTask = NULL;
|
||||
// }
|
||||
|
||||
/** Reset WIFI */
|
||||
wifiConnector.reset();
|
||||
|
||||
/** Reset local config */
|
||||
configuration.reset();
|
||||
|
||||
oledDisplay.setText("Factory reset", "successful", "");
|
||||
|
||||
delay(3000);
|
||||
oledDisplay.setText("", "", "");
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
|
||||
/** Show current content cause reset ignore */
|
||||
factoryBtnPressTime = 0;
|
||||
appDispHandler();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (factoryBtnPressTime != 0) {
|
||||
appDispHandler();
|
||||
}
|
||||
factoryBtnPressTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void wdgFeedUpdate(void) {
|
||||
ag.watchdog.reset();
|
||||
Serial.println("External watchdog feed!");
|
||||
}
|
||||
|
||||
static bool sgp41Init(void) {
|
||||
ag.sgp41.setNoxLearningOffset(configuration.getNoxLearningOffset());
|
||||
ag.sgp41.setTvocLearningOffset(configuration.getTvocLearningOffset());
|
||||
if (ag.sgp41.begin(Wire)) {
|
||||
Serial.println("Init SGP41 success");
|
||||
configuration.hasSensorSGP = true;
|
||||
return true;
|
||||
} else {
|
||||
Serial.println("Init SGP41 failuire");
|
||||
configuration.hasSensorSGP = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void wifiFactoryConfigure(void) {
|
||||
WiFi.persistent(true);
|
||||
WiFi.begin("airgradient", "cleanair");
|
||||
WiFi.persistent(false);
|
||||
oledDisplay.setText("Configure WiFi", "connect to", "\'airgradient\'");
|
||||
delay(2500);
|
||||
oledDisplay.setText("Rebooting...", "", "");
|
||||
delay(2500);
|
||||
oledDisplay.setText("", "", "");
|
||||
ESP.restart();
|
||||
}
|
||||
|
||||
static void mqttHandle(void) {
|
||||
if(mqttClient.isConnected() == false) {
|
||||
mqttClient.connect(String("airgradient-") + ag.deviceId());
|
||||
}
|
||||
|
||||
if (mqttClient.isConnected()) {
|
||||
String payload = measurements.toString(true, fwMode, wifiConnector.RSSI(),
|
||||
&ag, &configuration);
|
||||
String topic = "airgradient/readings/" + ag.deviceId();
|
||||
if (mqttClient.publish(topic.c_str(), payload.c_str(), payload.length())) {
|
||||
Serial.println("MQTT sync success");
|
||||
} else {
|
||||
Serial.println("MQTT sync failure");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sendDataToAg() {
|
||||
/** Change oledDisplay and led state */
|
||||
stateMachine.displayHandle(AgStateMachineWiFiOkServerConnecting);
|
||||
|
||||
delay(1500);
|
||||
if (apiClient.sendPing(wifiConnector.RSSI(), measurements.bootCount)) {
|
||||
stateMachine.displayHandle(AgStateMachineWiFiOkServerConnected);
|
||||
} else {
|
||||
stateMachine.displayHandle(AgStateMachineWiFiOkServerConnectFailed);
|
||||
}
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
|
||||
void dispSensorNotFound(String ss) {
|
||||
ss = ss + " not found";
|
||||
oledDisplay.setText("Sensor init", "Error:", ss.c_str());
|
||||
delay(2000);
|
||||
}
|
||||
|
||||
static void boardInit(void) {
|
||||
/** Display init */
|
||||
oledDisplay.begin();
|
||||
|
||||
/** Show boot display */
|
||||
Serial.println("Firmware Version: " + ag.getVersion());
|
||||
|
||||
oledDisplay.setText("AirGradient ONE",
|
||||
"FW Version: ", ag.getVersion().c_str());
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
|
||||
ag.button.begin();
|
||||
ag.watchdog.begin();
|
||||
|
||||
/** Run LED test on start up if button pressed */
|
||||
oledDisplay.setText("Press now for", "factory WiFi", "configure");
|
||||
|
||||
uint32_t stime = millis();
|
||||
while (true) {
|
||||
if (ag.button.getState() == ag.button.BUTTON_PRESSED) {
|
||||
wifiFactoryConfigure();
|
||||
}
|
||||
delay(1);
|
||||
uint32_t ms = (uint32_t)(millis() - stime);
|
||||
if (ms >= 3000) {
|
||||
break;
|
||||
}
|
||||
delay(1);
|
||||
}
|
||||
|
||||
/** Show message init sensor */
|
||||
oledDisplay.setText("Sensor", "initializing...", "");
|
||||
|
||||
/** Init sensor SGP41 */
|
||||
if (sgp41Init() == false) {
|
||||
dispSensorNotFound("SGP41");
|
||||
}
|
||||
|
||||
/** Init SHT */
|
||||
if (ag.sht.begin(Wire) == false) {
|
||||
Serial.println("SHTx sensor not found");
|
||||
configuration.hasSensorSHT = false;
|
||||
dispSensorNotFound("SHT");
|
||||
}
|
||||
|
||||
/** Init S8 CO2 sensor */
|
||||
if (ag.s8.begin(&Serial) == false) {
|
||||
Serial.println("CO2 S8 sensor not found");
|
||||
configuration.hasSensorS8 = false;
|
||||
dispSensorNotFound("S8");
|
||||
}
|
||||
|
||||
/** Init PMS5003 */
|
||||
configuration.hasSensorPMS1 = true;
|
||||
configuration.hasSensorPMS2 = false;
|
||||
if (ag.pms5003.begin(&Serial) == false) {
|
||||
Serial.println("PMS sensor not found");
|
||||
configuration.hasSensorPMS1 = false;
|
||||
|
||||
dispSensorNotFound("PMS");
|
||||
}
|
||||
|
||||
/** Set S8 CO2 abc days period */
|
||||
if (configuration.hasSensorS8) {
|
||||
if (ag.s8.setAbcPeriod(configuration.getCO2CalibrationAbcDays() * 24)) {
|
||||
Serial.println("Set S8 AbcDays successful");
|
||||
} else {
|
||||
Serial.println("Set S8 AbcDays failure");
|
||||
}
|
||||
}
|
||||
|
||||
localServer.setFwMode(FW_MODE_I_42PS);
|
||||
}
|
||||
|
||||
static void failedHandler(String msg) {
|
||||
while (true) {
|
||||
Serial.println(msg);
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
static void configurationUpdateSchedule(void) {
|
||||
if (apiClient.fetchServerConfiguration()) {
|
||||
configUpdateHandle();
|
||||
}
|
||||
}
|
||||
|
||||
static void configUpdateHandle() {
|
||||
if (configuration.isUpdated() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
stateMachine.executeCo2Calibration();
|
||||
|
||||
String mqttUri = configuration.getMqttBrokerUri();
|
||||
if (mqttClient.isCurrentUri(mqttUri) == false) {
|
||||
mqttClient.end();
|
||||
initMqtt();
|
||||
}
|
||||
|
||||
if (configuration.hasSensorSGP) {
|
||||
if (configuration.noxLearnOffsetChanged() ||
|
||||
configuration.tvocLearnOffsetChanged()) {
|
||||
ag.sgp41.end();
|
||||
|
||||
int oldTvocOffset = ag.sgp41.getTvocLearningOffset();
|
||||
int oldNoxOffset = ag.sgp41.getNoxLearningOffset();
|
||||
bool result = sgp41Init();
|
||||
const char *resultStr = "successful";
|
||||
if (!result) {
|
||||
resultStr = "failure";
|
||||
}
|
||||
if (oldTvocOffset != configuration.getTvocLearningOffset()) {
|
||||
Serial.printf("Setting tvocLearningOffset from %d to %d hours %s\r\n",
|
||||
oldTvocOffset, configuration.getTvocLearningOffset(),
|
||||
resultStr);
|
||||
}
|
||||
if (oldNoxOffset != configuration.getNoxLearningOffset()) {
|
||||
Serial.printf("Setting noxLearningOffset from %d to %d hours %s\r\n",
|
||||
oldNoxOffset, configuration.getNoxLearningOffset(),
|
||||
resultStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (configuration.isDisplayBrightnessChanged()) {
|
||||
oledDisplay.setBrightness(configuration.getDisplayBrightness());
|
||||
}
|
||||
|
||||
appDispHandler();
|
||||
}
|
||||
|
||||
static void appDispHandler(void) {
|
||||
AgStateMachineState state = AgStateMachineNormal;
|
||||
|
||||
/** Only show display status on online mode. */
|
||||
if (configuration.isOfflineMode() == false) {
|
||||
if (wifiConnector.isConnected() == false) {
|
||||
state = AgStateMachineWiFiLost;
|
||||
} else if (apiClient.isFetchConfigureFailed()) {
|
||||
state = AgStateMachineSensorConfigFailed;
|
||||
if (apiClient.isNotAvailableOnDashboard()) {
|
||||
stateMachine.displaySetAddToDashBoard();
|
||||
} else {
|
||||
stateMachine.displayClearAddToDashBoard();
|
||||
}
|
||||
} else if (apiClient.isPostToServerFailed()) {
|
||||
state = AgStateMachineServerLost;
|
||||
}
|
||||
}
|
||||
stateMachine.displayHandle(state);
|
||||
}
|
||||
|
||||
static void oledDisplaySchedule(void) {
|
||||
if (factoryBtnPressTime == 0) {
|
||||
appDispHandler();
|
||||
}
|
||||
}
|
||||
|
||||
static void updateTvoc(void) {
|
||||
measurements.TVOC = ag.sgp41.getTvocIndex();
|
||||
measurements.TVOCRaw = ag.sgp41.getTvocRaw();
|
||||
measurements.NOx = ag.sgp41.getNoxIndex();
|
||||
measurements.NOxRaw = ag.sgp41.getNoxRaw();
|
||||
|
||||
Serial.println();
|
||||
Serial.printf("TVOC index: %d\r\n", measurements.TVOC);
|
||||
Serial.printf("TVOC raw: %d\r\n", measurements.TVOCRaw);
|
||||
Serial.printf("NOx index: %d\r\n", measurements.NOx);
|
||||
Serial.printf("NOx raw: %d\r\n", measurements.NOxRaw);
|
||||
}
|
||||
|
||||
static void updatePm(void) {
|
||||
if (ag.pms5003.connected()) {
|
||||
measurements.pm01_1 = ag.pms5003.getPm01Ae();
|
||||
measurements.pm25_1 = ag.pms5003.getPm25Ae();
|
||||
measurements.pm10_1 = ag.pms5003.getPm10Ae();
|
||||
measurements.pm03PCount_1 = ag.pms5003.getPm03ParticleCount();
|
||||
|
||||
Serial.println();
|
||||
Serial.printf("PM1 ug/m3: %d\r\n", measurements.pm01_1);
|
||||
Serial.printf("PM2.5 ug/m3: %d\r\n", measurements.pm25_1);
|
||||
Serial.printf("PM10 ug/m3: %d\r\n", measurements.pm10_1);
|
||||
Serial.printf("PM0.3 Count: %d\r\n", measurements.pm03PCount_1);
|
||||
Serial.printf("PM firmware version: %d\r\n", ag.pms5003.getFirmwareVersion());
|
||||
ag.pms5003.resetFailCount();
|
||||
} else {
|
||||
ag.pms5003.updateFailCount();
|
||||
Serial.printf("PMS read failed %d times\r\n", ag.pms5003.getFailCount());
|
||||
if (ag.pms5003.getFailCount() >= PMS_FAIL_COUNT_SET_INVALID) {
|
||||
measurements.pm01_1 = utils::getInvalidPmValue();
|
||||
measurements.pm25_1 = utils::getInvalidPmValue();
|
||||
measurements.pm10_1 = utils::getInvalidPmValue();
|
||||
measurements.pm03PCount_1 = utils::getInvalidPmValue();
|
||||
}
|
||||
|
||||
if(ag.pms5003.getFailCount() >= ag.pms5003.getFailCountMax()) {
|
||||
Serial.printf("PMS failure count reach to max set %d, restarting...", ag.pms5003.getFailCountMax());
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sendDataToServer(void) {
|
||||
/** Ignore send data to server if postToAirGradient disabled */
|
||||
if (configuration.isPostDataToAirGradient() == false ||
|
||||
configuration.isOfflineMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
||||
&ag, &configuration);
|
||||
if (apiClient.postToServer(syncData)) {
|
||||
Serial.println();
|
||||
Serial.println(
|
||||
"Online mode and isPostToAirGradient = true: watchdog reset");
|
||||
Serial.println();
|
||||
}
|
||||
measurements.bootCount++;
|
||||
}
|
||||
|
||||
static void tempHumUpdate(void) {
|
||||
delay(100);
|
||||
if (ag.sht.measure()) {
|
||||
measurements.Temperature = ag.sht.getTemperature();
|
||||
measurements.Humidity = ag.sht.getRelativeHumidity();
|
||||
|
||||
Serial.printf("Temperature in C: %0.2f\r\n", measurements.Temperature);
|
||||
Serial.printf("Relative Humidity: %d\r\n", measurements.Humidity);
|
||||
Serial.printf("Temperature compensated in C: %0.2f\r\n",
|
||||
measurements.Temperature);
|
||||
Serial.printf("Relative Humidity compensated: %d\r\n",
|
||||
measurements.Humidity);
|
||||
|
||||
// Update compensation temperature and humidity for SGP41
|
||||
if (configuration.hasSensorSGP) {
|
||||
ag.sgp41.setCompensationTemperatureHumidity(measurements.Temperature,
|
||||
measurements.Humidity);
|
||||
}
|
||||
} else {
|
||||
Serial.println("SHT read failed");
|
||||
measurements.Temperature = utils::getInvalidTemperature();
|
||||
measurements.Humidity = utils::getInvalidHumidity();
|
||||
}
|
||||
}
|
61
examples/DiyProIndoorV4_2/LocalServer.cpp
Normal file
61
examples/DiyProIndoorV4_2/LocalServer.cpp
Normal file
@ -0,0 +1,61 @@
|
||||
#include "LocalServer.h"
|
||||
|
||||
LocalServer::LocalServer(Stream &log, OpenMetrics &openMetrics,
|
||||
Measurements &measure, Configuration &config,
|
||||
WifiConnector &wifiConnector)
|
||||
: PrintLog(log, "LocalServer"), openMetrics(openMetrics), measure(measure),
|
||||
config(config), wifiConnector(wifiConnector), server(80) {}
|
||||
|
||||
LocalServer::~LocalServer() {}
|
||||
|
||||
bool LocalServer::begin(void) {
|
||||
server.on("/measures/current", HTTP_GET, [this]() { _GET_measure(); });
|
||||
server.on(openMetrics.getApi(), HTTP_GET, [this]() { _GET_metrics(); });
|
||||
server.on("/config", HTTP_GET, [this]() { _GET_config(); });
|
||||
server.on("/config", HTTP_PUT, [this]() { _PUT_config(); });
|
||||
server.begin();
|
||||
logInfo("Init: " + getHostname() + ".local");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void LocalServer::setAirGraident(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
String LocalServer::getHostname(void) {
|
||||
return "airgradient_" + ag->deviceId();
|
||||
}
|
||||
|
||||
void LocalServer::_handle(void) { server.handleClient(); }
|
||||
|
||||
void LocalServer::_GET_config(void) {
|
||||
if(ag->isOne()) {
|
||||
server.send(200, "application/json", config.toString());
|
||||
} else {
|
||||
server.send(200, "application/json", config.toString(fwMode));
|
||||
}
|
||||
}
|
||||
|
||||
void LocalServer::_PUT_config(void) {
|
||||
String data = server.arg(0);
|
||||
String response = "";
|
||||
int statusCode = 400; // Status code for data invalid
|
||||
if (config.parse(data, true)) {
|
||||
statusCode = 200;
|
||||
response = "Success";
|
||||
} else {
|
||||
response = config.getFailedMesage();
|
||||
}
|
||||
server.send(statusCode, "text/plain", response);
|
||||
}
|
||||
|
||||
void LocalServer::_GET_metrics(void) {
|
||||
server.send(200, openMetrics.getApiContentType(), openMetrics.getPayload());
|
||||
}
|
||||
|
||||
void LocalServer::_GET_measure(void) {
|
||||
server.send(
|
||||
200, "application/json",
|
||||
measure.toString(true, fwMode, wifiConnector.RSSI(), ag, &config));
|
||||
}
|
||||
|
||||
void LocalServer::setFwMode(AgFirmwareMode fwMode) { this->fwMode = fwMode; }
|
38
examples/DiyProIndoorV4_2/LocalServer.h
Normal file
38
examples/DiyProIndoorV4_2/LocalServer.h
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef _LOCAL_SERVER_H_
|
||||
#define _LOCAL_SERVER_H_
|
||||
|
||||
#include "AgConfigure.h"
|
||||
#include "AgValue.h"
|
||||
#include "AirGradient.h"
|
||||
#include "OpenMetrics.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
|
||||
class LocalServer : public PrintLog {
|
||||
private:
|
||||
AirGradient *ag;
|
||||
OpenMetrics &openMetrics;
|
||||
Measurements &measure;
|
||||
Configuration &config;
|
||||
WifiConnector &wifiConnector;
|
||||
ESP8266WebServer server;
|
||||
AgFirmwareMode fwMode;
|
||||
|
||||
public:
|
||||
LocalServer(Stream &log, OpenMetrics &openMetrics, Measurements &measure,
|
||||
Configuration &config, WifiConnector& wifiConnector);
|
||||
~LocalServer();
|
||||
|
||||
bool begin(void);
|
||||
void setAirGraident(AirGradient *ag);
|
||||
String getHostname(void);
|
||||
void setFwMode(AgFirmwareMode fwMode);
|
||||
void _handle(void);
|
||||
void _GET_config(void);
|
||||
void _PUT_config(void);
|
||||
void _GET_metrics(void);
|
||||
void _GET_measure(void);
|
||||
};
|
||||
|
||||
#endif /** _LOCAL_SERVER_H_ */
|
186
examples/DiyProIndoorV4_2/OpenMetrics.cpp
Normal file
186
examples/DiyProIndoorV4_2/OpenMetrics.cpp
Normal file
@ -0,0 +1,186 @@
|
||||
#include "OpenMetrics.h"
|
||||
|
||||
OpenMetrics::OpenMetrics(Measurements &measure, Configuration &config,
|
||||
WifiConnector &wifiConnector, AgApiClient &apiClient)
|
||||
: measure(measure), config(config), wifiConnector(wifiConnector),
|
||||
apiClient(apiClient) {}
|
||||
|
||||
OpenMetrics::~OpenMetrics() {}
|
||||
|
||||
void OpenMetrics::setAirGradient(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
const char *OpenMetrics::getApiContentType(void) {
|
||||
return "application/openmetrics-text; version=1.0.0; charset=utf-8";
|
||||
}
|
||||
|
||||
const char *OpenMetrics::getApi(void) { return "/metrics"; }
|
||||
|
||||
String OpenMetrics::getPayload(void) {
|
||||
String response;
|
||||
String current_metric_name;
|
||||
const auto add_metric = [&](const String &name, const String &help,
|
||||
const String &type, const String &unit = "") {
|
||||
current_metric_name = "airgradient_" + name;
|
||||
if (!unit.isEmpty())
|
||||
current_metric_name += "_" + unit;
|
||||
response += "# HELP " + current_metric_name + " " + help + "\n";
|
||||
response += "# TYPE " + current_metric_name + " " + type + "\n";
|
||||
if (!unit.isEmpty())
|
||||
response += "# UNIT " + current_metric_name + " " + unit + "\n";
|
||||
};
|
||||
const auto add_metric_point = [&](const String &labels, const String &value) {
|
||||
response += current_metric_name + "{" + labels + "} " + value + "\n";
|
||||
};
|
||||
|
||||
add_metric("info", "AirGradient device information", "info");
|
||||
add_metric_point("airgradient_serial_number=\"" + ag->deviceId() +
|
||||
"\",airgradient_device_type=\"" + ag->getBoardName() +
|
||||
"\",airgradient_library_version=\"" + ag->getVersion() +
|
||||
"\"",
|
||||
"1");
|
||||
|
||||
add_metric("config_ok",
|
||||
"1 if the AirGradient device was able to successfully fetch its "
|
||||
"configuration from the server",
|
||||
"gauge");
|
||||
add_metric_point("", apiClient.isFetchConfigureFailed() ? "0" : "1");
|
||||
|
||||
add_metric(
|
||||
"post_ok",
|
||||
"1 if the AirGradient device was able to successfully send to the server",
|
||||
"gauge");
|
||||
add_metric_point("", apiClient.isPostToServerFailed() ? "0" : "1");
|
||||
|
||||
add_metric(
|
||||
"wifi_rssi",
|
||||
"WiFi signal strength from the AirGradient device perspective, in dBm",
|
||||
"gauge", "dbm");
|
||||
add_metric_point("", String(wifiConnector.RSSI()));
|
||||
|
||||
if (config.hasSensorS8 && measure.CO2 >= 0) {
|
||||
add_metric("co2",
|
||||
"Carbon dioxide concentration as measured by the AirGradient S8 "
|
||||
"sensor, in parts per million",
|
||||
"gauge", "ppm");
|
||||
add_metric_point("", String(measure.CO2));
|
||||
}
|
||||
|
||||
float _temp = utils::getInvalidTemperature();
|
||||
float _hum = utils::getInvalidHumidity();
|
||||
int pm01 = utils::getInvalidPmValue();
|
||||
int pm25 = utils::getInvalidPmValue();
|
||||
int pm10 = utils::getInvalidPmValue();
|
||||
int pm03PCount = utils::getInvalidPmValue();
|
||||
int atmpCompensated = utils::getInvalidTemperature();
|
||||
int ahumCompensated = utils::getInvalidHumidity();
|
||||
|
||||
if (config.hasSensorSHT) {
|
||||
_temp = measure.Temperature;
|
||||
_hum = measure.Humidity;
|
||||
atmpCompensated = _temp;
|
||||
ahumCompensated = _hum;
|
||||
}
|
||||
|
||||
if (config.hasSensorPMS1) {
|
||||
pm01 = measure.pm01_1;
|
||||
pm25 = measure.pm25_1;
|
||||
pm10 = measure.pm10_1;
|
||||
pm03PCount = measure.pm03PCount_1;
|
||||
}
|
||||
|
||||
if (config.hasSensorPMS1) {
|
||||
if (utils::isValidPm(pm01)) {
|
||||
add_metric("pm1",
|
||||
"PM1.0 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm01));
|
||||
}
|
||||
if (utils::isValidPm(pm25)) {
|
||||
add_metric("pm2d5",
|
||||
"PM2.5 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm25));
|
||||
}
|
||||
if (utils::isValidPm(pm10)) {
|
||||
add_metric("pm10",
|
||||
"PM10 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm10));
|
||||
}
|
||||
if (utils::isValidPm03Count(pm03PCount)) {
|
||||
add_metric("pm0d3",
|
||||
"PM0.3 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in number of particules per 100 milliliters",
|
||||
"gauge", "p100ml");
|
||||
add_metric_point("", String(pm03PCount));
|
||||
}
|
||||
}
|
||||
|
||||
if (config.hasSensorSGP) {
|
||||
if (utils::isValidVOC(measure.TVOC)) {
|
||||
add_metric("tvoc_index",
|
||||
"The processed Total Volatile Organic Compounds (TVOC) index "
|
||||
"as measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.TVOC));
|
||||
}
|
||||
if (utils::isValidVOC(measure.TVOCRaw)) {
|
||||
add_metric("tvoc_raw",
|
||||
"The raw input value to the Total Volatile Organic Compounds "
|
||||
"(TVOC) index as measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.TVOCRaw));
|
||||
}
|
||||
if (utils::isValidNOx(measure.NOx)) {
|
||||
add_metric("nox_index",
|
||||
"The processed Nitrous Oxide (NOx) index as measured by the "
|
||||
"AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.NOx));
|
||||
}
|
||||
if (utils::isValidNOx(measure.NOxRaw)) {
|
||||
add_metric("nox_raw",
|
||||
"The raw input value to the Nitrous Oxide (NOx) index as "
|
||||
"measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.NOxRaw));
|
||||
}
|
||||
}
|
||||
|
||||
if (utils::isValidTemperature(_temp)) {
|
||||
add_metric(
|
||||
"temperature",
|
||||
"The ambient temperature as measured by the AirGradient SHT / PMS "
|
||||
"sensor, in degrees Celsius",
|
||||
"gauge", "celsius");
|
||||
add_metric_point("", String(_temp));
|
||||
}
|
||||
if (utils::isValidTemperature(atmpCompensated)) {
|
||||
add_metric("temperature_compensated",
|
||||
"The compensated ambient temperature as measured by the "
|
||||
"AirGradient SHT / PMS "
|
||||
"sensor, in degrees Celsius",
|
||||
"gauge", "celsius");
|
||||
add_metric_point("", String(atmpCompensated));
|
||||
}
|
||||
if (utils::isValidHumidity(_hum)) {
|
||||
add_metric(
|
||||
"humidity",
|
||||
"The relative humidity as measured by the AirGradient SHT sensor",
|
||||
"gauge", "percent");
|
||||
add_metric_point("", String(_hum));
|
||||
}
|
||||
if (utils::isValidHumidity(ahumCompensated)) {
|
||||
add_metric("humidity_compensated",
|
||||
"The compensated relative humidity as measured by the "
|
||||
"AirGradient SHT / PMS sensor",
|
||||
"gauge", "percent");
|
||||
add_metric_point("", String(ahumCompensated));
|
||||
}
|
||||
|
||||
response += "# EOF\n";
|
||||
return response;
|
||||
}
|
28
examples/DiyProIndoorV4_2/OpenMetrics.h
Normal file
28
examples/DiyProIndoorV4_2/OpenMetrics.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef _OPEN_METRICS_H_
|
||||
#define _OPEN_METRICS_H_
|
||||
|
||||
#include "AgConfigure.h"
|
||||
#include "AgValue.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include "AirGradient.h"
|
||||
#include "AgApiClient.h"
|
||||
|
||||
class OpenMetrics {
|
||||
private:
|
||||
AirGradient *ag;
|
||||
Measurements &measure;
|
||||
Configuration &config;
|
||||
WifiConnector &wifiConnector;
|
||||
AgApiClient &apiClient;
|
||||
|
||||
public:
|
||||
OpenMetrics(Measurements &measure, Configuration &conig,
|
||||
WifiConnector &wifiConnector, AgApiClient& apiClient);
|
||||
~OpenMetrics();
|
||||
void setAirGradient(AirGradient *ag);
|
||||
const char *getApiContentType(void);
|
||||
const char* getApi(void);
|
||||
String getPayload(void);
|
||||
};
|
||||
|
||||
#endif /** _OPEN_METRICS_H_ */
|
File diff suppressed because it is too large
Load Diff
72
examples/OneOpenAir/LocalServer.cpp
Normal file
72
examples/OneOpenAir/LocalServer.cpp
Normal file
@ -0,0 +1,72 @@
|
||||
#include "LocalServer.h"
|
||||
|
||||
LocalServer::LocalServer(Stream &log, OpenMetrics &openMetrics,
|
||||
Measurements &measure, Configuration &config,
|
||||
WifiConnector &wifiConnector)
|
||||
: PrintLog(log, "LocalServer"), openMetrics(openMetrics), measure(measure),
|
||||
config(config), wifiConnector(wifiConnector) {}
|
||||
|
||||
LocalServer::~LocalServer() {}
|
||||
|
||||
bool LocalServer::begin(void) {
|
||||
server.on("/measures/current", HTTP_GET, [this]() { _GET_measure(); });
|
||||
server.on(openMetrics.getApi(), HTTP_GET, [this]() { _GET_metrics(); });
|
||||
server.on("/config", HTTP_GET, [this]() { _GET_config(); });
|
||||
server.on("/config", HTTP_PUT, [this]() { _PUT_config(); });
|
||||
server.begin();
|
||||
|
||||
if (xTaskCreate(
|
||||
[](void *param) {
|
||||
LocalServer *localServer = (LocalServer *)param;
|
||||
for (;;) {
|
||||
localServer->_handle();
|
||||
}
|
||||
},
|
||||
"webserver", 1024 * 4, this, 5, NULL) != pdTRUE) {
|
||||
Serial.println("Create task handle webserver failed");
|
||||
}
|
||||
logInfo("Init: " + getHostname() + ".local");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void LocalServer::setAirGraident(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
String LocalServer::getHostname(void) {
|
||||
return "airgradient_" + ag->deviceId();
|
||||
}
|
||||
|
||||
void LocalServer::_handle(void) { server.handleClient(); }
|
||||
|
||||
void LocalServer::_GET_config(void) {
|
||||
if(ag->isOne()) {
|
||||
server.send(200, "application/json", config.toString());
|
||||
} else {
|
||||
server.send(200, "application/json", config.toString(fwMode));
|
||||
}
|
||||
}
|
||||
|
||||
void LocalServer::_PUT_config(void) {
|
||||
String data = server.arg(0);
|
||||
String response = "";
|
||||
int statusCode = 400; // Status code for data invalid
|
||||
if (config.parse(data, true)) {
|
||||
statusCode = 200;
|
||||
response = "Success";
|
||||
} else {
|
||||
response = config.getFailedMesage();
|
||||
}
|
||||
server.send(statusCode, "text/plain", response);
|
||||
}
|
||||
|
||||
void LocalServer::_GET_metrics(void) {
|
||||
server.send(200, openMetrics.getApiContentType(), openMetrics.getPayload());
|
||||
}
|
||||
|
||||
void LocalServer::_GET_measure(void) {
|
||||
server.send(
|
||||
200, "application/json",
|
||||
measure.toString(true, fwMode, wifiConnector.RSSI(), ag, &config));
|
||||
}
|
||||
|
||||
void LocalServer::setFwMode(AgFirmwareMode fwMode) { this->fwMode = fwMode; }
|
38
examples/OneOpenAir/LocalServer.h
Normal file
38
examples/OneOpenAir/LocalServer.h
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef _LOCAL_SERVER_H_
|
||||
#define _LOCAL_SERVER_H_
|
||||
|
||||
#include "AgConfigure.h"
|
||||
#include "AgValue.h"
|
||||
#include "AirGradient.h"
|
||||
#include "OpenMetrics.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include <Arduino.h>
|
||||
#include <WebServer.h>
|
||||
|
||||
class LocalServer : public PrintLog {
|
||||
private:
|
||||
AirGradient *ag;
|
||||
OpenMetrics &openMetrics;
|
||||
Measurements &measure;
|
||||
Configuration &config;
|
||||
WifiConnector &wifiConnector;
|
||||
WebServer server;
|
||||
AgFirmwareMode fwMode;
|
||||
|
||||
public:
|
||||
LocalServer(Stream &log, OpenMetrics &openMetrics, Measurements &measure,
|
||||
Configuration &config, WifiConnector& wifiConnector);
|
||||
~LocalServer();
|
||||
|
||||
bool begin(void);
|
||||
void setAirGraident(AirGradient *ag);
|
||||
String getHostname(void);
|
||||
void setFwMode(AgFirmwareMode fwMode);
|
||||
void _handle(void);
|
||||
void _GET_config(void);
|
||||
void _PUT_config(void);
|
||||
void _GET_metrics(void);
|
||||
void _GET_measure(void);
|
||||
};
|
||||
|
||||
#endif /** _LOCAL_SERVER_H_ */
|
1312
examples/OneOpenAir/OneOpenAir.ino
Normal file
1312
examples/OneOpenAir/OneOpenAir.ino
Normal file
File diff suppressed because it is too large
Load Diff
219
examples/OneOpenAir/OpenMetrics.cpp
Normal file
219
examples/OneOpenAir/OpenMetrics.cpp
Normal file
@ -0,0 +1,219 @@
|
||||
#include "OpenMetrics.h"
|
||||
|
||||
OpenMetrics::OpenMetrics(Measurements &measure, Configuration &config,
|
||||
WifiConnector &wifiConnector, AgApiClient &apiClient)
|
||||
: measure(measure), config(config), wifiConnector(wifiConnector),
|
||||
apiClient(apiClient) {}
|
||||
|
||||
OpenMetrics::~OpenMetrics() {}
|
||||
|
||||
void OpenMetrics::setAirGradient(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
const char *OpenMetrics::getApiContentType(void) {
|
||||
return "application/openmetrics-text; version=1.0.0; charset=utf-8";
|
||||
}
|
||||
|
||||
const char *OpenMetrics::getApi(void) { return "/metrics"; }
|
||||
|
||||
String OpenMetrics::getPayload(void) {
|
||||
String response;
|
||||
String current_metric_name;
|
||||
const auto add_metric = [&](const String &name, const String &help,
|
||||
const String &type, const String &unit = "") {
|
||||
current_metric_name = "airgradient_" + name;
|
||||
if (!unit.isEmpty())
|
||||
current_metric_name += "_" + unit;
|
||||
response += "# HELP " + current_metric_name + " " + help + "\n";
|
||||
response += "# TYPE " + current_metric_name + " " + type + "\n";
|
||||
if (!unit.isEmpty())
|
||||
response += "# UNIT " + current_metric_name + " " + unit + "\n";
|
||||
};
|
||||
const auto add_metric_point = [&](const String &labels, const String &value) {
|
||||
response += current_metric_name + "{" + labels + "} " + value + "\n";
|
||||
};
|
||||
|
||||
add_metric("info", "AirGradient device information", "info");
|
||||
add_metric_point("airgradient_serial_number=\"" + ag->deviceId() +
|
||||
"\",airgradient_device_type=\"" + ag->getBoardName() +
|
||||
"\",airgradient_library_version=\"" + ag->getVersion() +
|
||||
"\"",
|
||||
"1");
|
||||
|
||||
add_metric("config_ok",
|
||||
"1 if the AirGradient device was able to successfully fetch its "
|
||||
"configuration from the server",
|
||||
"gauge");
|
||||
add_metric_point("", apiClient.isFetchConfigureFailed() ? "0" : "1");
|
||||
|
||||
add_metric(
|
||||
"post_ok",
|
||||
"1 if the AirGradient device was able to successfully send to the server",
|
||||
"gauge");
|
||||
add_metric_point("", apiClient.isPostToServerFailed() ? "0" : "1");
|
||||
|
||||
add_metric(
|
||||
"wifi_rssi",
|
||||
"WiFi signal strength from the AirGradient device perspective, in dBm",
|
||||
"gauge", "dbm");
|
||||
add_metric_point("", String(wifiConnector.RSSI()));
|
||||
|
||||
if (config.hasSensorS8 && measure.CO2 >= 0) {
|
||||
add_metric("co2",
|
||||
"Carbon dioxide concentration as measured by the AirGradient S8 "
|
||||
"sensor, in parts per million",
|
||||
"gauge", "ppm");
|
||||
add_metric_point("", String(measure.CO2));
|
||||
}
|
||||
|
||||
float _temp = utils::getInvalidTemperature();
|
||||
float _hum = utils::getInvalidHumidity();
|
||||
int pm01 = utils::getInvalidPmValue();
|
||||
int pm25 = utils::getInvalidPmValue();
|
||||
int pm10 = utils::getInvalidPmValue();
|
||||
int pm03PCount = utils::getInvalidPmValue();
|
||||
int atmpCompensated = utils::getInvalidTemperature();
|
||||
int ahumCompensated = utils::getInvalidHumidity();
|
||||
if (config.hasSensorPMS1 && config.hasSensorPMS2) {
|
||||
_temp = (measure.temp_1 + measure.temp_2) / 2.0f;
|
||||
_hum = (measure.hum_1 + measure.hum_2) / 2.0f;
|
||||
pm01 = (measure.pm01_1 + measure.pm01_2) / 2;
|
||||
pm25 = (measure.pm25_1 + measure.pm25_2) / 2;
|
||||
pm10 = (measure.pm10_1 + measure.pm10_2) / 2;
|
||||
pm03PCount = (measure.pm03PCount_1 + measure.pm03PCount_2) / 2;
|
||||
} else {
|
||||
if (ag->isOne()) {
|
||||
if (config.hasSensorSHT) {
|
||||
_temp = measure.Temperature;
|
||||
_hum = measure.Humidity;
|
||||
}
|
||||
|
||||
if (config.hasSensorPMS1) {
|
||||
pm01 = measure.pm01_1;
|
||||
pm25 = measure.pm25_1;
|
||||
pm10 = measure.pm10_1;
|
||||
pm03PCount = measure.pm03PCount_1;
|
||||
}
|
||||
} else {
|
||||
if (config.hasSensorPMS1) {
|
||||
_temp = measure.temp_1;
|
||||
_hum = measure.hum_1;
|
||||
pm01 = measure.pm01_1;
|
||||
pm25 = measure.pm25_1;
|
||||
pm10 = measure.pm10_1;
|
||||
pm03PCount = measure.pm03PCount_1;
|
||||
}
|
||||
if (config.hasSensorPMS2) {
|
||||
_temp = measure.temp_2;
|
||||
_hum = measure.hum_2;
|
||||
pm01 = measure.pm01_2;
|
||||
pm25 = measure.pm25_2;
|
||||
pm10 = measure.pm10_2;
|
||||
pm03PCount = measure.pm03PCount_2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Get temperature and humidity compensated */
|
||||
if (ag->isOne()) {
|
||||
atmpCompensated = _temp;
|
||||
ahumCompensated = _hum;
|
||||
} else {
|
||||
atmpCompensated = ag->pms5003t_1.compensateTemp(_temp);
|
||||
ahumCompensated = ag->pms5003t_1.compensateHum(_hum);
|
||||
}
|
||||
|
||||
if (config.hasSensorPMS1 || config.hasSensorPMS2) {
|
||||
if (utils::isValidPm(pm01)) {
|
||||
add_metric("pm1",
|
||||
"PM1.0 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm01));
|
||||
}
|
||||
if (utils::isValidPm(pm25)) {
|
||||
add_metric("pm2d5",
|
||||
"PM2.5 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm25));
|
||||
}
|
||||
if (utils::isValidPm(pm10)) {
|
||||
add_metric("pm10",
|
||||
"PM10 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in micrograms per cubic meter",
|
||||
"gauge", "ugm3");
|
||||
add_metric_point("", String(pm10));
|
||||
}
|
||||
if (utils::isValidPm03Count(pm03PCount)) {
|
||||
add_metric("pm0d3",
|
||||
"PM0.3 concentration as measured by the AirGradient PMS "
|
||||
"sensor, in number of particules per 100 milliliters",
|
||||
"gauge", "p100ml");
|
||||
add_metric_point("", String(pm03PCount));
|
||||
}
|
||||
}
|
||||
|
||||
if (config.hasSensorSGP) {
|
||||
if (utils::isValidVOC(measure.TVOC)) {
|
||||
add_metric("tvoc_index",
|
||||
"The processed Total Volatile Organic Compounds (TVOC) index "
|
||||
"as measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.TVOC));
|
||||
}
|
||||
if (utils::isValidVOC(measure.TVOCRaw)) {
|
||||
add_metric("tvoc_raw",
|
||||
"The raw input value to the Total Volatile Organic Compounds "
|
||||
"(TVOC) index as measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.TVOCRaw));
|
||||
}
|
||||
if (utils::isValidNOx(measure.NOx)) {
|
||||
add_metric("nox_index",
|
||||
"The processed Nitrous Oxide (NOx) index as measured by the "
|
||||
"AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.NOx));
|
||||
}
|
||||
if (utils::isValidNOx(measure.NOxRaw)) {
|
||||
add_metric("nox_raw",
|
||||
"The raw input value to the Nitrous Oxide (NOx) index as "
|
||||
"measured by the AirGradient SGP sensor",
|
||||
"gauge");
|
||||
add_metric_point("", String(measure.NOxRaw));
|
||||
}
|
||||
}
|
||||
|
||||
if (utils::isValidTemperature(_temp)) {
|
||||
add_metric("temperature",
|
||||
"The ambient temperature as measured by the AirGradient SHT / PMS "
|
||||
"sensor, in degrees Celsius",
|
||||
"gauge", "celsius");
|
||||
add_metric_point("", String(_temp));
|
||||
}
|
||||
if (utils::isValidTemperature(atmpCompensated)) {
|
||||
add_metric(
|
||||
"temperature_compensated",
|
||||
"The compensated ambient temperature as measured by the AirGradient SHT / PMS "
|
||||
"sensor, in degrees Celsius",
|
||||
"gauge", "celsius");
|
||||
add_metric_point("", String(atmpCompensated));
|
||||
}
|
||||
if (utils::isValidHumidity(_hum)) {
|
||||
add_metric(
|
||||
"humidity",
|
||||
"The relative humidity as measured by the AirGradient SHT sensor",
|
||||
"gauge", "percent");
|
||||
add_metric_point("", String(_hum));
|
||||
}
|
||||
if (utils::isValidHumidity(ahumCompensated)) {
|
||||
add_metric(
|
||||
"humidity_compensated",
|
||||
"The compensated relative humidity as measured by the AirGradient SHT / PMS sensor",
|
||||
"gauge", "percent");
|
||||
add_metric_point("", String(ahumCompensated));
|
||||
}
|
||||
|
||||
response += "# EOF\n";
|
||||
return response;
|
||||
}
|
28
examples/OneOpenAir/OpenMetrics.h
Normal file
28
examples/OneOpenAir/OpenMetrics.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef _OPEN_METRICS_H_
|
||||
#define _OPEN_METRICS_H_
|
||||
|
||||
#include "AgConfigure.h"
|
||||
#include "AgValue.h"
|
||||
#include "AgWiFiConnector.h"
|
||||
#include "AirGradient.h"
|
||||
#include "AgApiClient.h"
|
||||
|
||||
class OpenMetrics {
|
||||
private:
|
||||
AirGradient *ag;
|
||||
Measurements &measure;
|
||||
Configuration &config;
|
||||
WifiConnector &wifiConnector;
|
||||
AgApiClient &apiClient;
|
||||
|
||||
public:
|
||||
OpenMetrics(Measurements &measure, Configuration &conig,
|
||||
WifiConnector &wifiConnector, AgApiClient& apiClient);
|
||||
~OpenMetrics();
|
||||
void setAirGradient(AirGradient *ag);
|
||||
const char *getApiContentType(void);
|
||||
const char* getApi(void);
|
||||
String getPayload(void);
|
||||
};
|
||||
|
||||
#endif /** _OPEN_METRICS_H_ */
|
206
examples/OneOpenAir/OtaHandler.h
Normal file
206
examples/OneOpenAir/OtaHandler.h
Normal file
@ -0,0 +1,206 @@
|
||||
#ifndef _OTA_HANDLER_H_
|
||||
#define _OTA_HANDLER_H_
|
||||
#include <Arduino.h>
|
||||
#include <esp_err.h>
|
||||
#include <esp_http_client.h>
|
||||
#include <esp_ota_ops.h>
|
||||
|
||||
#define OTA_BUF_SIZE 1024
|
||||
#define URL_BUF_SIZE 256
|
||||
|
||||
enum OtaUpdateOutcome {
|
||||
UPDATE_PERFORMED,
|
||||
ALREADY_UP_TO_DATE,
|
||||
UPDATE_FAILED,
|
||||
UDPATE_SKIPPED
|
||||
};
|
||||
|
||||
enum OtaState {
|
||||
OTA_STATE_BEGIN,
|
||||
OTA_STATE_FAIL,
|
||||
OTA_STATE_SKIP,
|
||||
OTA_STATE_UP_TO_DATE,
|
||||
OTA_STATE_PROCESSING,
|
||||
OTA_STATE_SUCCESS
|
||||
};
|
||||
|
||||
typedef void(*OtaHandlerCallback_t)(OtaState state,
|
||||
String message);
|
||||
|
||||
class OtaHandler {
|
||||
public:
|
||||
void updateFirmwareIfOutdated(String deviceId) {
|
||||
String url = "http://hw.airgradient.com/sensors/airgradient:" + deviceId +
|
||||
"/generic/os/firmware.bin";
|
||||
url += "?current_firmware=";
|
||||
url += GIT_VERSION;
|
||||
char urlAsChar[URL_BUF_SIZE];
|
||||
url.toCharArray(urlAsChar, URL_BUF_SIZE);
|
||||
Serial.printf("checking for new OTA update @ %s\n", urlAsChar);
|
||||
|
||||
esp_http_client_config_t config = {};
|
||||
config.url = urlAsChar;
|
||||
OtaUpdateOutcome ret = attemptToPerformOta(&config);
|
||||
Serial.println(ret);
|
||||
if (this->callback) {
|
||||
switch (ret) {
|
||||
case OtaUpdateOutcome::UPDATE_PERFORMED:
|
||||
this->callback(OtaState::OTA_STATE_SUCCESS, "");
|
||||
break;
|
||||
case OtaUpdateOutcome::UDPATE_SKIPPED:
|
||||
this->callback(OtaState::OTA_STATE_SKIP, "");
|
||||
break;
|
||||
case OtaUpdateOutcome::ALREADY_UP_TO_DATE:
|
||||
this->callback(OtaState::OTA_STATE_UP_TO_DATE, "");
|
||||
break;
|
||||
case OtaUpdateOutcome::UPDATE_FAILED:
|
||||
this->callback(OtaState::OTA_STATE_FAIL, "");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setHandlerCallback(OtaHandlerCallback_t callback) {
|
||||
this->callback = callback;
|
||||
}
|
||||
|
||||
private:
|
||||
OtaHandlerCallback_t callback;
|
||||
|
||||
OtaUpdateOutcome attemptToPerformOta(const esp_http_client_config_t *config) {
|
||||
esp_http_client_handle_t client = esp_http_client_init(config);
|
||||
if (client == NULL) {
|
||||
Serial.println("Failed to initialize HTTP connection");
|
||||
return OtaUpdateOutcome::UPDATE_FAILED;
|
||||
}
|
||||
|
||||
esp_err_t err = esp_http_client_open(client, 0);
|
||||
if (err != ESP_OK) {
|
||||
esp_http_client_cleanup(client);
|
||||
Serial.printf("Failed to open HTTP connection: %s\n",
|
||||
esp_err_to_name(err));
|
||||
return OtaUpdateOutcome::UPDATE_FAILED;
|
||||
}
|
||||
esp_http_client_fetch_headers(client);
|
||||
|
||||
int httpStatusCode = esp_http_client_get_status_code(client);
|
||||
if (httpStatusCode == 304) {
|
||||
Serial.println("Firmware is already up to date");
|
||||
cleanupHttp(client);
|
||||
return OtaUpdateOutcome::ALREADY_UP_TO_DATE;
|
||||
} else if (httpStatusCode != 200) {
|
||||
Serial.printf("Firmware update skipped, the server returned %d\n",
|
||||
httpStatusCode);
|
||||
cleanupHttp(client);
|
||||
return OtaUpdateOutcome::UDPATE_SKIPPED;
|
||||
}
|
||||
|
||||
esp_ota_handle_t update_handle = 0;
|
||||
const esp_partition_t *update_partition = NULL;
|
||||
Serial.println("Starting OTA update ...");
|
||||
update_partition = esp_ota_get_next_update_partition(NULL);
|
||||
if (update_partition == NULL) {
|
||||
Serial.println("Passive OTA partition not found");
|
||||
cleanupHttp(client);
|
||||
return OtaUpdateOutcome::UPDATE_FAILED;
|
||||
}
|
||||
Serial.printf("Writing to partition subtype %d at offset 0x%x\n",
|
||||
update_partition->subtype, update_partition->address);
|
||||
|
||||
err = esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle);
|
||||
if (err != ESP_OK) {
|
||||
Serial.printf("esp_ota_begin failed, error=%d\n", err);
|
||||
cleanupHttp(client);
|
||||
return OtaUpdateOutcome::UPDATE_FAILED;
|
||||
}
|
||||
|
||||
esp_err_t ota_write_err = ESP_OK;
|
||||
char *upgrade_data_buf = (char *)malloc(OTA_BUF_SIZE);
|
||||
if (!upgrade_data_buf) {
|
||||
Serial.println("Couldn't allocate memory for data buffer");
|
||||
return OtaUpdateOutcome::UPDATE_FAILED;
|
||||
}
|
||||
|
||||
int binary_file_len = 0;
|
||||
int totalSize = esp_http_client_get_content_length(client);
|
||||
Serial.println("File size: " + String(totalSize) + String(" bytes"));
|
||||
|
||||
// Show display start update new firmware.
|
||||
if (this->callback) {
|
||||
this->callback(OtaState::OTA_STATE_BEGIN, "");
|
||||
}
|
||||
|
||||
// Download file and write new firmware to OTA partition
|
||||
uint32_t lastUpdate = millis();
|
||||
while (1) {
|
||||
int data_read =
|
||||
esp_http_client_read(client, upgrade_data_buf, OTA_BUF_SIZE);
|
||||
if (data_read == 0) {
|
||||
if (this->callback) {
|
||||
this->callback(OtaState::OTA_STATE_PROCESSING, String(100));
|
||||
}
|
||||
Serial.println("Connection closed, all data received");
|
||||
break;
|
||||
}
|
||||
if (data_read < 0) {
|
||||
Serial.println("Data read error");
|
||||
if (this->callback) {
|
||||
this->callback(OtaState::OTA_STATE_FAIL, "");
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (data_read > 0) {
|
||||
ota_write_err = esp_ota_write(
|
||||
update_handle, (const void *)upgrade_data_buf, data_read);
|
||||
if (ota_write_err != ESP_OK) {
|
||||
if (this->callback) {
|
||||
this->callback(OtaState::OTA_STATE_FAIL, "");
|
||||
}
|
||||
break;
|
||||
}
|
||||
binary_file_len += data_read;
|
||||
|
||||
int percent = (binary_file_len * 100) / totalSize;
|
||||
uint32_t ms = (uint32_t)(millis() - lastUpdate);
|
||||
if (ms >= 250) {
|
||||
// sm.executeOTA(StateMachine::OtaState::OTA_STATE_PROCESSING, "",
|
||||
// percent);
|
||||
if (this->callback) {
|
||||
this->callback(OtaState::OTA_STATE_PROCESSING,
|
||||
String(percent));
|
||||
}
|
||||
lastUpdate = millis();
|
||||
}
|
||||
}
|
||||
}
|
||||
free(upgrade_data_buf);
|
||||
cleanupHttp(client);
|
||||
Serial.printf("# of bytes written: %d\n", binary_file_len);
|
||||
|
||||
esp_err_t ota_end_err = esp_ota_end(update_handle);
|
||||
if (ota_write_err != ESP_OK) {
|
||||
Serial.printf("Error: esp_ota_write failed! err=0x%d\n", err);
|
||||
return OtaUpdateOutcome::UPDATE_FAILED;
|
||||
} else if (ota_end_err != ESP_OK) {
|
||||
Serial.printf("Error: esp_ota_end failed! err=0x%d. Image is invalid",
|
||||
ota_end_err);
|
||||
return OtaUpdateOutcome::UPDATE_FAILED;
|
||||
}
|
||||
|
||||
err = esp_ota_set_boot_partition(update_partition);
|
||||
if (err != ESP_OK) {
|
||||
Serial.printf("esp_ota_set_boot_partition failed! err=0x%d\n", err);
|
||||
return OtaUpdateOutcome::UPDATE_FAILED;
|
||||
}
|
||||
return OtaUpdateOutcome::UPDATE_PERFORMED;
|
||||
}
|
||||
|
||||
void cleanupHttp(esp_http_client_handle_t client) {
|
||||
esp_http_client_close(client);
|
||||
esp_http_client_cleanup(client);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
@ -1,974 +0,0 @@
|
||||
/*
|
||||
This is the code for the AirGradient Open Air open-source hardware outdoor Air
|
||||
Quality Monitor with an ESP32-C3 Microcontroller.
|
||||
|
||||
It is an air quality monitor for PM2.5, CO2, TVOCs, NOx, Temperature and
|
||||
Humidity and can send data over Wifi.
|
||||
|
||||
Open source air quality monitors and kits are available:
|
||||
Indoor Monitor: https://www.airgradient.com/indoor/
|
||||
Outdoor Monitor: https://www.airgradient.com/outdoor/
|
||||
|
||||
Build Instructions:
|
||||
https://www.airgradient.com/documentation/open-air-pst-kit-1-3/
|
||||
|
||||
The codes needs the following libraries installed:
|
||||
“WifiManager by tzapu, tablatronix” tested with version 2.0.16-rc.2
|
||||
"Arduino_JSON" by Arduino Version 0.2.0
|
||||
|
||||
Please make sure you have esp32 board manager installed. Tested with
|
||||
version 2.0.11.
|
||||
|
||||
Important flashing settings:
|
||||
- Set board to "ESP32C3 Dev Module"
|
||||
- Enable "USB CDC On Boot"
|
||||
- Flash frequency "80Mhz"
|
||||
- Flash mode "QIO"
|
||||
- Flash size "4MB"
|
||||
- Partition scheme "Default 4MB with spiffs (1.2MB APP/1,5MB SPIFFS)"
|
||||
- JTAG adapter "Disabled"
|
||||
|
||||
If you have any questions please visit our forum at
|
||||
https://forum.airgradient.com/
|
||||
|
||||
CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
|
||||
|
||||
*/
|
||||
|
||||
#include <AirGradient.h>
|
||||
#include <Arduino_JSON.h>
|
||||
#include <HTTPClient.h>
|
||||
#include <HardwareSerial.h>
|
||||
#include <WiFiManager.h>
|
||||
#include <Wire.h>
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Application state machine state
|
||||
*
|
||||
*/
|
||||
enum {
|
||||
APP_SM_WIFI_MANAGER_MODE, /** In WiFi Manger Mode */
|
||||
APP_SM_WIFI_MAMAGER_PORTAL_ACTIVE, /** WiFi Manager has connected to mobile
|
||||
phone */
|
||||
APP_SM_WIFI_MANAGER_STA_CONNECTING, /** After SSID and PW entered and OK
|
||||
clicked, connection to WiFI network is
|
||||
attempted*/
|
||||
APP_SM_WIFI_MANAGER_STA_CONNECTED, /** Connecting to WiFi worked */
|
||||
APP_SM_WIFI_OK_SERVER_CONNECTING, /** Once connected to WiFi an attempt to
|
||||
reach the server is performed */
|
||||
APP_SM_WIFI_OK_SERVER_CONNNECTED, /** Server is reachable, all fine */
|
||||
/** Exceptions during WIFi Setup */
|
||||
APP_SM_WIFI_MANAGER_CONNECT_FAILED, /** Cannot connect to WiFi (e.g. wrong
|
||||
password, WPA Enterprise etc.) */
|
||||
APP_SM_WIFI_OK_SERVER_CONNECT_FAILED, /** Connected to WiFi but server not
|
||||
reachable, e.g. firewall block/
|
||||
whitelisting needed etc. */
|
||||
APP_SM_WIFI_OK_SERVER_OK_SENSOR_CONFIG_FAILED, /** Server reachable but sensor
|
||||
not configured correctly*/
|
||||
|
||||
/** During Normal Operation */
|
||||
APP_SM_WIFI_LOST, /** Connection to WiFi network failed credentials incorrect
|
||||
encryption not supported etc. */
|
||||
APP_SM_SERVER_LOST, /** Connected to WiFi network but the server cannot be
|
||||
reached through the internet, e.g. blocked by firewall
|
||||
*/
|
||||
APP_SM_SENSOR_CONFIG_FAILED, /** Server is reachable but there is some
|
||||
configuration issue to be fixed on the server
|
||||
side */
|
||||
APP_SM_NORMAL,
|
||||
};
|
||||
|
||||
#define LED_FAST_BLINK_DELAY 250 /** ms */
|
||||
#define LED_SLOW_BLINK_DELAY 1000 /** ms */
|
||||
#define WIFI_CONNECT_COUNTDOWN_MAX 180 /** sec */
|
||||
#define WIFI_CONNECT_RETRY_MS 10000 /** ms */
|
||||
#define LED_BAR_COUNT_INIT_VALUE (-1) /** */
|
||||
#define LED_BAR_ANIMATION_PERIOD 100 /** ms */
|
||||
#define DISP_UPDATE_INTERVAL 5000 /** ms */
|
||||
#define SERVER_CONFIG_UPDATE_INTERVAL 30000 /** ms */
|
||||
#define SERVER_SYNC_INTERVAL 60000 /** ms */
|
||||
#define SENSOR_CO2_CALIB_COUNTDOWN_MAX 5 /** sec */
|
||||
#define SENSOR_TVOC_UPDATE_INTERVAL 1000 /** ms */
|
||||
#define SENSOR_CO2_UPDATE_INTERVAL 5000 /** ms */
|
||||
#define SENSOR_PM_UPDATE_INTERVAL 5000 /** ms */
|
||||
#define SENSOR_TEMP_HUM_UPDATE_INTERVAL 5000 /** ms */
|
||||
#define DISPLAY_DELAY_SHOW_CONTENT_MS 2000 /** ms */
|
||||
#define WIFI_HOTSPOT_PASSWORD_DEFAULT \
|
||||
"cleanair" /** default WiFi AP password \
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Use use LED bar state
|
||||
*/
|
||||
typedef enum {
|
||||
UseLedBarOff, /** Don't use LED bar */
|
||||
UseLedBarPM, /** Use LED bar for PMS */
|
||||
UseLedBarCO2, /** Use LED bar for CO2 */
|
||||
} UseLedBar;
|
||||
|
||||
/**
|
||||
* @brief Schedule handle with timing period
|
||||
*
|
||||
*/
|
||||
class AgSchedule {
|
||||
public:
|
||||
AgSchedule(int period, void (*handler)(void))
|
||||
: period(period), handler(handler) {}
|
||||
void run(void) {
|
||||
uint32_t ms = (uint32_t)(millis() - count);
|
||||
if (ms >= period) {
|
||||
/** Call handler */
|
||||
handler();
|
||||
|
||||
Serial.printf("[AgSchedule] handle 0x%08x, period: %d(ms)\r\n",
|
||||
(unsigned int)handler, period);
|
||||
|
||||
/** Update period time */
|
||||
count = millis();
|
||||
}
|
||||
}
|
||||
void setPeriod(int period) { this->period = period; }
|
||||
|
||||
private:
|
||||
void (*handler)(void);
|
||||
int period;
|
||||
int count;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief AirGradient server configuration and sync data
|
||||
*
|
||||
*/
|
||||
class AgServer {
|
||||
public:
|
||||
void begin(void) {
|
||||
inF = false;
|
||||
inUSAQI = false;
|
||||
configFailed = false;
|
||||
serverFailed = false;
|
||||
memset(models, 0, sizeof(models));
|
||||
memset(mqttBroker, 0, sizeof(mqttBroker));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get server configuration
|
||||
*
|
||||
* @param id Device ID
|
||||
* @return true Success
|
||||
* @return false Failure
|
||||
*/
|
||||
bool pollServerConfig(String id) {
|
||||
String uri =
|
||||
"http://hw.airgradient.com/sensors/airgradient:" + id + "/one/config";
|
||||
|
||||
/** Init http client */
|
||||
HTTPClient client;
|
||||
if (client.begin(uri) == false) {
|
||||
configFailed = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Get */
|
||||
int retCode = client.GET();
|
||||
if (retCode != 200) {
|
||||
client.end();
|
||||
configFailed = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/** clear failed */
|
||||
configFailed = false;
|
||||
|
||||
/** Get response string */
|
||||
String respContent = client.getString();
|
||||
client.end();
|
||||
Serial.println("Get server config: " + respContent);
|
||||
|
||||
/** Parse JSON */
|
||||
JSONVar root = JSON.parse(respContent);
|
||||
if (JSON.typeof(root) == "undefined") {
|
||||
/** JSON invalid */
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Get "country" */
|
||||
if (JSON.typeof_(root["country"]) == "string") {
|
||||
String country = root["country"];
|
||||
if (country == "US") {
|
||||
inF = true;
|
||||
} else {
|
||||
inF = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Get "pmStandard" */
|
||||
if (JSON.typeof_(root["pmStandard"]) == "string") {
|
||||
String standard = root["pmStandard"];
|
||||
if (standard == "ugm3") {
|
||||
inUSAQI = false;
|
||||
} else {
|
||||
inUSAQI = true;
|
||||
}
|
||||
}
|
||||
|
||||
/** Get "co2CalibrationRequested" */
|
||||
if (JSON.typeof_(root["co2CalibrationRequested"]) == "boolean") {
|
||||
co2Calib = root["co2CalibrationRequested"];
|
||||
}
|
||||
|
||||
/** Get "ledBarMode" */
|
||||
if (JSON.typeof_(root["ledBarMode"]) == "string") {
|
||||
String mode = root["ledBarMode"];
|
||||
if (mode == "co2") {
|
||||
ledBarMode = UseLedBarCO2;
|
||||
} else if (mode == "pm") {
|
||||
ledBarMode = UseLedBarPM;
|
||||
} else if (mode == "off") {
|
||||
ledBarMode = UseLedBarOff;
|
||||
} else {
|
||||
ledBarMode = UseLedBarOff;
|
||||
}
|
||||
}
|
||||
|
||||
/** Get model */
|
||||
if (JSON.typeof_(root["model"]) == "string") {
|
||||
String model = root["model"];
|
||||
if (model.length()) {
|
||||
int len =
|
||||
model.length() < sizeof(models) ? model.length() : sizeof(models);
|
||||
memset(models, 0, sizeof(models));
|
||||
memcpy(models, model.c_str(), len);
|
||||
}
|
||||
}
|
||||
|
||||
/** Get "mqttBrokerUrl" */
|
||||
if (JSON.typeof_(root["mqttBrokerUrl"]) == "string") {
|
||||
String mqtt = root["mqttBrokerUrl"];
|
||||
if (mqtt.length()) {
|
||||
int len = mqtt.length() < sizeof(mqttBroker) ? mqtt.length()
|
||||
: sizeof(mqttBroker);
|
||||
memset(mqttBroker, 0, sizeof(mqttBroker));
|
||||
memcpy(mqttBroker, mqtt.c_str(), len);
|
||||
}
|
||||
}
|
||||
|
||||
/** Get 'abcDays' */
|
||||
if (JSON.typeof_(root["abcDays"]) == "number") {
|
||||
co2AbcCalib = root["abcDays"];
|
||||
} else {
|
||||
co2AbcCalib = -1;
|
||||
}
|
||||
|
||||
/** Show configuration */
|
||||
showServerConfig();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool postToServer(String id, String payload) {
|
||||
/**
|
||||
* @brief Only post data if WiFi is connected
|
||||
*/
|
||||
if (WiFi.isConnected() == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Serial.printf("Post payload: %s\r\n", payload.c_str());
|
||||
|
||||
String uri =
|
||||
"http://hw.airgradient.com/sensors/airgradient:" + id + "/measures";
|
||||
|
||||
WiFiClient wifiClient;
|
||||
HTTPClient client;
|
||||
if (client.begin(wifiClient, uri.c_str()) == false) {
|
||||
return false;
|
||||
}
|
||||
client.addHeader("content-type", "application/json");
|
||||
int retCode = client.POST(payload);
|
||||
client.end();
|
||||
|
||||
if ((retCode == 200) || (retCode == 429)) {
|
||||
serverFailed = false;
|
||||
return true;
|
||||
}
|
||||
serverFailed = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get temperature configuration unit
|
||||
*
|
||||
* @return true F unit
|
||||
* @return false C Unit
|
||||
*/
|
||||
bool isTemperatureUnitF(void) { return inF; }
|
||||
|
||||
/**
|
||||
* @brief Get PMS standard unit
|
||||
*
|
||||
* @return true USAQI
|
||||
* @return false ugm3
|
||||
*/
|
||||
bool isPMSinUSAQI(void) { return inUSAQI; }
|
||||
|
||||
/**
|
||||
* @brief Get status of get server coniguration is failed
|
||||
*
|
||||
* @return true Failed
|
||||
* @return false Success
|
||||
*/
|
||||
bool isConfigFailed(void) { return configFailed; }
|
||||
|
||||
/**
|
||||
* @brief Get status of post server configuration is failed
|
||||
*
|
||||
* @return true Failed
|
||||
* @return false Success
|
||||
*/
|
||||
bool isServerFailed(void) { return serverFailed; }
|
||||
|
||||
/**
|
||||
* @brief Get request calibration CO2
|
||||
*
|
||||
* @return true Requested. If result = true, it's clear after function call
|
||||
* @return false Not-requested
|
||||
*/
|
||||
bool isCo2Calib(void) {
|
||||
bool ret = co2Calib;
|
||||
if (ret) {
|
||||
co2Calib = false;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the Co2 auto calib period
|
||||
*
|
||||
* @return int days, -1 if invalid.
|
||||
*/
|
||||
int getCo2Abccalib(void) { return co2AbcCalib; }
|
||||
|
||||
/**
|
||||
* @brief Get device configuration model name
|
||||
*
|
||||
* @return String Model name, empty string if server failed
|
||||
*/
|
||||
String getModelName(void) { return String(models); }
|
||||
|
||||
/**
|
||||
* @brief Get mqttBroker url
|
||||
*
|
||||
* @return String Broker url, empty if server failed
|
||||
*/
|
||||
String getMqttBroker(void) { return String(mqttBroker); }
|
||||
|
||||
/**
|
||||
* @brief Show server configuration parameter
|
||||
*/
|
||||
void showServerConfig(void) {
|
||||
Serial.println("Server configuration: ");
|
||||
Serial.printf(" inF: %s\r\n", inF ? "true" : "false");
|
||||
Serial.printf(" inUSAQI: %s\r\n", inUSAQI ? "true" : "false");
|
||||
Serial.printf(" useRGBLedBar: %d\r\n", (int)ledBarMode);
|
||||
Serial.printf(" Model: %s\r\n", models);
|
||||
Serial.printf(" Mqtt Broker: %s\r\n", mqttBroker);
|
||||
Serial.printf(" S8 calib period: %d\r\n", co2AbcCalib);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get server config led bar mode
|
||||
*
|
||||
* @return UseLedBar
|
||||
*/
|
||||
UseLedBar getLedBarMode(void) { return ledBarMode; }
|
||||
|
||||
private:
|
||||
bool inF; /** Temperature unit, true: F, false: C */
|
||||
bool inUSAQI; /** PMS unit, true: USAQI, false: ugm3 */
|
||||
bool configFailed; /** Flag indicate get server configuration failed */
|
||||
bool serverFailed; /** Flag indicate post data to server failed */
|
||||
bool co2Calib; /** Is co2Ppmcalibration requset */
|
||||
int co2AbcCalib = -1; /** update auto calibration number of day */
|
||||
UseLedBar ledBarMode = UseLedBarCO2; /** */
|
||||
char models[20]; /** */
|
||||
char mqttBroker[256]; /** */
|
||||
};
|
||||
AgServer agServer;
|
||||
|
||||
/** Create airgradient instance for 'OPEN_AIR_OUTDOOR' board */
|
||||
AirGradient ag(OPEN_AIR_OUTDOOR);
|
||||
|
||||
static int ledSmState = APP_SM_NORMAL;
|
||||
|
||||
int loopCount = 0;
|
||||
|
||||
WiFiManager wifiManager; /** wifi manager instance */
|
||||
static bool wifiHasConfig = false;
|
||||
static String wifiSSID = "";
|
||||
|
||||
int tvocIndex = -1;
|
||||
int noxIndex = -1;
|
||||
int co2Ppm = 0;
|
||||
|
||||
int pm25_1 = -1;
|
||||
int pm01_1 = -1;
|
||||
int pm10_1 = -1;
|
||||
int pm03PCount_1 = -1;
|
||||
float temp_1;
|
||||
int hum_1;
|
||||
|
||||
int pm25_2 = -1;
|
||||
int pm01_2 = -1;
|
||||
int pm10_2 = -1;
|
||||
int pm03PCount_2 = -1;
|
||||
float temp_2;
|
||||
int hum_2;
|
||||
|
||||
int pm1Value01;
|
||||
int pm1Value25;
|
||||
int pm1Value10;
|
||||
int pm1PCount;
|
||||
int pm1temp;
|
||||
int pm1hum;
|
||||
int pm2Value01;
|
||||
int pm2Value25;
|
||||
int pm2Value10;
|
||||
int pm2PCount;
|
||||
int pm2temp;
|
||||
int pm2hum;
|
||||
int countPosition;
|
||||
const int targetCount = 20;
|
||||
|
||||
enum {
|
||||
FW_MODE_PST, /** PMS5003T, S8 and SGP41 */
|
||||
FW_MODE_PPT, /** PMS5003T_1, PMS5003T_2, SGP41 */
|
||||
FW_MODE_PP /** PMS5003T_1, PMS5003T_2 */
|
||||
};
|
||||
int fw_mode = FW_MODE_PST;
|
||||
|
||||
void boardInit(void);
|
||||
void failedHandler(String msg);
|
||||
void co2Calibration(void);
|
||||
static String getDevId(void);
|
||||
static void updateWiFiConnect(void);
|
||||
static void tvocPoll(void);
|
||||
static void pmPoll(void);
|
||||
static void sendDataToServer(void);
|
||||
static void co2Poll(void);
|
||||
static void serverConfigPoll(void);
|
||||
static const char *getFwMode(int mode);
|
||||
|
||||
AgSchedule configSchedule(SERVER_CONFIG_UPDATE_INTERVAL, serverConfigPoll);
|
||||
AgSchedule serverSchedule(SERVER_SYNC_INTERVAL, sendDataToServer);
|
||||
AgSchedule co2Schedule(SENSOR_CO2_UPDATE_INTERVAL, co2Poll);
|
||||
AgSchedule pmsSchedule(SENSOR_PM_UPDATE_INTERVAL, pmPoll);
|
||||
AgSchedule tvocSchedule(SENSOR_TVOC_UPDATE_INTERVAL, tvocPoll);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
/** Board init */
|
||||
boardInit();
|
||||
|
||||
/** Server init */
|
||||
agServer.begin();
|
||||
|
||||
/** WiFi connect */
|
||||
connectToWifi();
|
||||
|
||||
if (WiFi.isConnected()) {
|
||||
wifiHasConfig = true;
|
||||
sendPing();
|
||||
|
||||
agServer.pollServerConfig(getDevId());
|
||||
if (agServer.isConfigFailed()) {
|
||||
ledSmHandler(APP_SM_WIFI_OK_SERVER_OK_SENSOR_CONFIG_FAILED);
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
}
|
||||
|
||||
ledSmHandler(APP_SM_NORMAL);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
configSchedule.run();
|
||||
serverSchedule.run();
|
||||
if (fw_mode == FW_MODE_PST) {
|
||||
co2Schedule.run();
|
||||
}
|
||||
pmsSchedule.run();
|
||||
if (fw_mode == FW_MODE_PST || fw_mode == FW_MODE_PPT) {
|
||||
tvocSchedule.run();
|
||||
}
|
||||
updateWiFiConnect();
|
||||
}
|
||||
|
||||
void sendPing() {
|
||||
JSONVar root;
|
||||
root["wifi"] = WiFi.RSSI();
|
||||
root["boot"] = loopCount;
|
||||
if (agServer.postToServer(getDevId(), JSON.stringify(root))) {
|
||||
ledSmHandler(APP_SM_WIFI_OK_SERVER_CONNNECTED);
|
||||
} else {
|
||||
ledSmHandler(APP_SM_WIFI_OK_SERVER_CONNECT_FAILED);
|
||||
}
|
||||
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
|
||||
}
|
||||
|
||||
static void sendDataToServer(void) {
|
||||
JSONVar root;
|
||||
root["wifi"] = WiFi.RSSI();
|
||||
root["boot"] = loopCount;
|
||||
if (fw_mode == FW_MODE_PST) {
|
||||
if (co2Ppm >= 0) {
|
||||
root["rco2"] = co2Ppm;
|
||||
}
|
||||
if (pm01_1 >= 0) {
|
||||
root["pm01"] = pm01_1;
|
||||
}
|
||||
if (pm25_1 >= 0) {
|
||||
root["pm02"] = pm25_1;
|
||||
}
|
||||
if (pm10_1 >= 0) {
|
||||
root["pm10"] = pm10_1;
|
||||
}
|
||||
if (pm03PCount_1 >= 0) {
|
||||
root["pm003_count"] = pm03PCount_1;
|
||||
}
|
||||
if (tvocIndex >= 0) {
|
||||
root["tvoc_index"] = tvocIndex;
|
||||
}
|
||||
if (noxIndex >= 0) {
|
||||
root["noxIndex"] = noxIndex;
|
||||
}
|
||||
if (temp_1 >= 0) {
|
||||
root["atmp"] = temp_1;
|
||||
}
|
||||
if (hum_1 >= 0) {
|
||||
root["rhum"] = hum_1;
|
||||
}
|
||||
} else if (fw_mode == FW_MODE_PPT) {
|
||||
if (tvocIndex > 0) {
|
||||
root["tvoc_index"] = loopCount;
|
||||
}
|
||||
if (noxIndex > 0) {
|
||||
root["nox_index"] = loopCount;
|
||||
}
|
||||
}
|
||||
|
||||
if (fw_mode == FW_MODE_PP || FW_MODE_PPT) {
|
||||
root["pm01"] = (int)((pm01_1 + pm01_2) / 2);
|
||||
root["pm02"] = (int)((pm25_1 + pm25_2) / 2);
|
||||
root["pm003_count"] = (int)((pm03PCount_1 + pm03PCount_2) / 2);
|
||||
root["atmp"] = (int)((temp_1 + temp_2) / 2);
|
||||
root["rhum"] = (int)((hum_1 + hum_2) / 2);
|
||||
root["channels"]["1"]["pm01"] = pm01_1;
|
||||
root["channels"]["1"]["pm02"] = pm25_1;
|
||||
root["channels"]["1"]["pm10"] = pm10_1;
|
||||
root["channels"]["1"]["pm003_count"] = pm03PCount_1;
|
||||
root["channels"]["1"]["atmp"] = temp_1;
|
||||
root["channels"]["1"]["rhum"] = hum_1;
|
||||
root["channels"]["2"]["pm01"] = pm01_2;
|
||||
root["channels"]["2"]["pm02"] = pm25_2;
|
||||
root["channels"]["2"]["pm10"] = pm10_2;
|
||||
root["channels"]["2"]["pm003_count"] = pm03PCount_2;
|
||||
root["channels"]["2"]["atmp"] = temp_2;
|
||||
root["channels"]["2"]["rhum"] = hum_2;
|
||||
}
|
||||
|
||||
/** Send data to sensor */
|
||||
if (agServer.postToServer(getDevId(), JSON.stringify(root))) {
|
||||
resetWatchdog();
|
||||
}
|
||||
loopCount++;
|
||||
}
|
||||
|
||||
void resetWatchdog() {
|
||||
Serial.println("Watchdog reset");
|
||||
ag.watchdog.reset();
|
||||
}
|
||||
|
||||
bool wifiMangerClientConnected(void) {
|
||||
return WiFi.softAPgetStationNum() ? true : false;
|
||||
}
|
||||
|
||||
// Wifi Manager
|
||||
void connectToWifi() {
|
||||
wifiSSID = "airgradient-" + String(getNormalizedMac());
|
||||
|
||||
wifiManager.setConfigPortalBlocking(false);
|
||||
wifiManager.setTimeout(WIFI_CONNECT_COUNTDOWN_MAX);
|
||||
|
||||
wifiManager.setAPCallback([](WiFiManager *obj) {
|
||||
/** This callback if wifi connnected failed and try to start configuration
|
||||
* portal */
|
||||
ledSmState = APP_SM_WIFI_MANAGER_MODE;
|
||||
});
|
||||
wifiManager.setSaveConfigCallback([]() {
|
||||
/** Wifi connected save the configuration */
|
||||
ledSmHandler(APP_SM_WIFI_MANAGER_STA_CONNECTED);
|
||||
});
|
||||
wifiManager.setSaveParamsCallback([]() {
|
||||
/** Wifi set connect: ssid, password */
|
||||
ledSmHandler(APP_SM_WIFI_MANAGER_STA_CONNECTING);
|
||||
});
|
||||
wifiManager.autoConnect(wifiSSID.c_str(), WIFI_HOTSPOT_PASSWORD_DEFAULT);
|
||||
|
||||
xTaskCreate(
|
||||
[](void *obj) {
|
||||
while (wifiManager.getConfigPortalActive()) {
|
||||
wifiManager.process();
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
},
|
||||
"wifi_cfg", 4096, NULL, 10, NULL);
|
||||
|
||||
uint32_t stimer = millis();
|
||||
bool clientConnectChanged = false;
|
||||
while (wifiManager.getConfigPortalActive()) {
|
||||
if (WiFi.isConnected() == false) {
|
||||
if (ledSmState == APP_SM_WIFI_MANAGER_MODE) {
|
||||
uint32_t ms = (uint32_t)(millis() - stimer);
|
||||
if (ms >= 100) {
|
||||
stimer = millis();
|
||||
ledSmHandler(ledSmState);
|
||||
}
|
||||
}
|
||||
|
||||
/** Check for client connect to change led color */
|
||||
bool clientConnected = wifiMangerClientConnected();
|
||||
if (clientConnected != clientConnectChanged) {
|
||||
clientConnectChanged = clientConnected;
|
||||
if (clientConnectChanged) {
|
||||
ledSmHandler(APP_SM_WIFI_MAMAGER_PORTAL_ACTIVE);
|
||||
} else {
|
||||
ledSmHandler(APP_SM_WIFI_MANAGER_MODE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Show display wifi connect result failed */
|
||||
ag.statusLed.setOff();
|
||||
delay(2000);
|
||||
if (WiFi.isConnected() == false) {
|
||||
ledSmHandler(APP_SM_WIFI_MANAGER_CONNECT_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
String getNormalizedMac() {
|
||||
String mac = WiFi.macAddress();
|
||||
mac.replace(":", "");
|
||||
mac.toLowerCase();
|
||||
return mac;
|
||||
}
|
||||
|
||||
void boardInit(void) {
|
||||
if (Wire.begin(ag.getI2cSdaPin(), ag.getI2cSclPin()) == false) {
|
||||
failedHandler("Init I2C failed");
|
||||
}
|
||||
|
||||
ag.watchdog.begin();
|
||||
|
||||
ag.button.begin();
|
||||
|
||||
ag.statusLed.begin();
|
||||
|
||||
/** detect sensor: PMS5003, PMS5003T, SGP41 and S8 */
|
||||
if (ag.s8.begin(Serial1) == false) {
|
||||
Serial.println("S8 not detect run mode 'PPT'");
|
||||
fw_mode = FW_MODE_PPT;
|
||||
|
||||
/** De-initialize Serial1 */
|
||||
Serial1.end();
|
||||
}
|
||||
if (ag.sgp41.begin(Wire) == false) {
|
||||
if (fw_mode == FW_MODE_PST) {
|
||||
failedHandler("Init SGP41 failed");
|
||||
} else {
|
||||
Serial.println("SGP41 not detect run mode 'PP'");
|
||||
fw_mode = FW_MODE_PP;
|
||||
}
|
||||
}
|
||||
|
||||
if (ag.pms5003t_1.begin(Serial0) == false) {
|
||||
failedHandler("Init PMS5003T_1 failed");
|
||||
}
|
||||
if (fw_mode != FW_MODE_PST) {
|
||||
if (ag.pms5003t_2.begin(Serial1) == false) {
|
||||
failedHandler("Init PMS5003T_2 failed");
|
||||
}
|
||||
}
|
||||
|
||||
if (fw_mode != FW_MODE_PST) {
|
||||
pmsSchedule.setPeriod(2000);
|
||||
}
|
||||
|
||||
Serial.printf("Firmware node: %s\r\n", getFwMode(fw_mode));
|
||||
}
|
||||
|
||||
void failedHandler(String msg) {
|
||||
while (true) {
|
||||
Serial.println(msg);
|
||||
vTaskDelay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void co2Calibration(void) {
|
||||
/** Count down for co2CalibCountdown secs */
|
||||
for (int i = 0; i < SENSOR_CO2_CALIB_COUNTDOWN_MAX; i++) {
|
||||
Serial.printf("Start CO2 calib after %d sec\r\n",
|
||||
SENSOR_CO2_CALIB_COUNTDOWN_MAX - i);
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
if (ag.s8.setBaselineCalibration()) {
|
||||
Serial.println("Calibration success");
|
||||
delay(1000);
|
||||
Serial.println("Wait for calib finish...");
|
||||
int count = 0;
|
||||
while (ag.s8.isBaseLineCalibrationDone() == false) {
|
||||
delay(1000);
|
||||
count++;
|
||||
}
|
||||
Serial.printf("Calib finish after %d sec\r\n", count);
|
||||
delay(2000);
|
||||
} else {
|
||||
Serial.println("Calibration failure!!!");
|
||||
delay(2000);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief WiFi reconnect handler
|
||||
*/
|
||||
static void updateWiFiConnect(void) {
|
||||
static uint32_t lastRetry;
|
||||
if (wifiHasConfig == false) {
|
||||
return;
|
||||
}
|
||||
if (WiFi.isConnected()) {
|
||||
lastRetry = millis();
|
||||
return;
|
||||
}
|
||||
uint32_t ms = (uint32_t)(millis() - lastRetry);
|
||||
if (ms >= WIFI_CONNECT_RETRY_MS) {
|
||||
lastRetry = millis();
|
||||
WiFi.reconnect();
|
||||
|
||||
Serial.printf("Re-Connect WiFi\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update tvocIndexindex
|
||||
*
|
||||
*/
|
||||
static void tvocPoll(void) {
|
||||
tvocIndex = ag.sgp41.getTvocIndex();
|
||||
noxIndex = ag.sgp41.getNoxIndex();
|
||||
|
||||
Serial.printf("tvocIndexindex: %d\r\n", tvocIndex);
|
||||
Serial.printf(" NOx index: %d\r\n", noxIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update PMS data
|
||||
*
|
||||
*/
|
||||
static void pmPoll(void) {
|
||||
if (fw_mode == FW_MODE_PST) {
|
||||
if (ag.pms5003t_1.readData()) {
|
||||
pm01_1 = ag.pms5003t_1.getPm01Ae();
|
||||
pm25_1 = ag.pms5003t_1.getPm25Ae();
|
||||
pm25_1 = ag.pms5003t_1.getPm10Ae();
|
||||
pm03PCount_1 = ag.pms5003t_1.getPm03ParticleCount();
|
||||
temp_1 = ag.pms5003t_1.getTemperature();
|
||||
hum_1 = ag.pms5003t_1.getRelativeHumidity();
|
||||
}
|
||||
} else {
|
||||
if (ag.pms5003t_1.readData() && ag.pms5003t_2.readData()) {
|
||||
pm1Value01 = pm1Value01 + ag.pms5003t_1.getPm01Ae();
|
||||
pm1Value25 = pm1Value25 + ag.pms5003t_1.getPm25Ae();
|
||||
pm1Value10 = pm1Value10 + ag.pms5003t_1.getPm10Ae();
|
||||
pm1PCount = pm1PCount + ag.pms5003t_1.getPm03ParticleCount();
|
||||
pm1temp = pm1temp + ag.pms5003t_1.getTemperature();
|
||||
pm1hum = pm1hum + ag.pms5003t_1.getRelativeHumidity();
|
||||
pm2Value01 = pm2Value01 + ag.pms5003t_2.getPm01Ae();
|
||||
pm2Value25 = pm2Value25 + ag.pms5003t_2.getPm25Ae();
|
||||
pm2Value10 = pm2Value10 + ag.pms5003t_2.getPm10Ae();
|
||||
pm2PCount = pm2PCount + ag.pms5003t_2.getPm03ParticleCount();
|
||||
pm2temp = pm2temp + ag.pms5003t_2.getTemperature();
|
||||
pm2hum = pm2hum + ag.pms5003t_2.getRelativeHumidity();
|
||||
countPosition++;
|
||||
if (countPosition == targetCount) {
|
||||
pm01_1 = pm1Value01 / targetCount;
|
||||
pm25_1 = pm1Value25 / targetCount;
|
||||
pm10_1 = pm1Value10 / targetCount;
|
||||
pm03PCount_1 = pm1PCount / targetCount;
|
||||
temp_1 = pm1temp / targetCount;
|
||||
hum_1 = pm1hum / targetCount;
|
||||
pm01_2 = pm2Value01 / targetCount;
|
||||
pm25_2 = pm2Value25 / targetCount;
|
||||
pm10_2 = pm2Value10 / targetCount;
|
||||
pm03PCount_2 = pm2PCount / targetCount;
|
||||
temp_2 = pm2temp / targetCount;
|
||||
hum_2 = pm2hum / targetCount;
|
||||
|
||||
countPosition = 0;
|
||||
|
||||
pm1Value01 = 0;
|
||||
pm1Value25 = 0;
|
||||
pm1Value10 = 0;
|
||||
pm1PCount = 0;
|
||||
pm1temp = 0;
|
||||
pm1hum = 0;
|
||||
pm2Value01 = 0;
|
||||
pm2Value25 = 0;
|
||||
pm2Value10 = 0;
|
||||
pm2PCount = 0;
|
||||
pm2temp = 0;
|
||||
pm2hum = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void co2Poll(void) {
|
||||
co2Ppm = ag.s8.getCo2();
|
||||
Serial.printf("CO2 index: %d\r\n", co2Ppm);
|
||||
}
|
||||
|
||||
static void serverConfigPoll(void) {
|
||||
if (agServer.pollServerConfig(getDevId())) {
|
||||
/** Only support CO2 S8 sensor on FW_MODE_PST */
|
||||
if (fw_mode == FW_MODE_PST) {
|
||||
if (agServer.isCo2Calib()) {
|
||||
co2Calibration();
|
||||
}
|
||||
if (agServer.getCo2Abccalib() > 0) {
|
||||
if (ag.s8.setAutoCalib(agServer.getCo2Abccalib() * 24) == false) {
|
||||
Serial.println("Set S8 auto calib failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static String getDevId(void) { return getNormalizedMac(); }
|
||||
|
||||
void ledBlinkDelay(uint32_t tdelay) {
|
||||
ag.statusLed.setOn();
|
||||
delay(tdelay);
|
||||
ag.statusLed.setOff();
|
||||
delay(tdelay);
|
||||
}
|
||||
|
||||
void ledSmHandler(int sm) {
|
||||
if (sm > APP_SM_NORMAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
ledSmState = sm;
|
||||
switch (sm) {
|
||||
case APP_SM_WIFI_MANAGER_MODE: {
|
||||
ag.statusLed.setToggle();
|
||||
break;
|
||||
}
|
||||
case APP_SM_WIFI_MAMAGER_PORTAL_ACTIVE: {
|
||||
ag.statusLed.setOn();
|
||||
break;
|
||||
}
|
||||
case APP_SM_WIFI_MANAGER_STA_CONNECTING: {
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
case APP_SM_WIFI_MANAGER_STA_CONNECTED: {
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
case APP_SM_WIFI_OK_SERVER_CONNECTING: {
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
case APP_SM_WIFI_OK_SERVER_CONNNECTED: {
|
||||
ag.statusLed.setOff();
|
||||
|
||||
/** two time slow blink, then off */
|
||||
for (int i = 0; i < 2; i++) {
|
||||
ledBlinkDelay(LED_SLOW_BLINK_DELAY);
|
||||
}
|
||||
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
case APP_SM_WIFI_MANAGER_CONNECT_FAILED: {
|
||||
/** Three time fast blink then 2 sec pause. Repeat 3 times */
|
||||
ag.statusLed.setOff();
|
||||
|
||||
for (int j = 0; j < 3; j++) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ledBlinkDelay(LED_FAST_BLINK_DELAY);
|
||||
}
|
||||
delay(2000);
|
||||
}
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
case APP_SM_WIFI_OK_SERVER_CONNECT_FAILED: {
|
||||
ag.statusLed.setOff();
|
||||
for (int j = 0; j < 3; j++) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
ledBlinkDelay(LED_FAST_BLINK_DELAY);
|
||||
}
|
||||
delay(2000);
|
||||
}
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
case APP_SM_WIFI_OK_SERVER_OK_SENSOR_CONFIG_FAILED: {
|
||||
ag.statusLed.setOff();
|
||||
for (int j = 0; j < 3; j++) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
ledBlinkDelay(LED_FAST_BLINK_DELAY);
|
||||
}
|
||||
delay(2000);
|
||||
}
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
case APP_SM_WIFI_LOST: {
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
case APP_SM_SERVER_LOST: {
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
case APP_SM_SENSOR_CONFIG_FAILED: {
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
case APP_SM_NORMAL: {
|
||||
ag.statusLed.setOff();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static const char *getFwMode(int mode) {
|
||||
switch (mode) {
|
||||
case FW_MODE_PST:
|
||||
return "FW_MODE_PST";
|
||||
case FW_MODE_PPT:
|
||||
return "FW_MODE_PPT";
|
||||
case FW_MODE_PP:
|
||||
return "FW_MODE_PP";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "FW_MODE_UNKNOW";
|
||||
}
|
@ -25,7 +25,7 @@ void setup()
|
||||
if (ag.s8.begin(&Serial) == false)
|
||||
{
|
||||
#else
|
||||
if (ag.s8.begin(Serial1) == false)
|
||||
if (ag.s8.begin(Serial0) == false)
|
||||
{
|
||||
#endif
|
||||
failedHandler("SenseAir S8 init failed");
|
||||
|
@ -10,8 +10,8 @@ CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
|
||||
#ifdef ESP8266
|
||||
AirGradient ag = AirGradient(DIY_BASIC);
|
||||
#else
|
||||
// AirGradient ag = AirGradient(ONE_INDOOR);
|
||||
AirGradient ag = AirGradient(OPEN_AIR_OUTDOOR);
|
||||
AirGradient ag = AirGradient(ONE_INDOOR);
|
||||
// AirGradient ag = AirGradient(OPEN_AIR_OUTDOOR);
|
||||
#endif
|
||||
|
||||
void failedHandler(String msg);
|
||||
@ -35,42 +35,56 @@ void setup() {
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t lastRead = 0;
|
||||
void loop() {
|
||||
int PM2;
|
||||
bool readResul = false;
|
||||
#ifdef ESP8266
|
||||
if (ag.pms5003.readData()) {
|
||||
PM2 = ag.pms5003.getPm25Ae();
|
||||
Serial.printf("PM2.5 in ug/m3: %d\r\n", PM2);
|
||||
Serial.printf("PM2.5 in US AQI: %d\r\n",
|
||||
ag.pms5003.convertPm25ToUsAqi(PM2));
|
||||
}
|
||||
#else
|
||||
if (ag.getBoardType() == OPEN_AIR_OUTDOOR) {
|
||||
if (ag.pms5003t_1.readData()) {
|
||||
PM2 = ag.pms5003t_1.getPm25Ae();
|
||||
readResul = true;
|
||||
}
|
||||
} else {
|
||||
if (ag.pms5003.readData()) {
|
||||
PM2 = ag.pms5003.getPm25Ae();
|
||||
readResul = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (readResul) {
|
||||
Serial.printf("PM2.5 in ug/m3: %d\r\n", PM2);
|
||||
if (ag.getBoardType() == OPEN_AIR_OUTDOOR) {
|
||||
Serial.printf("PM2.5 in US AQI: %d\r\n",
|
||||
ag.pms5003t_1.convertPm25ToUsAqi(PM2));
|
||||
} else {
|
||||
uint32_t ms = (uint32_t)(millis() - lastRead);
|
||||
if (ms >= 5000) {
|
||||
lastRead = millis();
|
||||
#ifdef ESP8266
|
||||
if (ag.pms5003.connected()) {
|
||||
PM2 = ag.pms5003.getPm25Ae();
|
||||
Serial.printf("PM2.5 in ug/m3: %d\r\n", PM2);
|
||||
Serial.printf("PM2.5 in US AQI: %d\r\n",
|
||||
ag.pms5003.convertPm25ToUsAqi(PM2));
|
||||
} else {
|
||||
Serial.println("PMS sensor failed");
|
||||
}
|
||||
#else
|
||||
if (ag.getBoardType() == OPEN_AIR_OUTDOOR) {
|
||||
if (ag.pms5003t_1.connected()) {
|
||||
PM2 = ag.pms5003t_1.getPm25Ae();
|
||||
readResul = true;
|
||||
}
|
||||
} else {
|
||||
if (ag.pms5003.connected()) {
|
||||
PM2 = ag.pms5003.getPm25Ae();
|
||||
readResul = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
delay(5000);
|
||||
if (readResul) {
|
||||
Serial.printf("PM2.5 in ug/m3: %d\r\n", PM2);
|
||||
if (ag.getBoardType() == OPEN_AIR_OUTDOOR) {
|
||||
Serial.printf("PM2.5 in US AQI: %d\r\n",
|
||||
ag.pms5003t_1.convertPm25ToUsAqi(PM2));
|
||||
} else {
|
||||
Serial.printf("PM2.5 in US AQI: %d\r\n",
|
||||
ag.pms5003.convertPm25ToUsAqi(PM2));
|
||||
}
|
||||
} else {
|
||||
Serial.println("PMS sensor failed");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ag.getBoardType() == OPEN_AIR_OUTDOOR) {
|
||||
ag.pms5003t_1.handle();
|
||||
} else {
|
||||
ag.pms5003.handle();
|
||||
}
|
||||
}
|
||||
|
||||
void failedHandler(String msg) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=AirGradient Air Quality Sensor
|
||||
version=3.0.3
|
||||
version=3.1.9
|
||||
author=AirGradient <support@airgradient.com>
|
||||
maintainer=AirGradient <support@airgradient.com>
|
||||
sentence=ESP32-C3 / ESP8266 library for air quality monitor measuring PM, CO2, Temperature, TVOC and Humidity with OLED display.
|
||||
|
7
partitions.csv
Normal file
7
partitions.csv
Normal file
@ -0,0 +1,7 @@
|
||||
# Name ,Type ,SubType ,Offset ,Size ,Flags
|
||||
nvs ,data ,nvs ,0x9000 ,0x5000 ,
|
||||
otadata ,data ,ota ,0xe000 ,0x2000 ,
|
||||
app0 ,app ,ota_0 ,0x10000 ,0x1E0000 ,
|
||||
app1 ,app ,ota_1 ,0x1F0000 ,0x1E0000 ,
|
||||
spiffs ,data ,spiffs ,0x3D0000 ,0x20000 ,
|
||||
coredump ,data ,coredump ,0x3F0000 ,0x10000 ,
|
|
53
platformio.ini
Normal file
53
platformio.ini
Normal file
@ -0,0 +1,53 @@
|
||||
; PlatformIO Project Configuration File
|
||||
;
|
||||
; Build options: build flags, source filter
|
||||
; Upload options: custom upload port, speed and extra flags
|
||||
; Library options: dependencies, extra library storages
|
||||
; Advanced options: extra scripting
|
||||
;
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[env:esp32-c3]
|
||||
platform = espressif32
|
||||
board = esp32-c3-devkitm-1
|
||||
framework = arduino
|
||||
; build_flags = !echo '-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 -D GIT_VERSION=\\"'$(git describe --tags --always --dirty)'\\"'
|
||||
build_flags = -D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1
|
||||
extra_scripts = pre:version.py
|
||||
board_build.partitions = partitions.csv
|
||||
monitor_speed = 115200
|
||||
lib_deps =
|
||||
aglib=symlink://../arduino
|
||||
EEPROM
|
||||
WebServer
|
||||
ESPmDNS
|
||||
FS
|
||||
SPIFFS
|
||||
HTTPClient
|
||||
WiFiClientSecure
|
||||
Update
|
||||
DNSServer
|
||||
|
||||
; [env:esp8266]
|
||||
; platform = espressif8266
|
||||
; board = d1_mini
|
||||
; framework = arduino
|
||||
; monitor_speed = 115200
|
||||
; lib_deps =
|
||||
; aglib=symlink://../arduino
|
||||
; EEPROM
|
||||
; ESP8266HTTPClient
|
||||
; ESP8266WebServer
|
||||
; DNSServer
|
||||
|
||||
monitor_filters = time
|
||||
|
||||
[platformio]
|
||||
src_dir = examples/OneOpenAir
|
||||
; src_dir = examples/BASIC
|
||||
; src_dir = examples/DiyProIndoorV4_2
|
||||
; src_dir = examples/DiyProIndoorV3_3
|
||||
; src_dir = examples/TestCO2
|
||||
; src_dir = examples/TestPM
|
||||
; src_dir = examples/TestSht
|
201
src/AgApiClient.cpp
Normal file
201
src/AgApiClient.cpp
Normal file
@ -0,0 +1,201 @@
|
||||
#include "AgApiClient.h"
|
||||
#include "AgConfigure.h"
|
||||
#include "AirGradient.h"
|
||||
#include "Libraries/Arduino_JSON/src/Arduino_JSON.h"
|
||||
#ifdef ESP8266
|
||||
#include <ESP8266HTTPClient.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#else
|
||||
#include <HTTPClient.h>
|
||||
#endif
|
||||
|
||||
AgApiClient::AgApiClient(Stream &debug, Configuration &config)
|
||||
: PrintLog(debug, "ApiClient"), config(config) {}
|
||||
|
||||
AgApiClient::~AgApiClient() {}
|
||||
|
||||
/**
|
||||
* @brief Initialize the API client
|
||||
*
|
||||
*/
|
||||
void AgApiClient::begin(void) {
|
||||
getConfigFailed = false;
|
||||
postToServerFailed = false;
|
||||
logInfo("Init apiRoot: " + apiRoot);
|
||||
logInfo("begin");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get configuration from AirGradient cloud
|
||||
*
|
||||
* @param deviceId Device ID
|
||||
* @return true Success
|
||||
* @return false Failure
|
||||
*/
|
||||
bool AgApiClient::fetchServerConfiguration(void) {
|
||||
if (config.getConfigurationControl() ==
|
||||
ConfigurationControl::ConfigurationControlLocal ||
|
||||
config.isOfflineMode()) {
|
||||
logWarning("Ignore fetch server configuration");
|
||||
|
||||
// Clear server configuration failed flag, cause it's ignore but not
|
||||
// really failed
|
||||
getConfigFailed = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
String uri = apiRoot + "/sensors/airgradient:" +
|
||||
ag->deviceId() + "/one/config";
|
||||
|
||||
/** Init http client */
|
||||
#ifdef ESP8266
|
||||
HTTPClient client;
|
||||
WiFiClient wifiClient;
|
||||
if (client.begin(wifiClient, uri) == false) {
|
||||
getConfigFailed = true;
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
HTTPClient client;
|
||||
client.setTimeout(timeoutMs);
|
||||
if (client.begin(uri) == false) {
|
||||
getConfigFailed = true;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Get data */
|
||||
int retCode = client.GET();
|
||||
|
||||
logInfo(String("GET: ") + uri);
|
||||
logInfo(String("Return code: ") + String(retCode));
|
||||
|
||||
if (retCode != 200) {
|
||||
client.end();
|
||||
getConfigFailed = true;
|
||||
|
||||
/** Return code 400 mean device not setup on cloud. */
|
||||
if (retCode == 400) {
|
||||
notAvailableOnDashboard = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** clear failed */
|
||||
getConfigFailed = false;
|
||||
notAvailableOnDashboard = false;
|
||||
|
||||
/** Get response string */
|
||||
String respContent = client.getString();
|
||||
client.end();
|
||||
|
||||
// logInfo("Get configuration: " + respContent);
|
||||
|
||||
/** Parse configuration and return result */
|
||||
return config.parse(respContent, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Post data to AirGradient cloud
|
||||
*
|
||||
* @param deviceId Device Id
|
||||
* @param data String JSON
|
||||
* @return true Success
|
||||
* @return false Failure
|
||||
*/
|
||||
bool AgApiClient::postToServer(String data) {
|
||||
if (config.isPostDataToAirGradient() == false) {
|
||||
logWarning("Ignore post data to server");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (WiFi.isConnected() == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String uri = apiRoot + "/sensors/airgradient:" + ag->deviceId() + "/measures";
|
||||
// logInfo("Post uri: " + uri);
|
||||
// logInfo("Post data: " + data);
|
||||
|
||||
WiFiClient wifiClient;
|
||||
HTTPClient client;
|
||||
client.setTimeout(timeoutMs);
|
||||
if (client.begin(wifiClient, uri.c_str()) == false) {
|
||||
logError("Init client failed");
|
||||
return false;
|
||||
}
|
||||
client.addHeader("content-type", "application/json");
|
||||
int retCode = client.POST(data);
|
||||
client.end();
|
||||
|
||||
logInfo(String("POST: ") + uri);
|
||||
logInfo(String("DATA: ") + data);
|
||||
logInfo(String("Return code: ") + String(retCode));
|
||||
|
||||
if ((retCode == 200) || (retCode == 429)) {
|
||||
postToServerFailed = false;
|
||||
return true;
|
||||
} else {
|
||||
logError("Post response failed code: " + String(retCode));
|
||||
}
|
||||
postToServerFailed = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get failed status when get configuration from AirGradient cloud
|
||||
*
|
||||
* @return true Success
|
||||
* @return false Failure
|
||||
*/
|
||||
bool AgApiClient::isFetchConfigureFailed(void) { return getConfigFailed; }
|
||||
|
||||
/**
|
||||
* @brief Get failed status when post data to AirGradient cloud
|
||||
*
|
||||
* @return true Success
|
||||
* @return false Failure
|
||||
*/
|
||||
bool AgApiClient::isPostToServerFailed(void) { return postToServerFailed; }
|
||||
|
||||
/**
|
||||
* @brief Get status device has available on dashboard or not. should get after
|
||||
* fetch configuration return failed
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool AgApiClient::isNotAvailableOnDashboard(void) {
|
||||
return notAvailableOnDashboard;
|
||||
}
|
||||
|
||||
void AgApiClient::setAirGradient(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
/**
|
||||
* @brief Send the package to check the connection with cloud
|
||||
*
|
||||
* @param rssi WiFi RSSI
|
||||
* @param bootCount Boot count
|
||||
* @return true Success
|
||||
* @return false Failure
|
||||
*/
|
||||
bool AgApiClient::sendPing(int rssi, int bootCount) {
|
||||
JSONVar root;
|
||||
root["wifi"] = rssi;
|
||||
root["boot"] = bootCount;
|
||||
return postToServer(JSON.stringify(root));
|
||||
}
|
||||
|
||||
String AgApiClient::getApiRoot() const { return apiRoot; }
|
||||
|
||||
void AgApiClient::setApiRoot(const String &apiRoot) { this->apiRoot = apiRoot; }
|
||||
|
||||
/**
|
||||
* @brief Set http request timeout. (Default: 10s)
|
||||
*
|
||||
* @param timeoutMs
|
||||
*/
|
||||
void AgApiClient::setTimeout(uint16_t timeoutMs) {
|
||||
this->timeoutMs = timeoutMs;
|
||||
}
|
47
src/AgApiClient.h
Normal file
47
src/AgApiClient.h
Normal file
@ -0,0 +1,47 @@
|
||||
/**
|
||||
* @file AgApiClient.h
|
||||
* @brief HTTP client connect post data to Aigradient cloud.
|
||||
* @version 0.1
|
||||
* @date 2024-Apr-02
|
||||
*
|
||||
* @copyright Copyright (c) 2024
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _AG_API_CLIENT_H_
|
||||
#define _AG_API_CLIENT_H_
|
||||
|
||||
#include "AgConfigure.h"
|
||||
#include "AirGradient.h"
|
||||
#include "Main/PrintLog.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
class AgApiClient : public PrintLog {
|
||||
private:
|
||||
Configuration &config;
|
||||
AirGradient *ag;
|
||||
String apiRoot = "http://hw.airgradient.com";
|
||||
|
||||
bool getConfigFailed;
|
||||
bool postToServerFailed;
|
||||
bool notAvailableOnDashboard = false; // Device not setup on Airgradient cloud dashboard.
|
||||
uint16_t timeoutMs = 10000; // Default set to 10s
|
||||
|
||||
public:
|
||||
AgApiClient(Stream &stream, Configuration &config);
|
||||
~AgApiClient();
|
||||
|
||||
void begin(void);
|
||||
bool fetchServerConfiguration(void);
|
||||
bool postToServer(String data);
|
||||
bool isFetchConfigureFailed(void);
|
||||
bool isPostToServerFailed(void);
|
||||
bool isNotAvailableOnDashboard(void);
|
||||
void setAirGradient(AirGradient *ag);
|
||||
bool sendPing(int rssi, int bootCount);
|
||||
String getApiRoot() const;
|
||||
void setApiRoot(const String &apiRoot);
|
||||
void setTimeout(uint16_t timeoutMs);
|
||||
};
|
||||
|
||||
#endif /** _AG_API_CLIENT_H_ */
|
1218
src/AgConfigure.cpp
Normal file
1218
src/AgConfigure.cpp
Normal file
File diff suppressed because it is too large
Load Diff
88
src/AgConfigure.h
Normal file
88
src/AgConfigure.h
Normal file
@ -0,0 +1,88 @@
|
||||
#ifndef _AG_CONFIG_H_
|
||||
#define _AG_CONFIG_H_
|
||||
|
||||
#include "App/AppDef.h"
|
||||
#include "Main/PrintLog.h"
|
||||
#include "AirGradient.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
class Configuration : public PrintLog {
|
||||
private:
|
||||
bool co2CalibrationRequested;
|
||||
bool ledBarTestRequested;
|
||||
bool udpated;
|
||||
String failedMessage;
|
||||
bool _noxLearnOffsetChanged;
|
||||
bool _tvocLearningOffsetChanged;
|
||||
bool ledBarBrightnessChanged = false;
|
||||
bool displayBrightnessChanged = false;
|
||||
String otaNewFirmwareVersion;
|
||||
bool _offlineMode = false;
|
||||
bool _ledBarModeChanged = false;
|
||||
|
||||
AirGradient* ag;
|
||||
|
||||
String getLedBarModeName(LedBarMode mode);
|
||||
void saveConfig(void);
|
||||
void loadConfig(void);
|
||||
void defaultConfig(void);
|
||||
void printConfig(void);
|
||||
String jsonTypeInvalidMessage(String name, String type);
|
||||
String jsonValueInvalidMessage(String name, String value);
|
||||
void jsonInvalid(void);
|
||||
void configLogInfo(String name, String fromValue, String toValue);
|
||||
String getPMStandardString(bool usaqi);
|
||||
String getAbcDayString(int value);
|
||||
void toConfig(const char* buf);
|
||||
|
||||
public:
|
||||
Configuration(Stream &debugLog);
|
||||
~Configuration();
|
||||
|
||||
bool hasSensorS8 = true;
|
||||
bool hasSensorPMS1 = true;
|
||||
bool hasSensorPMS2 = true;
|
||||
bool hasSensorSGP = true;
|
||||
bool hasSensorSHT = true;
|
||||
|
||||
bool begin(void);
|
||||
bool parse(String data, bool isLocal);
|
||||
String toString(void);
|
||||
String toString(AgFirmwareMode fwMode);
|
||||
bool isTemperatureUnitInF(void);
|
||||
String getCountry(void);
|
||||
bool isPmStandardInUSAQI(void);
|
||||
int getCO2CalibrationAbcDays(void);
|
||||
LedBarMode getLedBarMode(void);
|
||||
String getLedBarModeName(void);
|
||||
bool getDisplayMode(void);
|
||||
String getMqttBrokerUri(void);
|
||||
bool isPostDataToAirGradient(void);
|
||||
ConfigurationControl getConfigurationControl(void);
|
||||
bool isCo2CalibrationRequested(void);
|
||||
bool isLedBarTestRequested(void);
|
||||
void reset(void);
|
||||
String getModel(void);
|
||||
bool isUpdated(void);
|
||||
String getFailedMesage(void);
|
||||
void setPostToAirGradient(bool enable);
|
||||
bool noxLearnOffsetChanged(void);
|
||||
bool tvocLearnOffsetChanged(void);
|
||||
int getTvocLearningOffset(void);
|
||||
int getNoxLearningOffset(void);
|
||||
String wifiSSID(void);
|
||||
String wifiPass(void);
|
||||
void setAirGradient(AirGradient *ag);
|
||||
bool isLedBarBrightnessChanged(void);
|
||||
int getLedBarBrightness(void);
|
||||
bool isDisplayBrightnessChanged(void);
|
||||
int getDisplayBrightness(void);
|
||||
String newFirmwareVersion(void);
|
||||
bool isOfflineMode(void);
|
||||
void setOfflineMode(bool offline);
|
||||
void setOfflineModeWithoutSave(bool offline);
|
||||
bool isLedBarModeChanged(void);
|
||||
bool isMonitorDisplayCompensatedValues(void);
|
||||
};
|
||||
|
||||
#endif /** _AG_CONFIG_H_ */
|
552
src/AgOledDisplay.cpp
Normal file
552
src/AgOledDisplay.cpp
Normal file
@ -0,0 +1,552 @@
|
||||
#include "AgOledDisplay.h"
|
||||
#include "Libraries/U8g2/src/U8g2lib.h"
|
||||
#include "Main/utils.h"
|
||||
|
||||
/** Cast U8G2 */
|
||||
#define DISP() ((U8G2_SH1106_128X64_NONAME_F_HW_I2C *)(this->u8g2))
|
||||
|
||||
/**
|
||||
* @brief Show dashboard temperature and humdity
|
||||
*
|
||||
* @param hasStatus
|
||||
*/
|
||||
void OledDisplay::showTempHum(bool hasStatus, char *buf, int buf_size) {
|
||||
/** Temperature */
|
||||
if (utils::isValidTemperature(value.Temperature)) {
|
||||
float t = 0.0f;
|
||||
if (config.isTemperatureUnitInF()) {
|
||||
t = utils::degreeC_To_F(value.Temperature);
|
||||
} else {
|
||||
t = value.Temperature;
|
||||
}
|
||||
|
||||
if (config.isTemperatureUnitInF()) {
|
||||
if (hasStatus) {
|
||||
snprintf(buf, buf_size, "%0.1f", t);
|
||||
} else {
|
||||
snprintf(buf, buf_size, "%0.1f°F", t);
|
||||
}
|
||||
} else {
|
||||
if (hasStatus) {
|
||||
snprintf(buf, buf_size, "%.1f", t);
|
||||
} else {
|
||||
snprintf(buf, buf_size, "%.1f°C", t);
|
||||
}
|
||||
}
|
||||
} else { /** Show invalid value */
|
||||
if (config.isTemperatureUnitInF()) {
|
||||
snprintf(buf, buf_size, "-°F");
|
||||
} else {
|
||||
snprintf(buf, buf_size, "-°C");
|
||||
}
|
||||
}
|
||||
DISP()->drawUTF8(1, 10, buf);
|
||||
|
||||
/** Show humidity */
|
||||
if (utils::isValidHumidity(value.Humidity)) {
|
||||
snprintf(buf, buf_size, "%d%%", value.Humidity);
|
||||
} else {
|
||||
snprintf(buf, buf_size, "-%%");
|
||||
}
|
||||
|
||||
if (value.Humidity > 99) {
|
||||
DISP()->drawStr(97, 10, buf);
|
||||
} else {
|
||||
DISP()->drawStr(105, 10, buf);
|
||||
}
|
||||
}
|
||||
|
||||
void OledDisplay::setCentralText(int y, String text) {
|
||||
setCentralText(y, text.c_str());
|
||||
}
|
||||
|
||||
void OledDisplay::setCentralText(int y, const char *text) {
|
||||
int x = (DISP()->getWidth() - DISP()->getStrWidth(text)) / 2;
|
||||
DISP()->drawStr(x, y, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Construct a new Ag Oled Display:: Ag Oled Display object
|
||||
*
|
||||
* @param config AgConfiguration
|
||||
* @param value Measurements
|
||||
* @param log Serial Stream
|
||||
*/
|
||||
OledDisplay::OledDisplay(Configuration &config, Measurements &value,
|
||||
Stream &log)
|
||||
: PrintLog(log, "OledDisplay"), config(config), value(value) {}
|
||||
|
||||
/**
|
||||
* @brief Set AirGradient instance
|
||||
*
|
||||
* @param ag Point to AirGradient instance
|
||||
*/
|
||||
void OledDisplay::setAirGradient(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
OledDisplay::~OledDisplay() {}
|
||||
|
||||
/**
|
||||
* @brief Initialize display
|
||||
*
|
||||
* @return true Success
|
||||
* @return false Failure
|
||||
*/
|
||||
bool OledDisplay::begin(void) {
|
||||
if (isBegin) {
|
||||
logWarning("Already begin, call 'end' and try again");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||
/** Create u8g2 instance */
|
||||
u8g2 = new U8G2_SH1106_128X64_NONAME_F_HW_I2C(U8G2_R0, U8X8_PIN_NONE);
|
||||
if (u8g2 == NULL) {
|
||||
logError("Create 'U8G2' failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Init u8g2 */
|
||||
if (DISP()->begin() == false) {
|
||||
logError("U8G2 'begin' failed");
|
||||
return false;
|
||||
}
|
||||
} else if (ag->isBasic()) {
|
||||
logInfo("DIY_BASIC init");
|
||||
ag->display.begin(Wire);
|
||||
ag->display.setTextColor(1);
|
||||
ag->display.clear();
|
||||
ag->display.show();
|
||||
}
|
||||
|
||||
/** Show low brightness on startup. then it's completely turn off on main
|
||||
* application */
|
||||
int brightness = config.getDisplayBrightness();
|
||||
if (brightness == 0) {
|
||||
setBrightness(1);
|
||||
}
|
||||
|
||||
isBegin = true;
|
||||
logInfo("begin");
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Initialize display
|
||||
*
|
||||
*/
|
||||
void OledDisplay::end(void) {
|
||||
if (!isBegin) {
|
||||
logWarning("Already end, call 'begin' and try again");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||
/** Free u8g2 */
|
||||
delete DISP();
|
||||
u8g2 = NULL;
|
||||
} else if (ag->isBasic()) {
|
||||
ag->display.end();
|
||||
}
|
||||
|
||||
isBegin = false;
|
||||
logInfo("end");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Show text on 3 line of display
|
||||
*
|
||||
* @param line1
|
||||
* @param line2
|
||||
* @param line3
|
||||
*/
|
||||
void OledDisplay::setText(String &line1, String &line2, String &line3) {
|
||||
setText(line1.c_str(), line2.c_str(), line3.c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Show text on 3 line of display
|
||||
*
|
||||
* @param line1
|
||||
* @param line2
|
||||
* @param line3
|
||||
*/
|
||||
void OledDisplay::setText(const char *line1, const char *line2,
|
||||
const char *line3) {
|
||||
if (isDisplayOff) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||
DISP()->drawStr(1, 10, line1);
|
||||
DISP()->drawStr(1, 30, line2);
|
||||
DISP()->drawStr(1, 50, line3);
|
||||
} while (DISP()->nextPage());
|
||||
} else if (ag->isBasic()) {
|
||||
ag->display.clear();
|
||||
|
||||
ag->display.setCursor(1, 1);
|
||||
ag->display.setText(line1);
|
||||
ag->display.setCursor(1, 17);
|
||||
ag->display.setText(line2);
|
||||
ag->display.setCursor(1, 33);
|
||||
ag->display.setText(line3);
|
||||
|
||||
ag->display.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Text on 4 line
|
||||
*
|
||||
* @param line1
|
||||
* @param line2
|
||||
* @param line3
|
||||
* @param line4
|
||||
*/
|
||||
void OledDisplay::setText(String &line1, String &line2, String &line3,
|
||||
String &line4) {
|
||||
setText(line1.c_str(), line2.c_str(), line3.c_str(), line4.c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Text on 4 line
|
||||
*
|
||||
* @param line1
|
||||
* @param line2
|
||||
* @param line3
|
||||
* @param line4
|
||||
*/
|
||||
void OledDisplay::setText(const char *line1, const char *line2,
|
||||
const char *line3, const char *line4) {
|
||||
if (isDisplayOff) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||
DISP()->drawStr(1, 10, line1);
|
||||
DISP()->drawStr(1, 25, line2);
|
||||
DISP()->drawStr(1, 40, line3);
|
||||
DISP()->drawStr(1, 55, line4);
|
||||
} while (DISP()->nextPage());
|
||||
} else if (ag->isBasic()) {
|
||||
ag->display.clear();
|
||||
ag->display.setCursor(0, 0);
|
||||
ag->display.setText(line1);
|
||||
ag->display.setCursor(0, 10);
|
||||
ag->display.setText(line2);
|
||||
ag->display.setCursor(0, 20);
|
||||
ag->display.setText(line3);
|
||||
ag->display.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update dashboard content
|
||||
*
|
||||
*/
|
||||
void OledDisplay::showDashboard(void) { showDashboard(NULL); }
|
||||
|
||||
/**
|
||||
* @brief Update dashboard content and error status
|
||||
*
|
||||
*/
|
||||
void OledDisplay::showDashboard(const char *status) {
|
||||
if (isDisplayOff) {
|
||||
return;
|
||||
}
|
||||
|
||||
char strBuf[16];
|
||||
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||
if ((status == NULL) || (strlen(status) == 0)) {
|
||||
showTempHum(false, strBuf, sizeof(strBuf));
|
||||
} else {
|
||||
String strStatus = "Show status: " + String(status);
|
||||
logInfo(strStatus);
|
||||
|
||||
int strWidth = DISP()->getStrWidth(status);
|
||||
DISP()->drawStr((DISP()->getWidth() - strWidth) / 2, 10, status);
|
||||
|
||||
/** Show WiFi NA*/
|
||||
if (strcmp(status, "WiFi N/A") == 0) {
|
||||
DISP()->setFont(u8g2_font_t0_12_tf);
|
||||
showTempHum(true, strBuf, sizeof(strBuf));
|
||||
}
|
||||
}
|
||||
|
||||
/** Draw horizonal line */
|
||||
DISP()->drawLine(1, 13, 128, 13);
|
||||
|
||||
/** Show CO2 label */
|
||||
DISP()->setFont(u8g2_font_t0_12_tf);
|
||||
DISP()->drawUTF8(1, 27, "CO2");
|
||||
|
||||
DISP()->setFont(u8g2_font_t0_22b_tf);
|
||||
if (utils::isValidCO2(value.CO2)) {
|
||||
sprintf(strBuf, "%d", value.CO2);
|
||||
} else {
|
||||
sprintf(strBuf, "%s", "-");
|
||||
}
|
||||
DISP()->drawStr(1, 48, strBuf);
|
||||
|
||||
/** Show CO2 value index */
|
||||
DISP()->setFont(u8g2_font_t0_12_tf);
|
||||
DISP()->drawStr(1, 61, "ppm");
|
||||
|
||||
/** Draw vertical line */
|
||||
DISP()->drawLine(52, 14, 52, 64);
|
||||
DISP()->drawLine(97, 14, 97, 64);
|
||||
|
||||
/** Draw PM2.5 label */
|
||||
DISP()->setFont(u8g2_font_t0_12_tf);
|
||||
DISP()->drawStr(55, 27, "PM2.5");
|
||||
|
||||
/** Draw PM2.5 value */
|
||||
if (utils::isValidPm(value.pm25_1)) {
|
||||
int pm25 = value.pm25_1;
|
||||
|
||||
/** Compensate PM2.5 value. */
|
||||
if (config.hasSensorSHT && config.isMonitorDisplayCompensatedValues()) {
|
||||
pm25 = ag->pms5003.compensate(pm25, value.Humidity);
|
||||
logInfo("PM2.5 compensate: " + String(pm25));
|
||||
}
|
||||
|
||||
if (config.isPmStandardInUSAQI()) {
|
||||
sprintf(strBuf, "%d", ag->pms5003.convertPm25ToUsAqi(pm25));
|
||||
} else {
|
||||
sprintf(strBuf, "%d", pm25);
|
||||
}
|
||||
} else { /** Show invalid value. */
|
||||
sprintf(strBuf, "%s", "-");
|
||||
}
|
||||
DISP()->setFont(u8g2_font_t0_22b_tf);
|
||||
DISP()->drawStr(55, 48, strBuf);
|
||||
|
||||
/** Draw PM2.5 unit */
|
||||
DISP()->setFont(u8g2_font_t0_12_tf);
|
||||
if (config.isPmStandardInUSAQI()) {
|
||||
DISP()->drawUTF8(55, 61, "AQI");
|
||||
} else {
|
||||
DISP()->drawUTF8(55, 61, "ug/m³");
|
||||
}
|
||||
|
||||
/** Draw tvocIndexlabel */
|
||||
DISP()->setFont(u8g2_font_t0_12_tf);
|
||||
DISP()->drawStr(100, 27, "VOC:");
|
||||
|
||||
/** Draw tvocIndexvalue */
|
||||
if (utils::isValidVOC(value.TVOC)) {
|
||||
sprintf(strBuf, "%d", value.TVOC);
|
||||
} else {
|
||||
sprintf(strBuf, "%s", "-");
|
||||
}
|
||||
DISP()->drawStr(100, 39, strBuf);
|
||||
|
||||
/** Draw NOx label */
|
||||
DISP()->drawStr(100, 53, "NOx:");
|
||||
if (utils::isValidNOx(value.NOx)) {
|
||||
sprintf(strBuf, "%d", value.NOx);
|
||||
} else {
|
||||
sprintf(strBuf, "%s", "-");
|
||||
}
|
||||
DISP()->drawStr(100, 63, strBuf);
|
||||
} while (DISP()->nextPage());
|
||||
} else if (ag->isBasic()) {
|
||||
ag->display.clear();
|
||||
|
||||
/** Set CO2 */
|
||||
if (utils::isValidCO2(value.CO2)) {
|
||||
snprintf(strBuf, sizeof(strBuf), "CO2:%d", value.CO2);
|
||||
} else {
|
||||
snprintf(strBuf, sizeof(strBuf), "CO2:-");
|
||||
}
|
||||
|
||||
ag->display.setCursor(0, 0);
|
||||
ag->display.setText(strBuf);
|
||||
|
||||
/** Set PM */
|
||||
int pm25 = value.pm25_1;
|
||||
if (config.hasSensorSHT && config.isMonitorDisplayCompensatedValues()) {
|
||||
pm25 = (int)ag->pms5003.compensate(pm25, value.Humidity);
|
||||
}
|
||||
|
||||
ag->display.setCursor(0, 12);
|
||||
if (utils::isValidPm(pm25)) {
|
||||
snprintf(strBuf, sizeof(strBuf), "PM2.5:%d", pm25);
|
||||
} else {
|
||||
snprintf(strBuf, sizeof(strBuf), "PM2.5:-");
|
||||
}
|
||||
ag->display.setText(strBuf);
|
||||
|
||||
/** Set temperature and humidity */
|
||||
if (utils::isValidTemperature(value.Temperature)) {
|
||||
if (config.isTemperatureUnitInF()) {
|
||||
snprintf(strBuf, sizeof(strBuf), "T:%0.1f F",
|
||||
utils::degreeC_To_F(value.Temperature));
|
||||
} else {
|
||||
snprintf(strBuf, sizeof(strBuf), "T:%0.f1 C", value.Temperature);
|
||||
}
|
||||
} else {
|
||||
if (config.isTemperatureUnitInF()) {
|
||||
snprintf(strBuf, sizeof(strBuf), "T:-F");
|
||||
} else {
|
||||
snprintf(strBuf, sizeof(strBuf), "T:-C");
|
||||
}
|
||||
}
|
||||
|
||||
ag->display.setCursor(0, 24);
|
||||
ag->display.setText(strBuf);
|
||||
|
||||
if (utils::isValidHumidity(value.Humidity)) {
|
||||
snprintf(strBuf, sizeof(strBuf), "H:%d %%", (int)value.Humidity);
|
||||
} else {
|
||||
snprintf(strBuf, sizeof(strBuf), "H:- %%");
|
||||
}
|
||||
|
||||
ag->display.setCursor(0, 36);
|
||||
ag->display.setText(strBuf);
|
||||
|
||||
ag->display.show();
|
||||
}
|
||||
}
|
||||
|
||||
void OledDisplay::setBrightness(int percent) {
|
||||
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||
if (percent == 0) {
|
||||
isDisplayOff = true;
|
||||
|
||||
// Clear display.
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
} while (DISP()->nextPage());
|
||||
|
||||
} else {
|
||||
isDisplayOff = false;
|
||||
DISP()->setContrast((127 * percent) / 100);
|
||||
}
|
||||
} else if (ag->isBasic()) {
|
||||
if (percent == 0) {
|
||||
isDisplayOff = true;
|
||||
|
||||
// Clear display.
|
||||
ag->display.clear();
|
||||
ag->display.show();
|
||||
}
|
||||
else {
|
||||
isDisplayOff = false;
|
||||
ag->display.setContrast((255 * percent) / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ESP32
|
||||
void OledDisplay::showFirmwareUpdateVersion(String version) {
|
||||
if (isDisplayOff) {
|
||||
return;
|
||||
}
|
||||
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||
setCentralText(20, "Firmware Update");
|
||||
setCentralText(40, "New version");
|
||||
setCentralText(60, version.c_str());
|
||||
} while (DISP()->nextPage());
|
||||
}
|
||||
|
||||
void OledDisplay::showFirmwareUpdateProgress(int percent) {
|
||||
if (isDisplayOff) {
|
||||
return;
|
||||
}
|
||||
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||
setCentralText(20, "Firmware Update");
|
||||
setCentralText(50, String("Updating... ") + String(percent) + String("%"));
|
||||
} while (DISP()->nextPage());
|
||||
}
|
||||
|
||||
void OledDisplay::showFirmwareUpdateSuccess(int count) {
|
||||
if (isDisplayOff) {
|
||||
return;
|
||||
}
|
||||
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||
setCentralText(20, "Firmware Update");
|
||||
setCentralText(40, "Success");
|
||||
setCentralText(60, String("Rebooting... ") + String(count));
|
||||
} while (DISP()->nextPage());
|
||||
}
|
||||
|
||||
void OledDisplay::showFirmwareUpdateFailed(void) {
|
||||
if (isDisplayOff) {
|
||||
return;
|
||||
}
|
||||
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||
setCentralText(20, "Firmware Update");
|
||||
setCentralText(40, "fail, will retry");
|
||||
// setCentralText(60, "will retry");
|
||||
} while (DISP()->nextPage());
|
||||
}
|
||||
|
||||
void OledDisplay::showFirmwareUpdateSkipped(void) {
|
||||
if (isDisplayOff) {
|
||||
return;
|
||||
}
|
||||
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||
setCentralText(20, "Firmware Update");
|
||||
setCentralText(40, "skipped");
|
||||
} while (DISP()->nextPage());
|
||||
}
|
||||
|
||||
void OledDisplay::showFirmwareUpdateUpToDate(void) {
|
||||
if (isDisplayOff) {
|
||||
return;
|
||||
}
|
||||
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||
setCentralText(20, "Firmware Update");
|
||||
setCentralText(40, "up to date");
|
||||
} while (DISP()->nextPage());
|
||||
}
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
void OledDisplay::showRebooting(void) {
|
||||
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||
DISP()->firstPage();
|
||||
do {
|
||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||
// setCentralText(20, "Firmware Update");
|
||||
setCentralText(40, "Rebooting...");
|
||||
// setCentralText(60, String("Retry after 24h"));
|
||||
} while (DISP()->nextPage());
|
||||
} else if (ag->isBasic()) {
|
||||
ag->display.clear();
|
||||
|
||||
ag->display.setCursor(0, 20);
|
||||
ag->display.setText("Rebooting...");
|
||||
|
||||
ag->display.show();
|
||||
}
|
||||
}
|
52
src/AgOledDisplay.h
Normal file
52
src/AgOledDisplay.h
Normal file
@ -0,0 +1,52 @@
|
||||
#ifndef _AG_OLED_DISPLAY_H_
|
||||
#define _AG_OLED_DISPLAY_H_
|
||||
|
||||
#include "AgConfigure.h"
|
||||
#include "AgValue.h"
|
||||
#include "AirGradient.h"
|
||||
#include "Main/PrintLog.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
class OledDisplay : public PrintLog {
|
||||
private:
|
||||
Configuration &config;
|
||||
AirGradient *ag;
|
||||
bool isBegin = false;
|
||||
void *u8g2 = NULL;
|
||||
Measurements &value;
|
||||
bool isDisplayOff = false;
|
||||
|
||||
void showTempHum(bool hasStatus, char* buf, int buf_size);
|
||||
void setCentralText(int y, String text);
|
||||
void setCentralText(int y, const char *text);
|
||||
|
||||
public:
|
||||
OledDisplay(Configuration &config, Measurements &value,
|
||||
Stream &log);
|
||||
~OledDisplay();
|
||||
|
||||
void setAirGradient(AirGradient *ag);
|
||||
bool begin(void);
|
||||
void end(void);
|
||||
void setText(String &line1, String &line2, String &line3);
|
||||
void setText(const char *line1, const char *line2, const char *line3);
|
||||
void setText(String &line1, String &line2, String &line3, String &line4);
|
||||
void setText(const char *line1, const char *line2, const char *line3,
|
||||
const char *line4);
|
||||
void showDashboard(void);
|
||||
void showDashboard(const char *status);
|
||||
void setBrightness(int percent);
|
||||
#ifdef ESP32
|
||||
void showFirmwareUpdateVersion(String version);
|
||||
void showFirmwareUpdateProgress(int percent);
|
||||
void showFirmwareUpdateSuccess(int count);
|
||||
void showFirmwareUpdateFailed(void);
|
||||
void showFirmwareUpdateSkipped(void);
|
||||
void showFirmwareUpdateUpToDate(void);
|
||||
#else
|
||||
|
||||
#endif
|
||||
void showRebooting(void);
|
||||
};
|
||||
|
||||
#endif /** _AG_OLED_DISPLAY_H_ */
|
26
src/AgSchedule.cpp
Normal file
26
src/AgSchedule.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include "AgSchedule.h"
|
||||
|
||||
AgSchedule::AgSchedule(int period, void (*handler)(void))
|
||||
: period(period), handler(handler) {}
|
||||
|
||||
AgSchedule::~AgSchedule() {}
|
||||
|
||||
void AgSchedule::run(void) {
|
||||
uint32_t ms = (uint32_t)(millis() - count);
|
||||
if (ms >= period) {
|
||||
handler();
|
||||
count = millis();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set schedule period
|
||||
*
|
||||
* @param period Period in ms
|
||||
*/
|
||||
void AgSchedule::setPeriod(int period) { this->period = period; }
|
||||
|
||||
/**
|
||||
* @brief Update period
|
||||
*/
|
||||
void AgSchedule::update(void) { count = millis(); }
|
20
src/AgSchedule.h
Normal file
20
src/AgSchedule.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef _AG_SCHEDULE_H_
|
||||
#define _AG_SCHEDULE_H_
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
class AgSchedule {
|
||||
private:
|
||||
int period;
|
||||
void (*handler)(void);
|
||||
uint32_t count;
|
||||
|
||||
public:
|
||||
AgSchedule(int period, void (*handler)(void));
|
||||
~AgSchedule();
|
||||
void run(void);
|
||||
void update(void);
|
||||
void setPeriod(int period);
|
||||
};
|
||||
|
||||
#endif /** _AG_SCHEDULE_H_ */
|
821
src/AgStateMachine.cpp
Normal file
821
src/AgStateMachine.cpp
Normal file
@ -0,0 +1,821 @@
|
||||
#include "AgStateMachine.h"
|
||||
|
||||
#define LED_TEST_BLINK_DELAY 50 /** ms */
|
||||
#define LED_FAST_BLINK_DELAY 250 /** ms */
|
||||
#define LED_SLOW_BLINK_DELAY 1000 /** ms */
|
||||
#define LED_SHORT_BLINK_DELAY 500 /** ms */
|
||||
#define LED_LONG_BLINK_DELAY 2000 /** ms */
|
||||
|
||||
#define SENSOR_CO2_CALIB_COUNTDOWN_MAX 5 /** sec */
|
||||
|
||||
#define RGB_COLOR_R 255, 0, 0 /** Red */
|
||||
#define RGB_COLOR_G 0, 255, 0 /** Green */
|
||||
#define RGB_COLOR_Y 255, 150, 0 /** Yellow */
|
||||
#define RGB_COLOR_O 255, 40, 0 /** Orange */
|
||||
#define RGB_COLOR_P 180, 0, 255 /** Purple */
|
||||
|
||||
/**
|
||||
* @brief Animation LED bar with color
|
||||
*
|
||||
* @param r
|
||||
* @param g
|
||||
* @param b
|
||||
*/
|
||||
void StateMachine::ledBarSingleLedAnimation(uint8_t r, uint8_t g, uint8_t b) {
|
||||
if (ledBarAnimationCount < 0) {
|
||||
ledBarAnimationCount = 0;
|
||||
ag->ledBar.setColor(r, g, b, ledBarAnimationCount);
|
||||
} else {
|
||||
ledBarAnimationCount++;
|
||||
if (ledBarAnimationCount >= ag->ledBar.getNumberOfLeds()) {
|
||||
ledBarAnimationCount = 0;
|
||||
}
|
||||
ag->ledBar.setColor(r, g, b, ledBarAnimationCount);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LED status blink with delay
|
||||
*
|
||||
* @param ms Miliseconds
|
||||
*/
|
||||
void StateMachine::ledStatusBlinkDelay(uint32_t ms) {
|
||||
ag->statusLed.setOn();
|
||||
delay(ms);
|
||||
ag->statusLed.setOff();
|
||||
delay(ms);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Led bar show led color status
|
||||
*
|
||||
*/
|
||||
void StateMachine::sensorhandleLeds(void) {
|
||||
switch (config.getLedBarMode()) {
|
||||
case LedBarMode::LedBarModeCO2:
|
||||
co2handleLeds();
|
||||
break;
|
||||
case LedBarMode::LedBarModePm:
|
||||
pm25handleLeds();
|
||||
break;
|
||||
default:
|
||||
ag->ledBar.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Show CO2 LED status
|
||||
*
|
||||
*/
|
||||
void StateMachine::co2handleLeds(void) {
|
||||
int co2Value = value.CO2;
|
||||
if (co2Value <= 600) {
|
||||
/** G; 1 */
|
||||
ag->ledBar.setColor(RGB_COLOR_G, ag->ledBar.getNumberOfLeds() - 1);
|
||||
} else if (co2Value <= 800) {
|
||||
/** GG; 2 */
|
||||
ag->ledBar.setColor(RGB_COLOR_G, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_G, ag->ledBar.getNumberOfLeds() - 2);
|
||||
} else if (co2Value <= 1000) {
|
||||
/** YYY; 3 */
|
||||
ag->ledBar.setColor(RGB_COLOR_Y, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_Y, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_Y, ag->ledBar.getNumberOfLeds() - 3);
|
||||
} else if (co2Value <= 1250) {
|
||||
/** OOOO; 4 */
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 4);
|
||||
} else if (co2Value <= 1500) {
|
||||
/** OOOOO; 5 */
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 5);
|
||||
} else if (co2Value <= 1750) {
|
||||
/** RRRRRR; 6 */
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 5);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 6);
|
||||
} else if (co2Value <= 2000) {
|
||||
/** RRRRRRR; 7 */
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 5);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 6);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 7);
|
||||
} else if (co2Value <= 3000) {
|
||||
/** PPPPPPPP; 8 */
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 5);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 6);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 7);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 8);
|
||||
} else { /** > 3000 */
|
||||
/* PRPRPRPRP; 9 */
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 5);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 6);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 7);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 8);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 9);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Show PM2.5 LED status
|
||||
*
|
||||
*/
|
||||
void StateMachine::pm25handleLeds(void) {
|
||||
int pm25Value = value.pm25_1;
|
||||
if (config.isMonitorDisplayCompensatedValues() && config.hasSensorSHT) {
|
||||
pm25Value = ag->pms5003.compensate(value.pm25_1, value.Humidity);
|
||||
}
|
||||
|
||||
if (pm25Value < 5) {
|
||||
/** G; 1 */
|
||||
ag->ledBar.setColor(RGB_COLOR_G, ag->ledBar.getNumberOfLeds() - 1);
|
||||
} else if (pm25Value < 10) {
|
||||
/** GG; 2 */
|
||||
ag->ledBar.setColor(RGB_COLOR_G, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_G, ag->ledBar.getNumberOfLeds() - 2);
|
||||
} else if (pm25Value < 20) {
|
||||
/** YYY; 3 */
|
||||
ag->ledBar.setColor(RGB_COLOR_Y, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_Y, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_Y, ag->ledBar.getNumberOfLeds() - 3);
|
||||
} else if (pm25Value < 35) {
|
||||
/** YYYY; 4 */
|
||||
ag->ledBar.setColor(RGB_COLOR_Y, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_Y, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_Y, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_Y, ag->ledBar.getNumberOfLeds() - 4);
|
||||
} else if (pm25Value < 45) {
|
||||
/** OOOOO; 5 */
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 5);
|
||||
} else if (pm25Value < 55) {
|
||||
/** OOOOOO; 6 */
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 5);
|
||||
ag->ledBar.setColor(RGB_COLOR_O, ag->ledBar.getNumberOfLeds() - 6);
|
||||
} else if (pm25Value < 100) {
|
||||
/** RRRRRRR; 7 */
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 5);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 6);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 7);
|
||||
} else if (pm25Value < 200) {
|
||||
/** RRRRRRRR; 8 */
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 5);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 6);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 7);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 8);
|
||||
} else if (pm25Value < 250) {
|
||||
/** PPPPPPPPP; 9 */
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 5);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 6);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 7);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 8);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 9);
|
||||
} else { /** > 250 */
|
||||
/* PRPRPRPRP; 9 */
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 1);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 2);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 3);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 4);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 5);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 6);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 7);
|
||||
ag->ledBar.setColor(RGB_COLOR_R, ag->ledBar.getNumberOfLeds() - 8);
|
||||
ag->ledBar.setColor(RGB_COLOR_P, ag->ledBar.getNumberOfLeds() - 9);
|
||||
}
|
||||
}
|
||||
|
||||
void StateMachine::co2Calibration(void) {
|
||||
if (config.isCo2CalibrationRequested() && config.hasSensorS8) {
|
||||
logInfo("CO2 Calibration");
|
||||
|
||||
/** Count down to 0 then start */
|
||||
for (int i = 0; i < SENSOR_CO2_CALIB_COUNTDOWN_MAX; i++) {
|
||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3()) {
|
||||
String str =
|
||||
"after " + String(SENSOR_CO2_CALIB_COUNTDOWN_MAX - i) + " sec";
|
||||
disp.setText("Start CO2 calib", str.c_str(), "");
|
||||
} else if (ag->isBasic()) {
|
||||
String str = String(SENSOR_CO2_CALIB_COUNTDOWN_MAX - i) + " sec";
|
||||
disp.setText("CO2 Calib", "after", str.c_str());
|
||||
} else {
|
||||
logInfo("Start CO2 calib after " +
|
||||
String(SENSOR_CO2_CALIB_COUNTDOWN_MAX - i) + " sec");
|
||||
}
|
||||
delay(1000);
|
||||
}
|
||||
delay(2000);
|
||||
|
||||
if (ag->s8.setBaselineCalibration()) {
|
||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3()) {
|
||||
disp.setText("Calibration", "success", "");
|
||||
} else if (ag->isBasic()) {
|
||||
disp.setText("CO2 Calib", "success", "");
|
||||
} else {
|
||||
logInfo("CO2 Calibration: success");
|
||||
}
|
||||
delay(1000);
|
||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3() || ag->isBasic()) {
|
||||
disp.setText("Wait for", "calib done", "...");
|
||||
} else {
|
||||
logInfo("CO2 Calibration: Wait for calibration finish...");
|
||||
}
|
||||
|
||||
/** Count down wait for finish */
|
||||
int count = 0;
|
||||
while (ag->s8.isBaseLineCalibrationDone() == false) {
|
||||
delay(1000);
|
||||
count++;
|
||||
if (count >= 5) {
|
||||
Serial.println("Calibration Timeout");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3() || ag->isBasic()) {
|
||||
String str = "after " + String(count);
|
||||
disp.setText("Calib done", str.c_str(), "sec");
|
||||
} else {
|
||||
logInfo("CO2 Calibration: finish after " + String(count) + " sec");
|
||||
}
|
||||
delay(2000);
|
||||
} else {
|
||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3()) {
|
||||
disp.setText("Calibration", "failure!!!", "");
|
||||
} else if (ag->isBasic()) {
|
||||
disp.setText("CO2 calib", "failure!!!", "");
|
||||
} else {
|
||||
logInfo("CO2 Calibration: failure!!!");
|
||||
}
|
||||
delay(2000);
|
||||
}
|
||||
}
|
||||
|
||||
if (config.getCO2CalibrationAbcDays() >= 0 && config.hasSensorS8) {
|
||||
int newHour = config.getCO2CalibrationAbcDays() * 24;
|
||||
int curHour = ag->s8.getAbcPeriod();
|
||||
if (curHour != newHour) {
|
||||
String resultStr = "failure";
|
||||
if (ag->s8.setAbcPeriod(config.getCO2CalibrationAbcDays() * 24)) {
|
||||
resultStr = "successful";
|
||||
}
|
||||
String fromStr = String(curHour / 24) + " days";
|
||||
if (curHour == 0) {
|
||||
fromStr = "off";
|
||||
}
|
||||
String toStr = String(config.getCO2CalibrationAbcDays()) + " days";
|
||||
if (config.getCO2CalibrationAbcDays() == 0) {
|
||||
toStr = "off";
|
||||
}
|
||||
String msg =
|
||||
"Setting S8 from " + fromStr + " to " + toStr + " " + resultStr;
|
||||
logInfo(msg);
|
||||
}
|
||||
} else {
|
||||
logWarning("CO2 S8 not available, set 'abcDays' ignored");
|
||||
}
|
||||
}
|
||||
|
||||
void StateMachine::ledBarTest(void) {
|
||||
if (config.isLedBarTestRequested()) {
|
||||
if (ag->isOne()) {
|
||||
if (config.getCountry() == "TH") {
|
||||
uint32_t tstart = millis();
|
||||
logInfo("Start run LED test for 2 min");
|
||||
while (1) {
|
||||
ledBarRunTest();
|
||||
uint32_t ms = (uint32_t)(millis() - tstart);
|
||||
if (ms >= (60 * 1000 * 2)) {
|
||||
logInfo("LED test after 2 min finish");
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ledBarRunTest();
|
||||
}
|
||||
} else if (ag->isOpenAir()) {
|
||||
ledBarRunTest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StateMachine::ledBarPowerUpTest(void) { ledBarRunTest(); }
|
||||
|
||||
void StateMachine::ledBarRunTest(void) {
|
||||
if (ag->isOne()) {
|
||||
disp.setText("LED Test", "running", ".....");
|
||||
runLedTest('r');
|
||||
ag->ledBar.show();
|
||||
delay(1000);
|
||||
runLedTest('g');
|
||||
ag->ledBar.show();
|
||||
delay(1000);
|
||||
runLedTest('b');
|
||||
ag->ledBar.show();
|
||||
delay(1000);
|
||||
runLedTest('w');
|
||||
ag->ledBar.show();
|
||||
delay(1000);
|
||||
runLedTest('n');
|
||||
ag->ledBar.show();
|
||||
delay(1000);
|
||||
} else if (ag->isOpenAir()) {
|
||||
for (int i = 0; i < 100; i++) {
|
||||
ag->statusLed.setOn();
|
||||
delay(LED_TEST_BLINK_DELAY);
|
||||
ag->statusLed.setOff();
|
||||
delay(LED_TEST_BLINK_DELAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StateMachine::runLedTest(char color) {
|
||||
int r = 0;
|
||||
int g = 0;
|
||||
int b = 0;
|
||||
switch (color) {
|
||||
case 'g':
|
||||
g = 255;
|
||||
break;
|
||||
case 'y':
|
||||
r = 255;
|
||||
g = 255;
|
||||
break;
|
||||
case 'o':
|
||||
r = 255;
|
||||
g = 128;
|
||||
break;
|
||||
case 'r':
|
||||
r = 255;
|
||||
break;
|
||||
case 'b':
|
||||
b = 255;
|
||||
break;
|
||||
case 'w':
|
||||
r = 255;
|
||||
g = 255;
|
||||
b = 255;
|
||||
break;
|
||||
case 'p':
|
||||
r = 153;
|
||||
b = 153;
|
||||
break;
|
||||
case 'z':
|
||||
r = 102;
|
||||
break;
|
||||
case 'n':
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ag->ledBar.setColor(r, g, b);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Construct a new Ag State Machine:: Ag State Machine object
|
||||
*
|
||||
* @param disp OledDisplay
|
||||
* @param log Serial Stream
|
||||
* @param value Measurements
|
||||
* @param config Configuration
|
||||
*/
|
||||
StateMachine::StateMachine(OledDisplay &disp, Stream &log, Measurements &value,
|
||||
Configuration &config)
|
||||
: PrintLog(log, "StateMachine"), disp(disp), value(value), config(config) {}
|
||||
|
||||
StateMachine::~StateMachine() {}
|
||||
|
||||
/**
|
||||
* @brief OLED display show content from state value
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
void StateMachine::displayHandle(AgStateMachineState state) {
|
||||
// Ignore handle if not support display
|
||||
if (!(ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3() || ag->isBasic())) {
|
||||
if (state == AgStateMachineCo2Calibration) {
|
||||
co2Calibration();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (state > AgStateMachineNormal) {
|
||||
logError("displayHandle: State invalid");
|
||||
return;
|
||||
}
|
||||
|
||||
dispState = state;
|
||||
|
||||
switch (state) {
|
||||
case AgStateMachineWiFiManagerMode:
|
||||
case AgStateMachineWiFiManagerPortalActive: {
|
||||
if (wifiConnectCountDown >= 0) {
|
||||
if (ag->isBasic()) {
|
||||
String ssid = "\"airgradient-" + ag->deviceId() + "\" " +
|
||||
String(wifiConnectCountDown) + String("s");
|
||||
disp.setText("Connect tohotspot:", ssid.c_str(), "");
|
||||
} else {
|
||||
String line1 = String(wifiConnectCountDown) + "s to connect";
|
||||
String line2 = "to WiFi hotspot:";
|
||||
String line3 = "\"airgradient-";
|
||||
String line4 = ag->deviceId() + "\"";
|
||||
disp.setText(line1, line2, line3, line4);
|
||||
}
|
||||
wifiConnectCountDown--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiManagerStaConnecting: {
|
||||
disp.setText("Trying to", "connect to WiFi", "...");
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiManagerStaConnected: {
|
||||
disp.setText("WiFi connection", "successful", "");
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiOkServerConnecting: {
|
||||
if (ag->isBasic()) {
|
||||
disp.setText("Connecting", "to", "Server...");
|
||||
} else {
|
||||
disp.setText("Connecting to", "Server", "...");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiOkServerConnected: {
|
||||
disp.setText("Server", "connection", "successful");
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiManagerConnectFailed: {
|
||||
disp.setText("WiFi not", "connected", "");
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiOkServerConnectFailed: {
|
||||
// displayShowText("Server not", "reachable", "");
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiOkServerOkSensorConfigFailed: {
|
||||
if (ag->isBasic()) {
|
||||
disp.setText("Monitor", "not on", "dashboard");
|
||||
} else {
|
||||
disp.setText("Monitor not", "setup on", "dashboard");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiLost: {
|
||||
disp.showDashboard("WiFi N/A");
|
||||
break;
|
||||
}
|
||||
case AgStateMachineServerLost: {
|
||||
disp.showDashboard("AG Server N/A");
|
||||
break;
|
||||
}
|
||||
case AgStateMachineSensorConfigFailed: {
|
||||
if (addToDashBoard) {
|
||||
uint32_t ms = (uint32_t)(millis() - addToDashboardTime);
|
||||
if (ms >= 5000) {
|
||||
addToDashboardTime = millis();
|
||||
if (addToDashBoardToggle) {
|
||||
disp.showDashboard("Add to AG Dashb.");
|
||||
} else {
|
||||
disp.showDashboard(ag->deviceId().c_str());
|
||||
}
|
||||
addToDashBoardToggle = !addToDashBoardToggle;
|
||||
}
|
||||
} else {
|
||||
disp.showDashboard("");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineNormal: {
|
||||
disp.showDashboard();
|
||||
break;
|
||||
}
|
||||
case AgStateMachineCo2Calibration:
|
||||
co2Calibration();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief OLED display show content as previous state updated
|
||||
*
|
||||
*/
|
||||
void StateMachine::displayHandle(void) { displayHandle(dispState); }
|
||||
|
||||
/**
|
||||
* @brief Update status add to dashboard
|
||||
*
|
||||
*/
|
||||
void StateMachine::displaySetAddToDashBoard(void) {
|
||||
if (addToDashBoard == false) {
|
||||
addToDashboardTime = 0;
|
||||
addToDashBoardToggle = true;
|
||||
}
|
||||
addToDashBoard = true;
|
||||
}
|
||||
|
||||
void StateMachine::displayClearAddToDashBoard(void) { addToDashBoard = false; }
|
||||
|
||||
/**
|
||||
* @brief Set WiFi connection coundown on dashboard
|
||||
*
|
||||
* @param count Seconds
|
||||
*/
|
||||
void StateMachine::displayWiFiConnectCountDown(int count) {
|
||||
wifiConnectCountDown = count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Init before start LED bar animation
|
||||
*
|
||||
*/
|
||||
void StateMachine::ledAnimationInit(void) { ledBarAnimationCount = -1; }
|
||||
|
||||
/**
|
||||
* @brief Handle LED from state, only handle LED if board type is: One Indoor or
|
||||
* Open Air
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
void StateMachine::handleLeds(AgStateMachineState state) {
|
||||
/** Ignore if board type if not ONE_INDOOR or OPEN_AIR_OUTDOOR */
|
||||
if ((ag->getBoardType() != BoardType::ONE_INDOOR) &&
|
||||
(ag->getBoardType() != BoardType::OPEN_AIR_OUTDOOR)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (state > AgStateMachineNormal) {
|
||||
logError("ledHandle: state invalid");
|
||||
return;
|
||||
}
|
||||
|
||||
ledState = state;
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.clear(); // Set all LED OFF
|
||||
}
|
||||
switch (state) {
|
||||
case AgStateMachineWiFiManagerMode: {
|
||||
/** In WiFi Manager Mode */
|
||||
/** Turn LED OFF */
|
||||
/** Turn middle LED Color */
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.setColor(0, 0, 255, ag->ledBar.getNumberOfLeds() / 2);
|
||||
} else {
|
||||
ag->statusLed.setToggle();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiManagerPortalActive: {
|
||||
/** WiFi Manager has connected to mobile phone */
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.setColor(0, 0, 255);
|
||||
} else {
|
||||
ag->statusLed.setOn();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiManagerStaConnecting: {
|
||||
/** after SSID and PW entered and OK clicked, connection to WiFI network is
|
||||
* attempted */
|
||||
if (ag->isOne()) {
|
||||
ledBarSingleLedAnimation(255, 255, 255);
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiManagerStaConnected: {
|
||||
/** Connecting to WiFi worked */
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.setColor(255, 255, 255);
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiOkServerConnecting: {
|
||||
/** once connected to WiFi an attempt to reach the server is performed */
|
||||
if (ag->isOne()) {
|
||||
ledBarSingleLedAnimation(0, 255, 0);
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiOkServerConnected: {
|
||||
/** Server is reachable, all fine */
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.setColor(0, 255, 0);
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
|
||||
/** two time slow blink, then off */
|
||||
for (int i = 0; i < 2; i++) {
|
||||
ledStatusBlinkDelay(LED_SLOW_BLINK_DELAY);
|
||||
}
|
||||
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiManagerConnectFailed: {
|
||||
/** Cannot connect to WiFi (e.g. wrong password, WPA Enterprise etc.) */
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.setColor(255, 0, 0);
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
|
||||
for (int j = 0; j < 3; j++) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ledStatusBlinkDelay(LED_FAST_BLINK_DELAY);
|
||||
}
|
||||
delay(2000);
|
||||
}
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiOkServerConnectFailed: {
|
||||
/** Connected to WiFi but server not reachable, e.g. firewall block/
|
||||
* whitelisting needed etc. */
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.setColor(233, 183, 54); /** orange */
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
for (int j = 0; j < 3; j++) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
ledStatusBlinkDelay(LED_FAST_BLINK_DELAY);
|
||||
}
|
||||
delay(2000);
|
||||
}
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiOkServerOkSensorConfigFailed: {
|
||||
/** Server reachable but sensor not configured correctly */
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.setColor(139, 24, 248); /** violet */
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
for (int j = 0; j < 3; j++) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
ledStatusBlinkDelay(LED_FAST_BLINK_DELAY);
|
||||
}
|
||||
delay(2000);
|
||||
}
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineWiFiLost: {
|
||||
/** Connection to WiFi network failed credentials incorrect encryption not
|
||||
* supported etc. */
|
||||
if (ag->isOne()) {
|
||||
/** WIFI failed status LED color */
|
||||
ag->ledBar.setColor(255, 0, 0, 0);
|
||||
/** Show CO2 or PM color status */
|
||||
// sensorLedColorHandler();
|
||||
sensorhandleLeds();
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineServerLost: {
|
||||
/** Connected to WiFi network but the server cannot be reached through the
|
||||
* internet, e.g. blocked by firewall */
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.setColor(233, 183, 54, 0);
|
||||
|
||||
/** Show CO2 or PM color status */
|
||||
sensorhandleLeds();
|
||||
// sensorLedColorHandler();
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineSensorConfigFailed: {
|
||||
/** Server is reachable but there is some configuration issue to be fixed on
|
||||
* the server side */
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.setColor(139, 24, 248, 0);
|
||||
|
||||
/** Show CO2 or PM color status */
|
||||
sensorhandleLeds();
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineNormal: {
|
||||
if (ag->isOne()) {
|
||||
sensorhandleLeds();
|
||||
} else {
|
||||
ag->statusLed.setOff();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AgStateMachineLedBarTest:
|
||||
ledBarTest();
|
||||
break;
|
||||
case AgStateMachineLedBarPowerUpTest:
|
||||
ledBarPowerUpTest();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Show LED bar color
|
||||
if (ag->isOne()) {
|
||||
ag->ledBar.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Handle LED as previous state updated
|
||||
*
|
||||
*/
|
||||
void StateMachine::handleLeds(void) { handleLeds(ledState); }
|
||||
|
||||
/**
|
||||
* @brief Set display state
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
void StateMachine::setDisplayState(AgStateMachineState state) {
|
||||
dispState = state;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get current display state
|
||||
*
|
||||
* @return AgStateMachineState
|
||||
*/
|
||||
AgStateMachineState StateMachine::getDisplayState(void) { return dispState; }
|
||||
|
||||
/**
|
||||
* @brief Set AirGradient instance
|
||||
*
|
||||
* @param ag Point to AirGradient instance
|
||||
*/
|
||||
void StateMachine::setAirGradient(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
/**
|
||||
* @brief Get current LED state
|
||||
*
|
||||
* @return AgStateMachineState
|
||||
*/
|
||||
AgStateMachineState StateMachine::getLedState(void) { return ledState; }
|
||||
|
||||
void StateMachine::executeCo2Calibration(void) {
|
||||
Serial.println("state: " + String(AgStateMachineCo2Calibration));
|
||||
displayHandle(AgStateMachineCo2Calibration);
|
||||
}
|
||||
|
||||
void StateMachine::executeLedBarTest(void) {
|
||||
handleLeds(AgStateMachineLedBarTest);
|
||||
}
|
||||
|
||||
void StateMachine::executeLedBarPowerUpTest(void) {
|
||||
handleLeds(AgStateMachineLedBarPowerUpTest);
|
||||
}
|
57
src/AgStateMachine.h
Normal file
57
src/AgStateMachine.h
Normal file
@ -0,0 +1,57 @@
|
||||
#ifndef _AG_STATE_MACHINE_H_
|
||||
#define _AG_STATE_MACHINE_H_
|
||||
|
||||
#include "AgOledDisplay.h"
|
||||
#include "AgValue.h"
|
||||
#include "AgConfigure.h"
|
||||
#include "Main/PrintLog.h"
|
||||
#include "App/AppDef.h"
|
||||
|
||||
class StateMachine : public PrintLog {
|
||||
private:
|
||||
// AgStateMachineState state;
|
||||
AgStateMachineState ledState;
|
||||
AgStateMachineState dispState;
|
||||
AirGradient *ag;
|
||||
OledDisplay &disp;
|
||||
Measurements &value;
|
||||
Configuration &config;
|
||||
bool addToDashBoard = false;
|
||||
bool addToDashBoardToggle = false;
|
||||
uint32_t addToDashboardTime;
|
||||
int wifiConnectCountDown;
|
||||
int ledBarAnimationCount;
|
||||
|
||||
void ledBarSingleLedAnimation(uint8_t r, uint8_t g, uint8_t b);
|
||||
void ledStatusBlinkDelay(uint32_t delay);
|
||||
void sensorhandleLeds(void);
|
||||
void co2handleLeds(void);
|
||||
void pm25handleLeds(void);
|
||||
void co2Calibration(void);
|
||||
void ledBarTest(void);
|
||||
void ledBarPowerUpTest(void);
|
||||
void ledBarRunTest(void);
|
||||
void runLedTest(char color);
|
||||
|
||||
public:
|
||||
StateMachine(OledDisplay &disp, Stream &log,
|
||||
Measurements &value, Configuration& config);
|
||||
~StateMachine();
|
||||
void setAirGradient(AirGradient* ag);
|
||||
void displayHandle(AgStateMachineState state);
|
||||
void displayHandle(void);
|
||||
void displaySetAddToDashBoard(void);
|
||||
void displayClearAddToDashBoard(void);
|
||||
void displayWiFiConnectCountDown(int count);
|
||||
void ledAnimationInit(void);
|
||||
void handleLeds(AgStateMachineState state);
|
||||
void handleLeds(void);
|
||||
void setDisplayState(AgStateMachineState state);
|
||||
AgStateMachineState getDisplayState(void);
|
||||
AgStateMachineState getLedState(void);
|
||||
void executeCo2Calibration(void);
|
||||
void executeLedBarTest(void);
|
||||
void executeLedBarPowerUpTest(void);
|
||||
};
|
||||
|
||||
#endif /** _AG_STATE_MACHINE_H_ */
|
414
src/AgValue.cpp
Normal file
414
src/AgValue.cpp
Normal file
@ -0,0 +1,414 @@
|
||||
#include "AgValue.h"
|
||||
#include "AgConfigure.h"
|
||||
#include "AirGradient.h"
|
||||
#include "Main/utils.h"
|
||||
#include "Libraries/Arduino_JSON/src/Arduino_JSON.h"
|
||||
|
||||
#define json_prop_pmFirmware "firmware"
|
||||
|
||||
/**
|
||||
* @brief Get PMS5003 firmware version string
|
||||
*
|
||||
* @param fwCode
|
||||
* @return String
|
||||
*/
|
||||
String Measurements::pms5003FirmwareVersion(int fwCode) {
|
||||
return pms5003FirmwareVersionBase("PMS5003x", fwCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get PMS5003T firmware version string
|
||||
*
|
||||
* @param fwCode
|
||||
* @return String
|
||||
*/
|
||||
String Measurements::pms5003TFirmwareVersion(int fwCode) {
|
||||
return pms5003FirmwareVersionBase("PMS5003x", fwCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get firmware version string
|
||||
*
|
||||
* @param prefix Prefix firmware string
|
||||
* @param fwCode Version code
|
||||
* @return string
|
||||
*/
|
||||
String Measurements::pms5003FirmwareVersionBase(String prefix, int fwCode) {
|
||||
return prefix + String("-") + String(fwCode);
|
||||
}
|
||||
|
||||
String Measurements::toString(bool localServer, AgFirmwareMode fwMode, int rssi,
|
||||
void *_ag, void *_config) {
|
||||
AirGradient *ag = (AirGradient *)_ag;
|
||||
Configuration *config = (Configuration *)_config;
|
||||
|
||||
JSONVar root;
|
||||
root["wifi"] = rssi;
|
||||
if (localServer) {
|
||||
root["serialno"] = ag->deviceId();
|
||||
}
|
||||
|
||||
if (config->hasSensorS8 && utils::isValidCO2(this->CO2)) {
|
||||
root["rco2"] = this->CO2;
|
||||
}
|
||||
|
||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3() || ag->isBasic()) {
|
||||
if (config->hasSensorPMS1) {
|
||||
if (utils::isValidPm(this->pm01_1)) {
|
||||
root["pm01"] = this->pm01_1;
|
||||
}
|
||||
if (utils::isValidPm(this->pm25_1)) {
|
||||
root["pm02"] = this->pm25_1;
|
||||
}
|
||||
if (utils::isValidPm(this->pm10_1)) {
|
||||
root["pm10"] = this->pm10_1;
|
||||
}
|
||||
if (utils::isValidPm03Count(this->pm03PCount_1)) {
|
||||
root["pm003Count"] = this->pm03PCount_1;
|
||||
}
|
||||
if (!localServer) {
|
||||
|
||||
root[json_prop_pmFirmware] =
|
||||
this->pms5003FirmwareVersion(ag->pms5003.getFirmwareVersion());
|
||||
}
|
||||
}
|
||||
|
||||
if (config->hasSensorSHT) {
|
||||
if (utils::isValidTemperature(this->Temperature)) {
|
||||
root["atmp"] = ag->round2(this->Temperature);
|
||||
if (localServer) {
|
||||
root["atmpCompensated"] = ag->round2(this->Temperature);
|
||||
}
|
||||
}
|
||||
if (utils::isValidHumidity(this->Humidity)) {
|
||||
root["rhum"] = this->Humidity;
|
||||
if (localServer) {
|
||||
root["rhumCompensated"] = this->Humidity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config->hasSensorSHT && config->hasSensorPMS1) {
|
||||
int pm25 = ag->pms5003.compensate(this->pm25_1, this->Humidity);
|
||||
if (pm25 >= 0) {
|
||||
root["pm02Compensated"] = pm25;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (config->hasSensorPMS1 && config->hasSensorPMS2) {
|
||||
if (utils::isValidPm(this->pm01_1) && utils::isValidPm(this->pm01_2)) {
|
||||
root["pm01"] = ag->round2((this->pm01_1 + this->pm01_2) / 2.0f);
|
||||
}
|
||||
if (utils::isValidPm(this->pm25_1) && utils::isValidPm(this->pm25_2)) {
|
||||
root["pm02"] = ag->round2((this->pm25_1 + this->pm25_2) / 2.0f);
|
||||
}
|
||||
if (utils::isValidPm(this->pm10_1) && utils::isValidPm(this->pm10_2)) {
|
||||
root["pm10"] = ag->round2((this->pm10_1 + this->pm10_2) / 2.0f);
|
||||
}
|
||||
if (utils::isValidPm(this->pm03PCount_1) && utils::isValidPm(this->pm03PCount_2)) {
|
||||
root["pm003Count"] = ag->round2((this->pm03PCount_1 + this->pm03PCount_2) / 2.0f);
|
||||
}
|
||||
|
||||
float val;
|
||||
if (utils::isValidTemperature(this->temp_1) && utils::isValidTemperature(this->temp_1)) {
|
||||
root["atmp"] = ag->round2((this->temp_1 + this->temp_2) / 2.0f);
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_2.compensateTemp((this->temp_1 + this->temp_2) / 2.0f);
|
||||
if (utils::isValidTemperature(val)) {
|
||||
root["atmpCompensated"] = ag->round2(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (utils::isValidHumidity(this->hum_1) && utils::isValidHumidity(this->hum_1)) {
|
||||
root["rhum"] = ag->round2((this->hum_1 + this->hum_2) / 2.0f);
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_2.compensateHum((this->hum_1 + this->hum_2) / 2.0f);
|
||||
if (utils::isValidHumidity(val)) {
|
||||
root["rhumCompensated"] = (int)val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int pm25 = (ag->pms5003t_1.compensate(this->pm25_1, this->hum_1) +
|
||||
ag->pms5003t_2.compensate(this->pm25_2, this->hum_2)) /
|
||||
2;
|
||||
root["pm02Compensated"] = pm25;
|
||||
}
|
||||
|
||||
if (fwMode == FW_MODE_O_1PS || fwMode == FW_MODE_O_1PST) {
|
||||
float val;
|
||||
if (config->hasSensorPMS1) {
|
||||
if (utils::isValidPm(this->pm01_1)) {
|
||||
root["pm01"] = this->pm01_1;
|
||||
}
|
||||
if (utils::isValidPm(this->pm25_1)) {
|
||||
root["pm02"] = this->pm25_1;
|
||||
}
|
||||
if (utils::isValidPm(this->pm10_1)) {
|
||||
root["pm10"] = this->pm10_1;
|
||||
}
|
||||
if (utils::isValidPm03Count(this->pm03PCount_1)) {
|
||||
root["pm003Count"] = this->pm03PCount_1;
|
||||
}
|
||||
if (utils::isValidTemperature(this->temp_1)) {
|
||||
root["atmp"] = ag->round2(this->temp_1);
|
||||
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_1.compensateTemp(this->temp_1);
|
||||
if (utils::isValidTemperature(val)) {
|
||||
root["atmpCompensated"] = ag->round2(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (utils::isValidHumidity(this->hum_1)) {
|
||||
root["rhum"] = this->hum_1;
|
||||
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_1.compensateHum(this->hum_1);
|
||||
if (utils::isValidHumidity(val)) {
|
||||
root["rhumCompensated"] = (int)val;
|
||||
}
|
||||
}
|
||||
}
|
||||
root["pm02Compensated"] = ag->pms5003t_1.compensate(this->pm25_1, this->hum_1);
|
||||
if (!localServer) {
|
||||
root[json_prop_pmFirmware] =
|
||||
pms5003TFirmwareVersion(ag->pms5003t_1.getFirmwareVersion());
|
||||
}
|
||||
}
|
||||
if (config->hasSensorPMS2) {
|
||||
if(utils::isValidPm(this->pm01_2)) {
|
||||
root["pm01"] = this->pm01_2;
|
||||
}
|
||||
if(utils::isValidPm(this->pm25_2)) {
|
||||
root["pm02"] = this->pm25_2;
|
||||
}
|
||||
if(utils::isValidPm(this->pm10_2)) {
|
||||
root["pm10"] = this->pm10_2;
|
||||
}
|
||||
if(utils::isValidPm03Count(this->pm03PCount_2)) {
|
||||
root["pm003Count"] = this->pm03PCount_2;
|
||||
}
|
||||
|
||||
float val;
|
||||
if (utils::isValidTemperature(this->temp_2)) {
|
||||
root["atmp"] = ag->round2(this->temp_2);
|
||||
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_2.compensateTemp(this->temp_2);
|
||||
if (utils::isValidTemperature(val)) {
|
||||
root["atmpCompensated"] = ag->round2(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(utils::isValidHumidity(this->hum_2)) {
|
||||
root["rhum"] = this->hum_2;
|
||||
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_2.compensateHum(this->hum_2);
|
||||
if (utils::isValidHumidity(val)) {
|
||||
root["rhumCompensated"] = (int)val;
|
||||
}
|
||||
}
|
||||
}
|
||||
root["pm02Compensated"] = ag->pms5003t_2.compensate(this->pm25_2, this->hum_2);
|
||||
if(!localServer) {
|
||||
root[json_prop_pmFirmware] =
|
||||
pms5003TFirmwareVersion(ag->pms5003t_1.getFirmwareVersion());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (fwMode == FW_MODE_O_1P) {
|
||||
float val;
|
||||
if (config->hasSensorPMS1) {
|
||||
if (utils::isValidPm(this->pm01_1)) {
|
||||
root["pm01"] = this->pm01_1;
|
||||
}
|
||||
if (utils::isValidPm(this->pm25_1)) {
|
||||
root["pm02"] = this->pm25_1;
|
||||
}
|
||||
if (utils::isValidPm(this->pm10_1)) {
|
||||
root["pm10"] = this->pm10_1;
|
||||
}
|
||||
if (utils::isValidPm03Count(this->pm03PCount_1)) {
|
||||
root["pm003Count"] = this->pm03PCount_1;
|
||||
}
|
||||
if (utils::isValidTemperature(this->temp_1)) {
|
||||
root["atmp"] = ag->round2(this->temp_1);
|
||||
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_1.compensateTemp(this->temp_1);
|
||||
if (utils::isValidTemperature(val)) {
|
||||
root["atmpCompensated"] = ag->round2(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (utils::isValidHumidity(this->hum_1)) {
|
||||
root["rhum"] = this->hum_1;
|
||||
if(localServer) {
|
||||
val = ag->pms5003t_1.compensateHum(this->hum_1);
|
||||
if(utils::isValidHumidity(val)) {
|
||||
root["rhumCompensated"] = (int)val;
|
||||
}
|
||||
}
|
||||
}
|
||||
root["pm02Compensated"] = ag->pms5003t_1.compensate(this->pm25_1, this->hum_1);
|
||||
if(!localServer) {
|
||||
root[json_prop_pmFirmware] =
|
||||
pms5003TFirmwareVersion(ag->pms5003t_1.getFirmwareVersion());
|
||||
}
|
||||
} else if (config->hasSensorPMS2) {
|
||||
if(utils::isValidPm(this->pm01_2)) {
|
||||
root["pm01"] = this->pm01_2;
|
||||
}
|
||||
if(utils::isValidPm(this->pm25_2)) {
|
||||
root["pm02"] = this->pm25_2;
|
||||
}
|
||||
if(utils::isValidPm(this->pm10_2)) {
|
||||
root["pm10"] = this->pm10_2;
|
||||
}
|
||||
if(utils::isValidPm03Count(this->pm03PCount_2)) {
|
||||
root["pm003Count"] = this->pm03PCount_2;
|
||||
}
|
||||
if (utils::isValidTemperature(this->temp_2)) {
|
||||
root["atmp"] = ag->round2(this->temp_2);
|
||||
if (localServer) {
|
||||
|
||||
val = ag->pms5003t_1.compensateTemp(this->temp_2);
|
||||
if (utils::isValidTemperature(val)) {
|
||||
root["atmpCompensated"] = ag->round2(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (utils::isValidHumidity(this->hum_2)) {
|
||||
root["rhum"] = this->hum_2;
|
||||
|
||||
if(localServer) {
|
||||
val = ag->pms5003t_1.compensateHum(this->hum_2);
|
||||
if(utils::isValidHumidity(val)) {
|
||||
root["rhumCompensated"] = (int)val;
|
||||
}
|
||||
}
|
||||
}
|
||||
root["pm02Compensated"] = ag->pms5003t_1.compensate(this->pm25_1, this->hum_1);
|
||||
if(!localServer) {
|
||||
root[json_prop_pmFirmware] =
|
||||
pms5003TFirmwareVersion(ag->pms5003t_2.getFirmwareVersion());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
float val;
|
||||
if (config->hasSensorPMS1) {
|
||||
if(utils::isValidPm(this->pm01_1)) {
|
||||
root["channels"]["1"]["pm01"] = this->pm01_1;
|
||||
}
|
||||
if(utils::isValidPm(this->pm25_1)) {
|
||||
root["channels"]["1"]["pm02"] = this->pm25_1;
|
||||
}
|
||||
if(utils::isValidPm(this->pm10_1)) {
|
||||
root["channels"]["1"]["pm10"] = this->pm10_1;
|
||||
}
|
||||
if (utils::isValidPm03Count(this->pm03PCount_1)) {
|
||||
root["channels"]["1"]["pm003Count"] = this->pm03PCount_1;
|
||||
}
|
||||
if(utils::isValidTemperature(this->temp_1)) {
|
||||
root["channels"]["1"]["atmp"] = ag->round2(this->temp_1);
|
||||
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_1.compensateTemp(this->temp_1);
|
||||
if (utils::isValidTemperature(val)) {
|
||||
root["channels"]["1"]["atmpCompensated"] = ag->round2(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (utils::isValidHumidity(this->hum_1)) {
|
||||
root["channels"]["1"]["rhum"] = this->hum_1;
|
||||
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_1.compensateHum(this->hum_1);
|
||||
if (utils::isValidHumidity(val)) {
|
||||
root["channels"]["1"]["rhumCompensated"] = (int)val;
|
||||
}
|
||||
}
|
||||
}
|
||||
root["channels"]["1"]["pm02Compensated"] = ag->pms5003t_1.compensate(this->pm25_1, this->hum_1);
|
||||
|
||||
// PMS5003T version
|
||||
if(!localServer) {
|
||||
root["channels"]["1"][json_prop_pmFirmware] =
|
||||
pms5003TFirmwareVersion(ag->pms5003t_1.getFirmwareVersion());
|
||||
}
|
||||
}
|
||||
if (config->hasSensorPMS2) {
|
||||
float val;
|
||||
if (utils::isValidPm(this->pm01_2)) {
|
||||
root["channels"]["2"]["pm01"] = this->pm01_2;
|
||||
}
|
||||
if (utils::isValidPm(this->pm25_2)) {
|
||||
root["channels"]["2"]["pm02"] = this->pm25_2;
|
||||
}
|
||||
if (utils::isValidPm(this->pm10_2)) {
|
||||
root["channels"]["2"]["pm10"] = this->pm10_2;
|
||||
}
|
||||
if (utils::isValidPm03Count(this->pm03PCount_2)) {
|
||||
root["channels"]["2"]["pm003Count"] = this->pm03PCount_2;
|
||||
}
|
||||
if (utils::isValidTemperature(this->temp_2)) {
|
||||
root["channels"]["2"]["atmp"] = ag->round2(this->temp_2);
|
||||
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_1.compensateTemp(this->temp_2);
|
||||
if (utils::isValidTemperature(val)) {
|
||||
root["channels"]["2"]["atmpCompensated"] = ag->round2(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (utils::isValidHumidity(this->hum_2)) {
|
||||
root["channels"]["2"]["rhum"] = this->hum_2;
|
||||
|
||||
if (localServer) {
|
||||
val = ag->pms5003t_1.compensateHum(this->hum_2);
|
||||
if (utils::isValidHumidity(val)) {
|
||||
root["channels"]["2"]["rhumCompensated"] = (int)val;
|
||||
}
|
||||
}
|
||||
}
|
||||
root["channels"]["2"]["pm02Compensated"] = ag->pms5003t_2.compensate(this->pm25_2, this->hum_2);
|
||||
// PMS5003T version
|
||||
if(!localServer) {
|
||||
root["channels"]["2"][json_prop_pmFirmware] =
|
||||
pms5003TFirmwareVersion(ag->pms5003t_2.getFirmwareVersion());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config->hasSensorSGP) {
|
||||
if (utils::isValidVOC(this->TVOC)) {
|
||||
root["tvocIndex"] = this->TVOC;
|
||||
}
|
||||
if (utils::isValidVOC(this->TVOCRaw)) {
|
||||
root["tvocRaw"] = this->TVOCRaw;
|
||||
}
|
||||
if (utils::isValidNOx(this->NOx)) {
|
||||
root["noxIndex"] = this->NOx;
|
||||
}
|
||||
if (utils::isValidNOx(this->NOxRaw)) {
|
||||
root["noxRaw"] = this->NOxRaw;
|
||||
}
|
||||
}
|
||||
root["boot"] = bootCount;
|
||||
root["bootCount"] = bootCount;
|
||||
|
||||
if (localServer) {
|
||||
if (ag->isOne()) {
|
||||
root["ledMode"] = config->getLedBarModeName();
|
||||
}
|
||||
root["firmware"] = ag->getVersion();
|
||||
root["model"] = AgFirmwareModeName(fwMode);
|
||||
}
|
||||
|
||||
return JSON.stringify(root);
|
||||
}
|
79
src/AgValue.h
Normal file
79
src/AgValue.h
Normal file
@ -0,0 +1,79 @@
|
||||
#ifndef _AG_VALUE_H_
|
||||
#define _AG_VALUE_H_
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "App/AppDef.h"
|
||||
|
||||
class Measurements {
|
||||
private:
|
||||
String pms5003FirmwareVersion(int fwCode);
|
||||
String pms5003TFirmwareVersion(int fwCode);
|
||||
String pms5003FirmwareVersionBase(String prefix, int fwCode);
|
||||
public:
|
||||
Measurements() {
|
||||
pm25_1 = -1;
|
||||
pm01_1 = -1;
|
||||
pm10_1 = -1;
|
||||
pm03PCount_1 = -1;
|
||||
temp_1 = -1001;
|
||||
hum_1 = -1;
|
||||
|
||||
pm25_2 = -1;
|
||||
pm01_2 = -1;
|
||||
pm10_2 = -1;
|
||||
pm03PCount_2 = -1;
|
||||
temp_2 = -1001;
|
||||
hum_2 = -1;
|
||||
|
||||
Temperature = -1001;
|
||||
Humidity = -1;
|
||||
CO2 = -1;
|
||||
TVOC = -1;
|
||||
TVOCRaw = -1;
|
||||
NOx = -1;
|
||||
NOxRaw = -1;
|
||||
}
|
||||
~Measurements() {}
|
||||
|
||||
float Temperature;
|
||||
int Humidity;
|
||||
int CO2;
|
||||
int TVOC;
|
||||
int TVOCRaw;
|
||||
int NOx;
|
||||
int NOxRaw;
|
||||
|
||||
int pm25_1;
|
||||
int pm01_1;
|
||||
int pm10_1;
|
||||
int pm03PCount_1;
|
||||
float temp_1;
|
||||
int hum_1;
|
||||
|
||||
int pm25_2;
|
||||
int pm01_2;
|
||||
int pm10_2;
|
||||
int pm03PCount_2;
|
||||
float temp_2;
|
||||
int hum_2;
|
||||
|
||||
int pm1Value01;
|
||||
int pm1Value25;
|
||||
int pm1Value10;
|
||||
int pm1PCount;
|
||||
int pm1temp;
|
||||
int pm1hum;
|
||||
int pm2Value01;
|
||||
int pm2Value25;
|
||||
int pm2Value10;
|
||||
int pm2PCount;
|
||||
int pm2temp;
|
||||
int pm2hum;
|
||||
int countPosition;
|
||||
const int targetCount = 20;
|
||||
int bootCount;
|
||||
|
||||
String toString(bool isLocal, AgFirmwareMode fwMode, int rssi, void* _ag, void* _config);
|
||||
};
|
||||
|
||||
#endif /** _AG_VALUE_H_ */
|
415
src/AgWiFiConnector.cpp
Normal file
415
src/AgWiFiConnector.cpp
Normal file
@ -0,0 +1,415 @@
|
||||
#include "AgWiFiConnector.h"
|
||||
#include "Libraries/WiFiManager/WiFiManager.h"
|
||||
|
||||
#define WIFI_CONNECT_COUNTDOWN_MAX 180
|
||||
#define WIFI_HOTSPOT_PASSWORD_DEFAULT "cleanair"
|
||||
|
||||
#define WIFI() ((WiFiManager *)(this->wifi))
|
||||
|
||||
/**
|
||||
* @brief Set reference AirGradient instance
|
||||
*
|
||||
* @param ag Point to AirGradient instance
|
||||
*/
|
||||
void WifiConnector::setAirGradient(AirGradient *ag) { this->ag = ag; }
|
||||
|
||||
/**
|
||||
* @brief Construct a new Ag Wi Fi Connector:: Ag Wi Fi Connector object
|
||||
*
|
||||
* @param disp OledDisplay
|
||||
* @param log Stream
|
||||
* @param sm StateMachine
|
||||
*/
|
||||
WifiConnector::WifiConnector(OledDisplay &disp, Stream &log, StateMachine &sm,
|
||||
Configuration &config)
|
||||
: PrintLog(log, "WifiConnector"), disp(disp), sm(sm), config(config) {}
|
||||
|
||||
WifiConnector::~WifiConnector() {}
|
||||
|
||||
/**
|
||||
* @brief Connection to WIFI AP process. Just call one times
|
||||
*
|
||||
* @return true Success
|
||||
* @return false Failure
|
||||
*/
|
||||
bool WifiConnector::connect(void) {
|
||||
if (wifi == NULL) {
|
||||
wifi = new WiFiManager();
|
||||
if (wifi == NULL) {
|
||||
logError("Create 'WiFiManger' failed");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
WiFi.begin();
|
||||
String wifiSSID = WIFI()->getWiFiSSID(true);
|
||||
if (wifiSSID.isEmpty()) {
|
||||
logInfo("Connected WiFi is empty, connect to default wifi \"" +
|
||||
String(this->defaultSsid) + String("\""));
|
||||
|
||||
/** Set wifi connect */
|
||||
WiFi.begin(this->defaultSsid, this->defaultPassword);
|
||||
|
||||
/** Wait for wifi connect to AP */
|
||||
int count = 0;
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(1000);
|
||||
count++;
|
||||
if (count >= 15) {
|
||||
logError("Try connect to default wifi \"" + String(this->defaultSsid) +
|
||||
String("\" failed"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WIFI()->setConfigPortalBlocking(false);
|
||||
WIFI()->setConnectTimeout(15);
|
||||
WIFI()->setTimeout(WIFI_CONNECT_COUNTDOWN_MAX);
|
||||
|
||||
WIFI()->setAPCallback([this](WiFiManager *obj) { _wifiApCallback(); });
|
||||
WIFI()->setSaveConfigCallback([this]() { _wifiSaveConfig(); });
|
||||
WIFI()->setSaveParamsCallback([this]() { _wifiSaveParamCallback(); });
|
||||
WIFI()->setConfigPortalTimeoutCallback([this]() {_wifiTimeoutCallback();});
|
||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3() || ag->isBasic()) {
|
||||
disp.setText("Connecting to", "WiFi", "...");
|
||||
} else {
|
||||
logInfo("Connecting to WiFi...");
|
||||
}
|
||||
ssid = "airgradient-" + ag->deviceId();
|
||||
|
||||
// ssid = "AG-" + String(ESP.getChipId(), HEX);
|
||||
WIFI()->setConfigPortalTimeout(WIFI_CONNECT_COUNTDOWN_MAX);
|
||||
|
||||
WiFiManagerParameter postToAg("chbPostToAg",
|
||||
"Prevent Connection to AirGradient Server", "T",
|
||||
2, "type=\"checkbox\" ", WFM_LABEL_AFTER);
|
||||
WIFI()->addParameter(&postToAg);
|
||||
WiFiManagerParameter postToAgInfo(
|
||||
"<p>Prevent connection to the AirGradient Server. Important: Only enable "
|
||||
"it if you are sure you don't want to use any AirGradient cloud "
|
||||
"features. As a result you will not receive automatic firmware updates "
|
||||
"and your data will not reach the AirGradient dashboard.</p>");
|
||||
WIFI()->addParameter(&postToAgInfo);
|
||||
|
||||
WIFI()->autoConnect(ssid.c_str(), WIFI_HOTSPOT_PASSWORD_DEFAULT);
|
||||
|
||||
logInfo("Wait for configure portal");
|
||||
|
||||
#ifdef ESP32
|
||||
// Task handle WiFi connection.
|
||||
xTaskCreate(
|
||||
[](void *obj) {
|
||||
WifiConnector *connector = (WifiConnector *)obj;
|
||||
while (connector->_wifiConfigPortalActive()) {
|
||||
connector->_wifiProcess();
|
||||
vTaskDelay(1);
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
},
|
||||
"wifi_cfg", 4096, this, 10, NULL);
|
||||
|
||||
/** Wait for WiFi connect and show LED, display status */
|
||||
uint32_t dispPeriod = millis();
|
||||
uint32_t ledPeriod = millis();
|
||||
bool clientConnectChanged = false;
|
||||
|
||||
AgStateMachineState stateOld = sm.getDisplayState();
|
||||
while (WIFI()->getConfigPortalActive()) {
|
||||
/** LED animatoin and display update content */
|
||||
if (WiFi.isConnected() == false) {
|
||||
/** Display countdown */
|
||||
uint32_t ms;
|
||||
if (ag->isOne()) {
|
||||
ms = (uint32_t)(millis() - dispPeriod);
|
||||
if (ms >= 1000) {
|
||||
dispPeriod = millis();
|
||||
sm.displayHandle();
|
||||
} else {
|
||||
if (stateOld != sm.getDisplayState()) {
|
||||
stateOld = sm.getDisplayState();
|
||||
sm.displayHandle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** LED animations */
|
||||
ms = (uint32_t)(millis() - ledPeriod);
|
||||
if (ms >= 100) {
|
||||
ledPeriod = millis();
|
||||
sm.handleLeds();
|
||||
}
|
||||
|
||||
/** Check for client connect to change led color */
|
||||
bool clientConnected = wifiClientConnected();
|
||||
if (clientConnected != clientConnectChanged) {
|
||||
clientConnectChanged = clientConnected;
|
||||
if (clientConnectChanged) {
|
||||
sm.handleLeds(AgStateMachineWiFiManagerPortalActive);
|
||||
} else {
|
||||
sm.ledAnimationInit();
|
||||
sm.handleLeds(AgStateMachineWiFiManagerMode);
|
||||
if (ag->isOne()) {
|
||||
sm.displayHandle(AgStateMachineWiFiManagerMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delay(1); // avoid watchdog timer reset.
|
||||
}
|
||||
#else
|
||||
_wifiProcess();
|
||||
#endif
|
||||
|
||||
/** Show display wifi connect result failed */
|
||||
if (WiFi.isConnected() == false) {
|
||||
sm.handleLeds(AgStateMachineWiFiManagerConnectFailed);
|
||||
if (ag->isOne() || ag->isPro4_2() || ag->isPro3_3() || ag->isBasic()) {
|
||||
sm.displayHandle(AgStateMachineWiFiManagerConnectFailed);
|
||||
}
|
||||
delay(6000);
|
||||
} else {
|
||||
hasConfig = true;
|
||||
logInfo("WiFi Connected: " + WiFi.SSID() + " IP: " + localIpStr());
|
||||
|
||||
if (hasPortalConfig) {
|
||||
String result = String(postToAg.getValue());
|
||||
logInfo("Setting postToAirGradient set from " +
|
||||
String(config.isPostDataToAirGradient() ? "True" : "False") +
|
||||
String(" to ") + String(result != "T" ? "True" : "False") +
|
||||
String(" successful"));
|
||||
config.setPostToAirGradient(result != "T");
|
||||
}
|
||||
hasPortalConfig = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disconnect to current connected WiFi AP
|
||||
*
|
||||
*/
|
||||
void WifiConnector::disconnect(void) {
|
||||
if (WiFi.isConnected()) {
|
||||
logInfo("Disconnect");
|
||||
WiFi.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Has wifi STA connected to WIFI softAP (this device)
|
||||
*
|
||||
* @return true Connected
|
||||
* @return false Not connected
|
||||
*/
|
||||
bool WifiConnector::wifiClientConnected(void) {
|
||||
return WiFi.softAPgetStationNum() ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Handle WiFiManage softAP setup completed callback
|
||||
*
|
||||
*/
|
||||
void WifiConnector::_wifiApCallback(void) {
|
||||
sm.displayWiFiConnectCountDown(WIFI_CONNECT_COUNTDOWN_MAX);
|
||||
sm.setDisplayState(AgStateMachineWiFiManagerMode);
|
||||
sm.ledAnimationInit();
|
||||
sm.handleLeds(AgStateMachineWiFiManagerMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Handle WiFiManager save configuration callback
|
||||
*
|
||||
*/
|
||||
void WifiConnector::_wifiSaveConfig(void) {
|
||||
sm.setDisplayState(AgStateMachineWiFiManagerStaConnected);
|
||||
sm.handleLeds(AgStateMachineWiFiManagerStaConnected);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Handle WiFiManager save parameter callback
|
||||
*
|
||||
*/
|
||||
void WifiConnector::_wifiSaveParamCallback(void) {
|
||||
sm.ledAnimationInit();
|
||||
sm.handleLeds(AgStateMachineWiFiManagerStaConnecting);
|
||||
sm.setDisplayState(AgStateMachineWiFiManagerStaConnecting);
|
||||
hasPortalConfig = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check that WiFiManager Configure portal active
|
||||
*
|
||||
* @return true Active
|
||||
* @return false Not-Active
|
||||
*/
|
||||
bool WifiConnector::_wifiConfigPortalActive(void) {
|
||||
return WIFI()->getConfigPortalActive();
|
||||
}
|
||||
void WifiConnector::_wifiTimeoutCallback(void) { connectorTimeout = true; }
|
||||
|
||||
/**
|
||||
* @brief Process WiFiManager connection
|
||||
*
|
||||
*/
|
||||
void WifiConnector::_wifiProcess() {
|
||||
#ifdef ESP32
|
||||
WIFI()->process();
|
||||
#else
|
||||
/** Wait for WiFi connect and show LED, display status */
|
||||
uint32_t dispPeriod = millis();
|
||||
uint32_t ledPeriod = millis();
|
||||
bool clientConnectChanged = false;
|
||||
AgStateMachineState stateOld = sm.getDisplayState();
|
||||
|
||||
while (WIFI()->getConfigPortalActive()) {
|
||||
WIFI()->process();
|
||||
|
||||
if (WiFi.isConnected() == false) {
|
||||
/** Display countdown */
|
||||
uint32_t ms;
|
||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3() || ag->isBasic()) {
|
||||
ms = (uint32_t)(millis() - dispPeriod);
|
||||
if (ms >= 1000) {
|
||||
dispPeriod = millis();
|
||||
sm.displayHandle();
|
||||
logInfo("displayHandle state: " + String(sm.getDisplayState()));
|
||||
} else {
|
||||
if (stateOld != sm.getDisplayState()) {
|
||||
stateOld = sm.getDisplayState();
|
||||
sm.displayHandle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** LED animations */
|
||||
ms = (uint32_t)(millis() - ledPeriod);
|
||||
if (ms >= 100) {
|
||||
ledPeriod = millis();
|
||||
sm.handleLeds();
|
||||
}
|
||||
|
||||
/** Check for client connect to change led color */
|
||||
bool clientConnected = wifiClientConnected();
|
||||
if (clientConnected != clientConnectChanged) {
|
||||
clientConnectChanged = clientConnected;
|
||||
if (clientConnectChanged) {
|
||||
sm.handleLeds(AgStateMachineWiFiManagerPortalActive);
|
||||
} else {
|
||||
sm.ledAnimationInit();
|
||||
sm.handleLeds(AgStateMachineWiFiManagerMode);
|
||||
if (ag->isOne()) {
|
||||
sm.displayHandle(AgStateMachineWiFiManagerMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delay(1);
|
||||
}
|
||||
|
||||
// TODO This is for basic
|
||||
if (ag->getBoardType() == DIY_BASIC) {
|
||||
if (!WiFi.isConnected()) {
|
||||
// disp.setText("Booting", "offline", "mode");
|
||||
Serial.println("failed to connect and hit timeout");
|
||||
delay(2500);
|
||||
} else {
|
||||
hasConfig = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Handle and reconnect WiFi
|
||||
*
|
||||
*/
|
||||
void WifiConnector::handle(void) {
|
||||
// Ignore if WiFi is not configured
|
||||
if (hasConfig == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (WiFi.isConnected()) {
|
||||
lastRetry = millis();
|
||||
return;
|
||||
}
|
||||
|
||||
/** Retry connect WiFi each 10sec */
|
||||
uint32_t ms = (uint32_t)(millis() - lastRetry);
|
||||
if (ms >= 10000) {
|
||||
lastRetry = millis();
|
||||
WiFi.reconnect();
|
||||
logInfo("Re-Connect WiFi");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Is WiFi connected
|
||||
*
|
||||
* @return true Connected
|
||||
* @return false Disconnected
|
||||
*/
|
||||
bool WifiConnector::isConnected(void) { return WiFi.isConnected(); }
|
||||
|
||||
/**
|
||||
* @brief Reset WiFi configuretion and connection, disconnect wifi before call
|
||||
* this method
|
||||
*
|
||||
*/
|
||||
void WifiConnector::reset(void) {
|
||||
if(this->wifi == NULL) {
|
||||
this->wifi = new WiFiManager();
|
||||
if(this->wifi == NULL){
|
||||
logInfo("reset failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
WIFI()->resetSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get wifi RSSI
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int WifiConnector::RSSI(void) { return WiFi.RSSI(); }
|
||||
|
||||
/**
|
||||
* @brief Get WIFI IP as string format ex: 192.168.1.1
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
String WifiConnector::localIpStr(void) { return WiFi.localIP().toString(); }
|
||||
|
||||
/**
|
||||
* @brief Get status that wifi has configurated
|
||||
*
|
||||
* @return true Configurated
|
||||
* @return false Not Configurated
|
||||
*/
|
||||
bool WifiConnector::hasConfigurated(void) {
|
||||
if (WiFi.SSID().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get WiFi connection porttal timeout.
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool WifiConnector::isConfigurePorttalTimeout(void) { return connectorTimeout; }
|
||||
|
||||
/**
|
||||
* @brief Set wifi connect to default WiFi
|
||||
*
|
||||
*/
|
||||
void WifiConnector::setDefault(void) {
|
||||
WiFi.begin("airgradient", "cleanair");
|
||||
}
|
55
src/AgWiFiConnector.h
Normal file
55
src/AgWiFiConnector.h
Normal file
@ -0,0 +1,55 @@
|
||||
#ifndef _AG_WIFI_CONNECTOR_H_
|
||||
#define _AG_WIFI_CONNECTOR_H_
|
||||
|
||||
#include "AgOledDisplay.h"
|
||||
#include "AgStateMachine.h"
|
||||
#include "AirGradient.h"
|
||||
#include "AgConfigure.h"
|
||||
#include "Main/PrintLog.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
class WifiConnector : public PrintLog {
|
||||
private:
|
||||
AirGradient *ag;
|
||||
OledDisplay &disp;
|
||||
StateMachine &sm;
|
||||
Configuration &config;
|
||||
|
||||
String ssid;
|
||||
void *wifi = NULL;
|
||||
bool hasConfig;
|
||||
uint32_t lastRetry;
|
||||
bool hasPortalConfig = false;
|
||||
bool connectorTimeout = false;
|
||||
|
||||
bool wifiClientConnected(void);
|
||||
|
||||
public:
|
||||
void setAirGradient(AirGradient *ag);
|
||||
|
||||
WifiConnector(OledDisplay &disp, Stream &log, StateMachine &sm, Configuration& config);
|
||||
~WifiConnector();
|
||||
|
||||
bool connect(void);
|
||||
void disconnect(void);
|
||||
void handle(void);
|
||||
void _wifiApCallback(void);
|
||||
void _wifiSaveConfig(void);
|
||||
void _wifiSaveParamCallback(void);
|
||||
bool _wifiConfigPortalActive(void);
|
||||
void _wifiTimeoutCallback(void);
|
||||
void _wifiProcess();
|
||||
bool isConnected(void);
|
||||
void reset(void);
|
||||
int RSSI(void);
|
||||
String localIpStr(void);
|
||||
bool hasConfigurated(void);
|
||||
bool isConfigurePorttalTimeout(void);
|
||||
|
||||
const char* defaultSsid = "airgradient";
|
||||
const char* defaultPassword = "cleanair";
|
||||
void setDefault(void);
|
||||
};
|
||||
|
||||
#endif /** _AG_WIFI_CONNECTOR_H_ */
|
@ -1,6 +1,9 @@
|
||||
#include "AirGradient.h"
|
||||
|
||||
#define AG_LIB_VER "3.0.3"
|
||||
#ifdef ESP8266
|
||||
#include <ESP8266WiFi.h>
|
||||
#else
|
||||
#include "WiFi.h"
|
||||
#endif
|
||||
|
||||
AirGradient::AirGradient(BoardType type)
|
||||
: pms5003(type), pms5003t_1(type), pms5003t_2(type), s8(type), sgp41(type),
|
||||
@ -33,6 +36,52 @@ int AirGradient::getI2cSclPin(void) {
|
||||
return bsp->I2C.scl_pin;
|
||||
}
|
||||
|
||||
String AirGradient::getVersion(void) { return AG_LIB_VER; }
|
||||
String AirGradient::getVersion(void) { return GIT_VERSION; }
|
||||
|
||||
BoardType AirGradient::getBoardType(void) { return boardType; }
|
||||
|
||||
double AirGradient::round2(double value) {
|
||||
double ret;
|
||||
if (value >= 0) {
|
||||
ret = (int)(value * 100 + 0.5f);
|
||||
} else {
|
||||
ret = (int)(value * 100 - 0.5f);
|
||||
}
|
||||
|
||||
return ret / 100;
|
||||
}
|
||||
|
||||
String AirGradient::getBoardName(void) {
|
||||
return String(getBoardDefName(boardType));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Board Type is ONE_INDOOR
|
||||
*
|
||||
* @return true ONE_INDOOR
|
||||
* @return false Other
|
||||
*/
|
||||
bool AirGradient::isOne(void) {
|
||||
return boardType == BoardType::ONE_INDOOR;
|
||||
}
|
||||
|
||||
bool AirGradient::isOpenAir(void) {
|
||||
return boardType == BoardType::OPEN_AIR_OUTDOOR;
|
||||
}
|
||||
|
||||
bool AirGradient::isPro4_2(void) {
|
||||
return boardType == BoardType::DIY_PRO_INDOOR_V4_2;
|
||||
}
|
||||
|
||||
bool AirGradient::isPro3_3(void) {
|
||||
return boardType == BoardType::DIY_PRO_INDOOR_V3_3;
|
||||
}
|
||||
|
||||
bool AirGradient::isBasic(void) { return boardType == BoardType::DIY_BASIC; }
|
||||
|
||||
String AirGradient::deviceId(void) {
|
||||
String mac = WiFi.macAddress();
|
||||
mac.replace(":", "");
|
||||
mac.toLowerCase();
|
||||
return mac;
|
||||
}
|
||||
|
@ -1,17 +1,22 @@
|
||||
#ifndef _AIR_GRADIENT_H_
|
||||
#define _AIR_GRADIENT_H_
|
||||
|
||||
#include "display/oled.h"
|
||||
#include "main/BoardDef.h"
|
||||
#include "main/HardwareWatchdog.h"
|
||||
#include "main/LedBar.h"
|
||||
#include "main/PushButton.h"
|
||||
#include "main/StatusLed.h"
|
||||
#include "pms/pms5003.h"
|
||||
#include "pms/pms5003t.h"
|
||||
#include "s8/s8.h"
|
||||
#include "sgp41/sgp41.h"
|
||||
#include "sht/sht.h"
|
||||
#include "Display/Display.h"
|
||||
#include "Main/BoardDef.h"
|
||||
#include "Main/HardwareWatchdog.h"
|
||||
#include "Main/LedBar.h"
|
||||
#include "Main/PushButton.h"
|
||||
#include "Main/StatusLed.h"
|
||||
#include "PMS/PMS5003.h"
|
||||
#include "PMS/PMS5003T.h"
|
||||
#include "S8/S8.h"
|
||||
#include "Sgp41/Sgp41.h"
|
||||
#include "Sht/Sht.h"
|
||||
#include "Main/utils.h"
|
||||
|
||||
#ifndef GIT_VERSION
|
||||
#define GIT_VERSION "3.1.9-snap"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Class with define all the sensor has supported by Airgradient. Each
|
||||
@ -107,6 +112,67 @@ public:
|
||||
*/
|
||||
String getVersion(void);
|
||||
|
||||
/**
|
||||
* @brief Get the Board Name object
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
String getBoardName(void);
|
||||
|
||||
/**
|
||||
* @brief Round double value with for 2 decimal
|
||||
*
|
||||
* @param valuem Round value
|
||||
* @return double
|
||||
*/
|
||||
double round2(double value);
|
||||
|
||||
/**
|
||||
* @brief Check that Airgradient object is ONE_INDOOR
|
||||
*
|
||||
* @return true Yes
|
||||
* @return false No
|
||||
*/
|
||||
bool isOne(void);
|
||||
|
||||
/**
|
||||
* @brief Check that Airgradient object is OPEN_AIR
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool isOpenAir(void);
|
||||
|
||||
/**
|
||||
* @brief Check that Airgradient object is DIY_PRO 4.2 indoor
|
||||
*
|
||||
* @return true Yes
|
||||
* @return false No
|
||||
*/
|
||||
bool isPro4_2(void);
|
||||
/**
|
||||
* @brief Check that Airgradient object is DIY_PRO 3.7 indoor
|
||||
*
|
||||
* @return true Yes
|
||||
* @return false No
|
||||
*/
|
||||
bool isPro3_3(void);
|
||||
|
||||
/**
|
||||
* @brief Check that Airgradient object is DIY_BASIC
|
||||
*
|
||||
* @return true Yes
|
||||
* @return false No
|
||||
*/
|
||||
bool isBasic(void);
|
||||
|
||||
/**
|
||||
* @brief Get device Id
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
String deviceId(void);
|
||||
|
||||
private:
|
||||
BoardType boardType;
|
||||
};
|
||||
|
27
src/App/AppDef.cpp
Normal file
27
src/App/AppDef.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include "AppDef.h"
|
||||
|
||||
const char *AgFirmwareModeName(AgFirmwareMode mode) {
|
||||
switch (mode) {
|
||||
case FW_MODE_I_9PSL:
|
||||
return "I-9PSL";
|
||||
case FW_MODE_O_1PP:
|
||||
return "O-1PP";
|
||||
case FW_MODE_O_1PPT:
|
||||
return "O-1PPT";
|
||||
case FW_MODE_O_1PST:
|
||||
return "O-1PST";
|
||||
case FW_MODE_O_1PS:
|
||||
return "0-1PS";
|
||||
case FW_MODE_O_1P:
|
||||
return "O-1P";
|
||||
case FW_MODE_I_42PS:
|
||||
return "DIY-PRO-I-4.2PS";
|
||||
case FW_MODE_I_33PS:
|
||||
return "DIY-PRO-I-3.3PS";
|
||||
case FW_MODE_I_BASIC_40PS:
|
||||
return "DIY-BASIC-I-4.0PS";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "UNKNOWN";
|
||||
}
|
110
src/App/AppDef.h
Normal file
110
src/App/AppDef.h
Normal file
@ -0,0 +1,110 @@
|
||||
#ifndef _APP_DEF_H_
|
||||
#define _APP_DEF_H_
|
||||
|
||||
/**
|
||||
* @brief Application state machine state
|
||||
*
|
||||
*/
|
||||
enum AgStateMachineState {
|
||||
/** In WiFi Manger Mode */
|
||||
AgStateMachineWiFiManagerMode,
|
||||
|
||||
/** WiFi Manager has connected to mobile phone */
|
||||
AgStateMachineWiFiManagerPortalActive,
|
||||
|
||||
/** After SSID and PW entered and OK clicked, connection to WiFI network is
|
||||
attempted*/
|
||||
AgStateMachineWiFiManagerStaConnecting,
|
||||
|
||||
/** Connecting to WiFi worked */
|
||||
AgStateMachineWiFiManagerStaConnected,
|
||||
|
||||
/** Once connected to WiFi an attempt to reach the server is performed */
|
||||
AgStateMachineWiFiOkServerConnecting,
|
||||
|
||||
/** Server is reachable, all fine */
|
||||
AgStateMachineWiFiOkServerConnected,
|
||||
|
||||
/** =================================== *
|
||||
* Exceptions during WIFi Setup *
|
||||
* =================================== **/
|
||||
/** Cannot connect to WiFi (e.g. wrong password, WPA Enterprise etc.) */
|
||||
AgStateMachineWiFiManagerConnectFailed,
|
||||
|
||||
/** Connected to WiFi but server not reachable, e.g. firewall
|
||||
block/whitelisting needed etc. */
|
||||
AgStateMachineWiFiOkServerConnectFailed,
|
||||
|
||||
/** Server reachable but sensor not configured correctly*/
|
||||
AgStateMachineWiFiOkServerOkSensorConfigFailed,
|
||||
|
||||
/** =================================== *
|
||||
* During Normal Operation *
|
||||
* =================================== **/
|
||||
|
||||
/** Connection to WiFi network failed credentials incorrect encryption not
|
||||
supported etc. */
|
||||
AgStateMachineWiFiLost,
|
||||
|
||||
/** Connected to WiFi network but the server cannot be reached through the
|
||||
internet, e.g. blocked by firewall */
|
||||
AgStateMachineServerLost,
|
||||
|
||||
/** Server is reachable but there is some configuration issue to be fixed on
|
||||
the server side */
|
||||
AgStateMachineSensorConfigFailed,
|
||||
|
||||
/** CO2 calibration */
|
||||
AgStateMachineCo2Calibration,
|
||||
|
||||
/* LED bar testing */
|
||||
AgStateMachineLedBarTest,
|
||||
AgStateMachineLedBarPowerUpTest,
|
||||
|
||||
/** OTA perform, show display status */
|
||||
AgStateMachineOtaPerform,
|
||||
|
||||
/** LED: Show working state.
|
||||
* Display: Show dashboard */
|
||||
AgStateMachineNormal,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief RGB LED bar mode for ONE_INDOOR board
|
||||
*/
|
||||
enum LedBarMode {
|
||||
/** Don't use LED bar */
|
||||
LedBarModeOff,
|
||||
|
||||
/** Use LED bar for show PM2.5 value level */
|
||||
LedBarModePm,
|
||||
|
||||
/** Use LED bar for show CO2 value level */
|
||||
LedBarModeCO2,
|
||||
};
|
||||
|
||||
enum ConfigurationControl {
|
||||
/** Allow set configuration from local over device HTTP server */
|
||||
ConfigurationControlLocal,
|
||||
|
||||
/** Allow set configuration from Airgradient cloud */
|
||||
ConfigurationControlCloud,
|
||||
|
||||
/** Allow set configuration from Local and Cloud */
|
||||
ConfigurationControlBoth
|
||||
};
|
||||
|
||||
enum AgFirmwareMode {
|
||||
FW_MODE_I_9PSL, /** ONE_INDOOR */
|
||||
FW_MODE_O_1PST, /** PMS5003T, S8 and SGP41 */
|
||||
FW_MODE_O_1PPT, /** PMS5003T_1, PMS5003T_2, SGP41 */
|
||||
FW_MODE_O_1PP, /** PMS5003T_1, PMS5003T_2 */
|
||||
FW_MODE_O_1PS, /** PMS5003T, S8 */
|
||||
FW_MODE_O_1P, /** PMS5003T */
|
||||
FW_MODE_I_42PS, /** DIY_PRO 4.2 */
|
||||
FW_MODE_I_33PS, /** DIY_PRO 3.3 */
|
||||
FW_MODE_I_BASIC_40PS, /** DIY_BASIC 4.0 */
|
||||
};
|
||||
const char *AgFirmwareModeName(AgFirmwareMode mode);
|
||||
|
||||
#endif /** _APP_DEF_H_ */
|
@ -1,6 +1,6 @@
|
||||
#include "oled.h"
|
||||
#include "../library/Adafruit_SH110x/Adafruit_SH110X.h"
|
||||
#include "../library/Adafruit_SSD1306_Wemos_OLED/Adafruit_SSD1306.h"
|
||||
#include "Display.h"
|
||||
#include "../Libraries/Adafruit_SH110x/Adafruit_SH110X.h"
|
||||
#include "../Libraries/Adafruit_SSD1306_Wemos_OLED/Adafruit_SSD1306.h"
|
||||
|
||||
#define disp(func) \
|
||||
if (this->_boardType == DIY_BASIC) { \
|
@ -1,7 +1,7 @@
|
||||
#ifndef _AIR_GRADIENT_OLED_H_
|
||||
#define _AIR_GRADIENT_OLED_H_
|
||||
|
||||
#include "../main/BoardDef.h"
|
||||
#include "../Main/BoardDef.h"
|
||||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user