0

Long background story short, I have a 4P (H8QGi-F) motherboard with Ubuntu Server 16.04 mounted in a tower. It's a beast and I'm using it for computational chemistry at the moment, but will use it for more down the road. What I'm envisioning, is mounting a Pi into one of the ten HD racks and accessing the server terminal through the Pi's. That's the basic approach.

Powering the Pi, so long as the power supply is plugged in may be odd, considering I don't yet know if the mobo has continuous power at a USB. Further, I've never tried to boot a PC through a straightaway Ethernet cable, or shell into one in the same manner- I've always gone through my router, whether home network or remote SSH. The mobo doesn't have wireless, nor do I intend on attaching a wifi dongle, really. I'm more than ready to allow the Pi to remain powered permanently, using it to turn on and off the server as needed.

I feel like I'm leaving out details, but so be it for now. I'm sure this has been asked before, but I really can't find it- my googling is lacking due to sleep dep resulting from school. I'd appreciate some input from someone who knows what they're talking about.

Edit: my question is, can I run the Pi while the PC is off, use the wifi connection from the Pi to both turn off/on the PC and use the PC's terminal, and is it therefor possible to do thing like assign a temp/humidity sensor to shut down the PC in times of high humidity or temp? Sorry for the lack of concision!

  • Welcome, but it's not clear there is any actual question here, unless it is about powering the pi -- which is only an issue if the motherboard turns out not to have continuous power USB (it probably does). That is something you should resolve yourself, and if it does not, ask a clear and specific question about powering the pi from a standard PSU. Note we are not a discussion, so invitations to general brainstorming are inappropriate. Please take the tour to understand better how the site works. – goldilocks Oct 16 '16 at 13:47
  • A direct ethernet connection is simple enough, but obviously the pi would then need to use wifi or something else to stay online, and if the mobo only has one ethernet jack, then it would have to forward any internet connection it needs through the pi (which will probably be a noticeable added bottleneck). WoL (wake-on-lan) packets can be sent through the LAN (hence the name) so all this may in fact be unnecessary if all you really want to do is that. Just connect the pi to the same router. – goldilocks Oct 16 '16 at 13:53
  • Thank you for the feedback- my apologies for not phrasing concisely – Jacob Nowatzke Oct 18 '16 at 15:37
0

can I run the Pi while the PC is off

Yes, presuming it has power of course.

use the wifi connection from the Pi to both turn off/on the PC

If you are using WoL to turn on the computer, yes -- a quick search shows there's at least one simple command for this in Raspbian, wakeonlan (in the wakeonlan package; there's also a gwakeonlan which is probably some kind of GUI interface).

This does not require the Pi actually be connected to the PC. It just requires the PC's ethernet jack be connected to the router, and the Pi to be on the same LAN. This is probably better if you would like to use the PC's ethernet jack for internet. Most likely the wake up could even be sent via wifi, so the Pi could be left anywhere.

Doing things this way (via the router and the LAN) instead of using a direct ethernet connection to the PC is actually simpler, because if you use a direct ethernet connection but want the Pi online via wifi, you will have to make special arrangements to have the WoL packet sent over the ethernet interface, whereas if you do it via the LAN, it can simply be sent out via the default route (wifi) and will target the PC based on MAC address.1

To turn off the PC you'd have to SSH (or otherwise remotely log-) in either via the pi or more directly once it is running and exectute a shutdown.

and use the PC's terminal

That depends on what you mean by "use the PC's terminal", but once the PC is on you could do whatever you can normally can do with it remotely.


1. Routing is actually an IP (internet protocol) address based activity. If the default route is via wifi, any network message, including a WoL packet, that doesn't have a special route defined for it will be sent out over the wifi. If instead you want it to go through the ethernet interface, you'd have to configure the OS to make that happen.

Normally directing traffic (e.g., routing) through an alternate interface is not a big deal -- you just modify the kernel routing tables. However, again, these sort things by IP address, but a WoL packet uses a broadcast address (not the specific IP of the PC), since while off, there is no OS on the PC running to deal with IP traffic, and the ethernet card is not designed to work on that level; it can only deal with MAC (media access control) addresses.

Redirecting traffic through an alternative interface on the Pi based on MAC address is more complicated than doing so based on IP address. I believe it will require configuration of iptables, which controls the kernel firewall, using a special MAC module.

So, connecting to the internet from the Pi with wifi but then to the PC with ethernet for this purpose may not be impossible, but it will be much easier to instead just plug the PC into the router if you can, then send the WoL packet from the Pi over wifi. It will then be broadcast from the router to the PC.

  • I don't have wifi with the PC, but of course the Pi does. I'd like to connect the Pi LAN to the PC LAN and use WoL in that fashion. I suppose the PC doesn't NEED access to the Internet, though it would be nice for apt-get. Sending commands Pi-PC (at the PC's terminal) can be done through the Pi-PC LAN, correct? Will accept answer, just need to clarify these points. – Jacob Nowatzke Oct 18 '16 at 17:19
  • I actually think it would be easier to do it over the LAN if possible, because otherwise you will have to configure a route on the Pi based on the PC's MAC address; WoL doesn't use IP. That's not impossible, just awkward. I.e., if you really want to access the Pi over wifi, connect it directly to the PC via an ethernet cable, then wake and connect to the PC that way you could, but it is a more complex solution than just going through the router. – goldilocks Oct 18 '16 at 17:47
  • Please rephrase that comment, I'm a little lost in the details. – Jacob Nowatzke Oct 18 '16 at 20:06
  • I've added a paragraph and footnote trying to explain that further. It has to do with the fact that networking is organized in layers, and the ethernet hardware does not deal with the layer on which IP addresses exist; what it normally does is pass traffic up to the OS, which interprets it. But if the PC is off, there's no OS to do that, so you cannot effectively send a WoL packet to a specific IP. That's an issue because by default if connected to the internet via wifi, the pi will send stuff out over wifi, not ethernet. – goldilocks Oct 18 '16 at 20:30
  • It isn't insurmountable, it's just an added complication. Using wakeonlan should be drop dead easy. But forcing it to send a message over the ethernet cable when the network connection is actually wifi will be awkward. Hence, using the cable directly between the Pi and the PC does not provide any advantages. – goldilocks Oct 18 '16 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.