Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: deep6ixed on December 01, 2020, 05:30:04 AM
-
Decided to work on a new proof of concept. PLC sending a message to a server that sends a notification to a android smartphone.
Will be updating as I get it working. Currently wrote an android app for my job that handles notifications, I can send from server to phone, now let's see if I can get from PLC to server.
Any thoughts from end users how you'd want it to function?
-
What would be the method of communication between the PLC and server?
-
Http post or get command
-
Quick Question: does the httpcmd work fully on the simulator? Instruction help says its a BRX only command.
-
Quick Question: does the httpcmd work fully on the simulator? Instruction help says its a BRX only command.
Yes, it does, but not on 205 or Terminator.
-
Awesome. I have half the job done then. Its my work weekend, this weekend. So with luck I can get the POST command working how I need it to and then if I can get it talking to a node.js server, it would be possible to skip email and go straight to direct notification.
-
So, after a few hours, I can honestly say: Success!!
It is very possible to send notifications to android users from a simple HTTPCMD instruction when setup properly.
Here's the basic overview.
PLC formats a message via JSONBUILD, and then calls the HTTPCMD to send a POST message to a small Node.js server that handles all the comms with the google firebase server. All end user would have to setup is the HTTPCMD to point to IP address of the Node.js server, and more than one PLC could send messages out. Server responds with either a 200 response for a valid message sent or a 4xx/5xx code if there is a problem.