Comments (3)
Hi @prassaschr ,
ESP-RFID self sufficient project. Implementing MySQL support is easy but this will require specific solution for each MySQL setup, instead you can query ESP-RFID with a Node.js application (using WebSocket client) or any other tool for record keeping. Node.js and MySQL + WebSocket packages is just enough for the task.
Kind regards.
from esp-rfid.
This sounds interesting! Could you guide me by posting an example URL? I am not familiar with Node.js and Websocket client.
Thank you once more.
Kind Regards
from esp-rfid.
For example this is a simple Node.js script that is Websocket Server and a MySQL client. Websocket server listens for queries and executes a search query on MySQL server, then sends back results to Websocket client.
var mysql = require('mysql');
var connection = mysql.createConnection({
host: 'localhost',
user: 'admin',
password: '1',
database: 'tek_servis'
});
const WebSocket = require('ws');
const wss = new WebSocket.Server({
port: 8080
});
wss.broadcast = function broadcast(data) {
wss.clients.forEach(function each(client) {
if (client.readyState === WebSocket.OPEN) {
client.send(data);
}
});
};
function sorgula(data) {
connection.query("select c.hesapkodu, c.cariadi, c.tipi, c.cinsi, c.marka, c.model, c.tamadi, c.sfiyat, c.afiyat, c.ptipi, c.barkod, (case when 1=1 then(SELECT sum(coalesce(d.miktar,0)*m.gc) FROM stokgcm m, stokgcd d WHERE m.gcsno=d.gcsno and m.aktif=1 and d.hesapkodu=c.hesapkodu) else 0 end) as Kalan from cariler c where c.hesapkodu like '153%' and c.bayino=1 and c.aktif=1 and (c.barkod='" + data + "') or (c.tamadi like '%" + data + "%')", function(error, results, fields) {
if (error) throw error;
wss.broadcast(JSON.stringify(results));
});
}
wss.on('connection', function connection(ws) {
ws.on('message', function incoming(message) {
var obj = JSON.parse(message);
if (obj.type === "sorgu") {
sorgula(obj.data);
}
});
});
from esp-rfid.
Related Issues (20)
- Relais turns ON while restart HOT 5
- my system runing on build 119 but v2.0.0 rc0reading mfrc522 empty uuid HOT 35
- esp-rfid keeps disconnecting from mqtt HOT 5
- NTP unnecessarily blocking loop if connection is not present HOT 7
- Add support for generic serial input HOT 15
- Tag UID isn't read while using MFRC522 and v2.0.0.rc0 HOT 2
- wemos d1 unstable HOT 3
- ESP-RFID Relay Blue Board drivers problem HOT 3
- [FEATURE REQUEST] Do not try to reconnect to Wi-Fi when scanning "Admin" access tags in Client mode HOT 2
- How to get latest generic.bin for Dev branch HOT 2
- MQTT additional Command HOT 1
- Logs show Access granted for expired tags HOT 2
- Opening hours not working HOT 6
- Finished Hardware with Enclosure, Keypad and PN532
- PN532 Uids missing 0 sometimes HOT 3
- PIN in MQTT Message HOT 1
- cant build new html sites HOT 4
- in v2 user backup is broken HOT 1
- Pincode saved incorrectly in memory HOT 7
- cant build generic from dev branch HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-rfid.