필터 지우기
필터 지우기

Test sending data from the ground station to the satellite

조회 수: 11 (최근 30일)
Edilson Filho
Edilson Filho 2022년 12월 27일
댓글: Edilson Filho 2023년 3월 11일
Hello all.
I want to send known data from the ground station to the nanosatellite and check if the data arrived and how long it took.For example, send data in 32-byte packets and see how long it took to send.
I want to monitor each packet sent. Thanks

답변 (1개)

Nadia Shaik
Nadia Shaik 2023년 3월 9일
Hi Edilson,
I understand that you want to send data from ground station to the nanosatellite and want to monitor each packet.
To send data from the ground station to the nanosatellite, the nanosatellite must have a serial interface connected to the serial port of the ground station. To monitor each packet sent, please follow the below steps:
  1. Connect to the serial port of the ground station:
s = serialport("COM3", 9600);
Replace "COM3" with the name of the serial port on your computer where the ground station is connected.
2. Open a log file to record the time stamps of each packet and define the data to be sent:
logFile = fopen("packetLog.txt", "w");
data = randi([0 255], 1, 32);
packetSize = 32;
3. Send the data in packets using a "for" loop and record the time stamp of each packet in the log file:
for i = 1:length(data)/packetSize
packet = data((i-1)*packetSize+1:i*packetSize);
write(s, packet, "uint8");
fprintf(logFile, "%s\n", datetime('now'));
pause(0.1); % wait for the nanosatellite to respond end
end
4. Close the log file and disconnect from the serial port:
fclose(logFile);
clear s;
You can then analyze the log file to see how long it took for each packet to arrive.
For more information please refer to the documentation of the "serialport" and "write" functions.
I hope this helps!
  댓글 수: 1
Edilson Filho
Edilson Filho 2023년 3월 11일
Hey Nadia
Thanks for your interest. Well, I'll explain better what I wanted to do on that occasion. I wanted to simulate a communication between a ground station and a nanosatellite. So my question should have been how to simulate this transmission in each overpass, each time there is an active link between the ground station and the nanosatellite. I then a code and put it on my github.
Your answer is interesting, as it is another scenario that I intend to implement in my studies in the future.
Thanks.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Reference Applications에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by