- How to send sensor data from any Python script to Datacake using Webhook Integration.
- How to send and receive sensor data using Paho MQTT Library and Third-Party MQTT Integration on Datacake.
Basic example on how to send sensor data to Datacake using a POST HTTP Webhook call. The URL we are performing a POST call on is the URL of an API Product (and Device) on Datacake.
This is the corresponding decoder for the above python example.
You can test the above Python example on your local desktop, machine, Raspberry Pi, whatever device that has Python support and Requests library installed. Simply run the example like the following:
pip3 install requests
python3 python_api_example.py
Bidirectional MQTT communication example.
For this example we are using a public Datacake MQTT Broker. The connection details are as follows:
- Host:
public-mqtt-93bb.managed-mqtt.com - Port:
1883or8883(for TLS with CA-Signed Certificate) - Username:
datacake - Password:
datacake
pip3 install paho
python3 python_api_example_mqtt.py