Developer Portal Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Unable to get sensor data

    Highlighted
    Member

    Unable to get sensor data

    Hi all,

    I have created a project (Open C-project Wizard -> Name Project -> Finish) to implement the 'Enable all sensors in one' code which can be found here:

    https://developer.bosch.com/web/xdk/enable-all-sensors-in-one

    I copied the full code example into the '.c' file of my project in XDK Workbench. I then proceeded to clean the project, build the project and flash it to the XDK. Despite doing this, I am not receiveing any of the sensor measurements in my concole. I am guessing it may have something to do with the 72 warnings which are generated when building the project; particularly the onces which say the sensor statuses are depreceated. I have attached a zip file showing all the warnings and the console output. Other possibly relevant information:

     

    - The XDK remains connected to the com port before and after flashing (it is disconnected for the brief time when booting the application, as with every other program).

    - I have tried compiling the XDKApplicationTemplate and also a HelloWorldExample on the XDK, both of which work. 

    - When flashing to the device, LED 2 flashes orange, and LED 4 remains red. After connection has been established, all LEDs turn off.

    Thankyou in advance for helping.

    1 REPLY 1
    Highlighted
    Occasional Contributor

    Re: Unable to get sensor data

    Hello Stallion

    I have created a new XDK C project by Selecting File->New->Project option.

    New Project window opens. Under XDK, Selected C project and Clicked Next.

    New XDK C project window opens, I have given project name as "Sensor_Test" and Clicked Finish.

    "Sensor_Test" was created in Project Explorer.

    I have copied full source code from the https://developer.bosch.com/web/xdk/enable-all-sensors-in-one link. Removed the exisiting code from "AppController.c" file and pasted the copied code in "AppController.c" file of "Sensor_Test"  project.

    Compiled the Project and Flashed the binary into XDK device.

    I am able to get sensor data.

    I have attached test results below for reference,

     

     INFO | Try to flash application 'Sensor_Test.bin' on device 'XDK Device 1'
     INFO | Port 'COM12' has been disconnected
     INFO | Flashing application 'Sensor_Test.bin' successfully executed
     INFO | Booting application...
     INFO | Connecting to XDK device 'XDK Device 1' in port 'COM12'...
     INFO | Connection to port 'COM12' established
     INFO | Booting application...
     INFO | XDK DEVICE 1: b
     INFO | XDK DEVICE 1:  Performing application CRC validation (this will take a couple of seconds)
     INFO | XDK DEVICE 1:  Jumping to application
     INFO | Port 'COM12' has been disconnected
     INFO | Connecting to XDK device 'XDK Device 1' in port 'COM12'...
     INFO | Connection to port 'COM12' established
     INFO | XDK DEVICE 1: Accelerometer Converted data :
     INFO | XDK DEVICE 1: x =20 mg
     INFO | XDK DEVICE 1: y =11 mg
     INFO | XDK DEVICE 1: z =1044 mg
     INFO | XDK DEVICE 1: Accelerometer Raw data :
     INFO | XDK DEVICE 1: x =20 
     INFO | XDK DEVICE 1: y =11
     INFO | XDK DEVICE 1: z =1044
     INFO | XDK DEVICE 1: BME280 Environmental Conversion Data for Humidity:
     INFO | XDK DEVICE 1: h =78 %rh
     INFO | XDK DEVICE 1: BME280 Environmental Conversion Data for Pressure :
     INFO | XDK DEVICE 1: p =96165 Pa
     INFO | XDK DEVICE 1: BME280 Environmental Conversion Data for temperature :
     INFO | XDK DEVICE 1: t =26731 mDeg
     INFO | XDK DEVICE 1: Magnetometer Converted data :
     INFO | XDK DEVICE 1: x =4 microTesla
     INFO | XDK DEVICE 1: y =-34 microTesla
     INFO | XDK DEVICE 1: z =11 microTesla
     INFO | XDK DEVICE 1: r =6515
     INFO | XDK DEVICE 1: Magnetometer Raw data :
     INFO | XDK DEVICE 1: x =4
     INFO | XDK DEVICE 1: y =-34
     INFO | XDK DEVICE 1: z =11 
     INFO | XDK DEVICE 1: r =6515
     INFO | XDK DEVICE 1: Gyro Converted Data :
     INFO | XDK DEVICE 1: x =0 mDeg
     INFO | XDK DEVICE 1: y =-610 mDeg
     INFO | XDK DEVICE 1: z =61 mDeg
     INFO | XDK DEVICE 1: Gyro Raw Data :
     INFO | XDK DEVICE 1: x =0 
     INFO | XDK DEVICE 1: y =-610 
     INFO | XDK DEVICE 1: z =61 
     INFO | XDK DEVICE 1: Light sensor data obtained in millilux :74880 
     INFO | XDK DEVICE 1: Noise Sensor RMS Voltage :
     INFO | XDK DEVICE 1: Vrms = 0.000000 

     

     

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist