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
22 views

Read Input in Python 3 [on hold]

3 3 1 1 0 0 1 0 0 0 1 Question goes like - First line of input contains rows and columns of the array. Then the array is being input row wise. What could be the best way to read this in Python 3?
0
votes
0answers
28 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
32 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
26 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
18 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
62 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
42 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
64 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
30 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
109 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
88 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
39 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
26 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
73 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
53 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
47 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 ...
0
votes
1answer
142 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
60 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
46 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
97 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
335 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
535 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,...
3
votes
1answer
1k 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
777 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
57 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
325 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
2k 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
61 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
196 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
72 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
60 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
57 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
810 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
405 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 ...
-1
votes
1answer
77 views

Run python in Windows OS installed in micro SD card which is read by Arduino microcontroller board

I have a python code which runs in my computer with Windows operating system. The code reads some images as input, extends some cognitive services apis from Microsoft azure and finally give an audio ...
0
votes
1answer
877 views

Is there a way to send data from Tensorflow to Arduino via Bluetooth?

I am not sure if such a question is accepted here. If not please direct me to a more suitable Exchange. I am planning a small project involving Machine Learning using TensorFlow and Python, which ...
1
vote
1answer
134 views

How to work with analog readings using RPi and Firmata?

For context: I'm working on a whose goal is to sense the environment. This process is done using an Arduino Uno and an RPi. The easiest way that I found to perform communication between both boards is ...
0
votes
1answer
160 views

Lag in fetching serial data from Arduino

I am working on a project based on Arduino and python3.6,two HC-SR04 sense the distance of palms and process the data using Arduino and send it through serial port to python3.6 ,python3.6 with the ...
0
votes
2answers
789 views

Reading serial.print data with unknown characters python [closed]

I've got some simple python code working to read the serial.print data that is being sent from my Arduino Uno. It seems to be receiving the values correctly and printing them fine, however it is not ...
1
vote
2answers
2k views

Sending Float values from Python to Arduino via serial communication

I want to Control the current flowing through a circuit using an Arduino. I have trained a PID controller for this purpose. I am using a current sensor to determine the error. It runs successful on my ...
0
votes
2answers
2k views

easy_install pip on Arduino Yun fails

I want to install pip on the Yún which is running Linino OS but every time I execute the standard steps for opkg i.e. # opkg update # opkg install distribute # okpg install python-openssl # ...
1
vote
2answers
752 views

Communication with socketserver fails after specific number of packets

I'm trying to implement a full-duplex communication between my ESP8266 and a socketserver running on my laptop. In concrete I need each of the devices to initiate communication whenever it needs to. ...
1
vote
3answers
2k views

ESP8266 and Python Communication

I'm new to networking and working with ESP8266. I have successfully setup my ESP8266 and can program it from Arduino IDE (tested a blinky code). I want to send some data from a Python script running ...
2
votes
1answer
7k views

Arduino Serial Communication with Python: sending an array

I am a bit new to both Arduino and Python. My aim is to send commands to Arduino to run a stepper motor. I need to send an array containing the parameters. After consulting many earlier posts like: ...
-2
votes
1answer
62 views

Can arduino nano board support bluetooth earphone and python for sound function? [closed]

sorry for disturb, i new and no basic on arduino language and board. Now i have a project on my hand, and with this arduino nano board, i have a ultrasonic sensor that will detect object, is it ...
1
vote
1answer
555 views

How to send data from an Arduino GPRS module to a Django application hosted on Heroku?

I have a Django web application hosted on a Heroku server. Currently I am using the free package for hosting. I want to send data from an Arduino using a SIM900L GPRS module to the web application. I ...
-1
votes
2answers
195 views

Cannot mount NodeMCU with MicroPython on Mac OS X

I've recently bought a NodeMCU board and flashed MicroPython in it. I've read about the boot.py and main.py scripts, but I can't understand how to access them... I have succesfully connected to the ...
0
votes
2answers
1k views

How to send a number to Arduino via Python over serial?

I call an API in Python and it gives as output as a single digit and an Arduino program receives this number over serial and displays it on a 7-segment display. I wrote a different program in which ...
2
votes
2answers
3k views

Python - Arduino communication not reliable

I'm trying to establish basic communication between python and my arduino due. I have managed to get a message sent to the arduino and sent back, but the code that achieves this task does not give ...
1
vote
2answers
381 views

serial data gets spoiled

I use this small program on my Raspberry Pi to recieve a string sent by my arduino. import time import serial ser = serial.Serial('/dev/ttyACM0', 9600) def check_for_command(): bytestoread = ...