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

add modified chip_id.c #57

Merged
merged 1 commit into from
Oct 8, 2021
Merged

add modified chip_id.c #57

merged 1 commit into from
Oct 8, 2021

Conversation

shawaj
Copy link
Member

@shawaj shawaj commented Oct 8, 2021

Why

enable us to determine if the chipset is sx1302 or sx1303

How

add a modified version of chip_id.c that allows us to check the chip ID (0x00 or 0x02 for sx1302 and 0x03 for sx1303)

References

#56
Lora-net/sx1302_hal#60

@shawaj shawaj mentioned this pull request Oct 8, 2021
- add a modified version of chip_id.c that allows us to check the chip ID
- this allows us to determine if the chip is sx1302 or sx1303
@shawaj shawaj changed the title Create chip_id.c add modified chip_id.c Oct 8, 2021
@shawaj shawaj marked this pull request as ready for review October 8, 2021 04:06
@shawaj shawaj requested a review from a team as a code owner October 8, 2021 04:06
Copy link
Contributor

@marvinmarnold marvinmarnold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Can you confirm that I'm understanding this correctly.

  1. These changes are based on the 2.1 release of our forked sx1302_hal repo, with some new code you wrote by hand. This is the diff:
diff 2.1.txt pull-request.txt 
39a40
> #include "loragw_sx1302.h"
81a83
>     sx1302_model_id_t model_id;
197a200,207
>     }
> 
>     /* get the concentrator chip model */
>     x = sx1302_get_model_id(&model_id);
>     if (x != LGW_HAL_SUCCESS) {
>         printf("ERROR: failed to get concentrator chip model\n");
>     } else {
>         printf("\nINFO: concentrator chip model ID: 0x%02X\n", model_id);
  1. Additional work will need to be done to update the python chip detection to support this new logic.

FYI I'm making progress with hm-pktfwd refactor. I'm finishing up the Dockerfile and sx1302 related logic: https://github.com/NebraLtd/hm-pktfwd/tree/marvinmarnold/total-refactor

@shawaj
Copy link
Member Author

shawaj commented Oct 8, 2021

@marvinmarnold yes that's correct. It adds that detection for the chip Id, and In the dockerfile / compile script it pulls in the new files and builds with the new function.

As you say, this isn't picked up in the python code anywhere, and currently isn't actually needed for anything in particular (sx1302 and 3 can use the same config files, however we may want to make adjustments to the rssi offset and LUTs in the future potentially based on further testing, at which point we would need to be able to tell the difference).

I just thought it would be useful to be able to more easily detect the chip variant for debugging of any software or hardware issues in the future.

We don't have any sx1302/sx1303 based modules out in the field currently so it's more for the future than right now.

Currently the only units we have shipped use the sx1301

@shawaj
Copy link
Member Author

shawaj commented Oct 8, 2021

Also, on a side note this relates to #23

It's worth keeping an eye on Lora-net/sx1302_hal#58 also as this may remove the need for these "fixes" in future as their current purpose is to remove the hard coded temperature sensor and replace it with a fixed temp

@shawaj shawaj merged commit a48637d into master Oct 8, 2021
@shawaj shawaj deleted the shawaj/chipid branch October 8, 2021 16:59
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.

2 participants