I am a newbie to networking.
I have a Rpi-A connected to internet via 3G surf-stick and Rpi-B connected to internet via a WiFi hotspot.
I noticed that Rpi-A has a public IP address and Rpi-B has local/private IP. Both raspberry Pi's are on different networks.
I want to send binary data from Rpi-A to Rpi-B. Any suggestions on how can this be achieved?
update: I used the below code to test the MQTT connection. replacing XX.XX.XX.XX with public IP of raspberry Pi. Still I end up getting this error---> error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. what might be the possible reason for this error ? Is there anything missing in my code
import paho.mqtt.client as mqtt import time def on_connect(client, userdata, flags, rc): print("Connected with result code " + str(rc)) client = mqtt.Client() client.on_connect = on_connect client.connect("xx.xx.xxx.x", 1883, 60) client.loop_start() while True: time.sleep(2) client.publish('Due_0.72/cmd/in','hello') print "publish.."