News:

  • September 23, 2026, 03:08:51 AM

Login with username, password and session length

Author Topic: New Project - PLC to Android Notification  (Read 8385 times)

deep6ixed

  • Hero Member
  • *****
  • Posts: 105
New Project - PLC to Android Notification
« 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?

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: New Project - PLC to Android Notification
« Reply #1 on: December 01, 2020, 07:18:30 AM »
What would be the method of communication between the PLC and server?

deep6ixed

  • Hero Member
  • *****
  • Posts: 105
Re: New Project - PLC to Android Notification
« Reply #2 on: December 01, 2020, 07:26:32 AM »
Http post or get command

deep6ixed

  • Hero Member
  • *****
  • Posts: 105
Re: New Project - PLC to Android Notification
« Reply #3 on: December 02, 2020, 06:52:46 AM »
Quick Question:  does the httpcmd work fully on the simulator?  Instruction help says its a BRX only command.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: New Project - PLC to Android Notification
« Reply #4 on: December 02, 2020, 07:55:14 AM »
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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

deep6ixed

  • Hero Member
  • *****
  • Posts: 105
Re: New Project - PLC to Android Notification
« Reply #5 on: December 02, 2020, 08:29:44 AM »
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.

deep6ixed

  • Hero Member
  • *****
  • Posts: 105
Re: New Project - PLC to Android Notification
« Reply #6 on: December 05, 2020, 05:10:00 AM »
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.