MQTT in Mita
Antwort
05.04.19 20:50

I try to make XDK working with authenticated MQTT.

setup messaging : MQTT {
    authentication = Login(username = "my_user", password = "my_password" );
    clientId = "1234";
    cleanSession = true;
    transport = wireless;
    url = "mqtt://172.27.0.2:1883";
    var Test = topic("XDK/Test",1);    
}

I keep the following error message:

"INFO | XDK DEVICE 1: Error in XDK110 Application package.
 INFO | XDK DEVICE 1:     Package ID: 153
 INFO | XDK DEVICE 1:     Module ID: 0
 INFO | XDK DEVICE 1:     Severity code: 2
 INFO | XDK DEVICE 1:     Error code: 12
 INFO | XDK DEVICE 1: [ERROR, /root/XDK-Workspace/Mita_MQTT/src-gen/base/ConnectivityMQTTMessaging.c:404] MQTT_Connect : Failed to connect
 INFO | XDK DEVICE 1: [ERROR, /root/XDK-Workspace/Mita_MQTT/src-gen/base/ConnectivityMQTTMessaging.c:256] MQTT_Write : Connection failed!
 INFO | XDK DEVICE 1: [INFO, /root/XDK-Workspace/Mita_MQTT/src-gen/base/ConnectivityMQTTMessaging.c:250] MQTT_Write : Reconnecting..."

Every help is welcome :)

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
08.04.19 06:33 als Antwort auf François Boissinot.

Hi Francois

What MQTT server you are using for connection?

Try using the standard broker "mqtt://broker.hivemq.com:1883 "

Use good network for connection to the broker.

Thanks

Priyashi

 

 

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
08.04.19 09:13 als Antwort auf Priyashi Yadav.

Hi Yadav,

I use a RabbitMQ in my local network.

Francois

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
08.04.19 11:39 als Antwort auf François Boissinot.

Hi Francois,

I also just set up MQTT in Mita and i had problems when i tried to setup my wifi in my mqtt, so maybe try it seperated 

 setup wifi : WLAN {
    authentication = Personal(psk='yourPassword');
    ssid = '....';
}

setup mqttbroker : MQTT {
    transport  = wifi;
    url = 'mqtt://ip:1883';
    clientId ='yourClientId';

...}

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
09.04.19 06:07 als Antwort auf Emily Lindner.

Hi Both

setup net: WLAN {
  ssid = "MyWlan";
  authentication = Personal(psk = "password");
}
setup backend: MQTT {
  transport = net;
  url = "mqtt://ip:1883"; 
  clientId = "XDK42";
  var telemetry = topic("telemetry");
}

every 100 milliseconds {
  backend.telemetry.write(`${accelerometer.magnitude.read()}`);
}

Please refer https://www.eclipse.org/mita/platforms/xdk110

for more information

Thanks

Priyashi

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
09.04.19 07:22 als Antwort auf Priyashi Yadav.

Hello

MQTT is working for me on a local broker, but is it also possible to connect it with Enterprise WIFI?

I know there is an enterprise option but it doesnt really seem to work when i flash it on my XDK.

Regards

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
09.04.19 19:14 als Antwort auf Emily Lindner.

Hello,

Which MQTT broker are you using? Is it using authentication?

Regards

Francois

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
10.04.19 05:53 als Antwort auf François Boissinot.

Hello 

Im using an Broker from my company and as far as i know its not using authentication.

Regards

Emily

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
10.04.19 14:23 als Antwort auf Emily Lindner.

Hello Emily,

Enterprise connection is supported in WiFi. To establish the same, modify the WLAN setup in your Mita code as below,

setup net : WLAN{
	authentication=Enterprise(username="youruserid", password="yourpwd");
	ssid = "yourssid";
	isHostPgmEnabled=true;
}

Can you brief on the statement " doesnt really seem to work "? Do you see any connection error ?

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
10.04.19 14:20 als Antwort auf Padmapriya G.

Hi François Boissinot,

You mentioned that RabbitMQ is being used as broker. MQTT plugin must be enabled in the RabbitMQ broker as per the documentation https://www.rabbitmq.com/mqtt.html. Have you enabled the plugin and still facing issue ?

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
10.04.19 18:19 als Antwort auf Padmapriya G.

Hi,

The plugin in enabled and I can send and receive messages with mosquitto_pub and mosquitto_sub.

Can be something wrong with the authentication to the broker? The Wifi connection is OK.

 [INFO, /root/XDK-Workspace/Mita_MQTT/src-gen/main.c:210] enable ConnectivityWLANWireless succeeded
 INFO | XDK DEVICE 1: Error in XDK110 Application package.
 INFO | XDK DEVICE 1:     Package ID: 153
 INFO | XDK DEVICE 1:     Module ID: 0
 INFO | XDK DEVICE 1:     Severity code: 2
 INFO | XDK DEVICE 1:     Error code: 12
 INFO | XDK DEVICE 1: [ERROR, /root/XDK-Workspace/Mita_MQTT/src-gen/base/ConnectivityMQTTMessaging.c:397] MQTT_Connect : Failed to connect
 INFO | XDK DEVICE 1: [ERROR, /root/XDK-Workspace/Mita_MQTT/src-gen/main.c:224] failed to enable ConnectivityMQTTMessaging

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
11.04.19 05:03 als Antwort auf François Boissinot.

Hi Francois

There is a issue with authentication to the broker.

https://www.rabbitmq.com/access-control.html

This above link describes the authentication details for RabbitMQ .

Thanks

Priyashi

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
11.04.19 05:40 als Antwort auf Priyashi Yadav.

Hello

Im getting following output on my console when i flash it : 

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
11.04.19 09:00 als Antwort auf Emily Lindner.

Hello,

Did you flash the WiFiHostProgramming XDK project before you before you tried out the Enterprise project?

https://xdk.bosch-connectivity.com/community/-/message_boards/message/368415#_19_message_373269

https://xdk.bosch-connectivity.com/documents/37728/87798/XDK_Enterprise_WIFi_update/5c3475d8-a51a-48fc-83e4-ddf07563c10a

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
11.04.19 10:28 als Antwort auf François Boissinot.

Hello

I tried it but when i wanted to flash it , it just said " Invalid application ".

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
24.04.19 17:23 als Antwort auf Emily Lindner.

Hi Emily,

Which bootloader have you? If I remember well I was able to flash it only with bootloader 0.0.9 and 0.0.10.

I upgraded my XDK in 3 steps. Downgrade to 0.0.x if necessary, Flash and upgrade WifiEnterprise, Upgrade to whatever the newest bootloader is.

0 (0 Stimmen)
RE: MQTT in Mita
Antwort
25.04.19 10:52 als Antwort auf François Boissinot.

Hi Francois,

I have the Version 1.1.0 . How can i downgrade to 0.0.x ? 

0 (0 Stimmen)