Problem solved - by mistake I put code in wrong section of init.rc:
write /sys/class/gpio/export 142
write /sys/class/gpio/gpio142/direction out
chmod 777 /sys/class/gpio/gpio142/value
Hello,
In which section did you insert these commands in the init.rc?
on boot?