![]()
Page History
...
| Warning | ||
|---|---|---|
| ||
| The IoT Bridge for Snowflake v3.0.0 is now shipped as a component of Chariot. If you are using an older version of IoT Bridge for Snowflake, you will need to continue to refer to documentation here. |
...
IoT Bridge for Snowflake (IBSNOW) is an application that connects to an MQTT Server (such as Chariot MQTT Server or MQTT Distributor) and consumes MQTT Sparkplug messages from Edge devices.
...
Confirm your Snowflake resources (databases, stored procedures, user defined functions, roles, warehouses, etc) have been successfully created by the script execution.
IoT Bridge Setup
Log into the Chariot Web UI and navigate to 'Certificates' under IOT Bridge for Snowflake as shown below:
Click 'UPLOAD FILE' and upload the private key previously generated (rsa_key.p8). Confirm it is uploaded as shown below:
Now navigate to 'Servers' under IOT Bridge for Snowflake as shown below:
Now click 'Add Server' which will bring up the following dialog:
Change the following fields leaving all others default:
- Name = Chariot MQTT Server
- Username = admin
- Password = changeme
- If you have changed the password of the Chariot MQTT Server username, use whatever you set it to
- URL = tcp://localhost:1883
- Note we're using a local non-secure connection for this tutorial. If this were a production system connecting to a remote MQTT Server, TLS should be used.
- Sparkplug Client ID = IBSNOW-testing-client
- Verify Hostname = false
Save the configuration and confirm a new Server appears in the list as shown below:
Now navigate to 'IoT Bridge for Snowflake → Configuration' on the left navigation panel as shown below:
Modify the following properties leaving all others default:
- General → Snowflake Sparkplug MQTT Application Enabled = true
- General → Primary Host = IamHost
- Notify → Notify Database Name = cl_bridge_node_demo_db
- Notify → Notify Warehouse Name = cl_bridge_ingest_demo_wh
- Streaming Profile → User = IBSNOW_DEMO_INGEST
- Streaming Profile → URL = https://ACCOUNT_ID.snowflakecomputing.com:443
- Replace ACCOUNT_ID with your Snowflake account ID
- Streaming Profile → Account = ACCOUNT_ID
- Replace ACCOUNT_ID with your Snowflake account ID
- Streaming Profile → Private Key = PRIVATE_KEY_FILE_NAME
- Replace PRIVATE_KEY_FILE_NAME with the filename of your private key file (i.e. rsa_key.p8)
- Streaming Profile → Host = ACCOUNT_ID.snowflakecomputing.com
- Replace ACCOUNT_ID with your Snowflake account ID
- Streaming Profile → Database = cl_bridge_stage_demo_db
- Streaming Profile → Connect String = jdbc:snowflake://ACCOUNT_ID.snowflakecomputing.com:443
- Replace ACCOUNT_ID with your Snowflake account ID
- Streaming Profile → Warehouse = cl_bridge_ingest_DEMO_wh
- Streaming Profile → Role = cl_bridge_process_DEMO_rl
Once you've made these changes, save the configuration and navigate to the 'Status' tab under IoT Bridge for Snowflake.
At this point, make sure the trial license is running or you've purchased a license for the system. Also, ensure you've restarted IoT Bridge for Snowflake. If you have not done so, the 'RESTART SNOWFLAKE' banner will be present as shown below.
Once the trial is running and the configuration is saved, you should see the IoT Bridge for Snowfalke is connected to the Chariot MQTT Server as shown below.
Edge Setup with Ignition and MQTT Transmission
Install Ignition and MQTT Transmission module
At this point IoT Bridge is configured and ready to receive data. To get data flowing into IBSNOW we'll set up Inductive Automation's Ignition platform along with the MQTT Transmission module from Cirrus Link.
Installation of Ignition is very straightforward following the instructions in the Installing and Upgrading Ignition guide.
With Ignition installed, the Cirrus Link MQTT Transmission module must be installed as a plugin to Ignition. Follow the instructions in our Module Installation guide
Import UDTs and tags
Launch the Ignition Designer to connect to your Ignition instance.
Once it is launched, navigate to the 'default' tag provider in the Tag Browser, expand the tag tree to see the automatically created tags as shown below and delete tags Example Tag and MQTT Quickstart.
from the Designer import these tags IBSNOW_Quickstart_tags.json to MQTT Tags > PLC 1 create a UDT Definition and instance.
Review the Ignition Exporting and Importing Tags document if needed
You can view the imported UDT Definition and instance in the tag browser:
At this point, our tags are configured. A UDT definition will map to a model in Snowflake and UDT instances in Ignition will map to Snowflake.
But, before this will happen we need to point MQTT Transmission to the Chariot MQTT Server. To do so, browse back to the Ignition Gateway Web UI and select MQTT Transmission → Settings from the left navigation panel.
Now select the 'Transmitters' tab as shown below.
Now click the 'edit' button to the right of the 'Example Transmitter'. Scroll down to the 'Convert UDTs' option and uncheck it as shown below. This will also un-grey the 'Publish UDT Definitions' option. Leave it selected as shown below.
Now switch to the 'Servers' and 'Settings' tab. Delete the existing 'Chariot SCADA' pre-seeded MQTT Server Definition. Then create a new one with the following configuration.
- Name
- Chariot MQTT Server
- URL
- Your MQTT Server Endpoint URL of the form ssl://ENDPOINT_URL:8883
- To connect Transmission over SSL/TLS, set it up in Chariot according to this document.
- Alternatively, you may connect over TCP using the form tcp://ENDPOINT_URL:1883, though this should not be used in production over the public internet.
- Username
- Your username for the Chariot MQTT Server connection
- If using Chariot MQTT Server, the default username is 'admin'
- Password
- Your password for the Chariot MQTT Server connection
- If using Chariot MQTT Server, the default password is 'changeme'
When complete, you should see something similar to the following. However, the 'Connected' state should show '1 of 1' if everything was configured properly.
At this point, data should be flowing into Snowflake.
By tailing the log in IBSNOW you should see something similar to what is shown below which shows IBSNOW receiving the messages published from Ignition/MQTT Transmission.
When IBSNOW receives the Sparkplug MQTT messages, it creates and updates asset models and assets in Snowflake. The log below is also a useful debugging tool if things don't appear to work as they should.
Successful Insert
| Code Block | ||||
|---|---|---|---|---|
| ||||
FINEST|199857/0||23-04-21 15:46:22|15:46:22.951 [TahuHostCallback--3deac7a5] INFO o.e.tahu.host.TahuPayloadHandler - Handling NBIRTH from My MQTT Group/Edge Node ee38b1
FINEST|199857/0||23-04-21 15:46:22|15:46:22.953 [TahuHostCallback--3deac7a5] INFO o.e.t.host.manager.SparkplugEdgeNode - Edge Node My MQTT Group/Edge Node ee38b1 set online at Fri Apr 21 15:46:22 UTC 2023
FINEST|199857/0||23-04-21 15:46:23|15:46:23.072 [TahuHostCallback--3deac7a5] INFO o.e.tahu.host.TahuPayloadHandler - Handling DBIRTH from My MQTT Group/Edge Node ee38b1/PLC 1
FINEST|199857/0||23-04-21 15:46:23|15:46:23.075 [TahuHostCallback--3deac7a5] INFO o.e.t.host.manager.SparkplugDevice - Device My MQTT Group/Edge Node ee38b1/PLC 1 set online at Fri Apr 21 15:46:22 UTC 2023
FINEST|199857/0||23-04-21 15:46:23|15:46:23.759 [ingest-flush-thread] INFO n.s.i.s.internal.FlushService - [SF_INGEST] buildAndUpload task added for client=MY_CLIENT, blob=2023/4/21/15/46/rth2hb_eSKU3AAtxudYKnPFztPjrokzP29ZXzv5JFbbj0YUnqUUCC_1049_48_1.bdec, buildUploadWorkers stats=java.util.concurrent.ThreadPoolExecutor@32321763[Running, pool size = 2, active threads = 1, queued tasks = 0, completed tasks = 1]
FINEST|199857/0||23-04-21 15:46:23|15:46:23.774 [ingest-build-upload-thread-1] INFO n.s.i.i.a.h.io.compress.CodecPool - Got brand-new compressor [.gz]
FINEST|199857/0||23-04-21 15:46:23|15:46:23.822 [ingest-build-upload-thread-1] INFO n.s.i.streaming.internal.BlobBuilder - [SF_INGEST] Finish building chunk in blob=2023/4/21/15/46/rth2hb_eSKU3AAtxudYKnPFztPjrokzP29ZXzv5JFbbj0YUnqUUCC_1049_48_1.bdec, table=CL_BRIDGE_STAGE_DB.STAGE_DB.SPARKPLUG_RAW, rowCount=2, startOffset=0, uncompressedSize=5888, compressedChunkLength=5872, encryptedCompressedSize=5888, bdecVersion=THREE
FINEST|199857/0||23-04-21 15:46:23|15:46:23.839 [ingest-build-upload-thread-1] INFO n.s.i.s.internal.FlushService - [SF_INGEST] Start uploading file=2023/4/21/15/46/rth2hb_eSKU3AAtxudYKnPFztPjrokzP29ZXzv5JFbbj0YUnqUUCC_1049_48_1.bdec, size=5888
FINEST|199857/0||23-04-21 15:46:24|15:46:24.132 [ingest-build-upload-thread-1] INFO n.s.i.s.internal.FlushService - [SF_INGEST] Finish uploading file=2023/4/21/15/46/rth2hb_eSKU3AAtxudYKnPFztPjrokzP29ZXzv5JFbbj0YUnqUUCC_1049_48_1.bdec, size=5888, timeInMillis=292
FINEST|199857/0||23-04-21 15:46:24|15:46:24.148 [ingest-register-thread] INFO n.s.i.s.internal.RegisterService - [SF_INGEST] Start registering blobs in client=MY_CLIENT, totalBlobListSize=1, currentBlobListSize=1, idx=1
FINEST|199857/0||23-04-21 15:46:24|15:46:24.148 [ingest-register-thread] INFO n.s.i.s.i.SnowflakeStreamingIngestClientInternal - [SF_INGEST] Register blob request preparing for blob=[2023/4/21/15/46/rth2hb_eSKU3AAtxudYKnPFztPjrokzP29ZXzv5JFbbj0YUnqUUCC_1049_48_1.bdec], client=MY_CLIENT, executionCount=0
FINEST|199857/0||23-04-21 15:46:24|15:46:24.301 [ingest-register-thread] INFO n.s.i.s.i.SnowflakeStreamingIngestClientInternal - [SF_INGEST] Register blob request returned for blob=[2023/4/21/15/46/rth2hb_eSKU3AAtxudYKnPFztPjrokzP29ZXzv5JFbbj0YUnqUUCC_1049_48_1.bdec], client=MY_CLIENT, executionCount=0 |
Review the IBSNOW: Viewing the data in Snowflake document for details on the DB tables and views available














