Skip to content

Commit e1eb86a

Browse files
committed
Add better debugging
1 parent 855ba5e commit e1eb86a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ let serialCache = {
5454
}
5555
function cacheSerial(message) { //Build up a bit of a cache of serial messages because they seem to come in chunks
5656
if (serialCache["updated"] < (Date.now() - 65000)) { //If the cache is older than 65 seconds
57+
logger.log("warn","Resetting cache (out of date)", serialCache)
5758
serialCache["cache"] = Buffer.from([]) //Reset the cache
5859
}
5960
serialCache["updated"] = Date.now()

src/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const parser = (inputBuffer, offset) => {
1818
data.temperatureF = (data.temperatureRaw / 10).toFixed(1) // Temperature in degrees F
1919
data.temperatureC = (((data.temperatureRaw/10) - 32)*(5/9)).toFixed(1) // Temperature in degrees C
2020
if (data.windDirection < 1 || data.windDirection > 360) {
21-
logger.log("warn","Wind direction out of range")
21+
logger.log("warn","Wind direction out of range", data)
2222
return false
2323
} else if (data.windSpeed == 255 && data.humidity == 255) {
2424
logger.log("warn","Wind speed and humidity are 255 - console is in setup mode")

0 commit comments

Comments
 (0)