Create a Network and register a device

Making your first requests over Blecon

In order for a Blecon device to communicate with your cloud application, it needs to be added to a Blecon network. Blecon networks allow you to configure the handling of events generated by devices such as requests and messages.

This guide will show you how to create a Blecon network and add a device to that network.

Creating and configuring virtual networks requires a Blecon account. If you do not have a Blecon account, create one now.

Create a new network

  1. Go to the Blecon Console and click the green "Create Network" button

  2. Give your network a name and click "Create Network"

  3. Once the network has been created, you will see the Network Information page for the network you just created. You can return to this page from the main Blecon Console page.

Register a device on the network

To register a device to the network, you will need its Device ID. If you are using a Blecon modem connected to your computer, you can use the Blecon CLI to get the modem's ID.

  1. Go to the Network Information page for the network you want to add your device to.

  2. Type in or copy and paste the device ID into the "Device ID" box in the Register Device section of the page

  3. When the device has been successfully added, you will see the Device Information page for that device. You can return to this page by selecting the Device ID under the "Devices" tab in the Network Information page.

Check network connectivity by sending a request

In order for this test to complete, make sure you have a Blecon hotspot set up nearby.

Once you have registered your device, you can attempt to send a message to your network. You can do this with the Blecon CLI and an attached Blecon modem.

On your computer, use the request subcommand in the CLI to send a test message to the network.

The example below sends a four-byte message with values: 4b 1e c0 17

% ./blecon-cli request 4b1ec017
Waiting for connection...
Terminating connection

The CLI can convert text strings to binary for you

Blecon devices send data to the network as raw bytes but you can send text strings from the CLI using the-t option. The CLI will perform the conversion from text to binary (UTF-8).

For example:

./blecon-cli request -t "hello cloud!"

The modem reports it successfully connected to the network. Since you have not yet set up any routes to handle incoming device requests, there is no response returned.

You can confirm this is the case based on the network.routing_failed event in the "Recent Events" tab of the Network Information page:

Next Steps

Last updated