1. Overview
What You'll Learn
- How To Create A Sink in Omnicore
- How To Create A Registry in Omnicore
- How To Create A TCP UDP Device in Omnicore
- How To Connect An Omnicore Device With TCP Client
- Viewing Published Messages From Cloud PubSub
2. Provision - Create Sink (Optional)
- If you want your telemetry and state messages to be forwarded to Cloud Pub/Sub please configure a sink.Else skip this step.
- Go To Sink Tab And Click On Create Sink if not present.
- Copy Your Gcp Project Id To Project Field
- Follow the instructions and click continue.Choose either console or cli option.
3. Provision - Create A Registry
- Go To Registry Tab and click on New Registry
- If Root CA is needed, Paste the rootCA.crt generated in the previous step and paste it in the authentication.
- Enter Registry Details and Click Create. Sample Data is shown below.
4. Provision - Create A TCP Device
- Navigate to the Device Tab and select "New Device," then opt for TCP Device.
- Browse through the list of available Device Models, and upon finding the desired one, click on "Create Device".
- Input the Device's IMEI number and proceed by clicking on "Create."
5. Connect - Connecting With TCP Client and Publishing Data To Omnicore
- .Open the device details tab from the right side.Get the ip/domain name and port associated with the device
- We will be using a simulator called netcat for simulating tcp/udp devices.Enter the details fetched from above to the netcat simulator
#Tcp Device netcat -v {ip} {port} #Udp Device netcat -u {ip} {port} #Payload Conversion from ascii to binary before sending through netcat echo -n "2A74000143D3D7662869C1E49FEF18055E46AE545E46AE54139241ACBA2A4BB5000A051F260A0DAF01004E0000000300" | xxd -r -p | netcat -u {ip} {port}
- Press Enter and once in netcat ,one can publish ascii encoded messages to the server.
6. Message - Fetching Published Data From Pub Sub
- Open The Subscription Tab for the particular pubSub Topic For Events,as given in registry details.
- Messages can be pulled and viewed.