I am trying to use Process.h library to run a shell command. Here is my code. I am using Arduino Uno.

#include <Process.h>
#include <Bridge.h>

void setup() {
  // Initialize Bridge

  // Initialize Serial

  // Wait until a Serial Monitor is connected.
  while (!Serial);

  // run various example processes

void loop() {
  // Do nothing here.

void runPythonFunction() {

  Process p;        // Create a process and call it "p"
  //p.begin("/usr/bin/python /home/kairos/Arduino/codes/sketch_jan26a/tweet.py");
  p.runShellCommandAsynchronously("/usr/bin/python -U /path/to/tweet.py");      // Run the process and wait for its termination
  // Print command output on the SerialUSB.
  // A process output can be read with the stream methods
  while(p.available() > 0) {
     char c = p.read();
  // Ensure the last bit of data is sent.

If I do not comment the Bridge.begin() line, then in monitor display reverse question marks are displayed. And after commenting that, I am getting some garbage on the serial monitor. Also, my python script makes a new file in the same directory, which runs fine if I run it using a terminal. But if I run it using Arduino code, I am not able to see that new file being generated.

Even using p.begin() and p.run()it does not run. Nor using p.runShellCommandAsynchronously().

So how can I run that python script?

  • Do you have a Yun shield on your Uno?
    – Majenko
    Commented Jan 27, 2018 at 17:35
  • 1
    I am actually using SparkFun Redboard, same as this robotshop.com/en/…
    – Riken Shah
    Commented Jan 27, 2018 at 17:36
  • Do you have a Yun shield plugged into your SparkFun Redboard?
    – Majenko
    Commented Jan 27, 2018 at 17:38
  • No, I have directly connected the board to the computer.
    – Riken Shah
    Commented Jan 27, 2018 at 17:38
  • Was your intention to make your Arduino trigger the execution of a Python script which is on your computer?
    – per1234
    Commented Jan 27, 2018 at 23:34

1 Answer 1


The Uno cannot run python.

The Bridge library is intended for communication either between the two MCUs of the Yun, or between an Arduino board and the MCU on a Yun shield.

It is literally a Bridge between the two systems - Arduino and the Linux system in the Yun.

  • Is there any way I can run a python script?
    – Riken Shah
    Commented Jan 27, 2018 at 17:41
  • 2
    I knew you were going to ask that. Buy a Yun.
    – Majenko
    Commented Jan 27, 2018 at 17:42
  • Don't buy a Yún, it is an endless source of troubles. Buy a Raspberry Pi, and you have a full linux operating system for less money.
    – Jot
    Commented Jan 27, 2018 at 21:32
  • Tried it with Rpi, completed it in 20min, the same task that I was trying from two days #hackathon
    – Riken Shah
    Commented Jan 28, 2018 at 3:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.