jp19-lafa / IoT-Node

Code running on a single IoT device
MIT License
0 stars 0 forks source link

Contributors Forks Stargazers Issues MIT License


Logo

IoT Node

Code running on a single smart farm.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

About The Project

The IoT Node is a part of FarmLab project. It works together with the rest of the projects to create a full scalable and modern farm.

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Install python 3.X

sudo apt install python3

Install paho-mqtt

sudo pip install paho-mqtt

Installation

  1. Clone the IoT-Node
    git clone https:://github.com/jp19-lafa/IoT-Node.git
  2. Install prerequisites
    sudo apt install python3
    sudo pip install paho-mqtt

Usage

Edit the config.py file to contain all settings for connecting to the mqtt broker

Simply run the network.py file to start the connection. Make sure you build the hardware correctly as described in the wiki

python3 src/network.py

Bluetooth

When launching bluetooth/main.py the server will listen for all incomming bluetooth pairing requests. When such a request comes in the server will automatically accept the request. After that it waits until a bluetooth connection is made. (Using RFCOMM)

Here is a list of command to send to the bluetooth server to establish a network connection

Type Code Value
Wifi standard TYPE: wpa2,mchap
SSID name SSID: String
Password PWD: String
Username USER: String (mchap only)
Try to connect TRY: 1

Here is a list of exit/success codes

Code return type Meaning
Error 1 ERROR:1 You didn't tell the server the wifi connection type
Error 2 ERROR:2 The wifi connection type isn't recognized
Error 3 ERROR:3 Your network connection credentials are wrong
Error 4 ERROR:4 Property is not part of the connection type
Success 1 SUCCESS:1 Sever connected to the network succesfully

In a short example the Android application should listen for ERROR codes an display them correctly to the user. When a Success message has been send the bluetooth connection can be ended.

For more examples, please refer to the Documentation

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

tom - tom@odex.be

Project Link: https://github.com/jp19-lafa/IoT-Node

Acknowledgements