MQTT external broker connection

Hi,
I am in the process of upgrading to Openhab 2.5.9 and MQTT2. I have found a lot of great information within the community which has been a huge help. Thankyou to all those who are contributing, answering questions and providing tutorials!

I have my internal mosquitto broker setup and working well, however I am having troubles getting broker connections established to my external MQTT services (ThingSpeak and Ubidots). Both were working seemlessly in Openhab 2.2 using the MQTT1 binding. I have confirmed in am able to access a write data to both external services using the same configuration/credentials via MQTT Explorer.

Ubidots broker things file as follows:

Bridge mqtt:broker:UBIDOTS_BRKR "Ubidots Broker"  [ 
	host="industrial.api.ubidots.com", 
	port=1883, 
	secure="false", 
	username=" ........ user specific token code ......"	]

Eventlog entry:

2020-11-11 19:51:06.979 [hingStatusInfoChangedEvent] - 'mqtt:broker:29385cc4' changed from OFFLINE (COMMUNICATION_ERROR): CONNECT failed as CONNACK contained an Error Code: NOT_AUTHORIZED. to OFFLINE

2020-11-11 19:51:07.227 [hingStatusInfoChangedEvent] - 'mqtt:broker:29385cc4' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): CONNECT failed as CONNACK contained an Error Code: NOT_AUTHORIZED.

openhab.log entry:

2020-11-11 19:51:06.982 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'industrial.api.ubidots.com' with clientid 44867a8a-8b65-478a-945a-142ac18fa590
2020-11-11 19:52:06.994 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to 'industrial.api.ubidots.com'. Next attempt in 60000ms

The event log obviously suggests a problem with log in credentials, however the service only requires the user specific token code to be supplied via the username field and it ignores the password field. I’ve tried creating a new user token with the same results. The original user token and the new token both work via MQTT Explorer.

My Thingspeak connection is showing connected in Paper UI under things, however ThingSpeak is not receiving updates with new data via my rules. Yes, I have confirmed that my rules are working and the items are being updated as they were in my previous installation.

ThingSpeak broker things file as follows:

 Bridge mqtt:broker:TS_BRKR "ThingSpeak Broker"  [ 
	host="mqtt.thingspeak.com", 
	port=1883, 
	secure=false,
	enableDiscovery=false ]

There are no messaging showing up in Events, Openhab or my mqtt log files associated with my thingspeak broker.

For reference, following is the entry for my local mqtt broker connection that is working fine:

Bridge mqtt:broker:Openhab_BRKR "Openhab Broker" [ 
	host="localhost", 
	port=1883, 
	secure=false,
	qos=0,
	clientID="openhab_TS",
	enableDiscovery=false ]

I am hoping someone may have and idea as to what I am missing here to cause the connections to the external mqtt brokers.
Thanks,
Ron

A small stab in the dark:

clientid 44867a8a-8b65-478a-945a-142ac18fa590

Does Ubidots require a specific client name to show up, or should it be happy with something random like this?

No it works with random.

Just need to enter password

, password ="pleasework"

Thankyou. That was the problem. Ubidots does not require an entry for password, but it seems that OpenHab requires some non-blank entry for password.