SEND DATA TO IOT SIGHT
Antwort
11.04.19 16:35

Hi, I am trying to send light sensor data to IOT Sight but I am not very sure how. I am using workbench version 3.6.0 and example HttpExampleClient.

I have screenshot the changes I make in the AppController.C and AppController.h I am not sure whether I am doing it correctly...

Please guild me. Thank You.

0 (0 Stimmen)
RE: SEND DATA TO IOT SIGHT
Antwort
12.04.19 05:37 als Antwort auf ng John.

Hi NG John

1. You can use the common sensor module from xdk110/Common/source/sensors.
2. Define a structure in AppController.c for sensors and enable only light sensor.
static Sensor_Setup_T SensorSetup =
        {
                .CmdProcessorHandle = NULL,
                .Enable =
                        {
                                .Accel = false,
                                .Mag = false,
                                .Gyro = false,
                                .Humidity = false,
                                .Temp = false,
                                .Pressure = false,
                                .Light = true,
                                .Noise = false,
                        },
                .Config =
                        {
                                .Accel =
                                        {
                                                .Type = SENSOR_ACCEL_BMA280,
                                                .IsRawData = false,
                                                .IsInteruptEnabled = true,
                                                .Callback = AccelAppCallback,
                                        },
                                .Gyro =
                                        {
                                                .Type = SENSOR_GYRO_BMG160,
                                                .IsRawData = false,
                                        },
                                .Mag =
                                        {
                                                .IsRawData = false,
                                        },
                                .Light =
                                        {
                                                .IsInteruptEnabled = false,
                                                .Callback = LightAppCallback,
                                        },
                                .Temp =
                                        {
                                                .OffsetCorrection = APP_TEMPERATURE_OFFSET_CORRECTION,
                                        },
                        },
        };/**< Sensor setup parameters */
3. In AppControllerSetup under AppController.c file , setup sensor and wifi
4. In AppControllerSetup under AppController.c file , Enable sensor and wifi
5. In AppControllerFire call Sensor_GetData(&sensorData) and the http get and post related apis.

For sensor related configuration you can refer SendDataOverMQTT or StreamSensorDataOverUsb.
In that you will find how to configure sensors and get the data
6. Use HttpExampleClient for sending the sensor data to the server and also use the correct format for sending the data.
 Also you can refer post https://xdk.bosch-connectivity.com/community/-/message_boards/message/487553
 
Revert if you face any issues.

Thanks
Priyashi

0 (0 Stimmen)