Giter Club home page Giter Club logo

dslink-java-mqtt's Introduction

dslink-java-mqtt

Build Status

A DSLink that works with MQTT. More information about MQTT can be located at http://mqtt.org/

IMAGE ALT TEXT HERE

Distributions

Distributions can be ran independent of Gradle and anywhere Java is installed. Prebuilt distributions can be found here.

Creating a distribution

Run ./gradlew distZip from the command line. Distributions will be located in build/distributions.

Running a distribution

Run ./bin/dslink-java-mqtt -b http://localhost:8080/conn from the command line. The link will then be running.

Test running

A local test run requires a broker to be actively running. When adding MQTT servers all URLs must be prefixed with either:

  • tcp://
  • ssl://
  • local://

Running:
./gradlew run -Dexec.args="--broker http://localhost:8080/conn"

Common issues/troubleshooting

Status of new MQTT connection is "Disconnected"

When a new MQTT connection is created, the status always starts as 'Disconnected' since there is no subscription. Subscribe to the topics then if it works the status will be changed to 'Connected'.

After subscription data is not updating

This could be because of (1) server settings or (2) Broker is not reachable from server

(1) Server Settings:

  • Check server URL is correct. remove unwanted '/', ':' or any other character.

  • Verify if the server needs any authentication

  • Check the broker port details. Default port for most MQTT brokers is 1883 for plain MQTT or 8883 for MQTT over TLSs

  • Ensure that the client id is unique

(2) Network Analysis:

  • Try to connect to broker from server using a standlone tool like 'mosquitto_sub' (more details at https://mosquitto.org/man/mosquitto_sub-1.html).
    • Simple example: mosquitto_sub -h <host url> -t <topics> -v.
    • You could use 'mosquitto_pub' tool to publish topics for testing.

dslink-java-mqtt's People

Contributors

a-hansen avatar azenla avatar d-shapiro avatar gmtr-web avatar jurispuchin avatar lhruska avatar rinick avatar samrg472 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dslink-java-mqtt's Issues

dslink stops working after a few days

I'm using DG Solution Builder and my mqtt dslink is not working after a few days. In fact I have to remove all subscriptions and re-add them to get it running again. otherwise I just cannot see new incoming mqtt messages anymore. Does anybode have the same problem here? Log is not showing anything suspicious ...

Invalid value processing

When the value in json body is null (e.g. {"UPS Type":"SMART-UPS 3000 RM","STATUS":"Ready","folder":null,"BatteryCapacity":"100"} ) or invalid (e.g. {"UPS Type":"SMART-UPS 3000 RM","STATUS":"Ready","folder":"null","BatteryCapacity""100"}) the link does not send anything. It just logs the following error message:

[2018-12-04 08:24:09.552041] 2018-12-04 08:24:09.551 [MQTT Rec: xx] ERROR org.dsa.iot.mqtt.Mqtt - Lost connection to MQTT
[2018-12-04 08:24:09.552084] Connection lost (32109) - java.io.EOFException
[2018-12-04 08:24:09.552097] at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:181)
[2018-12-04 08:24:09.552110] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[2018-12-04 08:24:09.552121] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2018-12-04 08:24:09.552133] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
[2018-12-04 08:24:09.552145] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[2018-12-04 08:24:09.552153] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2018-12-04 08:24:09.552159] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2018-12-04 08:24:09.552165] at java.lang.Thread.run(Thread.java:748)
[2018-12-04 08:24:09.552170] Caused by: java.io.EOFException
[2018-12-04 08:24:09.552176] at java.io.DataInputStream.readByte(DataInputStream.java:267)
[2018-12-04 08:24:09.552182] at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:92)
[2018-12-04 08:24:09.552189] at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:133)
[2018-12-04 08:24:09.552195] ... 7 more
[2018-12-04 08:24:09.552201]

The null value in json body is a valid item in json. For invalid json value I would expect an error message in the properties tab.

are there any log files

Setup the link and added parameters, mqtt-spy can connect to broker, however in DGSB the Data\downstream\MQTT server is showing as disconnected and will not connect. Not sure where to start trouble shooting.

Getting segmentation fault on broker, malformed list response from mqtt

Using MQTT DSLink with EFM 1.6.1, the MQTT process starts recording this in the MQTT log after a subscription is added:
[2019-04-10 05:01:04.797421] ERROR(5000): Malformed list response,
[2019-04-10 05:01:04.797813] ERROR(5000): Malformed list response,
[2019-04-10 05:01:10.084911] ERROR(5000): Malformed list response,
[2019-04-10 05:01:10.086854] ERROR(5000): Malformed list response,
[2019-04-10 05:01:10.092951] ERROR(5000): Malformed list response,
[2019-04-10 05:01:14.790957] ERROR(5000): Malformed list response,
[2019-04-10 05:01:14.805954] ERROR(5000): Malformed list response,

The subscription still returns valid data to the topic and passes it to the upstream node.

However eventually a segmentation fault occurs in the broker. and the whole EFM app is unstable until it is restarted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.