added error checking for sendmsg
quiet some debug output
only connect to bsim if you are actually using bsim in a portal!!
moved init code into init_bsim and init_hardware, for symmetry