mqtt

Example MQTT Client Code not working C

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I got the example code from here . I have the header file MQTTClient.h as well. However when I build I get the errors: undefined reference to MQTTClient_create undefined reference to MQTTClient_connect undefined reference to MQTTClient_publishMessage undefined reference to MQTTClient_waitForCompletion undefined reference to MQTTClient_disconnect In the header file these are set up as follows: DLLExport int MQTTClient_create(MQTTClient* handle, const char* serverURI, const char* clientId, int persistence_type, void* persistence_context); I am

Eclipse paho Mqtt:Getting java.io.EOF Exception

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting "java.io.eof" exception,when i am trying to subscribe mqtt client. I am using eclipse paho library and using mosquitto broker. I am not getting any answer of this,so please help me why this happens ? Mqtt connection and subscribe I am using this code for connecting and subscribing to mosquitto private void buildClient(String clientId){ log.debug("Connecting... "+clientId); try { mqttClient = new MqttClient(envConfiguration.getBrokerUrl(), clientId,new MemoryPersistence()); System.out.println(mqttClient.isConnected()); } catch

MQTT what is the purpose or usage of Last Will Testament?

我的未来我决定 提交于 2019-12-03 02:18:18
问题 I'm surely missing something about how the whole MQTT protocol works, as I can't grasp the usage pattern of Last Will Testament messages: what's their purpose? One example I often see is about informing that a device has gone offline. It doesn't make very much sense to me, since it's obvious that if a device isn't publishing any data it may be offline or there could be some network problems. So, what are some practical usages of the LWT? What was it invented for? 回答1: LWT messages are not

SparkStreaming, RabbitMQ and MQTT in python using pika

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Just to make things tricky, I'd like to consume messages from the rabbitMQ queue. Now I know there is a plugin for MQTT on rabbit ( https://www.rabbitmq.com/mqtt.html ). However I cannot seem to make an example work where Spark consumes a message that has been produced from pika. For example I am using the simple wordcount.py program here ( https://spark.apache.org/docs/1.2.0/streaming-programming-guide.html ) to see if I can I see a message producer in the following way: import sys import pika import json import future import pprofile def

Can a web browser use MQTT?

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We are looking at using MQTT as the messaging protocol on a new device we're building. We'd also like a web interface for the device. Does anyone know if you can implement a browser client app (without additional plugins) that talks MQTT? 回答1: Yes, as mentioned in Steve-o's comment MQTT via websockets is very possible. There are 2 options at the moment IBM's MQ 7.5 comes with websockets support, you can find details here . The Mosquitto broker has a javascript client with an example running here . To answer your second question lighttpd has

mosquitto MQTT broker and Java client with SSL / TLS

匿名 (未验证) 提交于 2019-12-03 02:00:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using mosquitto and the Eclipse PAHO Java client. Everything is working fine on plain TCP sockets. but now I want to use SSL for athentication (encryption not necessarily needed). first I followed the instructions from http://mosquitto.org/man/mosquitto-tls-7.html in mosquitto client I can not publish my message without the --insecure option, means i have to mosquitto_pub -h -p -t "/topic1/test" -m "testmsg" --cafile ca_cert.pem --cert client.crt --key client_priv.key --tls-version tlsv1.2 --insecure otherwise an protocol error appears

MQTT in AWS Lambda function for Alexa Javascript

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Please help, I need to use mqtt protocol in lambda function to send some data to a broker. I use simple code to test it : mqtt = require ( 'mqtt' ); var client = mqtt . connect ( 'mqtt://test.mosquitto.org' ); client . on ( 'connect' , function () { client . subscribe ( 'presence' ); client . publish ( 'presence' , 'Hello mqtt' ); }); client . on ( 'message' , function ( topic , message ) { // message is Buffer console . log ( message . toString ()); client . end (); }); But I get an error "Cannot find module 'mqtt'", how can I

PHP MQTT subscribe not consistent

匿名 (未验证) 提交于 2019-12-03 01:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to display some values using MQTT on a PHP based page. The PHP code contains the subscriber. I am using Bluemix IoT service for the MQTT broker. Also, the messages are published via Python code on local machine. When I try to display values on pages using page refresh, the page sometimes fails to display the values. There is no problem at the publisher end as the values are successfully displayed by Bluemix IoT service. My code is as follows: <? php // include class require ( 'phpMQTT.php' ); // set configuration values

MQTT (Mosquitto) Connection pool?

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What would you suggest for Mosquitto connection pooling in Java? We are wasting (blocking) too much time on establishing each connection, so we think some kind of reuse would be better. 回答1: I'd suggest using the generic object pooling in the Apache commons tools https://commons.apache.org/proper/commons-pool/ But also you could extend Thread to instantiate a MQTT connection object on creation and have a persistent connection per thread. This could be combined with the built in thread pool in the standard class libraries. I assume you do

Verify that local mosquitto MQTT Broker is bridged to test.mosquitto.org

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a local (OSX 11) mosquitto broker (1.4.7) running with the following config: connection test address test.mosquitto.org topic in_topic in 0 topic out_topic out 0 try_private false notifications false bridge_attempt_unsubscribe true I got the conf settings form here: bridge local mosquitto to cloud broker (thanks) I now have 3 terminals. A : subscribed to test.mosquitto.org directly using a ruby script and ruby-mqtt . B : subscribed to local broker with mosquitto_sub -t in_topic C : publishes using this command: mosquitto_pub -h test