UDP send/receive block configuration for NTP Timestamp capturing on Raspberry pi in Simulink

8 ビュー (過去 30 日間)
VISHAL SAWANT
VISHAL SAWANT 2022 年 1 月 17 日
回答済み: Anshuman 2024 年 1 月 29 日
Hello,
Working on Raspberry pi with simulink support packages. I need Real timestamp in date and clock form for one application.
I understood it can be done by UDP communication with NTP server ( I am trying with ntpServer = "pool.ntp.org";)
I am new on UDP side and need help to understand commands sequence that I shall be following. As reference I am using follwing content
Any leads are welcome and I will highly appriciate.
Thanks.
Vishal

回答 (1 件)

Anshuman
Anshuman 2024 年 1 月 29 日
Hi, you can follow the following sequence of steps to get the real timestamp from an NTP server:
  • You will need to set up UDP communication between your Raspberry Pi and the NTP server. This involves configuring the UDP Send and UDP Receive blocks in Simulink to communicate with the NTP server.
  • Then you'll have to send an NTP request to the NTP server to request the current time.
  • After sending the request, you will receive a response from the NTP server. This response needs to be decoded to extract the timestamp information.
  • The timestamp received from the NTP server will be in the form of the number of seconds since January 1, 1900. You will need to convert this to a human-readable date and time format.
These are the general steps to follow to get the real timestamp from an NTP server.

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by