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

Firmware update message is sent (if needed) when device joins channel. #79

Closed
jlmcgehee21 opened this issue Jun 1, 2018 · 3 comments
Closed
Assignees

Comments

@jlmcgehee21
Copy link
Contributor

References: https://github.com/nerves-hub/nerves_hub/blob/master/docs/client-server.md

Next, the server compares the running version of the firmware to the target version for that device on NervesHub. If those versions are different, then the channel queues a firmware update message to be sent as soon as the channel finishes the join process.

Depends On: #78

@jlmcgehee21
Copy link
Contributor Author

We will need to look up devices by the serial added to socket.assigns in order to check the target version. I'm guessing this should map somehow to :identifier, is there a method for this that is specified somewhere?

Still browsing the codebase to see what I can find as well.

@fhunleth
Copy link
Contributor

fhunleth commented Jun 1, 2018

If I understand correctly, I think that serial needs to be mapped directly to :identifier for the time being. This code was written before we wanted to deal with the issue of IDs being reused across tenants. The current plan is to assign UUIDs to devices in addition to manufacturing-assigned serial numbers. Code would work with UUIDs. Humans would see the serial numbers (for the most part). Both numbers would be embedded in the certs. Since we're hand generating certs at the moment, I think that it's ok to skip worrying about UUIDs until cert generation is available.

@mobileoverlord You agree? I know that you're getting close on cert generation, but it's still probably end next week-ish before you have something ready.

@jlmcgehee21 jlmcgehee21 self-assigned this Jun 4, 2018
jlmcgehee21 referenced this issue Jun 7, 2018
Why:
* We want to know if a device needs new firmware ASAP.
* nerves-hub/nerves_hub#79

This change addresses the need by:
* Checking if `%{"version" => version}` in the join payload matches the
target version in the database, and acting accordingly.
* Also updates the `current_version` in the database to the version that
is reported in the join payload.

Caveats:
* Cannot send out a message with instructions for updating firmware
because that is yet to be implemented.
@jlmcgehee21
Copy link
Contributor Author

☝️ gets us part of the way there, but I think this issue should stay open until we can send an actual firmware image.

mattlorey referenced this issue Jun 8, 2018
Why:
* We want to know if a device needs new firmware ASAP.
* nerves-hub/nerves_hub#79

This change addresses the need by:
* Checking if `%{"version" => version}` in the join payload matches the
target version in the database, and acting accordingly.
* Also updates the `current_version` in the database to the version that
is reported in the join payload.

Caveats:
* Cannot send out a message with instructions for updating firmware
because that is yet to be implemented.
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

No branches or pull requests

2 participants