GPSDev Function Unrecognized- ESP32 and GT-U7
When I run the first two code segments I get NaN/NaT or just no output but no error and when I the last two I get the error "Unrecognized function or variable ‘gpsdev’. I have tested the set up using the arduinoIDE and I get proper GPS output through that. I have also checked the baud rate, the communication between the esp32 and computer and that there is proper physical connection. Do you know why I am getting this error/no output? What is the best method to trouble shoot these errors? Any tips would be greatly appreciated. Thank you.
1.
a = arduino(‘COM3′,’ESP32-WROOM-DevKitC’,’Libraries’,’Serial’)
gps = gpsdev(a)
gpsData = gps.read;
latitude = gpsData.LLA(1);
longitude = gpsData.LLA(2);
gpsTime = gpsData.GPSReceiverTime;
% GPS returns UTC datetime. Convert it into system time zone.
gpsTime.TimeZone = ‘local’;
if(~isnan(latitude) && ~isnan(longitude))
% plot the position in geographic coordinates
fig = geoplot(latitude,longitude,’Marker’,"o",’MarkerSize’,6,’Color’,’red’,’MarkerFaceColor’,’red’);
% Sets the latitude and longitude limits of the base Map
geolimits([latitude-0.05,latitude+0.05],[longitude-0.05,longitude+0.05]) ;
% Selects the basemap
geobasemap streets;
timeString = strcat("Timestamp: ",string(gpsTime));
2.
a = arduino(‘COM3′,’ESP32-WROOM-DevKitC’,’Libraries’,’Serial’)
gps = gpsdev(a)
[tt,overruns] = read(gps)
3.
gps = gpsdev(‘COM4′,’OutputFormat’,"timetable")
[tt,overruns] = read(gps)
release(gps)
gps.SamplesPerRead = 2;
read(gps)
4.
s = serialport(‘COM3’, 9600)
gps = gpsdev(s,’OutputFormat’,"matrix")
[lla,speed,course,dops,gpsReceiverTime,timestamp,overruns] = read(gps)
%delete(gps);
%clear gps;
%clear a;
*These codes are adapted from MATWORKS references either by staff or other usersWhen I run the first two code segments I get NaN/NaT or just no output but no error and when I the last two I get the error "Unrecognized function or variable ‘gpsdev’. I have tested the set up using the arduinoIDE and I get proper GPS output through that. I have also checked the baud rate, the communication between the esp32 and computer and that there is proper physical connection. Do you know why I am getting this error/no output? What is the best method to trouble shoot these errors? Any tips would be greatly appreciated. Thank you.
1.
a = arduino(‘COM3′,’ESP32-WROOM-DevKitC’,’Libraries’,’Serial’)
gps = gpsdev(a)
gpsData = gps.read;
latitude = gpsData.LLA(1);
longitude = gpsData.LLA(2);
gpsTime = gpsData.GPSReceiverTime;
% GPS returns UTC datetime. Convert it into system time zone.
gpsTime.TimeZone = ‘local’;
if(~isnan(latitude) && ~isnan(longitude))
% plot the position in geographic coordinates
fig = geoplot(latitude,longitude,’Marker’,"o",’MarkerSize’,6,’Color’,’red’,’MarkerFaceColor’,’red’);
% Sets the latitude and longitude limits of the base Map
geolimits([latitude-0.05,latitude+0.05],[longitude-0.05,longitude+0.05]) ;
% Selects the basemap
geobasemap streets;
timeString = strcat("Timestamp: ",string(gpsTime));
2.
a = arduino(‘COM3′,’ESP32-WROOM-DevKitC’,’Libraries’,’Serial’)
gps = gpsdev(a)
[tt,overruns] = read(gps)
3.
gps = gpsdev(‘COM4′,’OutputFormat’,"timetable")
[tt,overruns] = read(gps)
release(gps)
gps.SamplesPerRead = 2;
read(gps)
4.
s = serialport(‘COM3’, 9600)
gps = gpsdev(s,’OutputFormat’,"matrix")
[lla,speed,course,dops,gpsReceiverTime,timestamp,overruns] = read(gps)
%delete(gps);
%clear gps;
%clear a;
*These codes are adapted from MATWORKS references either by staff or other users When I run the first two code segments I get NaN/NaT or just no output but no error and when I the last two I get the error "Unrecognized function or variable ‘gpsdev’. I have tested the set up using the arduinoIDE and I get proper GPS output through that. I have also checked the baud rate, the communication between the esp32 and computer and that there is proper physical connection. Do you know why I am getting this error/no output? What is the best method to trouble shoot these errors? Any tips would be greatly appreciated. Thank you.
1.
a = arduino(‘COM3′,’ESP32-WROOM-DevKitC’,’Libraries’,’Serial’)
gps = gpsdev(a)
gpsData = gps.read;
latitude = gpsData.LLA(1);
longitude = gpsData.LLA(2);
gpsTime = gpsData.GPSReceiverTime;
% GPS returns UTC datetime. Convert it into system time zone.
gpsTime.TimeZone = ‘local’;
if(~isnan(latitude) && ~isnan(longitude))
% plot the position in geographic coordinates
fig = geoplot(latitude,longitude,’Marker’,"o",’MarkerSize’,6,’Color’,’red’,’MarkerFaceColor’,’red’);
% Sets the latitude and longitude limits of the base Map
geolimits([latitude-0.05,latitude+0.05],[longitude-0.05,longitude+0.05]) ;
% Selects the basemap
geobasemap streets;
timeString = strcat("Timestamp: ",string(gpsTime));
2.
a = arduino(‘COM3′,’ESP32-WROOM-DevKitC’,’Libraries’,’Serial’)
gps = gpsdev(a)
[tt,overruns] = read(gps)
3.
gps = gpsdev(‘COM4′,’OutputFormat’,"timetable")
[tt,overruns] = read(gps)
release(gps)
gps.SamplesPerRead = 2;
read(gps)
4.
s = serialport(‘COM3’, 9600)
gps = gpsdev(s,’OutputFormat’,"matrix")
[lla,speed,course,dops,gpsReceiverTime,timestamp,overruns] = read(gps)
%delete(gps);
%clear gps;
%clear a;
*These codes are adapted from MATWORKS references either by staff or other users gps, esp32, gpsdev, gt-u7, serialport, read() MATLAB Answers — New Questions