Automatic detection of Arduino COM port in Matlab - matlab

I don't want to use something like serial ('COM2') to read data from Arduino by Matlab.
Is there any way in Matlab to identify COM port of an Arduino board automatically?

You can use the arduino command (from the MATLAB Support Package for Arduino Hardware) without any arguments:
recreates the last successful connection to the Arduino® hardware. If
that connection fails, it creates a connection to the first official
Arduino hardware connected to your host computer via USB.

Related

T-PicoC3 how to configure Micropython Network/Sockets using ESP32 over UART as NIC?

I'm using a T-PicoC3 and a custom build of Micropython on the RP2040. The only notable difference in the build is the inclusion of network, sockets, websockets, webrepl.
I'm getting the error: "OSError: no available NIC" which makes sense, as I have no NIC defined. The issue is, there are no documents on how to establish an ESP32 running AT commands over UART as a NIC. If this is even possible?
The end goal is to use ntptime and other u/socket based libraries on the T-PicoC3 without modification.

How could I make the raspberry pi as a WIFI and ssh module

For a digital design course, we have to use a microcontroller as the CPU of the system. The chip we plan to use is STM32L0C8T6. We want to integrate the SSH function into a keyboard. The way we plan to do it is to connect the STM32 with a Raspberry pi zero or 2 through UART or SPI. The Pi will connect to the WIFI and connect to other hosts through SSH. An LCD display is also connected to the STM32 which will work like the monitor, displaying all things you will see when ssh, like whatever is shown in the terminal when ssh.
My question is how to build the connection between the terminal and STM32. One possible way is to dump everything in the terminal into a file and send the file back to STM32 for display. I think this will be really slow. Are there any better ideas?
The question sounds wired, and I know we could connect LCD directly to the Pi, but this is the project requirement to have to follow. The LCD has to connect to the microcontroller.
Thank you so much!!!!

Can you access another server in the middle of the code?

I'm trying to run an optimization algorithm on the VS code on my pc. During the process, I need to access the raspberry pi which controls the voltages. The value of the voltage range from 0-150v and is the variable of the optimization problem.
Using the Remote SSH extension on VS code, I managed to control the python file on raspberry pi so I can control the voltages on my PC. However this is done on the raspberry pi server, while I want the algorithm to be run using my PC's computational power. So I am wondering, are there anyway that for a local ipynb code, I can access the raspberry pi server in the process and then jump out and continue?
I am aware that there are other ways like using WINSCP to synchronize the data.

Communicate Between two Matlab Sessions Using Data Transfer Cable

We have a shared PC in our LAB, connected to a Vector Network Analyzer (VNA). The PC communicates with the VNA through GPIB port, using Matlab functions. For my work, i need to acquire real-time data from the VNA into my own PC, which is few meters away from the VNA PC. I dont want to have wireless solutions due to the interference that might happen. I intend to buy a USB data transfer cable to connect the Matlab. But i couldn't find in google any similar idea to do so. I was wondering is such a solution practical? Does anybody has the same experience? And will be any problem regarding the drivers?
in USB bus systems there can only be one USB host all other devices are in USB device mode.in most cases the USB controllers of PCs are not capable of USB device mode, they all want to be USB host. in other bus systems like I2C this is called master-slave architecture
if you are lucky one of your PCs can be set to device mode and in this case this will work but your chances are very slim (because of the problem with the USB host and USB device mode)
https://unix.stackexchange.com/questions/195765/is-usb-to-usb-data-transfer-between-two-linux-oses-possible
a better solution would be to use ethernet
there are also modules in MATLAB for real-time communication over ethernet (Real-Time Transmit and Receive over Ethernet)
if your pcs have unused ethernet ports use an ethernet crossover cable (http://en.wikipedia.org/wiki/Ethernet_crossover_cable) and connect the pcs (i.e. http://www.ccm.net/faq/6340-connect-pcs-using-a-crossover-ethernet-cable)
else use an ethernet switch (or hub) to establish the ethernet communication between the pcs
beside MATLAB for communication you can use i.e. ssh or install a vnc server on one of the machines and remote-control it with a vnc client on the other,...
USB
with USB-to-ethernet adapters (ebay,...) you can use ethernet over usb when connecting the usb-to-ethernet adapters via a ethernet crossover cable
another possibility is to use two USB-to-serial adapters and connect them with a RS-232 crossover cable and then use RS-232 protocol for communication (putty,...)

How to Stream data over TCP to a Windows 7 laptop?

Im acquiring data from a sensor using RaspberryPi. Now the idea is to get the data streaming over an ethernet link to my Windows 7 laptop and do the monitoring and recording on the laptop. Can I get some advice on how to implement this in C/C++.
The idea is to get the signal from a sensor streamed to a Windows GUI.
You can push data from your raspberry PI to you Windows
You can have some sort of service on your Windows box and your raspberry PI can push information to your software running on your Windows.
or
you can pull data from your raspberry PI to you Windows
In this case, raspberry PI would be a passive provider and Windows would ask for data.
Hard to give you more information without more details but basically you decide who is going to the passive and active and program that way.
I personally would request data from the raspberry PI to Windows as I can have my service running and just update when I need instead of having my service running and suddenly have my data changing.
That said, it's hard to say without more details.
You need to tell what kind of programming language are you going to use.
According to your question, you need to dig into socket programming.
Recently,I linked my two Raspberry-Pi by writing a python script to establish a TCP connection between them.
and there is this protocol called "RTSP(Real Time Streaming Protocol)" to (as the name says) stream data in real-time.
(If you are to use python , there is this module called gst-python for streaming).
I think the above infos would give you where to start.