femtomc / MQTT.jl

Updated MQTT interface for Julia.
0 stars 0 forks source link

connect returns error, not sure how to diagnose #2

Open schaefer01 opened 1 year ago

schaefer01 commented 1 year ago

Hi,

Using your example with no changes, I did not see a response.

I decided to change the broker to point to a computer on my network runnning mosquitto.

I first verified using python with a paho client and a mosquitto broker with no problems but when I retried using julia and the same mosquitto broker but using your example except changing the broker, I get a connection refused error. Any ideas how to diagnose this?

connect(client, broker) ERROR: MQTT.MQTTException("connection refused identifier rejected") Stacktrace: [1] get @ ~/.julia/packages/MQTT/ZU9Oe/src/client.jl:329 [inlined] [2] #connect#10 @ ~/.julia/packages/MQTT/ZU9Oe/src/client.jl:433 [inlined] [3] connect(client::Client, host::String, port::Int64) @ MQTT ~/.julia/packages/MQTT/ZU9Oe/src/client.jl:433 [4] connect(client::Client, host::String) @ MQTT ~/.julia/packages/MQTT/ZU9Oe/src/client.jl:433 [5] top-level scope @ REPL[25]:1

schaefer01 commented 1 year ago

The exception details in the stack trace and also the raised error message do not point to the failed line The stack trace points to the line the function starts and the line of of the exception handler

This reminds me of the python try/except “do not do this” example where beginner programmers will place large block of code between the try and the except.

Only I don’t know if this is a coding problem or (more seriously) a julia language problem.

I’m going to instrument the MQTT library until I find the offending statement.