Fixed a lot of bugs with the previous request. Now communication with the Arduino works properly.