You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "online" key value is not entered in the redis server, so when running the mission, "The device is offline, pleas try again later." An error occurs. Why can't I register online with redis? HMS continues to fly through mqtt
@Transactional(isolation = Isolation.READ_UNCOMMITTED)
@Override
public TopicRequestsResponse<MqttReply<FlighttaskResourceGetResponse>> flighttaskResourceGet(TopicRequestsRequest<FlighttaskResourceGetRequest> response, MessageHeaders headers) {
String jobId = response.getData().getFlightId();
Optional<DeviceDTO> deviceOpt = deviceRedisService.getDeviceOnline(response.getGateway());
if (deviceOpt.isEmpty()) {
log.error("The device is offline, please try again later.");
return new TopicRequestsResponse().setData(MqttReply.error(CommonErrorEnum.DEVICE_OFFLINE));
}
Optional<WaylineJobDTO> waylineJobOpt = waylineJobService.getJobByJobId(deviceOpt.get().getWorkspaceId(), jobId);
if (waylineJobOpt.isEmpty()) {
log.error("The wayline job does not exist.");
return new TopicRequestsResponse().setData(MqttReply.error(CommonErrorEnum.ILLEGAL_ARGUMENT));
}
WaylineJobDTO waylineJob = waylineJobOpt.get();
// get wayline file
Optional<GetWaylineListResponse> waylineFile = waylineFileService.getWaylineByWaylineId(waylineJob.getWorkspaceId(), waylineJob.getFileId());
if (waylineFile.isEmpty()) {
log.error("The wayline file does not exist.");
return new TopicRequestsResponse().setData(MqttReply.error(CommonErrorEnum.ILLEGAL_ARGUMENT));
}
// get file url
try {
URL url = waylineFileService.getObjectUrl(waylineJob.getWorkspaceId(), waylineFile.get().getId());
return new TopicRequestsResponse<MqttReply<FlighttaskResourceGetResponse>>().setData(
MqttReply.success(new FlighttaskResourceGetResponse()
.setFile(new FlighttaskFile()
.setUrl(url.toString())
.setFingerprint(waylineFile.get().getSign()))));
} catch (SQLException | NullPointerException e) {
e.printStackTrace();
return new TopicRequestsResponse().setData(MqttReply.error(CommonErrorEnum.SYSTEM_ERROR));
}
}
The text was updated successfully, but these errors were encountered:
The error occurs because the device's online status isn't being registered in Redis. As a result, when the system calls deviceRedisService.getDeviceOnline(), it returns an empty value, triggering the error message "The device is offline, please try again later." Meanwhile, HMS continues with the flight task via MQTT because its process is not directly blocked by this Redis check.
In short, the online key is missing in Redis, so the system incorrectly determines that the device is offline, even though HMS proceeds with MQTT operations.
The "online" key value is not entered in the redis server, so when running the mission, "The device is offline, pleas try again later." An error occurs. Why can't I register online with redis? HMS continues to fly through mqtt
The text was updated successfully, but these errors were encountered: