Ignition 7.9 FTP over TLS

I am trying to automate uploading a file to an FTP server that requires explicit FTP over TLS. I have tried using pythons ftplib, but that does not seem to have support for FTPS until 2.7.

I then wrote a script that used org.apache.commons.net and I though I had it working because it works in the script console, but when I try running it in the gateway scope it says the java package net could not be found.

How can I automate this task on a 7.9.16 gateway?

I’m not even sure how you got it working against Apache Commons Net - as far as I can tell that is not a dependency we include in 7.9.16…

Do you have any 3rd party modules installed maybe?

well look at that we do have a custom module we made a long time ago to import apache commons net. It looks like it should be available in the gateway scope. Any ideas why it is not working?

<?xml version="1.0" encoding="UTF-8"?>
<modules>
	<module>
		<id>ApacheCommonsNet</id>
		<name>Apache Commons Net</name>
		<description>Apache Commons Net™ library implements the client side of many basic Internet protocols. The purpose of the library is to provide fundamental protocol access, not higher-level abstractions. Therefore, some of the design violates object-oriented design principles.</description>
		<version>3.5.0</version>
		<requiredignitionversion>7.9.6</requiredignitionversion>
		<requiredframeworkversion>7</requiredframeworkversion>
		<freemodule>true</freemodule>
		<jar scope="G">FreeModuleTemplate-gateway-1.0.0.jar</jar>
		<jar scope="G">commons-net-3.5.jar</jar>
		<jar scope="CD">commons-net-3.5.jar.pack.gz</jar>
		<hook scope="G">com.inductiveautomation.ignitionsdk.FreeModuleTemplate.GatewayHook</hook>
	</module>
</modules>

Adding dependencies that you intend to use in scripts via a module only works in Client/Designer scope, where there is no ClassLoader hierarchy. It does nothing for you in gateway scope unless you also add scripting function implementations that use the library to go along with it.

You could just drop it into $IGNITION/lib/core/gateway and restart to make it available in gateway scope, though.

In a pinch, you can supply a "script" module that just has (a) public static final field(s) that is(are) set to the class(es) you need. Like this for the report module: