access_time13 mins remaining

Creating a TCP/UDP Device And Connecting to Omnicore

access_time13 mins remaining

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.
  1. Go To Sink Tab And Click On Create Sink if not present.
    Add-Sink
  2. Copy Your Gcp Project Id To Project Field
    Add-Sink
  3. Follow the instructions and click continue.Choose either console or cli option.
    Add-Sink

3. Provision - Create A Registry

  1. Go To Registry Tab and click on New Registry
  2. If Root CA is needed, Paste the rootCA.crt generated in the previous step and paste it in the authentication.
  3. Enter Registry Details and Click Create. Sample Data is shown below.
    Create-Registry

4. Provision - Create A TCP Device

  1. Navigate to the Device Tab and select "New Device," then opt for TCP Device.
  2. Browse through the list of available Device Models, and upon finding the desired one, click on "Create Device". List-Device
  3. Input the Device's IMEI number and proceed by clicking on "Create." Create-Device

5. Connect - Connecting With TCP Client and Publishing Data To Omnicore

  1. .Open the device details tab from the right side.Get the ip/domain name and port associated with the device
    Netcat-Connect
  2. 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}
  3. Press Enter and once in netcat ,one can publish ascii encoded messages to the server.
    Netcat-Connect

6. Message - Fetching Published Data From Pub Sub

  1. Open The Subscription Tab for the particular pubSub Topic For Events,as given in registry details.
  2. Messages can be pulled and viewed.
    PubSub