Member-only story

Using Raspberry Pico SDK to Send PubNub Message

Ferry Djaja
2 min readMay 19, 2023

--

I would like to share a method of utilizing the Raspberry Pico SDK to send a message to PubNub, and I have implemented it using C++ code. Since I am not extensively knowledgeable in C++, I sought assistance from ChatGPT to aid me in achieving the desired outcome with the Raspberry Pico SDK and PubNub integration.

The code presented in this example is based on the original code available from the Pico SDK examples. I have customized and adjusted it to facilitate the transmission of a JSON payload to PubNub.

I have defined two character arrays, WIFI_SSID and WIFI_PASSWORD, which will hold the Wi-Fi network name and password, respectively. These arrays are used to establish a connection to the desired Wi-Fi network.

The variables PubKey and SubKey store the publish and subscribe keys for PubNub. These keys are essential for authenticating the communication between the client and the PubNub service.

The JSON_PAYLOAD variable is a string formatted in JSON notation. It represents the content of the message that will be published using PubNub.

--

--

No responses yet