Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temperature sensor is optional #63

Closed

Conversation

joelguittet
Copy link

@joelguittet joelguittet commented Oct 10, 2021

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 to gps_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 the stat 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:

  • lora_pkt_fwd started with configuration from the repository => fails because temperature sensor is not found => OK
  • lora_pkt_fwd with "temp_dev_path"="" in the configuration => starts and communication with server OK, no temp transmitted in the stat json packet => OK
  • temp_dev_path without -d option to use default I2C path => starts and use the proper path, fails because no temperature sensor => OK
  • temp_dev_path with -d option to pass the I2C path => starts and use the proper path, fails because no temperature sensor => OK

Please let me known anything about this PR, if it's suitable or not, if the philosophy should be a little bit different etc.

Joel

@joelguittet
Copy link
Author

Hello maintainers !
Any questions or remarks about my PR ?
Thanks,
Joel

@joelguittet
Copy link
Author

Up ?

@smtc-bot
Copy link

Thank you for your inquiry.

Customers are encouraged to submit technical questions via our dedicated support portal at https://semtech.force.com/ldp/ldp_support.

We invite all users to visit the LoRa Developer Portal Forum at https://forum.lora-developers.semtech.com and to join the thriving LoRa development community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants