"(Waiting for data)" and empty "InitialTimestamp" when executing the commands descriebed in "Stream Sensor Data with MATLAB Object Properties"
Show older comments
I try to read the sensor data from my phone with a MathLab script. The sensors work just fine when I read them in the "Sensors"-Tab in the MathLab-App on my phone.
Everything is set up according to the the description "Stream Sensor Data with MATLAB Object Properties" (https://de.mathworks.com/help/matlabmobile/ug/stream-sensor-data-with-mobiledev-logging-property.html)
When I execute the script in the MathLab-App on my phone the InitialTimestamp is empty (' ') and the arrays of the sensor data are empty (e. g. MagneticcField: [0x3 double] (Waiting for data))
This is the code is use:
% a script to test the sensor read out
disp('script started')
clear m
m = mobiledev
m.MagneticSensorEnabled = 1
m.PositionSensorEnabled = 1
m.Logging = 1
disp(m)
m.MagneticField
clear m
disp('script finished')
The output one my phone looks like this:
script started
m =
mobiledev with properties:
Device: 'Google - Pixel 6a(d89f)'
Connected: 1
Logging: 0
AvailableCameras: {'back' 'front'}
AvailableMicrophones: {'Pixel 6a-back' 'Pixel 6a-bottom'}
SelectedMicrophone: 'Pixel 6a-back'
InitialTimestamp: ''
AccelerationSensorEnabled: 0
AngularVelocitySensorEnabled: 0
MagneticSensorEnabled: 1
OrientationSensorEnabled: 0
PositionSensorEnabled: 1
MicrophoneEnabled: 0
Show all properties
m =
mobiledev with properties:
Device: 'Google - Pixel 6a(d89f)'
Connected: 1
Logging: 0
AvailableCameras: {'back' 'front'}
AvailableMicrophones: {'Pixel 6a-back' 'Pixel 6a-bottom'}
SelectedMicrophone: 'Pixel 6a-back'
InitialTimestamp: ''
AccelerationSensorEnabled: 0
AngularVelocitySensorEnabled: 0
MagneticSensorEnabled: 1
OrientationSensorEnabled: 0
PositionSensorEnabled: 1
MicrophoneEnabled: 0
Show all properties
m =
mobiledev with properties:
Device: 'Google - Pixel 6a(d89f)'
Connected: 1
Logging: 0
AvailableCameras: {'back' 'front'}
AvailableMicrophones: {'Pixel 6a-back' 'Pixel 6a-bottom'}
SelectedMicrophone: 'Pixel 6a-back'
InitialTimestamp: ''
AccelerationSensorEnabled: 0
AngularVelocitySensorEnabled: 0
MagneticSensorEnabled: 1
OrientationSensorEnabled: 0
PositionSensorEnabled: 1
MicrophoneEnabled: 0
Show all properties
m =
mobiledev with properties:
Device: 'Google - Pixel 6a(d89f)'
Connected: 1
Logging: 1
AvailableCameras: {'back' 'front'}
AvailableMicrophones: {'Pixel 6a-back' 'Pixel 6a-bottom'}
SelectedMicrophone: 'Pixel 6a-back'
InitialTimestamp: ''
AccelerationSensorEnabled: 0
AngularVelocitySensorEnabled: 0
MagneticSensorEnabled: 1
OrientationSensorEnabled: 0
PositionSensorEnabled: 1
MicrophoneEnabled: 0
Current Sensor Values:
MagneticField: [0x3 double] (Waiting for data)
Position Data:
Latitude: [0x1 double] (Waiting for data)
Longitude: [0x1 double] (Waiting for data)
Speed: [0x1 double] (Waiting for data)
Course: [0x1 double] (Waiting for data)
Altitude: [0x1 double] (Waiting for data)
HorizontalAccuracy: [0x1 double] (Waiting for data)
Show all properties
mobiledev with properties:
Device: 'Google - Pixel 6a(d89f)'
Connected: 1
Logging: 1
AvailableCameras: {'back' 'front'}
AvailableMicrophones: {'Pixel 6a-back' 'Pixel 6a-bottom'}
SelectedMicrophone: 'Pixel 6a-back'
InitialTimestamp: ''
AccelerationSensorEnabled: 0
AngularVelocitySensorEnabled: 0
MagneticSensorEnabled: 1
OrientationSensorEnabled: 0
PositionSensorEnabled: 1
MicrophoneEnabled: 0
Current Sensor Values:
MagneticField: [0x3 double] (Waiting for data)
Position Data:
Latitude: [0x1 double] (Waiting for data)
Longitude: [0x1 double] (Waiting for data)
Speed: [0x1 double] (Waiting for data)
Course: [0x1 double] (Waiting for data)
Altitude: [0x1 double] (Waiting for data)
HorizontalAccuracy: [0x1 double] (Waiting for data)
Show all properties
ans =
0×3 empty double matrix
script finished
Accepted Answer
More Answers (0)
Categories
Find more on Sensor Data Collection in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!