mbed (FRDM K64F) with Helium

07 Jul 2017

Hi All,

We just polished up a guide on how to connect an mbed board to the Helium network and pipe the data to a cloud provider of your choice. (This doc uses the FRDM K64F but most mbed boards will be compatible with our adapters).

https://www.helium.com/dev/hardware-libraries/arm_mbed

The full development board is FRDM K64F sitting on top of a Arduino adapter (the pinout is compatible) that itself pins into a Helium XBee Atom Module.

https://www.helium.com/assets/docs/mbed/atomwithk64f-c8fbb6fd7d4731f80fba914af43eb03b39defd617075dedddfb958b60fdf21e5.jpg

Once that's built, you can program it via the mbed IDE by dropping in the helium_basic library. And the code that handles sending data wirelessly is quite tidy and simple. Here's the bulk of it:

{
        printf("Starting\n");

        printf("Info - ");
        struct helium_info info;
        int status = helium.info(&info);
        if (helium_status_OK == status) {
            printf("%" PRIx64 " - ", info.mac);
        }
        report_status(status);

        printf("Connecting - ");
        status = helium.connect();
        report_status(status);

        printf("Creating Channel - ");
        int8_t result;
        status = channel.begin("Helium Cloud MQTT", &result);
        report_status(status);

        printf("Sending - ");
        const char *data = "Hello Helium";
        status = channel.send(data, strlen(data), &result);
        report_status_result(status, result);
    }

(The full helium library and the helium_basic program are available in the mbed.org repository via the IDE. You just need to search for Helium in the Programs tab.)

Hopefully someone here will find this interesting and useful. :) You can get a full list of mbed and Helium dev resources here. Let me know if you have any questions.