Skip to content

Increase retry to 200 is not compact key; Add regen key when not comp…#10

Open
flyerink wants to merge 2 commits intohelium:masterfrom
flyerink:devel
Open

Increase retry to 200 is not compact key; Add regen key when not comp…#10
flyerink wants to merge 2 commits intohelium:masterfrom
flyerink:devel

Conversation

@flyerink
Copy link
Copy Markdown

Increase retry to 200 is not compact key;

Add re-gen key when not compact key detected.

{true, _} -> ok;
false -> {error, not_compact}
false ->
case gen_compact_key(Pid, ?KEY_SLOT) of
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This does not seem correct.. check_miner_key is not there to actually generate the private key. It's just there to validate that there is a public compact key in a slot. There is a separate command to generate the private key

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If check the key not compact, it will always fail when run test. We can't run provision again to re-gen the private key any more. So this code can fix it by re-gen private key.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not the right assumption. Check_key_configuration should only check that the chip was already correctly configured. If it returns an error on is_compact it means it was not provisioned/configured correctly in a previous step


gen_compact_key(Pid, Slot) ->
gen_compact_key(Pid, Slot, 100).
gen_compact_key(Pid, Slot, 200).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why did you have to double the number of retries to 200? That seems like there's an issue with the part you are using if it needs this many retries to generate a private key

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

As test by my customer, they find many failure chip, which can't pass the private key testing as not compact key. So we can increase to retry 200 times to gen a compact private key.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This usually implies a hardware integration issue. We used to have the same problems on the original Helium hotspot and it turned out to be either a badly configured driver or i2c bus issues

@madninja
Copy link
Copy Markdown
Member

Note that (1) this is sill making the wrong assumptions about what the code is supposed to be doing and (2) has been superseded by gateway-mfr-rs

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