82, 81 code 2008 e4 Gem car

I am getting the 82, 81 code. I the magnet on the pickup was cracked so I replaced it. The problem is still there. I initially get 82 then 81, the car will eventually go what seems at normal speed but the speedometer only registers 0.

Next time lead off with what year car this is.

Your error message appears to be with the sensor.
You could try cleaning out the connector at the motor, as well as the main connector on the controller with some electronics spray and a blast of compressed air as a hail mary, but you should probably replace the sensor.