On Wed, Apr 1, 2015 at 2:15 AM, krishna g <[email protected]> wrote:

> import paho.mqtt.client as mqtt
> print("hello")
> mqttc = mqtt.Client("python_pub")
> mqttc.connect("test.mosquitto.org", 1883)
> mqttc.publish("hello/krishna", "temp =28")
> mqttc.loop(2) #timeout = 2s
>



What problems are you having? Does this code work in your development
environment?

I skimmed the code for Paho ( download link here
<http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.python.git/commit/> )
and it looks like it uses threads to listen for messages. Due to the way App
Engine works and your module type
<https://cloud.google.com/appengine/docs/python/modules/#Python_Instance_scaling_and_class>,
you may not be able to use threads (and therefore this library) in your
application. It also looks like this library attempts to bind a listener
socket, which is not allowed by the Sockets service:
https://cloud.google.com/appengine/docs/python/sockets/

The best alternative would be to run this within a Managed VM service, or
set it up within a Compute Engine (GCE) VM and build your own way to
communicate from your app to the GCE box.


-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CALSvALB_G0WSR_JpnjtJTC5kgCNTJ0LBE1G2Sy-xbqemDn1EcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to