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

Is it possible to reduce the accuracy of "battery" and keep 2-3 digits after the decimal point? #558

Closed
jsbjx opened this issue Dec 5, 2021 · 10 comments

Comments

@jsbjx
Copy link

jsbjx commented Dec 5, 2021

calling HTTP
{"name":"iSpindel000","ID":2774563,"angle":88.98952,"temperature":26.625,"temp_units":"C","battery":3.972889,"gravity":33.05824,"interval":1,"RSSI":-46}HTTPAPI: posting

"battery":3.972889
The voltage is 6 digits after the decimal point. Actually useless. Other software call data display is too long

@vytux-com
Copy link

Why? You can always round or truncate on display

@jsbjx
Copy link
Author

jsbjx commented Dec 5, 2021

The number of digits displayed in Craftbeerpi is too long. No way to set a decimal point

@vytux-com
Copy link

Sounds like an issue with Craftbeerpi application

@jsbjx
Copy link
Author

jsbjx commented Dec 5, 2021

Craftbeerpi received the data without processing it and displaying it directly. So if you send a signal, you can handle it well. The receiving end does not need to be processed

@ErikdBr
Copy link
Contributor

ErikdBr commented Dec 5, 2021

Did you measure the voltage of your fully charged battery, checked it against the displayed voltage in the Info page of the iSpindel configuration, and filled in the battery conversion factor in the configuration of the iSpindel?
Maybe that will help, if not, there is a ton of software out there that displays the voltage of the battery with 2 decimals so while in Craftbeerpi the receiving end may not need to be processed, maybe it can be processed?

@jsbjx
Copy link
Author

jsbjx commented Dec 5, 2021

1

2

3

The settings should be correct, the voltage data seen by the serial port is 6 digits after the decimal point
"battery":3.972889 (The data is not collected at the same time)
Is it necessary for iSpindel to output data with 6 digits after the decimal point?

@ErikdBr
Copy link
Contributor

ErikdBr commented Dec 5, 2021

You left the default battery conversion factor of 191.8 so the displayed voltage of 3.93 is probably not correct. If you want the correct voltage you need to measure the voltage directly at the battery with a multimeter as described in the FAQ:

How can I calibrate the voltage display?
From firmware 3.0 on you can adjust the conversion factor. By default, factor 191.8 is used.

You can adjust by this formula:
(displayed voltage / measured voltage) * current factor (191.8) = new factor

The new factor should be between current factor more or less 20% (191.8*0.8 - 191.8*1.2).

That doesn't necessarily solve your problem but if you want less decimals you'll need to find someone who wants to change that in the iSpindel firmware or do it yourself by putting in a pull request. Or as said before process it at the receiving end.

@thegreatgunbantoad
Copy link
Contributor

The iSpindle just sends a floating point number for Tilt, Temp, Gravity and Battery. Presumably CraftBeerPi handles formatting the others correctly, otherwise you'd have lots of digits on your SG too. This sounds like a limitation of CraftBeerPi. It really should be up to the program displaying the data to handle the formatting.

@universam1
Copy link
Owner

iSpindel is not responsible for the frontend, it is a measuring device only. Trying to solve such UI issues at this point totally misses the point of separation of concerns

@avollkopf
Copy link

Although closed, just for documentation that this is a RTFM topic. It is described in my CraftbeerPi4 documentation that digits can be changed for sensor data: https://openbrewing.gitbook.io/craftbeerpi4_support/master/craftbeerpi-4-server/dashboard#item-menu (->Sensor Data in the table of this chapter)

I added that feature back un June (PiBrewing/craftbeerpi4-ui@5e5c2e9)

Craftbeerpi4_sensor_digits

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

6 participants