Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello
Following the issue reported at #58, this is a Pull-Request to propose a solution permitting to have the temperature sensor optional.
To disable the temperature sensor, the configuration key
temp_dev_path
has been introduced and should be an empty string (the behavior is identical togps_tty_path
which disable the GPS when the path is empty). The default value in the global_conf files in the repo is "/dev/i2c-1", which was the value of the I2C_DEVICE definition (removed).Because I2C_DEVICE has been removed, the
pa_dev_path
for the pull duplex operation has been introduced as well. The implementation permit to have full duplex without temperature, temperature without full duplex, none of them, or both of them. Just need to do the proper configuration, i2c devices paths are independent.The
temp
field in thestat
json packet is not transmitted to the server if the temperature can't be read, for any reason (disabled or any other error, the other fields are transmitted anyway).The PR also fix a remaining TODO in the test_lorawan_i2c program (device from the command with option -d is now available, default option is still "/dev/i2c-1").
I have no concentrator board with temperature sensor, I have only a RAK2287 (SX1302 with SPI interface), so testing I have done are the following:
"temp_dev_path"=""
in the configuration => starts and communication with server OK, no temp transmitted in the stat json packet => OKPlease let me known anything about this PR, if it's suitable or not, if the philosophy should be a little bit different etc.
Joel