Mosquitto broker port 1883

hello all I am needing some help with connecting a mqtt agent, I am wanting to find out is it possible to connect to a mosquitto broker that is configured to a static ip address and on port 1883. I have set a user name and password as well. but i get this error

2024-12-18 12:11:41 2024-12-18 11:11:41.871  INFO    [ContainerScheduledExecutor-4  ] ocol.mqtt.AbstractMQTT_IOClient.PROTOCOL : Client 'mqtt://192.168.0.65:1883/?clientId=3xBXCvdvm9nDN2E1Vm7F9t' connection status changed: WAITING
2024-12-18 12:13:20 2024-12-18 11:13:20.673  INFO    [com.hivemq.client.mqtt-2-13   ] ocol.mqtt.AbstractMQTT_IOClient.PROTOCOL : Connection rejected by the broker 'mqtt://192.168.0.65:1883/?clientId=3xBXCvdvm9nDN2E1Vm7F9t': reasonCode=NOT_AUTHORIZED, initiator=SERVER

I think it could be how I am filling in the user name and password in the mqtt agent of openremote when I type it in it says json invalid this is how i have tried it.
{
“username”: #the username,
“password”: #the password
}
when I click save what i typed goes away i also tried
{
#the username,
#the password
}

the connection status just says waiting

I came right with connecting to the broker it was a rookie error in the username and password
{
“username”: “#username”,
“password”: “#password”
}

how would i need to structure the asset if my sensor payload is like this {“applicationID”:2,“devEUI”:“24e124136d319204”,“deviceName”:“Kitchen Freezer Sensor”,“humidity”:87,“magnet_status”:0,“temperature”:-19.9}

Hi Jonty :slight_smile:
The mqtt broker that OpenRemote works with via APIs is the same hivemq and is configured to only work on port 8883.
To connect an agent to OpenRemote, you must first install a mott service for standard ports (mosquito for example).

Then you can connect your agent.

Regards

1 Like

The mqtt broker that OpenRemote works with via APIs is the same hivemq and is configured to only work on port 8883.

Port 1883 is meant for temporary testing and unsecure connections, and uses mqtt://…
By default we use secure 8883 and mqtts://

You can check your docker-compose deployment files, to see what ports are mapped and
accessible from other machines.
.

how would i need to structure the asset if my sensor payload is like this {“applicationID”:2,“devEUI”:“24e124136d319204”,“deviceName”:“Kitchen Freezer Sensor”,“humidity”:87,“magnet_status”:0,“temperature”:-19.9}

You can check our documentation guide for this:

Specifically the chapter “Publish attribute values from the MQTT client”.
The payload of the MQTT message only has to be the JSON string you provided :wink:

1 Like

Hi @maurete
thanks for the input got it to connect.

@martin.peeters for now its a test environment hence I am using 1883, the gateway that I am using has a common topic as to where all the different sensors data goes. all the sensors have deveui’s if I make a asset that pulls the deveui and have json topics like temp, magnet_status and humidity would it populate those items?
just a bit unsure how to populate the asset object.

Hi @martin.peeters so before I went on holiday I had the gateway connected to the mosqiutto broker and openremote connected to the broker. Now that I am back openremote is connected but nothing is being received from openremote any idea what could have caused this?