mtconnect / cppagent

C++ Agent toolkit - Pre-built binaries, visit: https://github.com/mtconnect/cppagent/releases Docker images available at https://hub.docker.com/repositories/mtconnect
http://mtcup.org/
Apache License 2.0
143 stars 91 forks source link

v2.3.0.14 - MQTT adapter port hard coded in source (1883) #471

Closed neildes2 closed 4 months ago

neildes2 commented 5 months ago

Agent.cfg has mqtt port set to 1885 and agent is overriding to 1883 causing no connection.

MqttPort = 1885

image

image

wsobel commented 5 months ago

Are you setting the MqttPort in the cfg file or in the URL? If it is in the URL, it gets set to Port and then should work.

I'll test this. I'm working on some other MQTT related issues and will roll this into the current changes.

neildes2 commented 5 months ago

We have the Port on a separate line. I will test on the same line

neildes2 commented 5 months ago

Confirmed. If port on url line instead of on separate line, it will connect with defined port#

wsobel commented 4 months ago

Can I close this?

neildes2 commented 4 months ago

Only if it has been fixed. I have a bunch of agent.cfg with port on separate line. We are holding off on upgrade until we have a fix.

wsobel commented 4 months ago

I think this in fixed in 15. The port is defaulted, not hard coded. I have been having issues with mosquito on alternate ports. I tested and it tried to connect except mosquito was a pain.

Could not connect with their tools either.

See if it works with new build.

Best W

wsobel commented 4 months ago

The two lines above check if the options have been set and if they are not it defaults. It should not override unless not set. That’s why I need to see the lines in the cfg to reproduce.

wsobel commented 4 months ago

The port is being set properly in my tests using the same configuration. I have checked with the 472 configuration and it seems to work fine. Can you verify in build 15.

wsobel commented 4 months ago

Tested alt port. Needed to set allow_anonymous to true. Looks like it only defaults to true when 1883 is used.

Anyway, seems to be working with same config as 472.

wsobel commented 4 months ago

Could also be URL parsing error with trailing slash. May not be port but host.

wsobel commented 4 months ago

I have created a PR for the next version on branch 472_adaper_startup_issues

Is there any way you can test this branch before I merge to main?

neildes2 commented 4 months ago

Downloading now to build and test

wsobel commented 4 months ago

Fixed in build 2.3.0.16

wsobel commented 4 months ago

Please test this in the latest build.

neildes2 commented 4 months ago

Confirmed this issue is resolved in V2.3.0.16