Questions tagged [python]

Python is a programming language. Use this tag for questions regarding how to use Python with your Arduino, or on using of pySerial or such software. Also consider using [programming] and other specific tags.

Filter by
Sorted by
Tagged with
0
votes
0answers
27 views

Control Servo motor via Python GUI (PyQt) component “QDial”

I want to control a servomotor via a Python Gui (PyQt) component "QDial". Hopefully the servomotor should rotate "simultaneously" with the Dial in GUI. Below is the related code: ...
1
vote
1answer
52 views

Flash firmware with hex file over serial with Python (no avrdude, Arduino IDE)

I'm trying to make a Python function in the TCLab package to flash firmware to an Arduino Leonardo (32u4). I can compile the TCLab ino (firmware) and deploy with the Arduino IDE or with the Python ...
0
votes
1answer
48 views

Serial Read Data Loss With Arduino Nano

I am trying to use Serial reading from a python serial code (which is running on my Jetson Nano) in my project, but in some loop in my code, my data is receiving wrong. I use Serial.readBytesUntil() ...
0
votes
2answers
50 views

Arduino sends bad data ONLY when not connected at the launch my application

I'm trying to write a little sensor reading application with a light sensor attached to an Arduino, which writes the information from the sensor over serial. I have written a python program to read ...
1
vote
2answers
92 views

Debugging different serial receive / send behavior between Uno & Mega

I have a simple text parser (as a component of a larger project) coded up and seemingly working correctly. It parses a key-value delimited command like the following: <key1=value1;key2=value2;key3=...
0
votes
1answer
63 views

Can not receive data from python code

I want to send 4 float numbers from a python code to an Arduino, I was trying to send it via serial and i have some problems here is my python code: import time import serial import struct data = ...
0
votes
0answers
23 views

serial problem with python to arduino

when i execute the python script, the arduino response but the code between the if(Serial.available()) not responding. python script import time, serial arduino = serial.Serial('COM7', 9600) ...
-1
votes
1answer
29 views

Run servo when image is capture

I am trying to create a program when the camera capture the servo will rotate in 90 degrees continously, but my code will stop in print output 2 any idea to run the servo continously? Here's the Code ...
0
votes
2answers
1k views

Error 'exec: “python”: executable file not found in $PATH Error compiling for board AI Thinker ESP32-CAM.' in Arduino IDE 1.8.12

I am trying to upload a sketch to the ESP32-CAM board using Arduino IDE 1.8.12 and I get an error message: exec: "python": executable file not found in $PATH Error compiling for board AI Thinker ...
0
votes
1answer
238 views

Communication between Arduino and python: serial port sending empty data

Arduino code: this code is provided communication between sensor gy-521 and arduino. I read data by the command "1", after 1000 samples arduino is waited for new command for read data. Arduino code ...
-2
votes
2answers
56 views

Can I run my python based virtual assistant using Arduino? [closed]

I have a working project which is python based virtual assistant and now I am thinking to make it more accessible than carrying my laptop. I want to make a device like alexa echo dot more or less.. ...
0
votes
0answers
31 views

How can a python script and Arduino communicate using Xbee radio modules?

So I have to run a python script that detects some colors through an overhead webcam, and then I have to send this data to Arduino through Xbee but the catch is I am only allowed to do embedded ...
0
votes
4answers
49 views

How to link a computer processor to an Arduinno on a board? [closed]

I am completely new to Arduinno, so please forgive if the question is stupid. Here is the problem: I have a project where I want an Arduino (or similar microchip board) to handle some sensors and ...
0
votes
0answers
49 views

Problem sending values over serial to raspberry pi

I posted this in the raspberry pi stack exchange earlier with no luck...hoping someone here can help me out. I apologize as I have edited this quite a bit, but I have narrowed down the problem a bit ...
0
votes
1answer
213 views

How to program Arduino LCD shield with Python?

so I want to run a Arduino LCD shield with Python code..But after having some research on the Internet, I can not found any tutorial, some just give some basic code with LED. And one things that how ...
1
vote
0answers
178 views

How to parse data most efficiently coming through mqtt with ESP8266

I am writing a program that is currently set up like so: Python script running on my computer. Raspberry pi is the broker for the mqtt data transmission An ESP8266 is programmed to listen to/...
0
votes
1answer
212 views

find out the pin numbers for the Arduino IDE for a certain board - the esp 32

I followed the tutorial I found here https://techtutorialsx.com/2019/03/29/esp32-arduino-controlling-a-dc-motor/ On the very interesting topic controlling a DC motor with the esp32 and Arduino I have ...
0
votes
0answers
487 views

Data logging from ESP32 through UDP socket to PC

The idea is to send raw sensor data from ESP32 to PC through WIFI UDP socket and store it into CSV file using Python. As you can see from the code I am chopping 8 bytes of data into single bytes and ...
1
vote
0answers
37 views

Multiple arduino connections problem

I have 2 Arduino Mega 2560 connected via USB to my Ubuntu 18.04 machine. When I boot, one connects to /dev/ttyACM0 and the other connects to /dev/ttyACM1. Communication works perfectly. However, ...
0
votes
0answers
83 views

Serial read with python: output missing

I'm trying to read SMS using GSM Shield 2 and Python, but I have a problem where I can't read the SMS content using pySerial while it works fine with the Serial Mac app. I do the same thing on both ...
1
vote
1answer
45 views

Arduino IDE display DEBUG PORT Serial1 output

How can I display / capture Arduino IDE's Serial1 output? Can I display it using Arduino IDE or using a script in Python? This python script (courtesy of Chad G) works for the Serial: #!/usr/bin/env ...
0
votes
2answers
99 views

How Should I Send Data to My Laptop from Multiple Arduinos?

I'm working a project which involves reading multiple RFID tags, from multiple directions, at the same time. Because of the multiple directions, I need to use multiple antennae. Because of the ...
1
vote
1answer
439 views

Arduino communication protocol with python - beyond pyserial and Arduino example

TL;DR does someone know of a advance and reliable/redudent USB protocol for communicating between a raspberry pi and Arduino due (native port) I am trying to learn how to build a little robot which I ...
2
votes
1answer
71 views

The arduino can't seem to output correctly

i am a beginner at python and I am average at Arduino and I had the idea of using both of them together for a project. I have been trying to make a Arduino + Python car which I can control with my ...
0
votes
0answers
36 views

Arduino is no more writing Serial if i write before

Description: I have a code version where i only send data from Arduino to PC where i read data with PC. I want to add the possibility to send a command start or to stop the sending of data. This ...
1
vote
1answer
394 views

Running Python on Arduino

I've been using Python for quite long, and I was wondering if it can be used as a programming language for Arduino, rather than C/C++. When I'm using the Arduino IDE, the sketch is compiled into a ...
0
votes
1answer
271 views

Process Sensor Data from Arduino Yun with Python

I'm currently working on a small project with my Arduino Yún. I want to process the sensor data in python and send them in a message queue. I need to use Python3. I cannot find a way to get the ...
0
votes
0answers
90 views

Sending a union from Arduino via serial communication and parsing it in python

I want to send a union from Arduino to a python script running on a pc, and I want to parse the received union. I have read lots of topics online but I am stuck on how to do it in the most efficient ...
0
votes
0answers
120 views

Arduino Sensor Values to Raspberry Pi using NRF24

Im trying to send temperature sensor data through NRF24L01 to Raspberry Pi and read it in Raspberry Pi using python. But the temperature sensor data comes to the Raspberry Pi as letters, which I found ...
0
votes
1answer
79 views

Arduino will not read three successive packets in the serial connection

I have written a small program to send serial commands from Python to the Arduino Micro. This is my code for both: Python import serial ser = serial.Serial('COM5', 9600) ser.write(b'0') ser.write(...
0
votes
1answer
162 views

Sending to Arduino UNO multiple values from Python code

I'm starting to learn how to work with Arduino, particularly communication between a Python code running on a PC and an Arduino Uno. So I decided to start with what I thought to be a easy task. ...
0
votes
1answer
59 views

Programming the serial description

Is it possible to program a custom description so that my python program can know exactly what USB port to connect to for that specific programming? It should be able to find any board with that ...
1
vote
1answer
434 views

Help decrypting AES string from arduino rf module in python

Please excuse any glaring errors in my code, I'm new to both C and python. I'm trying to send an encrypted message from my arduino uno via a DHT22 sensor and an rf module using the radiohead ask and ...
1
vote
0answers
207 views

MPU6050 Acc and Gyro readings swapped

I have been trying to figure out this MPU6050 for a bit but the RAW readings are confusing me. It seems to me that the accelerometer readings and the gyro readings are getting swapped... and I don't ...
0
votes
0answers
72 views

Serial communication problem NodeMCU

this is my first post here. Before I ask you my problem, I'm sorry if I'm wrong to write but my English is bad. So, my problem is this: I'm developing a "client-server" system with serial ...
0
votes
1answer
133 views

Arduino Python to Serial command [duplicate]

I am trying to send commands via serial from Python to Arduino with the code below. If I save this code in a dedicated python file "Stepper.py" (Python2.7 on Mac OSX) , the code runs successfully ...
0
votes
0answers
754 views

nRF24L01 communication with Arduino as transmitter and Raspberry Pi as receiver

here are the codes and i don't know why it does not communicate. The arduino should send some example data and the raspberry pi should simply receive the data. Transmitter code (Arduino) #include &...
0
votes
0answers
908 views

Arduino Modbus - Rtu slave with Raspberry pi using MAX-485

I am trying to use Arduino as Modbus- RTU slave and Raspberry Pi as a Modbus master I have interfaced Max485 (RS485 to TTL converter) with Arduino and Rs485 to USB converter in Raspberry Pi, Initially,...
4
votes
1answer
2k views

Problem sending string with Python to Arduino through serial port

I want to send string 50 to Arduino through serial port, the Arduino UNO seems it communicates with port COM25 but it doesnt receive the string properly: import serial # if you have not already done ...
0
votes
1answer
2k views

How to send an integer through pyserial with Python to an Arduino and get back the same result?

There has been similar questions all over the internet but none of them seem to answer my question, so can anybody tell me what is wrong with this code and how I can fix it? Python code: import ...
0
votes
1answer
61 views

Output set to 'low' when new variable in buffer

I would like to turn on and off the output of two pins on my arduino independently from each other. However, so far all my attempts have failed. My current idea is to save the status (which I chose ...
2
votes
1answer
598 views

How to connect an Elegoo Nano to a Raspberry Pi and program it?

I own an several Elegoo Nanos and a Raspberry Pi. I would like to connect an Elegoo Nano to the Pi and upload nanpy onto the board and control it's GPIO pins. I have plugged the nano into the Pi and ...
0
votes
1answer
3k views

Serial communication between python and arduino

I am working on object tracking robot. I am using python and OpenCV to detect the object and send the proper data to the arduino that controls two servo motors. The data which should be sent to the ...
0
votes
1answer
77 views

Arduino Yun can no longer send to Dropbox

A long time ago I had set up an Arduino Yun to send files to Dropbox... I tried now and it ends in "killed" when trying to install the latest Dropbox Python module. pip install (six, urllib3, etc etc)...
0
votes
1answer
298 views

RGB LED strip controlled through PySerial only somewhat functional

I am trying to set up an LED-strip of 30 RGB LEDs (model WS2801). The strip is connected to an Arduino Uno and an external power supply and the goal is to send colors to the arduino using PySerial ...
0
votes
1answer
102 views

Can't display the two float values correctly from pyserial on Arduino's LCD

I transported two float values with pyserial to COM3 and Arduino accepted the values. But it displayed the first value correctly on LCD, the second value can't be read and showed "nan" on LCD. ...
-1
votes
1answer
106 views

Arduino and Pyton Serial Communication, Pyton get stuck and keeps sending [closed]

I have recebntly started a project where I need to connect an arduino and another device through serial. And I have setup a simple serial connection betwee python and arduino. I can setup the ...
-1
votes
1answer
65 views

How do I get LEDs to turn on according to a continuous Python input?

I'm trying to make a tuner. 3 LEDs are connected to the Arduino board, each one corresponding to one situation (too high, low or correct). Python handles the detecting of a note according to the mic ...
1
vote
2answers
1k views

Arduino and Python

Does anyone know how do I get Arduino and Python talking to each other? I would essentially like to write my code and export it somehow to the arduino-uno.
0
votes
0answers
540 views

Receive data on esp 01

I have um esp 01 on port 2 and 3 from my Arduino, I can send several characters, but I cannot to receive many characters, my code is this: #include <SoftwareSerial.h> //TX RX SoftwareSerial ...