Go to advanced search

by -rst-
Thu Jan 29, 2015 5:02 pm
Forum: General programming discussion
Topic: GPIO through CGI
Replies: 20
Views: 12307

Re: GPIO through CGI

Did you get the HTML output working?

Wondering if there is difference between:

Code: Select all

print "Content-type: text/html\n\n"
and

Code: Select all

print "Content-type: text/html"
print
https://docs.python.org/2/library/cgi.html
by -rst-
Thu Jan 29, 2015 3:40 pm
Forum: Other programming languages
Topic: Web Gui flask, button that execute a bash command with state
Replies: 3
Views: 10303

Re: Web Gui flask, button that execute a bash command with s

You might want to look at the Python sub-forum and search for "omxplayer dbuscontrol" - there are lot of people controlling omxplayer from python scripts... Also it should be possible to get the result code of the call to start the player (usually on Linux it should be zero for success), so you coul...
by -rst-
Thu Jan 29, 2015 3:29 pm
Forum: Python
Topic: Webpage --> Python
Replies: 13
Views: 2005

Re: Webpage --> Python

Of course it has to be Python you heretics - this is the holy Python subforum :lol:

To me it looks like the wording of the original question suggests the OP already has some Python code to turn on the pin ...but I may be wrong or course.
by -rst-
Thu Jan 29, 2015 3:05 pm
Forum: OpenGLES
Topic: Python with OpenGLES
Replies: 15
Views: 7467

Re: Python with OpenGLES

Sorry, not quite sure what you mean with that and the earlier comment on already using PyOpenGL... Did you install PyOpenGL onto a Raspberry Pi? Did it work? Did you try the tutorial? Did it produce any output? The intro http://pyopengl.sourceforge.net/context/tutorials/shader_intro.html says it "It...
by -rst-
Thu Jan 29, 2015 2:11 pm
Forum: Python
Topic: Volume Control of USB Audio Device by PyAudio in Python
Replies: 1
Views: 3689

Re: Volume Control of USB Audio Device by PyAudio in Python

Looks like PyAudio does not have functions for controlling the volume. Could possibly use the amixer command-line tool and subprocess call
by -rst-
Thu Jan 29, 2015 1:57 pm
Forum: Python
Topic: Webpage --> Python
Replies: 13
Views: 2005

Re: Webpage --> Python

If you already know how the create and serve the webpage and want to use Python for the GPIO control, best to find out how to call a python script through CGI on your webserver.

Or you could implement the whole thing in Python https://docs.python.org/2/library/simplehttpserver.html
by -rst-
Thu Jan 29, 2015 1:31 pm
Forum: Python
Topic: Help using dbuscontrol.sh to control omxplayer
Replies: 32
Views: 8200

Re: Help using dbuscontrol.sh to control omxplayer

Well, as I said I am not that familiar with omxplayer so not sure if it is possible, but it seems to me that you open the two player to two different display layers (using the layer parameter) - maybe there is a way to change this, so that you could start them both and just switch the active one on ...
by -rst-
Thu Jan 29, 2015 1:27 pm
Forum: Python
Topic: fswebcam - where are my pictures?
Replies: 16
Views: 5298

Re: fswebcam - where are my pictures?

And in fact the subprocess module is meant to be used to replace the os.system.
by -rst-
Thu Jan 29, 2015 12:40 pm
Forum: Python
Topic: fswebcam - where are my pictures?
Replies: 16
Views: 5298

Re: fswebcam - where are my pictures?

Using echo for debugging is a brilliant idea when calling os.system (or similar) - especially if the command involves environment variables it would be the only way to get the actual command string - for example: os.system("echo somecommand $HOME/somesubdir/somefile") Quite often the python print is...
by -rst-
Thu Jan 29, 2015 11:52 am
Forum: OpenGLES
Topic: Python with OpenGLES
Replies: 15
Views: 7467

Re: Python with OpenGLES

My problem is the lack of information about OpenGLES with Python, I need some guides to teach me this, I have already used PyOpenGL but only with deprecated functions. Are you saying this http://pyopengl.sourceforge.net/context/tutorials/index.html is not any good? I have been thinking of learning ...
by -rst-
Wed Jan 28, 2015 5:08 pm
Forum: Python
Topic: Help using dbuscontrol.sh to control omxplayer
Replies: 32
Views: 8200

Re: Help using dbuscontrol.sh to control omxplayer

I am afraid Ken did miss the point of the Popen and subprocess.call calls being completely separate: start player 1 (Popen) command player 1 to play (subprocess.call) wait command player 1 to stop (subprocess.call) start player 2 (Popen) command player 2 to play (subprocess.call) wait command player...
by -rst-
Wed Jan 28, 2015 4:30 pm
Forum: Python
Topic: python code with ping ultrasonic distance sensor
Replies: 1
Views: 1686

Re: python code with ping ultrasonic distance sensor

Does that code work (give close enough proper measurements)?

If so, you should look at creating a function out of it, return the measurement instead of just printing it and call the function from a loop in a main program ( https://docs.python.org/2/tutorial/cont ... -functions )...
by -rst-
Wed Jan 28, 2015 4:24 pm
Forum: Python
Topic: IOError: Errno 2
Replies: 1
Views: 2326

Re: IOError: Errno 2

As far as I understand the SPI dev module tries to open a file - most likely with parameters (0,0) the file would be /dev/spidev0.0 - and the error looks like there is no such file. Can you see the SPI device? Running in a console: ls -al /dev/spi* Did you do all the steps from http://www.raspberryp...
by -rst-
Wed Jan 28, 2015 3:48 pm
Forum: Python
Topic: RSS feed with python and JS
Replies: 2
Views: 679

Re: RSS feed with python and JS

Not quite sure if you want to read feeds from others or create your own feed outwards? Both are definitely possible - there are tweet.bot dinosaurs and what not just a google search away http://www.raspberrypi.org/boris-the-twitter-dino-bot/
by -rst-
Wed Jan 28, 2015 3:40 pm
Forum: Python
Topic: How to play mp4 file and display text
Replies: 1
Views: 515

Re: How to play mp4 file and display text

Maybe take a look at PyGame http://www.pygame.org/docs/ref/movie.html
by -rst-
Wed Jan 28, 2015 3:22 pm
Forum: Python
Topic: GPIO input setting lost after calling function
Replies: 2
Views: 1039

Re: GPIO input setting lost after calling function

jeffboyce wrote:That should be noted somewhere in a good reference for others to find.
Might be worth logging a documentation issue here https://github.com/waveform80/picamera/issues
by -rst-
Wed Jan 28, 2015 2:18 pm
Forum: Python
Topic: keyboard type
Replies: 4
Views: 818

Re: keyboard type

I wonder if it is this Tcl/Tk (which apparently IDLE uses as the UI toolkit) issue with internationalisation still there http://equi4.com/pub/am/starkit/2005-Ja ... 02279.html - a bit more recent find http://bugs.python.org/issue3493
by -rst-
Wed Jan 28, 2015 12:51 pm
Forum: Python
Topic: Upgrading Python
Replies: 4
Views: 920

Re: Upgrading Python

Difference between Python 3.2 and 3.4 should not be so big the instructions would not work using 3.2 too. In fact http://www.raspberrypi.org/forums/viewt ... 48#p229682
by -rst-
Wed Jan 28, 2015 11:45 am
Forum: Bare metal, Assembly language
Topic: Framebuffer issue with start.elf version
Replies: 3
Views: 993

Re: Framebuffer issue with start.elf version

I wonder if some of this work has caused your issue: https://github.com/raspberrypi/linux/issues/679 Something has definitely changed as I ran into issues with my Linux framebuffer code using KDSETMODE and FBIOPUT_VSCREENINFO http://www.raspberrypi.org/forums/viewtopic.php?f=67&t=19073&p=678878#p678...
by -rst-
Wed Jan 28, 2015 11:32 am
Forum: Graphics programming
Topic: Display current system time with milisecond resolution
Replies: 3
Views: 2347

Re: Display current system time with milisecond resolution

I assume you want to update the screen so often that it is going to cause high CPU usage which ever way you implement it.

If you want to avoid X, you might want to look at the hw accelerated stuff like one of the 'hello world' examples in Raspbian at /opt/vc/src/hello_pi/hello_font
by -rst-
Wed Jan 28, 2015 11:23 am
Forum: Other programming languages
Topic: Gambas on Raspberrypi
Replies: 2
Views: 1215

Re: Gambas on Raspberrypi

Maybe the people following the GAMBAS thread under 'Programming/Other languages' http://www.raspberrypi.org/forums/viewt ... =34&t=6182 could help?
by -rst-
Wed Jan 28, 2015 11:20 am
Forum: Graphics programming
Topic: processing alpha channel at descent framerate
Replies: 1
Views: 1319

Re: processing alpha channel at descent framerate

This sounds like something to do with using OpenMAX - there is a separate sub-forum http://www.raspberrypi.org/forums/viewforum.php?f=70 where you may find better educated audience.
by -rst-
Tue Jan 27, 2015 2:21 pm
Forum: Graphics programming
Topic: Is the FBIO_WAITFORVSYNC ioctl implemented in Rpi's fb? [OBSOLETE info]
Replies: 56
Views: 30301

Re: Is the FBIO_WAITFORVSYNC ioctl implemented in Rpi's fb?

After booting, "fbset -depth 8" (or a similar command) must be run, otherwise fbtestXIII displays a blank screen. Finally managed to find the cause for the blanking after boot: the changes in the framebuffer driver seem to require the calls to KDSETMODE to be inside the FBIOPUT_VSCREENINFO calls......

Go to advanced search