I posted a thread about my "new" truck purchase. In that I mention the problem I was having with getting P0031 and P0051 error codes. Now I am posting the fix (in my case at least). If anyone else gets both codes at the same time.
1) I grabbed the FSM from this thread. http://www.tacomaworld.com/forum/2nd...ir-manual.html
2) Found the section for my error codes.
3) Followed it down to the place where both codes meet (AF Heater Relay).
4) Found where the in cabin relay box was located. (Picture below behind the battery).
5) Found the correct relay for the AF Heater- Pulled it out. Man It's a bitch I tell you. In the picture below the AF Heater relay is circled red.
6) Pulled the Fog lamps Relay circled in gray (I tested this one an it was good- fog lights worked)
7) Switched them.
8) Restarted truck. No CEL. No battery clear. Truck is suppose to clear the CEL after start up once condition is cleared.
9) Drove around. Restarted a dozen more times. No CEL.
Hope this helps you.