open serial ports using matlab web
14 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (1 件)
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.)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!