-
Notifications
You must be signed in to change notification settings - Fork 8
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
panic: runtime error: integer divide by zero #5
Comments
@hyzhak, debug information you have provided is very limited. I can't figure out what happens. I can only theoretically assume that you specific sensor sample has empty coefficient set. Did you try another sample? To give better debug output, take example1.go file, comment the line
, and finally run whole example. Put whole debug output here. I hope this give more details on issue root cause. |
Sensor (BMP180) is working fine, but once in a while (about once a day) it fails with divide by zero error. Here is sample of log from the last fail
|
@hyzhak, I had one buggy BMP280, which works then did not work... I can add extra check in every math division taken from sensor calculation specification, but my advice - try to run with any other BMP sample. I just want to clarify what cause the issue: sensor or embedded device. If BMP software produce this error every time with no exception, there is no doubt - code contains error, but in your case it looks you have something buggy - sensor or embedded device. BTW, try to run BMP180 sensor with Python - would it have same behavior? Another advice. You can add next code before any measurement:
, because it execute verification that coefficient set is not zero:
Once Again my major advice for you - find what unstable part you have. There could million of reasons of it, beginning from bad power supply, ending with a broken/invalid Linux firmware. |
I've got an error:
The text was updated successfully, but these errors were encountered: