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

Device error state #10

Closed
pelikhan opened this issue Aug 8, 2020 · 12 comments
Closed

Device error state #10

pelikhan opened this issue Aug 8, 2020 · 12 comments
Assignees
Labels

Comments

@pelikhan
Copy link
Member

pelikhan commented Aug 8, 2020

Is there a register to surface an error state in device?

@pelikhan
Copy link
Member Author

Is there a register for the error state of a device?

@mmoskal mmoskal assigned jamesadevine and mmoskal and unassigned mmoskal Aug 10, 2020
@mmoskal
Copy link
Member

mmoskal commented Aug 10, 2020

@jamesadevine should we have a string register in control service? or maybe a common string register for every service? or should that be numeric?

@pelikhan do you have specific use cases in mind?

I was thinking hardware errors like:

  • my I2C accelerometer doesn't work (we currently panic, which may be actually better)

@pelikhan
Copy link
Member Author

I was thinking about surfacing the panic error code.

@jamesadevine
Copy link
Member

I was thinking a register in the control service that exposes a "list" of errors if there are any.

In the case where hardware isn't working, I think it is better to panic and send a message over JACDAC.

@pelikhan
Copy link
Member Author

should a device has a "safe boot" option that ignores all sensors and just broadcasts the error code?

@mmoskal
Copy link
Member

mmoskal commented Aug 10, 2020

It could just broadcast while the sensors are broken, I don't think there's much need to safe boot.

@pelikhan pelikhan transferred this issue from microsoft/jacdac-ts Aug 10, 2020
@pelikhan
Copy link
Member Author

does jacdac still broadcast while in panic mode?

@pelikhan
Copy link
Member Author

I understand we want to avoid a broken device polluting the bus with error messages.

@jamesadevine
Copy link
Member

Yeah, I think you'd just continue sending advertisement reports with some error flag set. A JD debugger/brain could then interrogate a device for its error state when connected

@tballmsft
Copy link
Contributor

tballmsft commented Nov 30, 2020

  • bit in the advertisement packet for failure
  • bundle a report packet in the case of a failure
    • generic code
    • device specific

Kinds of Failures:

  • hard fault (segmentation violation) vs. software panic (OOM, etc.)
  • hardware failures (I2C device doesn't respond)

Common failure codes for JACDAC:

  • generic codes (SUCCESS, ...)
  • device-specific codes

Take a look at: https://en.wikipedia.org/wiki/CAN_bus

@pelikhan
Copy link
Member Author

Base register in the service definition

@pelikhan
Copy link
Member Author

#91

@pelikhan pelikhan closed this as completed Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants