Connecting the BlitzWolf® BW-SHP6 WIFI smart socket
Overview
In this tutorial, we will look at how to connect the BlitzWolf® BW-SHP6 2300W WIFI Smart Socket to the Kaa platform using the default MQTT-based protocol. You will learn how to connect the real device used for Data Analytics and Notifications webinar, publish the telemetry data and handle commands from the Kaa platform.
Prerequisites
- You know how to connect a device.
- You have installed the Arduino IDE.
Playbook
We will provide the custom software for the smart socket. To do this repeat the steps from 1 to 7 from the serial flash instructions guide.
After that go through the below steps.
-
Before opening the Arduino IDE download and place the customized for the Blitzwolf BL0937 smart socket version of HLW8012 library to the
Arduino/libraries
folder. Do not install the HLW8012 library from Arduino library manager. Other libraries may be installed from Arduino library manager. -
Open the bw-shp6_kaa_example project with an Arduino IDE and define bellow connection parameters in the
bw-shp6_kaa_example.ino
file.
#define WIFI_SSID "**********" // your WiFi network SSID
#define WIFI_PASS "**********" // your WiFi network password
#define KAA_HOST "**********" // the KAA host address
#define KAA_PORT 1883
#define KAA_TOKEN "**********" // your device token
#define KAA_APP_VERSION "**********" // the application version you are working with
- In the Arduino IDE select:
Tools->Board: Generic ESP8266 Module for BW-SHP6 10A.
Tools->Flash Size: 1M (no SPIFFS).
Tools->Port: [your usb-serial adapter COM port].
-
Upload the
bw-shp6_kaa_example
project to the ESP. -
All programming part is done. Please finish all hardware preparation and make the smart socket able to connect to the power.
Now our smart socket can send the telemetry data with the voltage, current, and power values.
Also, the device can receive commands from the Kaa platform to switch On/Off
its state.
Resources
- All tutorial resources are located on GitHub.
- Customized for the Blitzwolf BL0937 smart socket version of the HLW8012 library GitHub.
Next steps
- Complete the Getting Started tutorials cycle with short tutorials about the main Kaa features.
- Data Analytics and Notifications webinar - figure out how this smart socket used with Kaa platform for data analytics and notifications.
- Device management - find out more about device management feature.