Git Product home page Git Product logo

iot-sense-tcp-protocol's Introduction

IoTSense: A Lightweight TCP Protocol for IoT Devices

IoTSense is a lightweight and efficient TCP-based protocol designed for transmitting sensor data between IoT devices. This repository contains a Go implementation of the IoTSense protocol with a client and server application.

Features

  • Simple and efficient packet structure
  • Customizable packet types for data transmission and termination
  • Easy-to-understand Go implementation
  • Command-line input for sending sensor data

Getting Started

Prerequisites

  • Go 1.14+ installed

Installation

  1. Clone the repository:
git clone https://github.com/chandiwalaaadhar/iot-sense-tcp-protocol.git
  1. Change to the repository directory:
cd iot-sense-tcp-protocol
  1. Compile the client and server applications:
go build -o client client/main.go
go build -o server server/main.go

Usage

  1. Run the IoTSense server:
/server/main 
  1. In a separate terminal, run the IoTSense client:
/client/main 
  1. Follow the prompts to enter the sensor data and sensor ID to send to the server. The server will display the received data and sensor ID in the Client Terminal.
this is a test message>1

Understanding the Code

Client

The client application (client/main.go) allows users to input sensor data and sensor ID from the command line. It connects to the server, sends the data using the IoTSense protocol, and sends a termination packet to signal the end of the transmission.

Server

The server application (server/main.go) listens for incoming connections on a specified port and processes incoming IoTSense packets. When a data packet is received, the server prints the sensor data and sensor ID.

Packet Structure

The IoTSensePacket structure represents packets in the IoTSense protocol:

type IoTSensePacket struct {
	PacketType byte
	SensorID   uint16
	DataLength uint16
	Data       []byte
}

Contributing

  1. Fork the repository
  2. Create a new feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Create a new Pull Request

iot-sense-tcp-protocol's People

Contributors

chandiwalaaadhar avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.