# How to get the ip of gateway v4, mac

**URL:** <https://bbs.aprbrother.com/t/how-to-get-the-ip-of-gateway-v4-mac/1405>\
**Category:** BLE Gateway\
**Created:** [December 22, 2018, 1:26am UTC](https://bbs.aprbrother.com/t/how-to-get-the-ip-of-gateway-v4-mac/1405 "2018-12-22T01:26:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhyqhs](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/b/b3f665/32.png) [@bhyqhs](https://bbs.aprbrother.com/u/bhyqhs)\
**Post date:** [December 22, 2018, 1:26am UTC](https://bbs.aprbrother.com/t/how-to-get-the-ip-of-gateway-v4-mac/1405/1 "2018-12-22T01:26:45Z")

</div>

Reference user manual ： [https://wiki.aprbrother.com/en/User\_Guide\_For\_AB\_BLE\_Gateway\_V4.html](https://wiki.aprbrother.com/en/User_Guide_For_AB_BLE_Gateway_V4.html)

keys contains ![image](https://bbs1.aprbrother.com/uploads/default/original/1X/fcce52699155c28e9f33fd4f527a8b4e9dd60254.png)

code：  
import paho.mqtt.client as mqtt  
import msgpack

def on\_subscribe(mosq, obj, mid, granted\_qos):  
 print("Subscribed: " + str(mid))

def on\_message(mosq, obj, msg):  
 for d in msgpack.unpackb(msg.payload)[b’mac’]:  
 print(’===============================’)  
 print(d)  
def on\_connect(mosq, obj, flags, rc):  
 print("Connected with result code " + str(rc))  
 mqttc.subscribe(“123221”, 0)  
 print(“Connected”)

mqttc = mqtt.Client()  
mqttc.on\_connect = on\_connect  
mqttc.on\_subscribe = on\_subscribe  
mqttc.on\_message = on\_message  
mqttc.connect(“[mqtt.bconimg.com](http://mqtt.bconimg.com)”, 1883, 60)  
mqttc.loop\_forever()

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [December 23, 2018, 3:59am UTC](https://bbs.aprbrother.com/t/how-to-get-the-ip-of-gateway-v4-mac/1405/2 "2018-12-23T03:59:08Z")

</div>

Please also paste the output of the python code. Here’s [an another python example](https://bbs.aprbrother.com/t/ble-gateway-v4-mqtt-and-problems-getting-information-msgpack-unpackb/1360/11)
