control4 / docs-driverworks

Home Page for the Driverworks SDK
Other
41 stars 17 forks source link

Can't get new versions of drivers to install #6

Closed tig closed 3 years ago

tig commented 3 years ago

Hey folks! Hugs.

I'm tyring to build a driver for a new motorized TV mount. I will talk to it over a TCP/IP socket.

For giggles I grabbed the docs-driverworks\sample_drivers\generic_tcp sample.

I installed in in my Control4 system and proved it would connect.

Then I modified it and used the driver packager to create an updated generic_tcp.c4z file.

No matter what I try, CP refuses to actually upgrade the version on the controller. I've changed the version #, I've changed the created and modified dates in driver.xml. Etc...

CP, shows my new version (4) is available in local. But doing Update doesn't do anything (it says the driver was updated successfully).

image

image

image

But after all that:

image

Oh, and I've tried updating my User Activity driver (https://github.com/tig/User_Activity) as well and it fails in the same way.

I must be missing something obvious.

Thanks.

spike411 commented 3 years ago

Hello Charlie,

If you add a new instance of the driver, does it show up as the original, or the updated version? And what if you restart the director afterwards?

What if you update manually, i.e., right-click on the device in the project and select Update Driver...? Do you get any errors or warnings?

I think that the DEBUG-level director.log and perhaps a few others (driver_debug.log, driver_error.log) are your best friends. So I'd open a couple of terminal windows and 'tail' the logs while adding/updating the drivers. (There's also a tool to do this in Composer, but the good old terminal/CLI is faster if you know your way around it.)

Maybe you could post driver.xml 'before' and 'after'? It should still be enough for me to try to recreate the issue.

The created/modified dates have no effect. The version element is important for the Driver Manager, but manual update should still work even if you don't

spike411 commented 3 years ago

I'm thinking it could be a mismatch between the driver file name and the proxy name (which you may have changed in between the versions) in the driver.xml. It could also be a 'fatal' (syntax) error in the Lua code which would make the Lua interpreter not to load the driver. Or something went wrong with the driver packaging.

tig commented 3 years ago

What if you update manually, i.e., right-click on the device in the project and select Update Driver...? Do you get any errors or warnings?

It says success. No errors.

If you add a new instance of the driver, does it show up as the original, or the updated version? And what if you restart the director afterwards?

By adding another instance, both are now at version 4. So that's progress.

I think that the DEBUG-level director.log and perhaps a few others (driver_debug.log, driver_error.log) are your best friends. So I'd open a couple of terminal windows and 'tail' the logs while adding/updating the drivers. (There's also a tool to do this in Composer, but the good old terminal/CLI is faster if you know your way around it.)

I'll need some help here. I have no idea what to look for in the logs. Can you give me some hints on the text to search for that involves driver updates?

Another symptom, that now has me thinking there is something wrong with my director:

Real drivers are failing to update. No matter what I do, I can't get these drivers marked as needing updates to update. image

image

FWIW, Here's the XML for the driver I'm trying to upgrade:

<devicedata>
    <copyright>Copyright 2019 Control4 Corporation. All Rights Reserved.</copyright>
    <manufacturer>Control4</manufacturer>
    <name>Generic TCP Tester</name>
    <model>Generic TCP Tester</model>
    <creator>Control4</creator>
    <created>07/08/2021 16:00</created>
    <modified>07/08/2021 16:00</modified>
    <version>4</version>
    <control>lua_gen</control>
    <driver>DriverWorks</driver>
    <auto_update>true</auto_update>
    <minimum_auto_update_version>1</minimum_auto_update_version>
    <minimum_os_version>2.9.0</minimum_os_version>
    <config>
        <script file="driver.lua"></script>
        <properties>
            <property>
                <name>Server Address</name>
                <default></default>
                <type>STRING</type>
                <readonly>false</readonly>
                <description>This can be either a hostname or an IP address</description>
            </property>
            <property>
                <name>Server Port</name>
                <minimum>1</minimum>
                <maximum>65535</maximum>
                <default>23</default>
                <type>RANGED_INTEGER</type>
                <readonly>false</readonly>
                <description>The port to connect to on the remote server. Some standard ports: HTTP 80, HTTPS 443 [Set Use SSL to Yes], TELNET 23</description>
            </property>
            <property>
                <name>Connection Type</name>
                <type>LIST</type>
                <items>
                    <item>TCP</item>
                    <item>UDP</item>
                    <item>MULTICAST</item>
                </items>
                <default>TCP</default>
                <readonly>false</readonly>
                <description>Which protocol to use (SSL only supports TCP)</description>
            </property>
            <property>
                <name>Use SSL</name>
                <type>LIST</type>
                <items>
                    <item>Yes</item>
                    <item>No</item>
                </items>
                <default>No</default>
                <readonly>false</readonly>
                <description>Whether to use SSL on the connection</description>
            </property>
            <property>
                <name>Open Connection</name>
                <type>LIST</type>
                <items>
                    <item>Open</item>
                    <item>Close</item>
                </items>
                <default>Close</default>
                <readonly>false</readonly>
                <description>Set to Open to open the connection with the above settings</description>
            </property>
            <property>
                <name>Send Data</name>
                <default></default>
                <type>STRING</type>
                <readonly>false</readonly>
                <description>Enter text to send to the remote server.\n is turned into a newline and \r is turned into a carriage return</description>
            </property>
            <property>
                <name>Server Response</name>
                <default></default>
                <type>STRING</type>
                <readonly>true</readonly>
                <description>Response from the remote server</description>
            </property>
        </properties>
    </config>
    <combo>true</combo>
    <proxies>
        <proxy>generic_http</proxy>
    </proxies>
</devicedata>
WWalshC4 commented 3 years ago

Can you confirm if you're still having this update issue with the latest version of Composer?

tig commented 3 years ago

the problem has resovled itself.

WWalshC4 commented 3 years ago

the problem has resovled itself.

IIRC this was a bug during the most recent beta that was resolved during the beta.