detecting BBB version?

easy question—how do I detect in software reliably the type and version of the BBB board that I am running?

/iaw

Read the EEPROM.

Gerald