Use Case
The smart home supply chain scenario contains multiple use cases. The idea is to enable a smart supply chain inside a home. For that, the ESP32 sensors are being used (using the RFID). As a semantic technology Nools is being used (a JavaScript Version of Drools). In order to run this scenario, the ESP32 and the JavaScript server have to be running on the same wifi connection.
BPMN for the Main Process
This BPMN is showing the whole process. The main process consists of three use cases: a fridge, toilet, and car.
USE CASE 1: Fridge
The first use case is describing the usage of the ESP32 in the fridge. For each item that is taken out, the RFID has to be placed on the reader. After 1 item reaches the amount of 1, the car is being sent to pick up new supplies in order to refill the fridge, so that the user never has to worry again about staying without milk, cheese, etc. in his fridge. The demonstration and the git link (source code) can be found on the links below.
USE CASE 2: Toilet
The toilet is the second use case and is similar to the fridge use case. An ESP32 is being placed in the WC and is being scanned for every toilet paper which is being used. After 4 of 5 paper rolls are being used, the JS application is sending the car to pick up new supplies. Use Case 1 and 2 are connected with the rules system Nools together. So if one of the items is used to 1 or bellow, all items will be bought and their counter refreshed to 5 (which is in my use case the maximum).
USE CASE 3: Car
The third use case consists of a autonomous car. The part of the autonomous car has been simulated, but a real robot or car can be implemented in the future.
In this scenario, the car is being triggered after the already described cases and is being sent to a shop to pick up the new goods and to bring them back home. The car has to be scanned after it arrives at the shop after it picks up the good and after it arrives at home.
Experiment
The link for the source code is: GIT.
The project consists of the Arduino implementation and of two javascript implementations (servers which are in this case running on localhost). The JavaScript part is using Nools as a semantic technology. In order to run this scenario, the two ESP32 sensors have to be connected on the same wifi connection as the JavaScript implementation, and they have to be running. The JavaScript code is making GET calls to the ESP32 in order to get the latest scanned RFID. After an RFID chip is being scanned, the JavaScript implementation part receives it, it checks if it is a new scan, and calls the rules from Nools after that. A message is being sent to the user according to which rules have been fired. The values are being saved to .txt files, which ADOxx is reading, and according to that adjusting, it’s graphical representation.
Overview of the whole scenario:
What is needed for the scenario?
In order to run the scenario please download first the files from Git. From Hardware 2 ESP32 with RFIDs are needed, a laptop and 2 microusb cables.
After downloading the content first adapt the file locations. The Javascript code has been commented, so all “FILELOCATION” strings have to be changed and the user has to add his file location. For the toilet and fridge scenario, the user needs to run both scenarios with “node server.js” and “node server2.js”. After connecting the ESP32 (please install the Arduino IDE), listen to the port and have a look at which URL they are responding. Then the URL has to be adjusted for both cases.
After each item is taken out of the fridge, the coresponding RFID must be scanned in order to adjust the values. The values are being saved to the TXT files, which are also being used by ADOxx for the Graphical Representation. So, also in ADOxx the location of the used txt files has to be adjusted (change for every Graph Rep).
Possible future extensions:
It would be possible in the future to implement an autonomous bot or car. Also, it would be good to expand the Nools rules.