Skip to main content

Screen driver

The screen driver has been added to overtime and is a little overloaded with functionality. It is the driver that displays stuff in the web browser (on the main screen in the caravan). The driver is split into server and clientYou can also run the client in dev mode using:

npm run start

and when you are happy, run

npm run build

Which will put the newly compiled files in the relevant directory for the server. To run the server, in the server directory just run

node main.js

Then point your browser at http://localhost:9102

The server communicates with the browser over web-sockets. It also communicates with the main engine over MQTT. By calling endpoints on the server, the content being displayed in the browser can be changed. The following is a list of possibilities:

endpointmethoddescriptionparams
/api/homeGETShow the future mundane log on a black background
/api/cameraGETStream the output from the browser webcam
/api/camera/scanGETShow the output from the browser webcam and overlay face scan results
/api/webGETDisplay arbitrary HTMLsnippet: name of an arbitrary bit of html. Stored in the screen_driver/server/public/snippets directory
/api/media/playGETPlay some media
  • media: name of a media file in the media directory
  • delay : number of milliseconds to wait before playing (defaults to 500).
/api/airGETShow the dyson air quality screen
/api/qrcodeGETShow a large qrcode on the screenqrcode: the url to be encoded as a qrcode.
/api/imageGETShow an image, fullscreenimage: the url of the image
/api/messageGETFlash up a message on the bottom of the screen for a few secondsmessage: the message to display