Skip to content

msf4-0/SWSI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

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"
  1. 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

  1. 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
  1. 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;

  1. 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 process for further detailed explaination.