Cellular Interface MQTT Demo (Mutual Authentication) missing mbedtls files

Hello All,

I am trying to put together the Cellular MQTT Demo and run it on a custom modem.
Modem has already been ported to Cellular Interface and I am trying to setup tls and mqtt on top of it.
When I look at the files used by the demo I see the mbedtls cellular wrapper is mentioned to be under ./FreeRTOS-Plus/Source/Utilities/mbedtls_freertos/mbedtls_bio_freertos_cellular.c

However, when I navigate to Utilities folder on github mbedtls is not present.
I did some digging in git history and it seems like this commit has removed that folder:
FreeRTOS Windows Simulator Build Changes and LTS 2.0 Update

Readme.md file on that directory still mentions mbedtls folder so was that folder accidentally deleted?

Additionally, looking at the file from an older commit I see that mbedtls_cellular_send function uses Sockets_Send from sockets_wrapper.h interface. However, I don’t see where exactly Sockets_Send function is implemented to call Cellular Interface socket functions.

Thank you,
Tuna Bicim

Are you looking for the files in this folder - FreeRTOS/FreeRTOS-Plus/Source/Application-Protocols/network_transport at main · FreeRTOS/FreeRTOS · GitHub

I saw that folder but doesn’t have any files that mention cellular and as I already mentioned this folder FreeRTOS/FreeRTOS-Plus/Source/Utilities at main · FreeRTOS/FreeRTOS · GitHub still mentions mbedtls even though that folder doesn’t exist anymore.

Also, the link from the Cellular MQTT Demo page for Transport Interface points to https://github.com/FreeRTOS/FreeRTOS/blob/main/FreeRTOS-Plus/Source/Application-Protocols/network_transport/using_mbedtls/using_mbedtls.c
which doesn’t exist either.

I understand grouping files by common folders for reuse but this makes it really hard to discover where files come from on a demo especially when documentation is not updated to match when folders change.

Where should I look at to find where exactly the cellular wrappers for mbedtls is for the demo and also where Sockets_Send function that uses the Cellular Interface is implemented.

Hi Tuna,

Thank you for feedback your question.

My suggestion is to reference any one of the cellular demo project under FreeRTOS_Cellular_Interface_Windows_Simulator. You can see which files are required for the transport interface implementation with cellular.

Thank you again for pointing out the document is out of sync. This is something we can improve.

Hi Ching-Hsin,

Thank you so much for a detailed breakdown of the stack and also where to look for specific files.

I think I understand the layering much better now and I see why we need each file.

Can you explain when I would use mbed tls bio functions and why I would need them? A link to an explanation would also be appreciated if you have it handy. I just don’t know what exactly they do.

I saw the sln files for the demos but I am on a Linux machine.
I downloaded a vscode extension that opens sln files and displays them like a workspace and I can see all the files that are used. I won’t really be able to build or test the example since I don’t have access to one of the supported modems or a Windows machine but seeing where all the files come from is still quite beneficial.

I’ll make another post if I run into issues but this should get me starting so I appreciate the response.

Regards,
Tuna

Hi Tuna,

Mbed TLS bio functions are the send\recv callbacks that are called within the Mbed TLS library. They are implemented with TCP_Sockets_Send and TCP_Sockets_Recv.

mbedtls_ssl_set_bio is the API to set bio callbacks for Mbed TLS library. It is called in TLS_FreeRTOS_Connect indirectly when performing the TLS handshaking.