Nubison IoT Developers 🇺🇸
NUBISON HomeUser GuideREST APIs🇰🇷 한국어
  • Get Started
  • MQTT/S
  • TCP/IP
  • HTTP
Powered by GitBook
On this page
  • Basic
  • Packet Type
  • Login Packet
  • Logout Packet
  • Data Packet
  • Command Packet
  • Heartbeat Packet
  • Appendix A: Error Code

TCP/IP

NUBISON IoT's standard TCP/IP protocol.

Basic

Please refer to the Getting Started section for the following communication platform information.

  • Device key: "Product Code_Device Identifier"

  • product code

  • Client ID

  • Client Secret

Encoding: UTF-8

The packet size must be at least 9 bytes. Packets less than that are not processed.

Packet Type

Type

Description

L

Cloud Login

O

Cloud Logout

D

Sensor Data Notification

C

Command

H

Heartbeat

R

Response

Login Packet

Device -> Server

1 byte

8 bytes

20 bytes

20 bytes

8 bytes

1 byte

any

L

Session ID

Client ID

Client Secret

Product Code

Identifier Length

Identifier

Server -> Device (Success)

1 byte

8 bytes

1 byte

24 bytes

1 byte (optional)

any (optional)

R

Session ID

0x01

Access Token

Encryption Key Length

Encryption Key

Server -> Device (Fail)

1 byte

8 bytes

1 byte

2 bytes

R

Session ID

0x00

Error Code

※ Session ID is a unique identifier for every transaction. To identify the transaction, it is a random string generated by the request sender and returned as-is by the responder.

Logout Packet

Device -> Server

1 byte

8 bytes

24 bytes

O

Session ID

Access Token

Server -> Device (Success)

1 byte

8 bytes

1 byte

R

Session ID

0x01

Data Packet

Device -> Server

1 byte

8 bytes

24 bytes

2 bytes

any

D

Session ID

Access Token

Payload Length

Payload

Server -> Device (Success)

1 byte

8 bytes

1 byte

R

Session ID

0x01

Server -> Device (Fail)

1 byte

8 bytes

1 byte

2 bytes

R

Session ID

0x00

Error Code

※ Payload is a customizing area for each device.

Command Packet

Server -> Device

1 byte

8 bytes

24 bytes

1 byte (optional)

any (optional)

C

Session ID

Access Token

Payload Length

Payload

Device -> Server (Success)

1 byte

8 bytes

1 byte

1 byte (optional)

any (optional)

R

Session ID

0x01

Payload Length

Payload

Device -> Server (Fail)

1 byte

8 bytes

1 byte

R

Session ID

0x00

※Payload is a customizing area for each device.

Heartbeat Packet

Device -> Server

1 byte

8 bytes

24 bytes

1 byte (optional)

any (optional)

H

Session ID

Access Token

Payload Length

Payload

Server -> Device (Success)

1 byte

8 bytes

1 byte

R

Session ID

0x01

Server -> Device (Fail)

1 byte

8 bytes

1 byte

2 bytes

R

Session ID

0x00

Error Code

※ Payload is a customizing area for each device.

  1. Add a Payload if you want Data Notification at the same time as Heartbeat.

  2. If the Heartbeat is simple, only construct and send the packet to the Access Token.

Appendix A: Error Code

Error Code

Description

Note

0x0001

Packet Type is not valid.

Invalid Packet Type.

Please refer to this document.

0x0002

Packet structure is not valid.

The packet structure according to Packet Type is invalid.

0x0003

Client ID or Client Secret is not valid.

Check again at NUBISON IoT Cloud.

0x0004

Device is not registered.

Please register the device

in the NUBISON IoT cloud before connecting

0x0005

Access Token is not valid.

Access Token is not valid.

0x0006

Payload structure is not valid.

The payload structure is different from

the device driver registered in NUBISON IoT Cloud.

0x9999

Server Error

Server error. Please contact the relevant manager.

PreviousMQTT/SNextHTTP

Last updated 2 years ago