Configuration
Add dependencies
Add the following dependencies in your package.json
:
"@dana/engine-qt",
"@dana/renderer-qml",
"@dana/tools-qml-grunt"
Profile
Add a freebox profile in your app.config.json
file:
Example:
"base-orange": {
"es5": true,
"base": {
"name": "free",
"vendors": [
"@dana/renderer-qml"
]
},
"device": {
"type": "freebox",
"model": "mini4k",
"freeId": "my_id"
},
"manifestJson": {
"name": "App name",
"description": "Some description",
"identifier": "com.company.identifier",
"entryPoints": {
"main": {
"file": "loader.qml",
"default": true
}
},
"capabilities": {
// ask free for hashs
}
}
device
type
: it could be :qt
: used it if you want to useqmlscene
for examplefreebox
: used it if you want to deploy on a freebox device
model
is required if you are usingfreebox
astype
. Available values are the following to match every freeboxes :revolution
devialet
mini4k
pop
freeId
is required if you are usingmini4k
orpop
asmodel
. It should match an existing app that as on open socket to change url in the loader.
ES6, ES5 or ES3
To be able to work on every device, you should build the application in es5 by adding in the profile :
"es5": true
Recommended polyfills
The following polyfills are recommended to have application working on all Freebox STB :
"polyfills": [
"es.promise",
"es.symbol",
"es.number",
"es.array.includes",
"es.array.iterator",
"es.array.find",
"es.array.find-index",
"es.object.assign",
"es.object.entries",
"es.object.values",
"es.array.iterator",
"es.string.pad-start",
"es.string.starts-with",
"es.string.ends-with",
"es.string.includes"
]
Debugging configuration
To retrieve logs on Revolution and Devialet devices, a freebox.log
file is generated inside generated
folder. When running grunt serve
command, a log show the command to retrieve the log using tail
.
To retrieve logs on Mini4k and Pop, grunt serve
will first launch the application specified in profile with freeId
. This application should have a Websocket server on port 8282 that will change loader url to match locally served application.
WebSocketServer {
id: _server
port: 8282
host: "0.0.0.0"
listen: true
accept: true
onClientConnected: {
webSocket.textMessageReceived.connect(function (message) {
const json = JSON.parse(message);
if (json["entry_point"]) {
loader.setSource(json["entry_point"]);
}
});
}
}
Then, as for Revolution and Devialet devices, a freebox.log
file is generated inside generated
folder. When running grunt serve
command, a log show the command to retrieve the log using tail
.