botdream
Posts: 19
Joined: Mon Sep 12, 2011 1:09 pm
Contact: Website

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Tue Sep 13, 2011 11:23 pm

I have some nice projects that I already tried to implement with other expensive Linux embedded hardware, some of the prototypes failed due to HW/SW limitations, some did succeed, but was to expensive to implement as a 'viable' solution. I will start with a simple suggestion, once I have some Raspberry Pi in my hands, I'm sure that I will have another interesting topics to open ;)

There are situations that I need to remote access my home/office/wife/friend PC, but I'm unable to do because the PC is turned OFF and the office is closed during the weekend ... I've been developing the idea to have a cheap and energy efficient Linux embedded board inside the PC that will have internet access via Ethernet connection, and by using XMPP protocol (been testing with Googletalk chat service), be able to send remote commands such as WAKE_UP, SLEEP, SHUTDOWN, etc, GPIO pin will then activate (maybe via relay switch) the PC power button ... I can tell you guys that I already had such solution, but my previous Linux embedded hardware platform didn't have support for a standard Linux Distro, making such XMPP app would require extra efforts (porting stuff to OpenWrt is a bit complicated and weird - at least for me)!

I've tried some C code libraries, but had hard time with the library dependencies and gave up! I decided to test some web-tech tools and found a nice way of doing this via Ruby, or even node.js (this last one still on tests).

I came up with this simples ruby script, that allows me to request a remote command over Gtalk chat (using XMPP protocol):
https://github.com/nneves/GtalkBot
(this is still an initial proof-of-concept script, but is currently working, just a matter of calling a GPIO service/script/app)

Well, I had the same problem trying to get Ruby running on my previous Linux embedded hardware, but I'm really confident that I will have success running this over Raspberry Pi board.

This solution could also be used for the Raspi to remote control some Relays connected to the GPIO port (via transistor circuit), and by connecting this relays to some power-plugs could also control other devices (OK, this is kind of dangerous, proper caution would be required on this - but have some other ideas for this one - RF plugs)

Pretty straight forward, as long as I have some Standard Linux distro such as Debian on Raspberry PI. Really hope to post an how to on this ;)

yroark
Posts: 2
Joined: Wed Sep 14, 2011 12:41 am

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Wed Sep 14, 2011 1:55 am

While I like the idea of physically embedding the device in the PC case and running wire to the 'Power On' pins. Would it make more sense to use the RPi as a device to send a WakeOnLan packet?

Providing WakeOnLan is configured and enabled on the PC in question?

Just curious as to your reasons for creating a direct physical connection to the 'Power On' pins and sending the momentary signal to turn the system on.

Keeping in mind that 'because its cool' is completely acceptable.

botdream
Posts: 19
Joined: Mon Sep 12, 2011 1:09 pm
Contact: Website

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Wed Sep 14, 2011 8:04 am

Hi @yroark,

I've been trying the WakeOnLan approach, but some of the PCs are a bit old and don't quite support this, or at least I never got this to work properly! And for me there is another restriction, you would have to MAP a port forward rule on your router for every PC that you want to control, and sometimes (office network) I don't have access to this, so, I'm aiming for a generic solution, as long as the internal network firewall/router allows GTalk/XMPP connection to an outside server I don't have to worry about that!

I was also trying to make something that I could use on my NAS system (that also uses Linux Embedded Hardware), for a generic remote control interface, so that my wife could easily restart the DLNA server, turn off the torrents, send a new link to download, etc, it was a good way to test both solutions! Since I'm constantly using Gtalk (PC, mobile) it made sense to me!

But in the end, yes, is kind of 'because its cool' thing ;) ... I appreciate your comment!

hippy
Posts: 4649
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Wed Sep 14, 2011 9:13 am

Quote from botdream on September 14, 2011, 00:23
I've tried some C code libraries, but had hard time with the library dependencies and gave up! ... Well, I had the same problem trying to get Ruby running on my previous Linux embedded hardware, but I'm really confident that I will have success running this over Raspberry Pi board.

That's generally been the case for me due to lack of Linux experience and lack of people who could help or lead me to the experience I need.

That's primarily a problem in trying to use NAS's, routers and the like as embedded platforms which they aren't intended to be used as and they are niche devices most Linux experts won't be familiar with, and those who are don't seem to have the time nor inclination to do 'hand holding'.

There's nothing worse and frustrating than, for example, "I got Squeezeplay to work", with, "Just compile and install the drivers - if it doesn't work you're doing something wrong!", when asked how. That's not how one leads the inexperienced; those who can will steam ahead, but those who can't likely never will.

Given its 'educational goals', if the R-Pi becomes ubiquitous, as we all hope, and gets a thriving development community which is willing to help and guide people then that should be much less of a problem.

eggn1n3
Posts: 106
Joined: Fri Jul 29, 2011 10:36 am

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Wed Sep 14, 2011 9:26 am

I agree, lots of people will developping on the same equipment (R-Pi), experience the same problems and hopefully as a result, share their solutions or findings too. This whole project heavily relies on the community to make it (even) a big(ger) success.

botdream
Posts: 19
Joined: Mon Sep 12, 2011 1:09 pm
Contact: Website

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Wed Sep 14, 2011 9:36 am

I agree with both, I myself had such frustrations that you describe, I had so many projects on my mind, then I start losing time with some SW/HW 'blocking' problems that you don't have experience, and you find yourself powerless to continue! Just a small example, once I had a webcam attached to a Linksys NSLU2 (aka SLUG running Debian), streaming MJPEG video (or JPEG images) via Ethernet, I could remote connect to it from internet, and also had attached 2 Servo Motors to drive PAN and TILT camera position, SLUG would use I2C protocol to send PAN&TILT commands to a microchip PIC microcontroller that would then adjust the camera position (control PWM pulses of both servo motors). This was kind of a cute think, I invested in some less expensive Linux Embedded hardware, but this one used OpenWrt! Well, I can tell you that porting this solution was a bit difficult ... at the end of all I discovered that GPIO I2C implementation (software emulated) was buggy and the bus hanged.... fixing it took a long time, and during the all process I lost motivation ...

My point: there will always be situations that porting will require some adjustments, but if you stick with a major Linux Distribution such as Debian (or other similar), you can always take advantage of your previous tests and experience, and also have some strong community to support you, this will be an important thing! So, you got that right, and Raspberry PI is also getting it right! ;)

eggn1n3
Posts: 106
Joined: Fri Jul 29, 2011 10:36 am

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Wed Sep 14, 2011 10:17 am

@Botdream, that sounds like a nice project! Hopefully you can make something great for the R-Pi. I used an Axis board once http://www.axis.com/products/d...../index.htm for my Zigbee project. It's a similar board like the R-Pi. Unfortunately the supporting community wasn't that big, making it difficult to find help in case of problems. This board has now been taken out of production; could be because of lack of a community. I hope this will not be the case for the R-Pi.

joukio
Posts: 10
Joined: Tue Aug 30, 2011 4:48 am

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Fri Sep 23, 2011 10:52 am

hi guys,

I would like a similar thing. Besides the already mentioned ideas I would like to use the RPI as a serial console server by hooking up the RPI via it's serial port to a serial console (rs232). Next to that I think by using 1-wire (with owfs) components it would be very easy to do all kind of things (switching on/off, reading temperatures, drive servo motors or stepper motors, read counters....). Perhaps an idea to do the cam control via 1-wire?

joukio
Posts: 10
Joined: Tue Aug 30, 2011 4:48 am

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Fri Sep 23, 2011 10:52 am

and other control and measurement as well of course...

botdream
Posts: 19
Joined: Mon Sep 12, 2011 1:09 pm
Contact: Website

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Fri Sep 23, 2011 11:23 am

I have another project (Work In Progress) that is similar to yours, but uses a different 'channel' for communication, the main idea would be to have a Ruby app running as a ZigBee (XBee) 'server', to remote control appliances (On/Off), sensor readings, etc. ZigBee modules communicate via wireless protocol (IEEE standard 802.15.4), but data is sent via Serial Protocol into the ZigBee modules. Will leave this to another topic, it's still very WIP ;)

aastaneh
Posts: 4
Joined: Sun Oct 16, 2011 1:45 am
Contact: Website

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Mon Oct 17, 2011 1:49 am

Cool idea! This sounds a lot like the ILOM (Integrated Lights-Out Management) hardware that is deployed on rackmount servers. Instead of using XMPP however, ILOMs have direct access to the BIOS and can stop/start the server. Quite useful when the system is unstable. Sadly ILOMs are nonexistent on PCs. This sounds like a good project that solves real problems.

Though.. if there were a way to just access the reset circuit using the Raspberry Pi and mount it as it it were a PCI card and get power from the power supply, that would be AMAZING.

joukio
Posts: 10
Joined: Tue Aug 30, 2011 4:48 am

Re: Remote Power ON/OFF a PC or any pluggable device via XMPP protocol

Mon Oct 17, 2011 8:06 am

Quote from aastaneh on October 17, 2011, 02:49
Cool idea! This sounds a lot like the ILOM (Integrated Lights-Out Management) hardware that is deployed on rackmount servers.
and drac and kvm over IP.....

Instead of using XMPP however, ILOMs have direct access to the BIOS and can stop/start the server.
In this perspective XMPP is (imho) an upper layer protocol which uses the rpi interfaces to do something with the host it manages. However, it could do much more then just remote power off/on or sleep/suspend/resume.

Quite useful when the system is unstable.
That's one of the main reasons I had in mind.

Sadly ILOMs are nonexistent on PCs.
There is a firm (Aten) which sells pci cards which do just this, but they are quite expensive ( > 160 euro's).

This sounds like a good project that solves real problems.
Glad to hear that :)

Though.. if there were a way to just access the reset circuit using the Raspberry Pi and mount it as it it were a PCI card and get power from the power supply, that would be AMAZING.
That is the idea yeah. But, I don't think I will use the PSU of the host itself. Instead I would go for an external power supply, otherwise you cannot really power of a system and power it back on.

Return to “Other projects”