Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
blocks:drivers:concepts [2024-03-20 13:27]
mattias [Using a Device Driver]
blocks:drivers:concepts [2024-04-18 11:24] (current)
admin [Using a Device Driver]
Line 11: Line 11:
 If an adequate driver for your device already exists, using it is quite straightforward. If an adequate driver for your device already exists, using it is quite straightforward.
  
-  - Obtain the drivers. Drivers provided by PIXILAB may come as part of your Blocks installation, or can be downloaded from PIXILAB's [[https://github.com/pixilab/blocks-script|github page]]. Find the green "Code" dropdown button and select download zip. +  - Obtain the drivers. Drivers provided by PIXILAB may come as part of your Blocks installation, or can be downloaded from PIXILAB's [[https://github.com/pixilab/blocks-script|github page]]. Find the green "Code" dropdown button and select download ZIP
- +  - Install the file(s) into your Blocks server by extracting the ZIP and then copying all relevant files to the PIXILAB-Blocks-root/script directory, typically located in the home directory for the user under which Blocks runs. Do this file copying while logged in as that user to avoid any access permission problems
-  - Install the file(s) into your Blocks server by extract the zip archive and copy all relevant files to the PIXILAB-Blocks-root/script directory under your home directory. +
   - Some rarely used device drivers are located in the driver-archive directory. If you need any of those, move those over from the archive to the acive driver directory. While blocks ignore the source code (.ts) file and use the .js it still makes sense to move/copy both the .ts and .js file to keep them in the same place.   - Some rarely used device drivers are located in the driver-archive directory. If you need any of those, move those over from the archive to the acive driver directory. While blocks ignore the source code (.ts) file and use the .js it still makes sense to move/copy both the .ts and .js file to keep them in the same place.
   - Make sure to also copy the latest version of all files in //system// and //system_lib//, as well as the files //package.json, package-lock.json// and //tsconfig.json//, into corresponding directories on your server.    - Make sure to also copy the latest version of all files in //system// and //system_lib//, as well as the files //package.json, package-lock.json// and //tsconfig.json//, into corresponding directories on your server. 
Line 20: Line 19:
 :!: When installing the files downloaded above, take care when copying the files into an existing PIXILAB-Blocks-root/script directory, as some operating systems will replace the entire directory with the new one, rather than adding only the individual files. You may want to copy files into directories one by one, rather than replacing your entire script directory with the downloaded one. :!: When installing the files downloaded above, take care when copying the files into an existing PIXILAB-Blocks-root/script directory, as some operating systems will replace the entire directory with the new one, rather than adding only the individual files. You may want to copy files into directories one by one, rather than replacing your entire script directory with the downloaded one.
  
-The driver(s) will now appear on the "Driver" menu for TCP/UDP Devices added on the manage page in Blocks. Once selected for a device, any functions exposed by the driver become available for use from panel controls, such as buttons and sliders, as well as Tasks.+The driver(s) will now appear on the "Driver" menu for Network Devices added to the Manage page. Once selected for a device, any functions exposed by the driver become available for use from panel controls, such as Buttons and Sliders, as well as from Tasks.
  
 ===== Driver Development Prerequisites ===== ===== Driver Development Prerequisites =====
Line 42: Line 41:
   * Development tools and code, as described [[blocks:drivers:tools|here]].   * Development tools and code, as described [[blocks:drivers:tools|here]].
   * Access to the device to be controlled, as well as all relevant documentation.   * Access to the device to be controlled, as well as all relevant documentation.
-  * If the device is controlled by serial data rather than a direct network connection, you'll need a [[blocks:drivers:serial|network-to-serial interface]].+  * If the device is controlled by serial data rather than a direct network connection, you'll need either a USB-to-serial interface if you're connecting through a PIXILAB Player or a [[blocks:drivers:serial|network-to-serial interface]].