04-29-2020, 11:18 PM
I am trying to use MATLAB to pull data from phyphox. I am trying to access this data every 20 seconds and to write over the previously stored data each time. This is the code that I wrote. When I run the code, it works, but the data that is collected is the same each time, which leads me to believe that I am not pulling the correct information. Am I using the wrong key words to get the information?
% remote access address
phyphox_address_home = 'IP';
% starts data collection in phyphox
start = webread('IP/control?cmd=start');
% initial data pull
address = sprintf('%sexport?format=0/get?gyr_time=0&gyrX|gyr_time&gyrY|gyr_time&gyrZ|gyr_time',phyphox_address_home);
GyroscopeData = webread(address)
% waits 5 seconds, then pulls data again
pause(5)
% pulls data every 20 seconds, writes over previous data
for i = 1:10
time = 20*i;
address = sprintf('%sexport?format=0/get?gyr_time=%d&gyrX|gyr_time&gyrY|gyr_time&gyrZ|gyr_time',phyphox_address_home,time);
GyroscopeData = webread(address)
pause(20)
end
% stops phyphox
stop = webread('IP/control?cmd=stop');
% remote access address
phyphox_address_home = 'IP';
% starts data collection in phyphox
start = webread('IP/control?cmd=start');
% initial data pull
address = sprintf('%sexport?format=0/get?gyr_time=0&gyrX|gyr_time&gyrY|gyr_time&gyrZ|gyr_time',phyphox_address_home);
GyroscopeData = webread(address)
% waits 5 seconds, then pulls data again
pause(5)
% pulls data every 20 seconds, writes over previous data
for i = 1:10
time = 20*i;
address = sprintf('%sexport?format=0/get?gyr_time=%d&gyrX|gyr_time&gyrY|gyr_time&gyrZ|gyr_time',phyphox_address_home,time);
GyroscopeData = webread(address)
pause(20)
end
% stops phyphox
stop = webread('IP/control?cmd=stop');