cancel
Showing results for 
Search instead for 
Did you mean: 

How to use X-Cube-Cellular v5.2.1 MQTT Client Application (publish, subscribe?)

McLovin
Associate III

Hi, hope someone could kindly help me out with this.

I am using the B-L462E-Cell-1 EVK with the 1SC modem from Murata.

My goal is to test MQTT on the device using X-Cube-Cellular v5.2.1 which has the MQTT client application. I have followed the readme to use IAR workbench IDE to include the relevant MQTT folders. I have also set the variables to use MQTT client.

I see these commands printed here. But the publish command doesn't work when I try to publish to the Hive MQ public MQTT broker. It seems to get stuck.

0693W00000NpQUVQA3.png 

I don't think this is a network related issue, since I used the cst command to check that my SIM has been configured already and I can received a signal. 

0693W00000NpSCJQA3.jpg 

My MQTT client configuration is seen here:

0693W00000NpS2iQAF.png 

Any ideas? Would appreciate some help from ST or the community. :)

1 ACCEPTED SOLUTION

Accepted Solutions
McLovin
Associate III

Update

Use the X-Cube-Cellular version (V7.0.0), which uses AzureRTOS and includes the NetXDuo network stack.

You can look into the ..\STM32CubeExpansion_CELLULAR_V7.0.0\Middlewares\ST\netxduo\addons folder to add the MQTT client.

There is also a MQTT sample code found in ..\STM32CubeExpansion_CELLULAR_V7.0.0\Middlewares\ST\netxduo\samples that explores how to connect and send data to a mosquitto broker.

If you do come across some undefined reference errors, then remember to include the paths to the header files by going to Properties → C/C++ General → Paths and symbols.

Credit to @JVand.12​ for the help.

View solution in original post

5 REPLIES 5
HDaji.1
Senior

Where did you download 5.2.1?

I only found 5.2.0, in which by default MQTT is not enabled.

I have compiling error after enabling MQTT.

It's 5.2.0 with the software patch found in the STMicro X Cube Cellular page.

Yes I also faced some compiling issues after enabling the MQTT client using STM32CubeIDE.

But there's a ReadMe inside one of the MQTT folders which says that IAR compiler needs to be used. Unfortunately that's only going to work with a 30 day trial or paying for the IAR IDE. So I'm stuck trying to implement it.

HDaji.1
Senior

I see your network operator is Singtel. What kind of SIM card do you use? How much is the cost?

HDaji.1
Senior

I wonder why IAR IDE can work, why CubeIDE cannot. Does not make sense.

They should use the same compiler.

McLovin
Associate III

Update

Use the X-Cube-Cellular version (V7.0.0), which uses AzureRTOS and includes the NetXDuo network stack.

You can look into the ..\STM32CubeExpansion_CELLULAR_V7.0.0\Middlewares\ST\netxduo\addons folder to add the MQTT client.

There is also a MQTT sample code found in ..\STM32CubeExpansion_CELLULAR_V7.0.0\Middlewares\ST\netxduo\samples that explores how to connect and send data to a mosquitto broker.

If you do come across some undefined reference errors, then remember to include the paths to the header files by going to Properties → C/C++ General → Paths and symbols.

Credit to @JVand.12​ for the help.