Raspberry Pi

Questions and comments specific to a particular plugin should go here.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Raspberry Pi

Post by Pako » Mon Apr 20, 2015 5:01 pm

I do not own Raspberry Pi and now I have no opportunity to work with RPi.
As soon as possible, I will deal with it.

Pako
You know flattr ? You can Image

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Raspberry Pi

Post by Pako » Fri Apr 24, 2015 6:55 pm

Finally, I had the opportunity a few hours to play with RPi.
I think that most bugs are fixed.
You can download the new version (0.4).
Paramiko subfolder inside the folder RaspberryPi (meaning, of course, including content) is already worthless and you can delete it.
The buttons "Reboot" and "Power off" should work even if the RPi runs on ArchLinux.
Please do not hesitate with any feedback.

Pako
You know flattr ? You can Image

kalia
Experienced User
Posts: 109
Joined: Wed Aug 12, 2009 1:10 am

Re: Raspberry Pi

Post by kalia » Fri Apr 24, 2015 7:08 pm

Hello Pako,

Thank you for updating the plugin. I tried using the new version and get the following error when clicking on "Add New" in Plugin Item Settings window.
Capture.PNG
pi error
Thanks,

kalia

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Raspberry Pi

Post by Pako » Fri Apr 24, 2015 7:55 pm

Thank you for the warning.
I have not tried a case where RPi list is empty ...
Corrected version (0.5) is available.

Pako
You know flattr ? You can Image

User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: Raspberry Pi

Post by Luca Brasi » Sat Apr 25, 2015 5:20 pm

hey guys,

don't know maybe I am just stupid but I cant figure out how to send a couple of commands to my raspberry.
I have HarmonyHubCotntrol installed there. So I want to issue those commands

Code: Select all

cd HarmonyHubControl
./HarmonyHubControl mymailadress@host.com Pass 192.168.1.210 issue_device_command 22977625 3D
./HarmonyHubControl mymailadress@host.com Pass 192.168.1.210 issue_device_command 22977625 Ok
./HarmonyHubControl mymailadress@host.com Pass 192.168.1.210 issue_device_command 22977625 DirectionUp
./HarmonyHubControl mymailadress@host.com Pass 192.168.1.210 issue_device_command 22977625 Ok
the first command will be accepted but whenever I try to fire one of the others I get

Code: Select all

19:18:11      bash: ./HarmonyHubControl: Is a directory
19:18:11      
19:18:11      Fehler in Befehl: "Raspberry Pi: Send command: mmrp01: ./HarmonyHubControl mymailadress@host.com Pass 192.168.1.210 issue_device_command 22977625 3D"
19:18:11      Traceback (most recent call last) (1700):
19:18:11        File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
19:18:11          return self(*args)
19:18:11        File "C:\Program Files (x86)\EventGhost\plugins\RaspberryPi\__init__.py", line 1552, in __call__
19:18:11          return self.plugin.rpiCommand(ix, cmd, dis)
19:18:11        File "C:\Program Files (x86)\EventGhost\plugins\RaspberryPi\__init__.py", line 1074, in rpiCommand
19:18:11          res = self.cmd_session(client, cmd, ign)
19:18:11        File "C:\Program Files (x86)\EventGhost\plugins\RaspberryPi\__init__.py", line 1004, in cmd_session
19:18:11          return res.decode("utf-8")
19:18:11      AttributeError: 'NoneType' object has no attribute 'decode'
I tried putting the command into quotes and stuff like that to no avail.
Do you have any idea?
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Raspberry Pi

Post by Sem;colon » Sat Apr 25, 2015 7:30 pm

Hello Luca Brasi,

can you please try if the general SSH plugin can do the job?
viewtopic.php?f=9&t=6021
..I'm just curious

User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: Raspberry Pi

Post by Luca Brasi » Sun Apr 26, 2015 9:44 am

Hi sem;colon and Pako,

no I was not aware of your plugin! But I checked and it works perfectly. Thanks!
I guess your plugin suits my task better than the Raspberry Pi one so Pako I guess it's up to you to decide if you wanna investigate any further...

Thank you guys
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Raspberry Pi

Post by Pako » Sun Apr 26, 2015 3:01 pm

Luca Brasi wrote:I guess your plugin suits my task better than the Raspberry Pi one so Pako I guess it's up to you to decide if you wanna investigate any further...
Of course, I would like to improve RPI plugin.
But I do not know how to invoke the same error, what appears to you.
I'm trying - for example - this:
RPi-CoupleCmd.png
and everything is OK.

Pako
You know flattr ? You can Image

User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: Raspberry Pi

Post by Luca Brasi » Sun Apr 26, 2015 4:45 pm

I think I got it figured out. Hope I can explain...
The error is caused by the logic of my commands.
I took them from a putty command list. Putty will take it, open a ssh session to the rpi and issue the commands. All in this same session.
So my first command will make the rpi to go into a folder called HarmonyHubControl and the consecutive commands will be executed there.

Code: Select all

cd HarmonyHubControl
./HarmonyHubControl mymailadress@host.com Pass 192.168.1.210 issue_device_command 22977625 3D
./HarmonyHubControl is a script inside home/myuser/HarmonyHubControl

On the other hand, I guess, the rpi plugin will open a session for each command I have in my macro. Which looks like this

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1700">
    <Macro Name="3D" Expanded="True">
        <Action>
            RaspberryPi.SendCommand(1, u'mmrp01', u'cd HarmonyHubControl', 0)
        </Action>
        <Action>
            RaspberryPi.SendCommand(1, u'mmrp01', u'./HarmonyHubControl mail@host.com Pass 192.168.1.210 issue_device_command 2291625 3D', 0)
        </Action>
        <Action>
            RaspberryPi.SendCommand(1, u'mmrp01', u'./HarmonyHubControl mail@host.com Pass 192.168.1.210 issue_device_command 2291625 Ok', 0)
        </Action>
        <Action>
            RaspberryPi.SendCommand(1, u'mmrp01', u'./HarmonyHubControl mail@host.com Pass 192.168.1.210 issue_device_command 2291625 DirectionUp', 0)
        </Action>
        <Action>
            RaspberryPi.SendCommand(1, u'mmrp01', u'./HarmonyHubControl mail@host.com Pass 192.168.1.210 issue_device_command 2291625 Ok', 0)
        </Action>
    </Macro>
</EventGhost>
So the first command will work cause it finds a folder called HarmonyHubControl in my home folder.
But the second one will be executed from the home folder as well. Where HarmonyHubControl is a folder an not a script.

Code: Select all

eg.plugins.RaspberryPi.SendCommand(1, u'mmrp01', u'./HarmonyHubControl mail@host.com Pass 192.168.77.210 issue_device_command 22977625 3D', 0)
will lead to the error

Code: Select all

19:18:11      bash: ./HarmonyHubControl: Is a directory
So if I leave out the folder change in the first line and go with the absolute path in the consecutive lines it works

Code: Select all

/home/myuser/HarmonyHubControl/HarmonyHubControl mail@host.com Pass 192.168.1.210 issue_device_command 22977625 3D
My previous commands work in the ssh plugin cause it works different. There a session is opened and the commands will all be executed within this session.
So I guess your plugin is fine. It just wasn't clear to me how it works. Don't know if that should be made clearer at any point or if you might consider a change in the plugin.
Bottom line is that you could just leave it as is and users might find this post if they go down the same road as I did...
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Raspberry Pi

Post by Pako » Sun Apr 26, 2015 5:33 pm

Yes, your explanation is correct.
This plugin uses for each individual command a separate session.
This I do not plan to change.
But I will consider whether it will be possible to send multiple commands at once (within a single action).

Pako
You know flattr ? You can Image

User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: Raspberry Pi

Post by Luca Brasi » Sun Apr 26, 2015 5:39 pm

That'd be cool.
I was researching for the same thing earlier today.
Found this site with info
http://thornelabs.net/2013/08/21/simple ... r-ssh.html
Maybe can be of use for you as well.
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Raspberry Pi

Post by Pako » Sun Apr 26, 2015 6:59 pm

The new version (0.6) is available.
Action Send command can now contain multiple lines (multiple commands).

Note:
It can be confusing that the results of all the commands are grouped together.

Pako
You know flattr ? You can Image

Phil
Experienced User
Posts: 110
Joined: Tue Apr 15, 2014 10:42 am
Location: Merseyside, UK

Re: Raspberry Pi

Post by Phil » Tue May 12, 2015 8:57 am

Working well for me, thanks!

Phil
Experienced User
Posts: 110
Joined: Tue Apr 15, 2014 10:42 am
Location: Merseyside, UK

Re: Raspberry Pi

Post by Phil » Mon Jun 15, 2015 9:04 pm

Hi
A couple of questions with this..

The Enable and Disable Rpi. is that purely for the list of observed values? so if I have disabled all those I dont need to worry about enabling or disabling? (for some reason the core voltage or core temperature fails, not sure if its a time out issue).


I just got a unicornhat for my pi (http://shop.pimoroni.com/products/unicorn-hat) and this plugin seems a great way to get it to display messages from EG :P

thanks again Pako

Phil
Experienced User
Posts: 110
Joined: Tue Apr 15, 2014 10:42 am
Location: Merseyside, UK

Re: Raspberry Pi

Post by Phil » Mon Jul 13, 2015 11:33 am

Hi
Im keen to use this to run a line of code to backup a few pi's on a weekly basis.
The script uses the command sudo dd if=/dev/mmcblk0p2 of=/media/backup/backup.img bs=1M which then backs up the whole of the SD card to a network location.

However, during this period eventghost is locked up and showing the yellow symbol in the bottom corner. As its backing up 8gb it takes some time, is there a way for me to send this command to the pi and leave it to do its thing?

The whole command I send involves first mounting the drive, then the backup then unmount using && between commands, if this makes any difference.


thanks

Post Reply