MQTT Certificate Works in Properties, But Not When Set in Blocks

Hi, I have a problem using my certificate in mqtt extension. When I put the certificate in Properties , it works fine. But when I put the certificate in a block , it doesn't work.

Capture2

example my cert
Capture

I tried three methods, but none of them worked:

  1. Separating the header and footer
    image

  2. Combining everything together
    image

  3. Splitting by line

Do you have any recommendations? Thank you!

(post deleted by author)

If you are developing with Niotron, why are you asking here ?

Assets are read only
Upload your file to the assets in the media section and read it from there

Thread closed, wrong community

Taifun

1 Like

I can do this on the Companion, but after generating the APK, it doesn't work. I think the issue is due to an incorrect file path, but I don't know the correct one.

Can you tell me about media section?

The media section is that part of the designer where you can upload files into your project like images etc and also your cert and key file

Taifun

1 Like

Thank you! Oh, I understand you now, but I can't hardcode the cert in the app because it changes based on certain conditions.

In this case I would store the files in ASD (which is the default location for the file component) and set them from there

To get the path to the ASD you can use an extension, for example Get the path of → ASD (app-specific dir) & → private data dir (internal storage) or these blocks

Taifun

1 Like