Connecting Python and Arduino, serial returns weird information

So essentially I am running a python script that grabs OSC information from my cellphone, from here I grab this information as


Currently, I am printing this information following this idea:

My issue is, that when I check the Serial Monitor, all that I am getting are reverse question marks and sometimes some squares and if I'm lucky a number.

this is also sending indefinitely.

I am going to try to simply return the values, address, and arguments from my OSC instead of printing it. If any of you have any ideas, I will appreciate them a lot.

This is my python code if it helps:

from pythonosc.dispatcher import Dispatcher
from pythonosc.osc_server import BlockingOSCUDPServer

def print_handler(address, *args):
    print(f"{address}: {args}")

def default_handler(address, *args):
    #print(f"DEFAULT {address}: {args}")
    #print(returner(address, *args))
    #returner(address, *args)

def returner(address, *args):
    stri = str(args)
    #print( type(address), type(stri) )

def returnAddress(address):
    return address

def returnArg(*args):
    filter = str(args)
    for elem in filter:
        if (elem.isdigit() == False):
            if (elem != "."):
                filter = filter.replace(elem,"")

    #filter.replace("(", "")
    return filter

dispatcher = Dispatcher()"/something/*", print_handler)

ip = "PlaceHolder"
port = 5555

server = BlockingOSCUDPServer((ip, port), dispatcher)
server.serve_forever()  # Blocks forever

some parts are removed since they have my IP.

This is my Arduino Code:

#include <Process.h>

void setup() {
  // put your setup code here, to run once:
  //Make a bridge
  //Make a Serial Killer, whoa scary!

  while (!Serial);

void loop() {
  // put your main code here, to run repeatedly:


void runPython() {
  Process p; //creation of the proccess
  p.runShellCommand("python /C:/Users/ashth/Desktop/");

  if (Serial.available() > 0) {
    // read the incoming string:
    String incomingString = Serial.readString();

    //prints the received data


Device: Arduino Uno or Elegoo Uno R3

Thanks in advance.

Looks like you've chosen the wrong baud rate.

Unfortunately you failed to read the sticky posts at the top of the forum as you posted your code as images.

As you're using the Bridge class I guess you use the Arduino Yun. What other information do you still hide from us?

Ah my bad, I have made some changes. Thanks for telling me! I thought I could use the bridge, is there another method I need to use in the case of using an Arduino Uno? I tried changing the baud rate, though I went with 9600 because that is what I saw as the default rate when googling, how do I know which is the right rate?

To do what exactly? You should start by telling us what hardware you use, how you wired it and what you're trying to achieve. Remember, in contrary to you we know nothing about your project.

If you used the Bridge library on an UNO you see the communication the library tried with the Linux part of the Yun. As the UNO doesn't have such part it communicates with the PC. It should be gone once you eliminated the Bridge library from your sketch.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.