Twilight airglow: 1. Photoelectrons and [O I] 5577-Angstrom radiation