AnsweredAssumed Answered

mag3110 validation

Question asked by Deepanraj Anbarasan on Sep 5, 2017
Latest reply on Sep 7, 2017 by Deepanraj Anbarasan

Hi ,

 

We are currently using Magnetometer sensor mag3110 in imx6 based custom board.To enable the Magnetometer sensor we have given the following command

echo 1 > /sys/devices/virtual/input/input2/enable

After this command we tried executing the evtest application and we are getting the x,y and z values.

But we noticed that no matter whatever position we fix our module it seemed to give an value which keeps on varying.

Is there any other setting need to be done in driver for proper magnetic variation to be observed.

Please provide support on this magnetometer sensor.

Event: time 1486121046.812402, type 3 (EV_ABS), code 0 (ABS_X), value 138
Event: time 1486121046.812402, type 3 (EV_ABS), code 1 (ABS_Y), value -97
Event: time 1486121046.812402, type 3 (EV_ABS), code 2 (ABS_Z), value -848
Event: time 1486121046.812402, -------------- SYN_REPORT ------------
Event: time 1486121046.932455, type 3 (EV_ABS), code 0 (ABS_X), value 145
Event: time 1486121046.932455, type 3 (EV_ABS), code 1 (ABS_Y), value -100
Event: time 1486121046.932455, type 3 (EV_ABS), code 2 (ABS_Z), value -866
Event: time 1486121046.932455, -------------- SYN_REPORT ------------
Event: time 1486121047.052411, type 3 (EV_ABS), code 0 (ABS_X), value 142
Event: time 1486121047.052411, type 3 (EV_ABS), code 2 (ABS_Z), value -848
Event: time 1486121047.052411, -------------- SYN_REPORT ------------
Event: time 1486121047.172423, type 3 (EV_ABS), code 0 (ABS_X), value 143
Event: time 1486121047.172423, type 3 (EV_ABS), code 1 (ABS_Y), value -93
Event: time 1486121047.172423, type 3 (EV_ABS), code 2 (ABS_Z), value -858
Event: time 1486121047.172423, -------------- SYN_REPORT ------------
Event: time 1486121047.294711, type 3 (EV_ABS), code 0 (ABS_X), value 141
Event: time 1486121047.294711, type 3 (EV_ABS), code 1 (ABS_Y), value -97
Event: time 1486121047.294711, type 3 (EV_ABS), code 2 (ABS_Z), value -863
Event: time 1486121047.294711, -------------- SYN_REPORT ------------
Event: time 1486121047.412455, type 3 (EV_ABS), code 0 (ABS_X), value 142
Event: time 1486121047.412455, type 3 (EV_ABS), code 1 (ABS_Y), value -100
Event: time 1486121047.412455, type 3 (EV_ABS), code 2 (ABS_Z), value -851
Event: time 1486121047.412455, -------------- SYN_REPORT ------------
Event: time 1486121047.532428, type 3 (EV_ABS), code 0 (ABS_X), value 145
Event: time 1486121047.532428, type 3 (EV_ABS), code 1 (ABS_Y), value -92
Event: time 1486121047.532428, type 3 (EV_ABS), code 2 (ABS_Z), value -858
Event: time 1486121047.532428, -------------- SYN_REPORT ------------
Event: time 1486121047.652432, type 3 (EV_ABS), code 0 (ABS_X), value 149
Event: time 1486121047.652432, type 3 (EV_ABS), code 1 (ABS_Y), value -99
Event: time 1486121047.652432, type 3 (EV_ABS), code 2 (ABS_Z), value -864
Event: time 1486121047.652432, -------------- SYN_REPORT ------------
Event: time 1486121047.772405, type 3 (EV_ABS), code 0 (ABS_X), value 142
Event: time 1486121047.772405, type 3 (EV_ABS), code 1 (ABS_Y), value -97
Event: time 1486121047.772405, type 3 (EV_ABS), code 2 (ABS_Z), value -851
Event: time 1486121047.772405, -------------- SYN_REPORT ------------
Event: time 1486121047.892432, type 3 (EV_ABS), code 0 (ABS_X), value 147
Event: time 1486121047.892432, type 3 (EV_ABS), code 1 (ABS_Y), value -93
Event: time 1486121047.892432, type 3 (EV_ABS), code 2 (ABS_Z), value -848
Event: time 1486121047.892432, -------------- SYN_REPORT ------------
Event: time 1486121048.012426, type 3 (EV_ABS), code 0 (ABS_X), value 143
Event: time 1486121048.012426, type 3 (EV_ABS), code 1 (ABS_Y), value -98
Event: time 1486121048.012426, type 3 (EV_ABS), code 2 (ABS_Z), value -868
Event: time 1486121048.012426, -------------- SYN_REPORT ------------
Event: time 1486121048.132427, type 3 (EV_ABS), code 1 (ABS_Y), value -97
Event: time 1486121048.132427, type 3 (EV_ABS), code 2 (ABS_Z), value -860
Event: time 1486121048.132427, -------------- SYN_REPORT ------------
Event: time 1486121048.252440, type 3 (EV_ABS), code 0 (ABS_X), value 145
Event: time 1486121048.252440, type 3 (EV_ABS), code 1 (ABS_Y), value -99
Event: time 1486121048.252440, type 3 (EV_ABS), code 2 (ABS_Z), value -867
Event: time 1486121048.252440, -------------- SYN_REPORT ------------
Event: time 1486121048.372432, type 3 (EV_ABS), code 0 (ABS_X), value 141
Event: time 1486121048.372432, type 3 (EV_ABS), code 1 (ABS_Y), value -92
Event: time 1486121048.372432, type 3 (EV_ABS), code 2 (ABS_Z), value -860
Event: time 1486121048.372432, -------------- SYN_REPORT ------------
Event: time 1486121048.494689, type 3 (EV_ABS), code 0 (ABS_X), value 143
Event: time 1486121048.494689, type 3 (EV_ABS), code 1 (ABS_Y), value -91
Event: time 1486121048.494689, type 3 (EV_ABS), code 2 (ABS_Z), value -853
Event: time 1486121048.494689, -------------- SYN_REPORT ------------
Event: time 1486121048.614687, type 3 (EV_ABS), code 0 (ABS_X), value 139
Event: time 1486121048.614687, type 3 (EV_ABS), code 1 (ABS_Y), value -98
Event: time 1486121048.614687, type 3 (EV_ABS), code 2 (ABS_Z), value -854
Event: time 1486121048.614687, -------------- SYN_REPORT ------------
Event: time 1486121048.732439, type 3 (EV_ABS), code 0 (ABS_X), value 142
Event: time 1486121048.732439, type 3 (EV_ABS), code 1 (ABS_Y), value -97
Event: time 1486121048.732439, type 3 (EV_ABS), code 2 (ABS_Z), value -864
Event: time 1486121048.732439, -------------- SYN_REPORT ------------
Event: time 1486121048.852470, type 3 (EV_ABS), code 2 (ABS_Z), value -857
Event: time 1486121048.852470, -------------- SYN_REPORT ------------
Event: time 1486121048.972439, type 3 (EV_ABS), code 0 (ABS_X), value 139
Event: time 1486121048.972439, type 3 (EV_ABS), code 2 (ABS_Z), value -861
Event: time 1486121048.972439, -------------- SYN_REPORT ------------
Event: time 1486121049.092442, type 3 (EV_ABS), code 1 (ABS_Y), value -94
Event: time 1486121049.092442, type 3 (EV_ABS), code 2 (ABS_Z), value -854
Event: time 1486121049.092442, -------------- SYN_REPORT ------------
Event: time 1486121049.212297, type 3 (EV_ABS), code 0 (ABS_X), value 140
Event: time 1486121049.212297, type 3 (EV_ABS), code 1 (ABS_Y), value -96
Event: time 1486121049.212297, type 3 (EV_ABS), code 2 (ABS_Z), value -855
Event: time 1486121049.212297, -------------- SYN_REPORT ------------
Event: time 1486121049.332468, type 3 (EV_ABS), code 0 (ABS_X), value 143
Event: time 1486121049.332468, type 3 (EV_ABS), code 1 (ABS_Y), value -94
Event: time 1486121049.332468, type 3 (EV_ABS), code 2 (ABS_Z), value -860
Event: time 1486121049.332468, -------------- SYN_REPORT ------------
Event: time 1486121049.452463, type 3 (EV_ABS), code 0 (ABS_X), value 145
Event: time 1486121049.452463, type 3 (EV_ABS), code 1 (ABS_Y), value -92
Event: time 1486121049.452463, type 3 (EV_ABS), code 2 (ABS_Z), value -868
Event: time 1486121049.452463, -------------- SYN_REPORT ------------
Event: time 1486121049.572435, type 3 (EV_ABS), code 0 (ABS_X), value 140
Event: time 1486121049.572435, type 3 (EV_ABS), code 1 (ABS_Y), value -95
Event: time 1486121049.572435, type 3 (EV_ABS), code 2 (ABS_Z), value -857
Event: time 1486121049.572435, -------------- SYN_REPORT ------------
Event: time 1486121049.692446, type 3 (EV_ABS), code 0 (ABS_X), value 148
Event: time 1486121049.692446, type 3 (EV_ABS), code 2 (ABS_Z), value -860
Event: time 1486121049.692446, -------------- SYN_REPORT ------------
Event: time 1486121049.814711, type 3 (EV_ABS), code 0 (ABS_X), value 146
Event: time 1486121049.814711, type 3 (EV_ABS), code 1 (ABS_Y), value -96
Event: time 1486121049.814711, type 3 (EV_ABS), code 2 (ABS_Z), value -861

 

When we move the magnetometer towards North X-axis value seemed to be positive and when we move sensor towards the East then Y-axis seemed to be positive.But the Value obtained in Z-axis is always seemed to be negative in all the direction.

 

Thank you,

Deepanraj.A

Outcomes