Rebooting a Rasberry Pi client via PLC

Gadelric

Member
Join Date
Nov 2018
Location
Midwest
Posts
137
Mr. and Ms. Wizards,

I have a project that I would like to outline and see what direction I can get.

Project: Find a way to reboot Raspberry Pi so the maint team stops frying the SD card when they yank the power cable out to restart the Pi. (3 in the last 30 days)

Reason for reset: For an unknown reason, and at random times, we drop communication between the server pi and the client. This causes the web page that is running in Chromium to display "oh' snap, something went wrong" Rebooting the Pi is the quickest and easiest way to recover this issue.
Without the client pi displaying the web page, the operators at that station do not know the status of their build, and they call the maint team for support. This results in the maint tech pulling the plug as that's the "quickest" way to recover for them.

Details: We are using Raspberry Pi 3 devices to pull a web page from a server pi (of same style). The server Pi is using java script to read tags from an Allen Bradly PLC. The server Pi serves up the web page and updates the indicators on the web page based on the tag value within the PLC.

Issue: I know very little about java script and the original developer of this process is not available for support. I have been able to update the clients and server pi as needed for adding/removing indicators, but that is the limit of my current abilities with this programming language.

Question 1: Being that I have established a connection with the server -> client, and server -> PLC, can i use the server to send a command to the client to reboot? (i have up to 7 clients running off of one server pi.)

Question 2: If using the server pi to reboot the client is not optimal, should i just have the client monitor a tag within the PLC?

Things of note: Using Rasperian operating system, Using JAVA script to read the PLC from the server. Using Chromium to display the web page on the client Pi.

I've seen some options where you can run a wire to one of the pins and have the pi monitor the voltage on said pin. I can do this, but would rather utilize the networking vs climbing around this assembly line dragging cable.


Thanks in advance for much needed advice,

Gad
 
It's unlikely you would be able to reboot from a web page or java script alone. That would just be going around all of the security that java script offers.

My question is why use a server Pi? Why not use the one Pi to run the Java script to read from the PLC and show the web pages?

Just my personal opinion because I do not care for the restrictions and slow speed of java script and web pages, I would run a desktop app on the Pi to do everything and take that "middle man" web server out of the picture.
 
Since the Server Pi and the Client Pi are connected, you could use the Server Pi to send a restart command to the Client Pi.
 
@ Archie, I had the same exact idea, but I didn't build this set up. If i can prove out a better way, i have the authorization to do what ever it is i want with these things, just as long as it works.

I presume i can cut down the server's code to only look for the bits that the station in question needs and add this code to the client. This would give me just the bits for that op, which should help with latency, now how do i have the same pi load the web page? do i just change the web page IP address call to the same IP as the pi? I apologize for my lack of knowledge.


@BJH, My initial idea was to pursue this, after thinking it over, if my web page is dropping do to loss of com with the server pi, the ability to send a restart command may also be lost. I've seen some options to reboot the pi if a ping test fails, but with this option you run into an issue with the pi getting stuck in an endless restart loop, so I have read.

I will try to see what I can mess up, I have a test environment set up, so I have the ability to fumble though this.
 
Enable SSH on the Pi and establish a remote console connection. sudo reboot

You may not need sudo

You can write a .NET application to do this for you with a single button press. Use the commandline version of PuTTY (plink.exe). That should be even easier for your maintenance folks.
 
If the client pi is not responding it is probably borked anyway. You need to try and connect to it an see if it is still responding at all.

If it is still functioning you could set up a watchdog process on it looking for some event that occurs in normal functioning. If it does not occur within n seconds sudo reboot.
 

Similar Topics

Please urgent help needed. B&R Power Panel 4PP250.1043-K01 just keeps rebooting once it gets to initialization stage. What can I do to resolve...
Replies
2
Views
2,531
Hi folks, I have 9 process lines that each have a footage counter that measures strip length for a coiling process. I've had these for a couple...
Replies
2
Views
2,085
Hi all, I've got several CS900 control stations being operated throughout my plant and have had no problems with them. Until now. I've got a 3...
Replies
1
Views
1,775
Hello fellas... Been a long time. I'm currently stumped. O:6/8 comes true (on) at every power cycle. For the life of me I can't figure out why. I...
Replies
6
Views
2,359
Have a G306 Panel reading Data from a ML1100, on one page I have a Setpoint adjustment going into a N7 register then in the ML1100 I have a GEQ...
Replies
8
Views
2,021
Back
Top Bottom