7 years, 11 months ago.

"simple-mbed-client" library not compiling

Hi, I am trying to follow the tutorial "Building an internet connected lighting system." at the link: https://docs.mbed.com/docs/building-an-internet-connected-lighting-system/en/latest/

hardware: -FRDM K22F board -ESP8266-01 wifi module -HCSR505 PIR motion module

problem: After copy and pasting the code in the section "adding connectivity," the software fails to compile, with the following error: Error: Identifier "mbedtls_ssl_conf_psk" is undefined in "simple-mbed-client/mbed-client/mbed-client-mbed-tls/source/m2mconnectionsecuritypimpl.cpp", Line: 203, Col: 18

I can't seem to find a single working example of "simple-mbed-client" library.

It seems there is an issue with simple-mbed-client. Please provide any feedback.

Thanks, -cpm219

1 Answer

7 years, 11 months ago.

These days we're required to have an mbed TLS Config file present... Very annoying as my tutorial is now outdated. For an example program (based on the same tutorial) which compiles against K22F, see: here (you'll need to define a button pin name in mbed_app.json for the K22F).

Also simple-mbed-client-example compiles for the K22F.

However, because the K22F does not have a built-in strong entropy source, you'll need to define the following macros:

MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES and MBEDTLS_TEST_NULL_ENTROPY

Add them to the 'macros' array in mbed_app.json (example).

I'll update the tutorials.

Accepted Answer

Hi, Thank you for the info. I have successfully compiled the program. my next battle is getting the device to show up on mbed device connector, which I have had no luck.

Does anyone know how I can get the device to show up on mbed device connector?

-cpm219

posted by Curtis Mattull 12 Jan 2017

I am not familiar with mbed TLS. However the K22F has an RNG. I don't know how good it is, but it is probably exactly the same as the K64F, and if I read it correctly that one is considered to have a built-in strong entropy source.

posted by Erik - 12 Jan 2017

@Erik, Good point. Wondering why the entropy source isn't configured in that case... I can't find any serial number on the RNG on the K22F, so can't assess whether it's the same one as K64F. Created an issue here to track.

@Curtis, if you use the esp8266 it should show the log's over serial output and indicate whether it successfully connects to WiFi. You might need to change the firmware on the esp8266 to this one...

posted by Jan Jongboom 12 Jan 2017

My esp8266 is updated with latest espressif firmware. Looking at the terminal I can see that it successfully connects to wifi. I think my issue is that the device is not registering with mbed device connector. Could it be the port? Every 30 secs roughly I see a tcp open and close. I never see a message saying registered successfully. Any ideas?

posted by Curtis Mattull 12 Jan 2017

@Curtis, can you try with the linked Espressif firmware?

posted by Jan Jongboom 12 Jan 2017

After trying a fresh simple-mbed-client-example, I was able to finally see the "device registered successfully" message and it also shows up on mbed device connector. Thanks for the help. I will definitely be playing with mbed cloud.

posted by Curtis Mattull 12 Jan 2017