필터 지우기
필터 지우기

Sending Wireless UDP signals in Matlab

조회 수: 5 (최근 30일)
Timothy Castiglia
Timothy Castiglia 2015년 7월 21일
댓글: Walter Roberson 2015년 7월 23일
I am a beginner with Matlab wireless connections. I simply want to send a number (0-255) wirelessly to another IP address. I send the signal with the code below but nothing seems to show up on the receiving end:
>> u=udp('192.168.1.101', 50002,'LocalPort', 50001);
=>> fopen(u);
=>> fwrite(u,50);
=>> fclose(u);
I have tried other variations of the upd function but I do not understand it very well. Is there anyone who knows what the Matlab code should look like? Or am I doing this right and something else must be wrong?
Thank you!
  댓글 수: 1
Walter Roberson
Walter Roberson 2015년 7월 21일
That code looks appropriate.
Are you able to ping the remote device?

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

답변 (1개)

Dasharath Gulvady
Dasharath Gulvady 2015년 7월 23일
Before executing "udp", start the UDP echo server using "echoudp":
You mentioned - "nothing seems to show up on the receiving end", how did you test this in the receiving end? What is the command you are using?
Execute all the commands mentioned in the example of "echoudp", and see if "fread" returns a valid result.
  댓글 수: 1
Walter Roberson
Walter Roberson 2015년 7월 23일
I do not see anything about this question that would suggest the use of the udp echo server? The destination is another IP address, not testing to the same IP address.

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

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by