- About
- What is currently implemented
- What should be implemented
- How can i contribute?
- How to lauch the project
- Running Tests 🧪
This project is an application written using Dart and Flutter for an ambitious open source project called StarPixel.
StarPixel is conceived as an electric car that absolutely anyone can build, using opensource information like drawings and software.
The main purpose of this application is to manage the functions of the car. it is also considered to be used as an on-board computer.
As the main hardware was choosen esp32. The software for esp32(called MainECU) lives here. The MainECU is the connecting link between this application and car interfaces.
Click here to open the design project in figma.
-
USB, Bluetooth, and Demo data sources
Below is the table with data source support for each platform at the present moment.
DataSource Android iOS Windows MacOS Linux Web Bluetooth ✔️ ✖️ ✖️ ✔️ ❔ ✖️ USB ✔️ ✖️ ✔️ ✔️ ❔ ✖️ WIFI ✖️ ✖️ ✖️ ✖️ ✖️ ✖️ HTTP ✖️ ✖️ ✖️ ✖️ ✖️ ✖️ Demo ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ -
USB Data Source
The ability to connect to
MainECU(eps32)
usingCH34X
andATMega16u2
USB to TTL adapters. Connection was tested onAndroid
,MacOS
andWindows
, but, theoretically, it should also work onLinux
. OniOS
this connection type is not available because of MFI Program. -
Bluetooth Data Source
For now, bluetooth connection with an esp32 device works only on
Android
andMacOS
. OniOS
connection viaBluetooth
is not availalbe because we use esp32 devices with Bluetooth Classic(under v4.0). Apple does not allow to use Bluetooth Classic if the device is not registered with the MFI Program. There are also esp32 devices with BLE(bluetooth version >=4.0), so if we will decide to replace Bluetooth Classic esp32 devices with Low Energy ones, we will have the oportunity to implement bluetooth connection also on iOS -
Demo Data Source
The purpose is to connect to a mocked service like to a real one. It generates random values(like speed and voltage). This way you can, for example, work on UI, or just have a look at all the app's functions, without the need to connect to a real device(maybe you don't have it at all).
-
-
User defined buttons
User can add his own buttons, which will send to and/or receive from the L2 level certain data.
For now 4 types of buttons are available:
- Simple button - just sends certain data by tapping.
- Indicator - subscribes and listens for certain data from the L2, and displays a color and/or a status according to the data.
Example of use: displaying the batery temperature(ok, warning, critical) - Y-axis joystick - sends drag/pan data to the L2 level in the range from -100 to 100. Also has an optional "on tap" handler, which means that certain data can be sent to the L2 when the joystick is just pressed(no drag/pan).
Example of use: window lifter. - X-axis joystick - sends drag/pan data to the L2 level in the range from -100 to 100. Also has an optional "on tap" handler, which means that certain data can be sent to the L2 when the joystick is just pressed(no drag/pan).
Example of use: seat regulator.
-
Responsive UI
-
Localization
Currently english and russian.
-
Flavors(generated by the Very Good CLI)
Development, staging and production.
-
Developer Tools
A set of parameters and settings, which are useful in the process of development. Developer tools are available only on development flavor
-
Firebase
Analytics and Crashlytics
-
Launcher(for android)
On android there is an option to choose the application as the default laucher. That way you can have an android device specially to use it as on-board computer
-
Other connection options
Via WIFI, and HTTP
-
Bluetooth connection on iOS
The reason why it's not implemented for now is in the What is currently implemented section
If you want to work constantly on this project please read the general regulations. Also there you will find instructions on how to join the team. Here is the StarPixel discord server.
This project currently runs on Android, iOS, and MacOS. For other platforms it may require some setup. Therefore, below will be instructions on how to lauch this project on these platforms.
Of course, you should have installed Dart and Flutter. If you haven't done this yet, please take a look at the documentation.
To launch the project you also should paste required firebase related files(google-services.json
for android, and GoogleService-Info.plist
with firebase_app_id_file.json
for iOS and MacOS).
If you want to contribute and work constantly on this project, you can contact me, i will give you access to the firebase project. Otherwise you can just create your own firebase project and download firebase related files. Also note that this project contains 3 flavors, and for each flavor was created an app on firebase. For android there is no big difference, because configurations for all these projects are inside one file, while for iOS you should have three different files GoogleService-Info.plist
and also three different files firebase_app_id_file.json
(one for each flavor). MacOS does not support flavors, therefore for MacOS you need only one file GoogleService-Info.plist
and one file firebase_app_id_file.json
.
For android you need to put the google-services.json
file in the android/app
directory, so the full path should be android/app/google-services.json
.
For iOS you should prepare three different files GoogleService-Info.plist
and three different files firebase_app_id_file.json
(one for each flavor: for production, staging, and development). Then you need to put these files respectively in directories ios/config/development/
, ios/config/staging/
, and ios/config/production/
. So in the end you should have the following structure:
ios/
config/
development/
firebase_app_id_file.json
GoogleService-Info.plist
staging/
firebase_app_id_file.json
GoogleService-Info.plist
production/
firebase_app_id_file.json
GoogleService-Info.plist
For iOS you need to put the GoogleService-Info.plist
file in the macos/Runner/
directory, so the full path should be macos/Runner/GoogleService-Info.plist
and the firebase_app_id_file.json
file in the macos/
directory, so the full path should be macos/firebase_app_id_file.json
.
This project contains 3 flavors:
- development
- staging
- production
To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands:
# Development
$ flutter run --flavor development --target lib/main_development.dart
# Staging
$ flutter run --flavor staging --target lib/main_staging.dart
# Production
$ flutter run --flavor production --target lib/main_production.dart
Again, if you want to lauch the app on MacOS, the commands above won't work, because MacOS does not support flavors. If you are using VSCode you can use lauch configurations with the [No flavor]
suffix. Or, if you want to use commands, you can use the commands above, just remove the flavor option(for example: flutter run --target lib/main_development.dart
)
To run all unit and widget tests use the following command:
$ flutter test --coverage --test-randomize-ordering-seed random
To view the generated coverage report you can use lcov.
# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/
# Open Coverage Report
$ open coverage/index.html