identify device model from sysobjectid

This is a backport from 2.4 development branch
use new signature, and pass datadir
make timeout configurable
allow timeout to be set from the server
add timeout command-line option