Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/msf4-0/SWSI

Smart Weighing Scale & Inventory
https://github.com/msf4-0/SWSI

arduino erpnext inventory-tracking-system iot node-red

Last synced: 19 days ago
JSON representation

Smart Weighing Scale & Inventory

Awesome Lists containing this project

README

        

# Smart Weighing Scale & Inventory
A wireless & portable smart weighing scale embedded system that interfaces with Node-Red for IoT connectivity and ERPNext for inventory & stock tracking.

The embedded system is developed on PlatformIO IDE and built on the Arduino framework.

## **Installation** ##
1. This application is supported in both Windows and Ubuntu 20.04
2. This application have been tested on vultr cloud platform, other cloud platforms have not been tested.

- Install Node.js at https://nodejs.org/en/
- Install Node-RED at https://nodered.org/docs/getting-started/local
- Install MySQL on windows at https://dev.mysql.com/downloads/installer/
- Install MySQL on Ubuntu 20.04 using the terminal
1. Typed in ```sudo apt update```
2. Install mySQL server package using the prompt ```sudo apt install mysql-server```
3. Ensure that the server is running using the prompt ```sudo systemctl start mysql.service```
4. Run the security script ```sudo mysql_secure_installation```, the first prompt will ask the user to validate the password. While the second prompt will be used for the MySQL root user.
5. You can check the condition of the services by using the command prompt ```systemctl status mysql.service```
- Install Influxdb at https://portal.influxdata.com/downloads/
- Install ERPNext using vultr (A cloud platform) at https://www.vultr.com/

## **Basic User Guide** ##

There are several process that you should be aware of before running the flow;
1. Within Microsoft Visual Studio, when trying to build and/or upload the code. In main.cpp (within the src folder), change the **!!!WIFI_ID!!!** and **!!!WIFI_PASSWORD!!!** according to your own network credentials. While the **mqtt_server_IP_address** change it according to your own IPv4 address.
```
// WiFI & MQTT
const char* id = "gdWS1"; // Unique Scale ID
const char* ssid = "!!!WIFI_ID!!!";
const char* password = "!!!WIFI_PASSWORD!!!";
const char* mqtt_server = "192.168.0.164"
```

2. In ERPNext homepage;

i. Underneath "My settings"

ii. You will able to find API Access that could "Generate API Key", likes so;

iii. Once generated, you can copy both the API Keys and the API Secret onto the Node-RED flow.

iv. By using change nodes and an inject node, you can make it so that the API Keys of the ERPNext to be global.

Inside the ERPNext domain node;

Inside the ERPNext token node;

V. Once this is done, your ERPNext should be connected to the Node-RED

3. Before importing the Node-RED flow, you need to install some Node-RED modules;
- node-red-contrib-influxdb
- node-red-contrib-aedes
- node-red-node-mysql
- node-red-contrib-bcrypt
- node-red-dashboard

4. To ensure that the data of the scale is being properly read, you need to ensure that influxdb is properly run. To do this, make a database called **location1** and **location2**.

Once done, proceed with inserting measurement onto our databases by using the command ```insert gdWS1/main value=0.1``` for scale 1 and ```insert gdWS2/main value=0.1``` for scale 2. Following is the successful configuration of both databases and measurements within scale 1;

Lastly, to see the value that is being read by using the command ```select * from “[Your Database Name]” order by time desc limit 5```;

5. For mysql, there is a node in node-RED that users should be aware of when running the flow, it is the mysql node that looks like;

Upon importing the flow, the node should also be configured accordingly. In our case, we set it as;

and

## **Detailed Documentation** ##
Follow the [documentation](https://drive.google.com/drive/folders/1bG_YV6uIwTKT_12CuCw8axnyWVp6YvOv?usp=sharing) process for further detailed explaination.