.. _net-tok: Network Tokens ************** The Network Token of :class:`.Module` and :class:`.Gateway` :ref:`c-devices` are required to be equal in order to communicate with each other. This mechanism can be used to ensure that only your devices communicate through your gateway. To create a new :class:`.NetToken`, use the :meth:`.Account.create_network_token` method :: my_net_token = account.create_network_token("The Best Network") Now, that Network Token can be updated to the :class:`.Gateway` and :class:`.Module` :ref:`c-devices` to take effect. You can view the Network Token of the :ref:`module` by :: mod_net_token = module.network_token However, you must set this Network Token on the device, just like the :ref:`app-tok`. Viewing the Network Token on the :ref:`gateway` is very much the same as the :ref:`module` :: gw_net_token = gateway.network_token However, the :ref:`gateway`'s Network Token can be set to your Network Token remotely when regisering the gateway, :meth:`Account.register_gateway` :: # Using the Gateway's Address account.register_gateway("$101$0-0-0-dbXXXXXXX", my_net_token) # Or a Gateway Object. account.register_gateway(my_gw, my_net_token)