6
            
            votes
        
            
                
                Accepted
            
        
            
        Arduino Serial Communication with Python: sending an array
                    If I use >BBB instead of >iii... That's because "B" is a byte. So you end up sending 3 bytes:
struct.pack("BBB", 1, 2, 3)
\x01\x02\x03
"i" is an int and has a size of 4, so you send 4*3 = 12 bytes:
...
                
            
       
        
            
                4
            
            votes
        
        
            
        How can I execute a string in my Arduino Uno board?
                    Unless you want to implement some form of scripting engine, you can't.
Arduino code is compiled code, not interpreted code. There is no way of converting text into runnable code, since that is done by ...
                
            
       
        
            
                4
            
            votes
        
        
            
        Pan and tilt bracket move to sound, control servo motors using microphone sound sensors
                    What you are trying to achieve is not easy. Expect to spend a lot of time
developing, testing and tuning it.
The first step would be to work the acoustics of your device. The sound
sensors are not ...
                
            
       
        
            
                4
            
            votes
        
            
                
                Accepted
            
        
            
        How to ignore garbage values in serial communication between arduino and python
                    The effect that you see is type promotion, in the C++ standard called "integral promotion", which happens implicitly. Values of type char are cast to int. Commonly, and in your case too, the ...
                
            
       
        
            
                3
            
            votes
        
            
                
                Accepted
            
        
            
            
        Problem sending string with Python to Arduino through serial port
                    The AVR Arduinos (Uno, Nano, Mega) have auto-reset function. At opening of USB connection the circuit around USB resets the MCU. After reset the bootloader waits a second for a new upload. If the ...
                
            
       
        
            
                3
            
            votes
        
            
                
                Accepted
            
        
        easy_install pip on Arduino Yun fails
                    Found this Arduino Forum Thread helpful.
# wget \
https://pypi.python.org/packages/source/p/pip/pip-6.0.8.tar.gz#md5=2332e6f97e75ded3bddde0ced01dbda3\
  --no-check-certificate
# easy_install pip-6.0....
                
            
       
        
            
                3
            
            votes
        
        
        share enum between python and arduino
                    One approach that I have used for similar purposes is to generate the appropriate header files (or module or whatever) from a simple text file for all the required uses.
Since you already know python ...
                
            
       
        
            
                2
            
            votes
        
        
            
            
        Can't communicate with arduino using python (Windows)
                    you must use this code
>>> import serial
>>> ser.close()             # close port
                
            
       
        
            
                2
            
            votes
        
        
            
        Programming an Arduino using Python, rather than C/C++
                    Yes,its possible with the recent new ArduinoPro H7 which has abilities to upload a written programme in Python and JavaScript and its a dual core,32bit.
                
            
       
        
            
                2
            
            votes
        
        
            
        Cannot mount NodeMCU with MicroPython on Mac OS X
                    The typical NodeMCU board uses a fixed function CP-210x USB-Serial chip.  This cannot appear to a host operating system as any ordinary sort of storage device, so it is not "mountable" via ...
                
            
       
        
            
                2
            
            votes
        
            
                
                Accepted
            
        
            
        How to work with analog readings using RPi and Firmata?
                    It does not appear that Firmata has proceeded with the ability to change the analog reference source. You referenced one of the issues opened for it, but I don't see anywhere where it committed to the ...
                
            
       
        
            
                2
            
            votes
        
            
                
                Accepted
            
        
        Arduino Python to Serial command
                    Majenkos comment (above) solved the problem:
"You need to wait after opening the serial port for the board to finish resetting and the bootloader to run and exit before you can send any commands."
...
                
            
       
        
            
                2
            
            votes
        
        
        Arduino and Python
                    You can not run python on an UNO. If you want to use python on a microcontoller you should look into boards supported by MicroPython or Circuit Python
                
            
       
        
            
                2
            
            votes
        
        
        Run python in Windows OS installed in micro SD card which is read by Arduino microcontroller board
                    With some Arduino boards, yes.  You want a board like the Yun (unfortunately retired now, but there are probably others similar) which has a MIPS SoC on it that runs Linux (specifically OpenWRT).  The ...
                
            
       
        
            
                2
            
            votes
        
        
            
        Running Python on Arduino
                    To my knowledge, there is not a "python to ATMega architecture" compiler out there. 
However, it's not true that MicroPython only runs on PyBoard. There are versions for installation also on the ...
                
            
       
        
            
                2
            
            votes
        
        
        How to link a computer processor to an Arduinno on a board?
                    It sounds like you need a lot of compute power. You can either put the sensors and AI on one device (and @majenko's suggestion of a Raspberry Pi would be a direction to pursue) or you need two devices,...
                
            
       
        
            
                2
            
            votes
        
        
        wdt reset cause:4, boot mode:(3,6)
                    You're calling delay() in the onWsEvent() callback. The ESPAsyncWebServer documentation specifically says not to do that in the 'Important things to remember' section:
You can not use yield or delay ...
                
            
       
        
            
                2
            
            votes
        
            
                
                Accepted
            
        
            
            
        Why do I need to use latin-1 instead of utf-8 when using python with arduino?
                    but is there something about arduino that requires using latin-1?
No, not really.
What it comes down to is that Serial.read() reads bytes, irrespective of whatever encoding they may be being used ...
                
            
       
        
            
                2
            
            votes
        
            
                
                Accepted
            
        
            
            
        What is the difference when an arduino has been unplugged vs when a serial port connection was closed?
                    We cannot know, if your python code also has a problem. But your Arduino code will send the series of "V" only once.
You are using this while loop:
while(counter < maxnum)
in there you ...
                
            
       
        
            
                2
            
            votes
        
        
            
        Arduino randomly stops sending data to python over serial
                    I removed free(value) - rookie mistake - but that didn't completely solved the problem (but reduced frequency of occurrences).
Seems like declaring array like char val[50] and passing it to function ...
                
            
       
        
            
                2
            
            votes
        
            
                
                Accepted
            
        
            
            
        get data from arduino using python
                    I would embed the call to .getData() into a try block and handle this specific exception with except UnicodeDecodeError. There can always be a transmission error, especially when the script is started....
                
            
       
        
            
                2
            
            votes
        
        
        `time.sleep` in python script reading serial output causes erratic behavior
                    Thanks to chrisl and timemage's comments, I figured out the issue: the Arduino was sending the data too fast and the bytes were piling up in the computer's inbound buffer. I solved this by adding a ...
                
            
       
        
            
                2
            
            votes
        
            
                
                Accepted
            
        
            
        Sending float values from Python to Arduino using Serial communication
                    There are two things going on here.
First of all, if you look up the readline() method in Python that is referenced in the PySerial manual, you'll see the following:
readline(size=- 1, /)
Read and ...
                
            
       
        
            
                2
            
            votes
        
            
                
                Accepted
            
        
            
        What is the best (fastest and most robust) way to send messages back and forth between Python on a PC and an Arduino, over serial?
                    There is no best way, but there is a better way (and more efficient way).
For an arbitrary forward torque of '50', the sending frame should be:
[161, 0, 0, 0, 50, 0, 0, 0]
And for a command of '-50', ...
                
            
       
        
            
                2
            
            votes
        
        
        Sending values with pyserial does not function if there is also sensing on Arduino Due
                    Opening a Serial connection will reset the Arduino.  The python code may be doing that when it creates the port.  Put a Serial.print("Starting") line in your setup function to see if that's ...
                
            
       
        
            
                1
            
            vote
        
        
        Arduino will not read three successive packets in the serial connection
                    The problem is that your code works but you substract 48 from what you received. 
Which if python sends a char with values: '0' '1' '2' it will result in the serially outputted values of NUL SOH STX ...
                
            
       
        
            
                1
            
            vote
        
            
                
                Accepted
            
        
        Programming the serial description
                    On a normal Arduino board, no, it's not possible from a sketch POV. With a Leonardo or similar ATMega32U4 based board it may be possible to give it a unique VID/PID combination, and even possibly ...
                
            
       
        
            
                1
            
            vote
        
        
            
            
        Help decrypting AES string from arduino rf module in python
                    By inspection only:
You are using an Initialization Vector and CBC mode in your Python code, but no IV and single block encryption in your Arduino code.
I think if you use MODE_ECB in your Python it ...
                
            
       
        
            
                1
            
            vote
        
            
                
                Accepted
            
        
        Is there a way to send data from Tensorflow to Arduino via Bluetooth?
                    The question is more "Is there a way to send data from Python ?" than "Is there a way to send them from Tensorflow to an Arduino ?" and the Answer is yes.
In Tensorflow your can recover your result in ...
                
            
       
        Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
python × 192serial × 93
arduino-uno × 61
arduino-mega × 17
programming × 17
raspberrypi × 12
arduino-nano × 11
communication × 11
arduino-ide × 10
arduino-yun × 9
esp8266 × 7
usb × 7
arduino-due × 7
esp32 × 6
c × 6
firmata × 6
sketch × 5
float × 5
c++ × 4
led × 4
i2c × 4
windows × 4
wifi × 3
bluetooth × 3
nodemcu × 3
 
         
         
         
         
         
         
         
         
         
        