AT24C256 EEPROM write failed

Here's a few thoughts on how to simplify things.

  1. Let the arduino manage the eeprom addresses, and eliminate the sending an receiving of addr.

  2. Can you get for the python sketch to send a single character start and end marker instead of the strings? Are there any bytes which can not be data?

  3. Code like this can try to read before the bytes are available to read. You can easily read faster than data arrives.

for(int i=0 ; i<4; i++){

            readed[i] = Serial.read();

          }
  1. Serial.available() will return the number of bytes in the read buffer, but you do not use this. You might be able to use blocking code which waits for bytes to be available.

  2. Take a look at Robin 2's code on python to Arduino. Demo of PC-Arduino comms using Python - #5 by Robin2 - Interfacing w/ Software on the Computer - Arduino Forum

In particular see ComArduino2.py and ArduinoPC2.ino. He receives data using the methods of the Serial tutorial.