I am trying to establish a connection between Raspberry PI and Ardunio, where Python runs on PI. the goal is to check that the Arduino is connected and sending the correct values, the connection seems to be established as I receive on the Python terminal, but the value adoes not fit correctly, it increases by 2, sometimes more than two, Could this be a delay problem connections? serial (USB) problem?
serial_text.ino (works on Arduino):
char dataString[50] = {0};
int a =0;
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(++a);
delay(1000);
}
Serial_test.py (works on PI):
import serial
ser = serial.Serial('/dev/ttyACM0',9600)
s = [0,1]
while True:
read_serial=ser.readline()
s[0] = str(int (ser.readline(),16))
print "a value from controller = ", s[0]
//print read_serial
EXIT (on the PI screen):

UPDATE:
I made some changes, but this is still the same problem, here are the changes:
serial_text.ino (works on Arduino):
int a =0;
void setup() {
Serial.begin(9600);
}
void loop() {
a++;
Serial.println(a);
delay(1000);
}
For Python, I just changed this line:
s[0] = str(int (ser.readline(),16))
TO:
s[0] = str(int (ser.readline(),10))
//print read_serial .
:
