Problems generating addresses using bip32
addrgen author here!

Addrgen was created before Electrum was BIP-0032 compatible and thus it used different master public keys and derivation method.

Please check the following PHP implementation which supports BIP-0032:


https://github.com/Bit-Wasp/bitcoin-lib-php


For python there are couple of implementations available, e.g.


https://pypi.python.org/pypi/bip32utils
https://pypi.python.org/pypi/pycoin/
https://pypi.python.org/pypi/bitcoin/