open serial ports using matlab web

조회 수: 18 (최근 30일)
Rolando Paz Herrera
Rolando Paz Herrera 2023년 2월 16일
댓글: Rolando Paz Herrera 2023년 3월 9일
I have some problems using serialport sentence in the online matlab enviroment. The serial port in windows it's called as 'COMx' but in linux is something like "/dev/ttySx" just like online matlab. So, when I try to open the port usin the sentence s = serialport("/dev/ttyS0", 115200) an error occurs saying Unable to connect to the serialport device at port '/dev/ttyS0', also happen using "COMx" instead. I gess that may be is some problems related with the access to the port of the computer from online matlab enviroment, but I don't know how fix it.

답변 (1개)

Walter Roberson
Walter Roberson 2023년 2월 16일
편집: Walter Roberson 2023년 2월 16일
MATLAB Online runs on a cloud somewhere. Your interface to it is through a web browser. The only part that runs on your own hardware is the web browser.
The only way for a web browser to access hardware that lives on your computer is by using an HTML5 interface. Security models in browsers have changed over the years so that JavaScript cannot access hardware except through specific interfaces. The only common browser that implements the interface is Chrome, and it is currently limited to playing sound and transferring some kinds of sensor data if I recall correctly.
In summary: there is no way for MATLAB Online to be able to access serial ports on your computer. That includes not being able to access arduino or raspberry pi.
(I have seen some hints that arduino connections might be available in the future.)

카테고리

Help CenterFile Exchange에서 Serial and USB Communication에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by