FordPass Access
This is a simple Lumen web app to send basic commands and fetch the current status to your Ford vehicle with Sync 3 enabled.
Local development
To get started you need to be familiar with Lumen micro-framework. Once the repo has been cloned, make sure to install all depedencies.
$ composer install
Ensure all config is set in the .env
file. Also make sure to include your FordPass credentials and VIN number for the API access.
FORD_USERNAME=[username]
FORD_PASSWORD=[password]
FORD_VIN=[password]
Once installed create a database.sqlite
file:
$ touch database/database.sqlite
Finally run the migrations:
$ php artisan migrate
Finally you can serve the app locally using PHP.
$ php -S localhost:8000 -t public
Supported Actions & Vehicle Information
Currently these are the supported actions:
start
stop
lock
unlock
Vehicle information actions:
status
details
capabilities
Endpoints
To access these actions/vehicle info via your browser you can visit:
GET /api/vehicle/{vin}/{command}
The endpoint will return a json
response of your request.
Console
The commands can also be invoked through the Artisan console:
$ php artisan vehicle:control {command}
You may also get the status of your car.
$ php artisan vehicle:status {--fresh}
Deployment
In case you'd like to have this up in the cloud, to keep it simple I have chosen to deploy to AWS Lambda. Before launching read the documentation on how to use Bref and serverless.
Follow the instructions on Bref's getting started tutorial to launch to your own instance of AWS Lambda and deploy the app. Once you have gotten all of your setup ready to be deployed you can use an internal artisan command to deploy:
$ php artisan deploy
Or you can use serverless' own cli.
$ serverless deploy
The deploy command will run a production composer install and deploy to AWS with serverless deploy
. The application updates Lumen's config for database, cache, session, and logging when launched.