Cannot Connect to TagoIO via MQTT – Authentication Fails

Cannot Connect to TagoIO via MQTT – Authentication Fails

Dear TagoIO Support Team,

I am encountering an issue while trying to connect to your MQTT broker at `mqtt.tago.io` on port `1883`.

Despite following the official documentation precisely and ensuring my device token is correct, the connection fails with the error: "Connection refused: Bad username or password".

Below is the exact Node.js code I’m using:

```javascript
const mqtt = require('mqtt');

const client = mqtt.connect('mqtt://mqtt.tago.io:1883', {
  username: 'Token', // Per documentation, literal string
  password: '92fc0f15-XXXXXXXXXXXXXXXXXX', // My device token
});

client.on('connect', () => {
  console.log('✅ Connected');
});

client.on('error', (err) => {
  console.error('❌ Error:', err.message);
});

I’ve double-checked:

  • Username is "Token" (case-sensitive, string)

  • The device token is current and active (copied from the Device > Access tab)

  • I’m using port 1883 (non-SSL)

  • No firewalls or connection issues on my end