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.

learn more… | top users | synonyms

1
vote
1answer
21 views

read/write data from 2 arduinos simultaneously over python

So for my project I have one Arduino Mega hooked up with a quadrature rotary encoder which is connected to the Computer. The other Arduino Uno is connected to a circuit I build which in turn is ...
3
votes
1answer
25 views

What's the problem with baudrate?

I was trying to evaluate the speed of communication between pc and Arduino, using this code in Arduino: void setup() { Serial.begin(9600); } void loop() { Serial.println("Ciao Arduino"); } and ...
0
votes
2answers
33 views

Writing a float to a BLE characteristic. What data format?

I am currently working on a python-based Bluetooth Low Energy client for OS X and I got stuck while trying to write a remote float characteristic value. First of all: my setup is an Arduino 101 with ...
1
vote
1answer
33 views

Why is communication between a Python program and Arduino not producing the expected result?

I have written some Arduino code (with help from the post Serial Input Basics). On serial I send some data and, based on certain values sent, certain LEDs will be lit. Here is the Arduino code: const ...
1
vote
1answer
41 views

Serial communication with Python

I am trying to send integer from my Python program to Arduino MEGA. If I send 1, the LED should turn on and If I send 0 the LED should turn off. I was able to write Python code correctly as I think. ...
0
votes
1answer
41 views

Is it possible to run Python embedded in Arduino? [duplicate]

I know how to program in C but I'm more productive in python, so, I would like to know if there is a way to run a python code into arduino.
0
votes
1answer
31 views

Trying to Serial.write RAW code properly

I have a SIM800L Module connected to my arduino Nano. I want to open a TCP connection from the sim800l module to my own server and send a text string. The connection is working however I am not able ...
0
votes
1answer
130 views

Arduino-Pyserial communication on python3, windows machine: Pyserial.write() doesn't seem to do anything

I've recently gotten my hands on an Arduino (Or rather a Genuino, but the overall architecture should be the same) UNO. I'm now using that Arduino to test how data is transmitted from an USB to Serial ...
0
votes
3answers
82 views

Installing Pyserial

I will be running my CNC Via Arduino UNO R3, so i have found out that it runs on GRBL and that i need to load Python and Pyserial and a graphic interface. Loaded Python 3.5.2, no problems, opened dos ...
1
vote
1answer
92 views

Bidirectional communication between Arduino and Raspberry Pi over USB possible?

Is it possible to have bidirectional communication betweeen an Arduino Uno Rev 3 and a Raspberry Pi Modell B+ running Rasbian? They're connected ofer USB, and it would be good if I could use Python on ...
-1
votes
1answer
78 views

Programming Arduino With Python [duplicate]

Im a beginner working with arduino. Im little familliar with java syn and its not hard for me to do the work with ide ;but i know python better....is there any Lib that let you program Arduino with ...
1
vote
0answers
41 views

Arduino receiving values over serial, but not responding

Now this is gonna make me cry. Yesterday night, my python script was working perfectly fine, while sending values over serial comm to my Arduino UNO. I have added the 10 microFarad capacitor between ...
0
votes
0answers
41 views

Arduino UNO suddenly stops responding

I wrote this simple script to control a servo over serial comm - #include <Servo.h> Servo steeringServo; char data = ' '; void setup() { steeringServo.attach(9); Serial.begin(115200); } ...
0
votes
1answer
49 views

Unusual behaviour over serial communication

I am sending data over serial connection from a python script to my Arduino UNO. Now initially whenever I tried to send data to the arduino, it would reset. The fix was to put a 10 microFarad ...
0
votes
0answers
31 views

Python to Arduino Interface Strange Error

I am using the Arduino Uno for my science fair project. The Uno is my Dataq device, and Python analyzes it. I built a simple interface using pyserial and it works. The only issue is that with nothing ...
0
votes
3answers
32 views

Sketch behaves differently when motor driver is added

I have written a simple sketch that takes values via serial communication through a Python script. Here's the code- #define LEDPin 13 void setup() { Serial.begin(9600); pinMode(LEDPin, OUTPUT); ...
0
votes
1answer
73 views

How to communicate from Python to Arduino Softserial

That is driving me nuts so I need your help. Master : PC with Ubuntu, a USB to serial converter (chipset CP2102), connected to Arduino Uno Pin 10, 11 and GND. The Arduino Uno is plugged in the same ...
1
vote
1answer
55 views

Serial available doesn't work right after upload

I have 2 programs to test serial communication, an simple arduino program that echoes whatever is on the serial port and a python program that writes to the serial port and prints the reply. I'm ...
0
votes
1answer
55 views

Does serial communication between PC and Arduino has to be in a loop?

I am trying to send a few variables from my python script to my Arduino. I am using pySerial. I am able to send the variables to the Arduino, but my Arduino sketch runs only for a second and then ...
0
votes
2answers
114 views

Getting Firmata to control WS2801 LEDs

I am trying to control a strip of WS2801 LEDs through an arduino uno running firmata from Python on my laptop. I've written some basic code based on adafruit's library here (from line 187): from ...
0
votes
0answers
121 views

Serial Communication between Arduino and Python

I am trying to establish a communication between Arduino and Python. I want to write int values as bytes from arduino and read them in Python but i need some help to do that. Here is my Arduino code: ...
0
votes
1answer
93 views

Arduino Serial Monitor works but not on PySerial and PuTTY

I made simple custom arduino board using an atmega328p and the PL2303 serial to USB chip. In my arduino program, I am in a loop that sends out a string continuously. I can read this in the Arduino ...
0
votes
0answers
34 views

Sync arduino-python transmision

I'm communicating two Arduinos with RF modules. One of them is: controlling a process measuring an analog input sending the measurement to the second Arduino The second Arduino is connected to a ...
0
votes
1answer
201 views

Send a file from PC to Arduino using HC-06 module

I want to send a file from my Laptop using its own Bluetooth transmitter to Arduino. Arduino has HC-06 module as receiver.Arduino has SD Card fore store the file. I was able to send bytes using Python ...
1
vote
2answers
149 views

SDS011 Dust Sensor Checksum Error

I'm working with an SDS011 particular sensor through its serial interface. The spec sheet (http://inovafitness.com/upload/file/20150311/14261262164716.pdf) indicates that the second to last byte of a ...
0
votes
1answer
146 views

Arduino Yun Python ImportError: No Module named mime.multipart

So, I have an Arduino Yun, and I'm trying to send an email with python. I have this code that I got from https://github.com/amicojeko/YouCantTouchThis But when I try to call the file with $python ...
0
votes
1answer
108 views

How can I control neopixels attached to a Digispark?

I want to use a string of Neopixels attached to a Digispark hanging off of a RasPi3 as indicators for various situations. For example: a motor (connected to a driver hat on the I2C bus of the RasPi) ...
0
votes
1answer
117 views

serial communication dead slow after a while

I'm workin on a node for blender to control an arduino. I notice it goes really slow after a while so I isolated the problem. It is good in maintaining 60 frames a second, then after around 40 seconds ...
1
vote
0answers
193 views

Send Newline / Carriage return with python

With the Serial Monitor I have the Newline option: How can I send the same using python? I tried: 30\r\n 30\r 30\n import serial ser = serial.Serial('COM3', 115200) while True: ...
1
vote
0answers
410 views

How to read data from arduino with raspberry pi via I2C

I have connected Raspberry pi 2 model B with arduino uno via Bi-Directional Level shifter, from this BLOG Raspberry pi GND ---------- GND Arduino 3.3v ---------- 5v ...
0
votes
2answers
59 views

Script on pc only gets 640 characters via serial

I experience that if the Arduino (Teensy 3.2) writes a rather long stream of characters to serial, the python script on the other end only receives the first 640 characters. I have found this result ...
1
vote
1answer
216 views

Unpacking arduino binary data on a python sketch

as a follow up to my earlier post Simultaneously reading data from multiple serial ports, I am stuck trying to develop a python sketch that can read the incoming serial data from the com port on my ...
1
vote
1answer
85 views

BLE Python with GUI on OSX [closed]

Has anyone connected BLE devices with Python + GUI on OSX? I've looked into a few libraries (most are old), but one that has the most success if Adafruit's BlueFruit library. However, this library ...
0
votes
3answers
76 views

Led issue with arduino controled by raspberry pi/python

I'm having an issue with my project. My project is 8 leds and a potentiometer on an arduino being read and controlled by a raspberry pi running python. when I'm using a potentiometer the signal is ...
1
vote
1answer
86 views

How do I go about building a backend for my Arduino device? [closed]

I am new to Arduino, but I am putting together a project in which the Arduino Uno has multiple sensors (temperature, humidity, etc) collecting data. Right now all it is currently going to do is get ...
0
votes
1answer
208 views

Python PySerial with Arduino fails byte check

I'm struggling with my first steps with Python and PySerial. I have one Arduino which reads impulses from an electricity power meter, passes the counts over to another Arduino over an RF link and then ...
1
vote
1answer
77 views

Does WiFiClient work on a Yún to send data over a certain IP and port to be received by a Python socket?

I haven't been able to get the example code from the page WiFi:Client:connect() to work on my Arduino Yún. Is this not how I'm supposed to send data over WiFi to be read by something like a socket? ...
2
votes
3answers
246 views

Share data between the two processors of the Arduino Yun

The linux processor runs a Python script from which I would like to send an array of integers to the Yun microprocessor. How can I do that? And then, how can I retrieve and then use this array in my ...
7
votes
0answers
451 views

Update Dynamically Tkinter Widget Scale from Arduino Ports using python and firmata

I'm having trouble trying to get Arduino digital ports values and set these values into a Python Tkinter Widget Scale. I'm using Python and Arduino with Firmata. I'm able to access my arduino board ...
2
votes
1answer
207 views

How to make data sent by Python (via serial connection) wait for Arduino to finish current task? [closed]

I am trying to make my Arduino micro-controller and my Mac talk together, and I have created a functional serial connection. My computer is sending data to my Arduino, and my Arduino is sending a 1 ...
1
vote
2answers
217 views

Python script to toggle LED's

I have 8 LED's connected to a shift register on my arduino uno r3. I am trying to write a Python3 script that will prompt a user to select one of the LED's and then prompt to toggle on or off. Should ...
1
vote
1answer
2k views

Graph plotting on Python using Tkinter Canvas

I'm trying to plot a graph with python using the canvas widget, I'm currently sending data in from an arduino sensor sketch ..does anyone have an idea on how I can plot this graph in real time on ...
-1
votes
3answers
3k views

Plotting a real time graph of sensor data from Arduino on Processing, MatLab or Python

I have an accelerometer connected to my Arduino Due to spit out data on my serial monitor as described in my earlier post. I'm trying to find a sketch I could use to plot a continuous real-time graph ...
-1
votes
1answer
287 views

Advanced Line Follower robot

I know about line follower mainly the grid solving robots i know the basics actually. Actually they have to trace the path of the grid in an arena and then reach back to starting point in a shortest ...
-1
votes
1answer
692 views

pySerial and serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected?)

I'm having some trouble getting my arduino uno to communicate with a simple python script through pyserial. Lets start with my arduino sketch: void setup() { Serial.begin(9600); } byte i = 0; ...
-1
votes
1answer
2k views

Serial.readString() - how does it work exactly?

Someone posted a solution for a problem I had which used Serial.read() .Why doesn't readString() seem to work though? From the docs it seems it reads the data as a String object which would make ...
0
votes
1answer
1k views

Pyserial serial.write() doesn't work

I need to communicate with an Arduino. Doing serial.readline() to read what Arduino has to say works fine. Doing serial.write('something') doesn't seem to do anything. What is interesting is that if ...
0
votes
1answer
147 views

make Arduino tell when the Python program stops reading from the Serial (crash, etc)

Here's the Arduino code: void setup() { Serial.begin(9600); pinMode(7, INPUT_PULLUP); } void loop() { int val = digitalRead(7); if (val == HIGH) { Serial.print("1"); } else {...
0
votes
1answer
622 views

arduino due-Python interfacing for high speed data rate

Four our project, I want to send data mesured by an Arduino due to a computer via Pyton very vast. So I tried to make a simple benchmark by sending 10240 int datas to determine the time it take. In ...
0
votes
2answers
373 views

Send numbers to arduino via serial port using python

I have a file with numbers called fginputs.txt. For example it could be something like this: 4958 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4958 I want python ...