Go to advanced search

by Grumpy Mike
Tue Jun 09, 2015 9:56 pm
Forum: Python
Topic: openCV closing a window with a mouse click
Replies: 5
Views: 1910

Re: openCV closing a window with a mouse click

Thanks for the reply. have you tried cvGetWindowHandle("window_name") Yes - this returns an error message saying that the module has no attribute GetWindowHandle. I have also tried the variants:- cv2.getWindowHandle cv2.cv.GetWindowHandle and many other combinations, it seems like it doesn't exist a...
by Grumpy Mike
Tue Jun 09, 2015 3:29 pm
Forum: Python
Topic: openCV closing a window with a mouse click
Replies: 5
Views: 1910

openCV closing a window with a mouse click

You would think I was asking for the world, but all I want to do is to have a user click the close X in an openCV window and have the program recognise it. It seems that this is not easy, and after three days of going round in circles and finding out how it can be done on a windows machine I am no c...
by Grumpy Mike
Sun May 31, 2015 9:37 am
Forum: Python
Topic: Does imgproc actually work
Replies: 0
Views: 353

Does imgproc actually work

I am trying to use imgproc from here:- https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/robot/downloads/ When I try and run this code, from imgproc import * cam = Camera(160, 120) image = cam.grabImage() image.drawRect(30, 30, 50, 50, 128, 0, 255) view.displayImage(image) or in fact any other...
by Grumpy Mike
Fri May 29, 2015 9:08 am
Forum: Python
Topic: GPIO update problem
Replies: 9
Views: 13956

Re: GPIO update problem

But is there any way to stop this? The normal turn off warnings does not work. It is a bit annoying when you know what you are doing.
by Grumpy Mike
Wed May 20, 2015 2:17 pm
Forum: Python
Topic: Calling command lines from Python
Replies: 6
Views: 1509

Re: Calling command lines from Python

OK face palm time. Thanks. in fact all those replies did work along with my original os.system call. It turns out that for some reason the call to the function that contained those calls was never being made. I spotted it when trying what Massi said. Sorry for the bother but you did prompt me to fin...
by Grumpy Mike
Wed May 20, 2015 1:47 pm
Forum: Python
Topic: Calling command lines from Python
Replies: 6
Views: 1509

Re: Calling command lines from Python

Thanks for your input:-
what output do you get?
Sorry where should I look for the output, I am not seeing anything.
subprocess.Popen should allow you a complete management of output
Not come across Popen before, just googled it and it looks sort of way beyond my pay grade in this language, sorry.
by Grumpy Mike
Wed May 20, 2015 1:32 pm
Forum: Python
Topic: Calling command lines from Python
Replies: 6
Views: 1509

Re: Calling command lines from Python

Thanks, but neither of those two worked.
by Grumpy Mike
Wed May 20, 2015 1:12 pm
Forum: Python
Topic: Calling command lines from Python
Replies: 6
Views: 1509

Calling command lines from Python

I am using WiringPi under Python. I have called up IDLE using gksudo idle. I am disableing the audio PWM output on exit of the python program by using:- wiringPi.pinMode(40,0) This works well. However in order to enable them again I have to type from a command line window:- gpio -g mode 40 alt0 Whic...
by Grumpy Mike
Tue Mar 17, 2015 4:21 pm
Forum: Python
Topic: Acessing all GPIO Registers
Replies: 1
Views: 413

Acessing all GPIO Registers

Does anyone know if there is a Python library that gives access to all the GPIO registers. That includes the edge detection registers so I can see brief pulses that a Python program could miss due to it being paged out by the operating system?
Thanks
by Grumpy Mike
Tue Mar 17, 2015 10:02 am
Forum: Beginners
Topic: Servo control - with or without driver?
Replies: 6
Views: 1094

Re: Servo control - with or without driver?

I just dont understand whats the difference between both (RaspiRobot and DRV8835). They are both H-bridge controllers. The RaspiRobot is built up on a board and uses a L293DNE chip at the heart of it. This uses transistors to do the switching and will give a little voltage loss on the motor drive a...
by Grumpy Mike
Wed Feb 11, 2015 8:14 am
Forum: Python
Topic: Metronome
Replies: 1
Views: 1189

Re: Metronome

Once you enter this loop:- while True: GPIO.output(16,1) time.sleep(1.1538) GPIO.output(16,0) time.sleep(1.1538) You have not got any way out, you never look at the input switches again. You need to add a function that looks at all the keys and returns a False if any key is pressed otherwise it retu...
by Grumpy Mike
Tue Feb 10, 2015 11:06 pm
Forum: Python
Topic: WiringPi2 on Pi2?
Replies: 8
Views: 1087

Re: WiringPi2 on Pi2?

It looks like that python library is cobwebware. It's not even been updated for B+ or A+.
Not sure why you said that. I did down load it last August when I got the B+ and it does work on that.
by Grumpy Mike
Tue Feb 10, 2015 7:07 pm
Forum: Python
Topic: WiringPi2 on Pi2?
Replies: 8
Views: 1087

Re: WiringPi2 on Pi2?

Best guess: that version is for the previous Pi's
I thought that pip was supposed to update automatically when the github code changed. That is it will always take the latest github code?

If I am wrong do you know who to prod to get it changed?
by Grumpy Mike
Tue Feb 10, 2015 6:02 pm
Forum: Python
Topic: WiringPi2 on Pi2?
Replies: 8
Views: 1087

Re: WiringPi2 on Pi2?

Thanks, it is good to know it is working under the hood.

Do you know what the problem is with the install then. I am writing something for "regular users" and I don't expect them to have to build it from the sources.
by Grumpy Mike
Tue Feb 10, 2015 5:37 pm
Forum: Python
Topic: WiringPi2 on Pi2?
Replies: 8
Views: 1087

WiringPi2 on Pi2?

Today I tried to install Wiring Pi 2 on a Pi2 by using sudo pip install wiringpi2 Despite me seeing changes in the last day or two on both Gordon's and Gadgetoid's Github account it failed to work on the Pi2. Am I installing it correctly to pick up all the new changes or do the changes not work? ( y...
by Grumpy Mike
Fri Jan 30, 2015 7:23 pm
Forum: General discussion
Topic: Looking for a bright RGB addressable LED strip
Replies: 17
Views: 20904

Re: Looking for a bright RGB addressable LED strip

Get this one:- https://github.com/tdicola/rpi_ws281x I have driven 240 LEDs with this, then I ran out of LEDs. Install with:- wget https://github.com/tdicola/rpi_ws281x/raw/master/python/dist/rpi_ws281x-1.0.0-py2.7-linux-armv6l.egg sudo easy_install rpi_ws281x-1.0.0-py2.7-linux-armv6l.egg No need fo...
by Grumpy Mike
Sun Jan 18, 2015 4:41 pm
Forum: General discussion
Topic: Looking for a bright RGB addressable LED strip
Replies: 17
Views: 20904

Re: Looking for a bright RGB addressable LED strip

You just don't know what you are talking about I am afraid.

The length of chain has nothing to do with the GPIO's ability to drive the chain.
If the complete message fits in the SPI FIFO (from memory 128 bytes) then it was OK.
No, the Neopixel library uses the DMA not the SPI.
by Grumpy Mike
Sun Jan 18, 2015 12:42 pm
Forum: General discussion
Topic: Looking for a bright RGB addressable LED strip
Replies: 17
Views: 20904

Re: Looking for a bright RGB addressable LED strip

Hi all. I have not seen them in real life, so I'm not sure how bright they are. Is there any brighter RGB addressable LED RPi friendly solution? Maybe something 12V would work better, but then how do I attach it to RPi? I intend to use a computer PSU for a prototype, so I'd have good 12V for LED, b...
by Grumpy Mike
Sun Jan 18, 2015 12:04 pm
Forum: General discussion
Topic: Looking for a bright RGB addressable LED strip
Replies: 17
Views: 20904

Re: Looking for a bright RGB addressable LED strip

I would like to point out that pigpio can not drive WS2812B (or similar) LEDs with waveforms. A chap did manage to drive a few of the WS2812B LEDs with pigpio and SPI but it was not reliable for more than a few LEDs. That makes no sense at all. The signals are regenerated on each WS2812b LED so if ...
by Grumpy Mike
Sat Nov 15, 2014 12:29 pm
Forum: Python
Topic: SSH session from Python
Replies: 9
Views: 7759

Re: SSH session from Python

So anyone looking for the answer to this it turns out that apt-get installs a rather old version of paramiko. So do this:- apt-get install python-pip And do a version check of the Python libs:- pip freeze This command produces lots of lines but the one of interest here is:- ........ paramiko==1.7.7....
by Grumpy Mike
Wed Nov 12, 2014 10:19 pm
Forum: Python
Topic: SSH session from Python
Replies: 9
Views: 7759

Re: SSH session from Python

Not to worry this module was not the answer. Still can't log on to a ssh session from python. Using this code:- #!/usr/bin/env python __author__ = 'timmattison' import paramiko import sys import time root_command = "whoami\n" root_command_result = "root" def send_string_and_wait(command, wait_time, ...
by Grumpy Mike
Wed Nov 12, 2014 9:47 pm
Forum: Python
Topic: SSH session from Python
Replies: 9
Views: 7759

Re: SSH session from Python

It looks to me like python-paramiko is installable by apt-get. Thanks looks like you were right. I am having trouble with switching networks. I am getting out to some internet addresses but not others. I unplugged the device I was trying to talk to for this problem and rebooted and now I can instal...
by Grumpy Mike
Wed Nov 12, 2014 9:33 pm
Forum: Python
Topic: SSH session from Python
Replies: 9
Views: 7759

Re: SSH session from Python

I get this:- [email protected] ~ $ sudo apt-get install python-paramiko Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: python-glade2 rfkill Use 'apt-get autoremove' to remove them. ...
by Grumpy Mike
Wed Nov 12, 2014 9:02 pm
Forum: Python
Topic: SSH session from Python
Replies: 9
Views: 7759

Re: SSH session from Python

Thanks. Adding the timeout in the pxssh.pxssh call had absolutely zero effect. It did not even change the amount of time before python crashed with the error, no matter what number I put in. It looks from that thread that paramiko might be the answer if only one could install it. I have tried search...
by Grumpy Mike
Wed Nov 12, 2014 12:15 pm
Forum: Python
Topic: SSH session from Python
Replies: 9
Views: 7759

SSH session from Python

I am trying to control a SSH session from python, I have this code:- import pxssh s=pxssh.pxssh() if not s.login('10.42.0.3','root','password'): print"login failed" print str(s) else: print"login sucessful" s.sendline('uptime') s.prompt() print s.before s.logout() But it fails at the login saying:- ...

Go to advanced search