Lora-net / sx1302_hal

SX1302/SX1303 Hardware Abstraction Layer and Tools (packet forwarder...)
Other
219 stars 272 forks source link

Permit temperature sensor to be optional #58

Closed joelguittet closed 1 year ago

joelguittet commented 2 years ago

Hello,

I would like to reopen an issue that was previously discussed at https://github.com/Lora-net/sx1302_hal/issues/28.

The issue deals with the mandatory temperature sensor required to make the RSSI compensation. All SX1302 boards have not the embedded temperature sensor has expected. I'm using RAK2287 which is a recent product (https://www.rakwireless.com/en-us/products/lpwan-gateways-and-concentrators/rak2287) but without the temperature sensor.

Today the solution is to get the code and patch it to remove the temperature sensor reading and use an arbitrary fixed value (let say 25 or 30°C for example).

It's a shame the RSSI compensation could not be bypassed today. Is it possible to study this use case please ?

If the answer is "yes that something that may be useful" I'm ready to work on it and propose a pull request.

Let me known please.

Regards Joel

(actually working with a patched packet-forwarder v1.0.5 binary because I have not the force to do the patches for all consecutive versions each time a new one is released :-( )

joelguittet commented 2 years ago

Nota bene: I just also notice the I2C Linux device is hard coded:

#define I2C_DEVICE          "/dev/i2c-1"

While the SPI device is available in the configuration... could be enhanced easily as well.

wong-hao commented 2 years ago

Hi there, I don't quite understand your problem.

What you need is to eliminate all the code related to the temperature sensor so that the program that could not run normally can run normally now, right?

joelguittet commented 2 years ago

Well, that's purely what I do today. But basically, doing this each time a release is done by updating a fork and doing the job again is not wanted by any développer. Why don't doing this in the mainline code instead of forking ?

I propose the following:

That what is done for the gps, leaving "gps_tty_path" simply disable this part in the packet-forwarder, so it's reasonable to think the same behavior ca be achieved for the temperature sensor.

If this solution fit, I can do it and create a pull request so you can review and discuss the details on it. I have checked the code and the above solution don't seems to be very complicated. Just need the go.

Joel

shawaj commented 2 years ago

+1 on this

We have the same issue where we have to patch the files with each release - see here https://github.com/NebraLtd/hm-pktfwd/tree/master/sx1302fixes

Having it as an optional, configurable option would be a welcome change

joelguittet commented 2 years ago

@shawaj I'm happy to see people having the same issue. I have identified the modifications to do and will do the PR here asap. It's better to understand the objective of this if we can speak around a real PR and it has more chance to be accepted in my opinion.

Should be a question of days before the PR will be done.

Joel

shawaj commented 2 years ago

Judging by the files / installer in this repo, we are not the only ones doing this either. Looks like a pretty common use case https://github.com/RAKWireless/rak_common_for_gateway/tree/master/lora/rak2287

P.S. thanks for your efforts on this!

joelguittet commented 2 years ago

Wasn't aware of this repo as well, looks to fit my needs. But anyway I'm no confortable with the idea of multiple forks and copies of the orignal project.

RAK has provided GPS with I2C interface. This repo has only serial option. Maybe something to improve too (later).

joelguittet commented 2 years ago

@shawaj @wong-hao PR has been proposed at https://github.com/Lora-net/sx1302_hal/pull/63

Joel

smtc-bot commented 1 year ago

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!