Skip to content

Sensorcal not working #45

@iglesiasmarianod

Description

@iglesiasmarianod

I've built the latest image and found sensorcal is not working.
It finds sensorboard as virgin and asks to initialize (even when the sensorboard is been calibrated before).
I clicked on "yes" to initialize the board again, but keeps seeing the board as virgin.
I ran sensorcal -c. The output is "EEPROM content not valid, run sensorcal -i"
I ran sensorcal -i and seems to run OK.
I suspect it has something to do with Checksum calculation or verification.
Running sensorcal -d The output is "EEPROM content not valid, run sensorcal -i" twice
From sensorcal:


		case 'd':
				// read actual EEPROM values
				printf("Reading EEPROM values ...\n\n");
				if( eeprom_read_data(&eeprom, &data) == 0)
				{
				  memcpy(sn,data.serial,6);
					printf("Actual EEPROM values:\n");
					printf("---------------------\n");
					printf("Serial: \t\t\t%s\n", sn);
					printf("Differential pressure offset:\t%f\n",data.zero_offset);
				}
				else
				{
					printf("EEPROM content not valid !!\n");
					printf("Please use -i to initialize EEPROM !!\n");
					exit_code=2;
					break;
				}

from 24c16.cpp

int eeprom_read_data(t_24c16 *eeprom, t_eeprom_data *data)
{
	// read eeprom data to struct
	if (eeprom_read(eeprom, (char*)data, 0x00, sizeof(*data))==1)
		return 1;						// Failed to read the EEPROM

	// verify checksum
	if (!verify_checksum(data))
	{
		printf("EEPROM content not valid !!\n");
		printf("Please use -i to initialize EEPROM !!\n");
		return 2;
	}
	else
	{
		return 0;
	}
}

It seems to be returning 2 and printing error message twice as eeprom_read() is not printing error messages.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions