OpenMarine
openplotter-i2c 3.x.x released - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=2)
+--- Thread: openplotter-i2c 3.x.x released (/showthread.php?tid=4276)

Pages: 1 2 3 4 5 6 7


RE: openplotter-i2c 3.x.x released - Sailoog - 2022-11-09

ops good luck!


RE: openplotter-i2c 3.x.x released - tobias.e - 2022-11-12

Is there a way to apply a calibration factor to a sensor value? What are magnitude and sensor settings?


RE: openplotter-i2c 3.x.x released - Sailoog - 2022-11-12

(2022-11-12, 08:04 PM)tobias.e Wrote: Is there a way to apply a calibration factor to a sensor value? What are magnitude and sensor settings?

Yes, you can set an offset for each magnitude.

Sensors setings are general settings affecting all magnitudes and a magnitude setting will affect only that magnitude. check ADS1115, it has both sensor and magnitude settings.


RE: openplotter-i2c 3.x.x released - tobias.e - 2022-11-12

(2022-11-12, 08:21 PM)Sailoog Wrote:
(2022-11-12, 08:04 PM)tobias.e Wrote: Is there a way to apply a calibration factor to a sensor value? What are magnitude and sensor settings?

Yes, you can set an offset for each magnitude.

Sensors setings are general settings affecting all magnitudes and a magnitude setting will affect only that magnitude. check ADS1115, it has both sensor and magnitude settings.

Hi Sailoog, 

thanks for the quick reply. The offset is added to the value, but i would like to multiply by a factor ( INA219 using a different shunt).

Best regards, 
Tobias


RE: openplotter-i2c 3.x.x released - Sailoog - 2022-11-14

RichFind, tobias.e, let's follow this discussion here please: https://forum.openmarine.net/showthread.php?tid=4310


RE: openplotter-i2c 3.x.x released - tobias.e - 2022-11-14

Hi Sailoog,

the other tread is great, as it allows to use the full potential of the INA219.

But I think, to be able to scale any sensor data would still be a useful feature for openplotter-i2c. 
So instead of 
Code:
value=value_raw + offset
 
generate
Code:
value=scaling_factor * value_raw + offset


Best regards, Tobias


RE: openplotter-i2c 3.x.x released - Sailoog - 2022-11-15

Yes, good idea. We could add a new field "Scaling factor" with 1 as default value next to the offset field.


RE: openplotter-i2c 3.x.x released - Sailoog - 2022-11-25

Scaling factor added to openplotter-i2c v3.3.5:

   

Please test and report, thanks.

Also added settings for INA219: https://forum.openmarine.net/showthread.php?tid=4310


RE: openplotter-i2c 3.x.x released - tobias.e - 2022-11-26

Hi Sailoog, 

Thank you for including this! Scaling seems to work just fine, but generation of default scaling values seems to be a problem.

I just changed the scaling value for temperature on the BMP280, and singnalK stopped getting values from I2C. 

Debug output from openpoltter-i2c was ( several lines per second): 



Code:
Error reading BMP280: 'factor'
Error reading INA219: 'factor'
Error reading BMP280: 'factor'
Error reading INA219: 'factor'


After also setting a factor for pressure on the BMP280, Errors for this sensor were gone, but the INA219 was still complaining: 


Code:
Error processing INA219: local variable 'current_lsb' referenced before assignment
Error reading INA219: 'factor'
Error reading INA219: 'factor'

This disappears after pressing edit and OK for each measurement.

Looks like the default value of 1.0 works only as long as no scaling factor has been set for any sensor.

One further observation: after setting all scaling values to 1, data was sent to signalK only once, and was not updated for several minutes.


As soon as i changed the update interval for e.g. pressure, data for pressure was updated accordingly. 


Best regards, 
Tobias


RE: openplotter-i2c 3.x.x released - Sailoog - 2022-11-26

Yes, this is expected for existing sensors but once you edit them or you created a new sensor everything should work.