Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs > Driver Dev: Logic vs Service vs Device drivers #358

Open
w-le opened this issue Sep 1, 2022 · 3 comments
Open

Docs > Driver Dev: Logic vs Service vs Device drivers #358

w-le opened this issue Sep 1, 2022 · 3 comments
Assignees
Labels
priority: low type: documentation improvements or additions to documentation type: enhancement new feature or request

Comments

@w-le
Copy link
Contributor

w-le commented Sep 1, 2022

service_url: "http://FUSION_SERVER/fusion/apiservice/",

Looks like Crestron Fusion is implemented as a "Logic driver", but I think a "Service Driver" makes more sense.

Hey @stakach and @jeremy-west I think this goes to show that the existing Driver development documentation isn't clear enough, cause even internally, experienced devs are implementing a HTTPS REST driver as a Logic driver.
https://docs.placeos.com/tutorials/backend/write-a-driver

@w-le
Copy link
Contributor Author

w-le commented Sep 2, 2022

While testing this with Steve, it turns out that implementing this as a Service driver is a functional requirement in PlaceOS not just a style thing. So Steve is changing it to a Service driver now. While it's a logic driver we get this error for requests:

{
    "error": "request failed",
    "sys_id": "sys-Dvx2zYxS7t",
    "module_name": "CrestronFusion",
    "index": 1,
    "message": "module raised: Error reading socket: Connection reset by peer (IO::Error)",
    "backtrace": [
        "/usr/share/crystal/src/io/evented.cr:61:9 in 'unbuffered_read'",
        "/usr/share/crystal/src/io/buffered.cr:80:16 in 'read'",
        "/usr/share/crystal/src/openssl/bio.cr:46:13 in '->'",
        "crypto/bio/bio_lib.c:272:5 in 'bio_read_intern'",
        "crypto/bio/bio_lib.c:298:5 in 'BIO_read'",
        "ssl/record/rec_layer_s3.c:296:19 in 'ssl3_read_n'",
        "ssl/record/ssl3_record.c:210:13 in 'ssl3_get_record'",
        "ssl/record/rec_layer_s3.c:1301:19 in 'ssl3_read_bytes'",
        "ssl/s3_lib.c:4467:5 in 'ssl3_read_internal'",
        "ssl/ssl_lib.c:1771:16 in '??'",
        "ssl/ssl_lib.c:1791:5 in 'SSL_read'",
        "/usr/share/crystal/src/openssl/ssl/socket.cr:129:5 in 'unbuffered_read'",
        "/usr/share/crystal/src/io/buffered.cr:261:5 in 'fill_buffer'",
        "/usr/share/crystal/src/io/buffered.cr:103:7 in 'peek'",
        "/usr/share/crystal/src/io.cr:653:37 in 'gets'",
        "/usr/share/crystal/src/io.cr:612:5 in 'gets'",
        "/usr/share/crystal/src/http/client/response.cr:127:7 in 'from_io?'",
        "/usr/share/crystal/src/http/client.cr:604:5 in 'exec_internal_single'",
        "/usr/share/crystal/src/http/client.cr:596:5 in 'exec_internal'",
        "/usr/share/crystal/src/http/client.cr:581:7 in 'exec'",
        "/usr/share/crystal/src/http/client.cr:713:5 in 'exec'",
        "/usr/share/crystal/src/http/client.cr:745:7 in 'exec'",
        "repositories/drivers/drivers/crestron/fusion.cr:162:5 in 'perform_request'",
        "repositories/drivers/drivers/crestron/fusion.cr:127:16 in 'get_signal_values'",

@w-le w-le added the type: documentation improvements or additions to documentation label Sep 2, 2022
@w-le
Copy link
Contributor Author

w-le commented Sep 2, 2022

Quite difficult to troubleshoot the above as it even took Steve 30mins. So I recommend updating that Driver dev documentation sooner rather than later to prevent the same time wastage in the future.

@w-le w-le assigned jeremyw24 and unassigned chillfox Sep 2, 2022
@w-le w-le removed the type: driver label Sep 2, 2022
@w-le w-le changed the title Convert Fusion from Logic Driver to Service Driver Docs > Driver Dev: Logic vs Service vs Device drivers Sep 2, 2022
@w-le
Copy link
Contributor Author

w-le commented Sep 2, 2022

Jeremy can assign to product team member to update the driver dev documentation to prevent this from happening in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low type: documentation improvements or additions to documentation type: enhancement new feature or request
Projects
None yet
Development

No branches or pull requests

3 participants