I'm developing an Android application to control a RC car.
I have a Raspberry Pi 2 running a Python script successfully controlling the motors moving the car. When I connect with Putty I am able to run my script with the command
sudo python /home/pi/Car.py
The script itself is running an infinite loop waiting for user input - press
w to go forward,
s goes backwards etc. So basically two step command:
1. Start the python script
2. Input commands for the movement e.g.
w w w s a w d.
The communication from the Android app to the Raspberry is done via the JSch library and my app successfully establishes connection. The problem is when I'm trying to run the second command, for the movement itself - seems like the script is not running and is not reading the value sent.
Do you have any suggestions what could be the reason for this, any ideas for fixes in the implementation of the python script maybe, I could provide source code if needed.