Can MATLAB Mobile on Android Access USB Serial Devices (Raspberry Pi Pico)?

33 visualizzazioni (ultimi 30 giorni)
Here's the hardware I'm working with:
  • Kindle Fire Tablet (10" 2023 edition) with USB OTG support
  • Raspberry Pi Pico (USB serial device)
  • USB debugging enabled on Android via developer settings
My goal is to establish serial communication between MATLAB Mobile on Android (on my Kindle Fire tablet) and a Raspberry Pi Pico via USB connection for a university engineering project. The same code works perfectly on desktop MATLAB.
Here's what I've figured out:
  • Desktop MATLAB on Windows successfully connects to the Pico using serialport()
  • The Pico is powered when connected to the Kindle Fire (USB connection is functional)
  • MATLAB Mobile accesses built-in Android sensors (accelerometer, camera, etc.)
My problem is that when running serialportlist on MATLAB Mobile, I only see built-in serial ports:
X = serialportlist;
disp(X)
Output: "/dev/ttyS2" "/dev/ttys0" "/dev/ttyS3" "/dev/ttyS1"
These are hardware UARTs on the Android device itself, not USB devices. When the Pico is properly detected via USB, I should see /dev/ttyACM0 or similar.
These are some extra issues I noticed.
  • No USB notification appears when Pico is plugged in (unlike when plugging into PC)
  • Attempting to connect gives: Unable to connect to the serialport device at port '/dev/ttyS1'
  • Android terminal apps (Termux) cannot access /dev/ without root (I would be willing to root my device but would rather not)
Here are my questions:
  1. Does MATLAB Mobile support USB serial communication at all? The documentation only mentions built-in sensors.
  2. If it does support USB, are there special Android permissions or settings required?
  3. Are there any workarounds or alternative approaches to connect external USB hardware to MATLAB Mobile?
  4. Would network-based communication (TCP/UDP) be supported if I switched to a Raspberry Pi Pico W?
Any guidance would be greatly appreciated. If USB serial isn't supported, I need to know definitively so I can find something different before my project deadline.

Risposta accettata

Satyam
Satyam il 17 Nov 2025 alle 7:56
Hi Tucker,
No, MATLAB Mobile on Android cannot access USB Serial devices using a serial connection. MATLAB Mobile allows you to connect to a MATLAB session running in the MathWorks Cloud. The Serial Port interface is supported by the following platforms, https://www.mathworks.com/help/matlab/import_export/troubleshooting-serial-port-interface.html
Unfortunately, it is not supported in MathWorks Cloud. So, Serial Port interface cannot be used from the MATLAB mobile. If you need to get data from a USB serial device into MATLAB Mobile, you can try out the following steps:
  1. Connect to a computer: Connect your USB serial device to a desktop computer running a full version of MATLAB.
  2. Use TCP/IP or UDP: Create a network connection (via TCP/IP or UDP) on the desktop to stream the serial data to your Android device.
  3. Use MATLAB Mobile: Use MATLAB Mobile on your Android device to receive and process the data over the network connection.
  1 Commento
Tucker
Tucker il 18 Nov 2025 alle 2:26
Hi Satyam, thanks for your response.
I figured this was the case, so unfortunately, I will not be able to use MatLab for this project. Disappointing that this functionality is not built into all MatLab versions; maybe MathWorks will implement something similar in the future?
For others having similar issues to me, I ended up forgoing MatLab entirely and using a Python server running Flask to host a local website where UI/UX elements can be displayed. This way, the entire system can run solely on the tablet and the Pico with no need for an external laptop or desktop.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Android Devices in Help Center e File Exchange

Prodotti


Release

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by