Go to advanced search

by slmaws
Wed Mar 18, 2015 8:57 pm
Forum: Python
Topic: python -m SimpleHTTPServer
Replies: 9
Views: 6349

Re: python -m SimpleHTTPServer

Sorry for a late replay. I'm a little sick. Twisted is a big python framework created to asynchronously serve dynamic content. You can use it to build HTTP server, IRC bot or to create web app which for example uses websockets. It's designed to serve hundreds of thousand requests simultaneously. Usi...
by slmaws
Wed Mar 18, 2015 8:18 am
Forum: Python
Topic: python -m SimpleHTTPServer
Replies: 9
Views: 6349

Re: python -m SimpleHTTPServer

You can try to use twisted. Install it via:

Code: Select all

sudo apt-get install python-twisted
or via

Code: Select all

sudo pip install twisted
and run via:

Code: Select all

twistd -n web -p 8000 --path .
You can change port and path to the dir. It's much more than 200 lines. You can not write stable and reliable HTTP Server in 200 lines of code :)
by slmaws
Wed Mar 18, 2015 12:38 am
Forum: Python
Topic: python -m SimpleHTTPServer
Replies: 9
Views: 6349

Re: python -m SimpleHTTPServer

SimpleHTTPServer is designed to serve static files, nothing more. The question is why do you need pure python HTTP server and how do you want to use it? I don't know any production ready python HTTP servers, actually I don't know any Python HTTP server. In python world to serve dynamic content WSGI ...
by slmaws
Tue Mar 17, 2015 12:52 am
Forum: Troubleshooting
Topic: Python GPIO does not work on Raspberry Pi 2
Replies: 30
Views: 23072

Re: Python GPIO does not work on Raspberry Pi 2

Does it change to output mode? You can check it with

Code: Select all

gpio readall
by slmaws
Mon Mar 09, 2015 8:41 pm
Forum: Beginners
Topic: Best methods to control Pi Robot
Replies: 5
Views: 845

Re: Best methods to control Pi Robot

No tutorials yet :( But I have some code: https://github.com/lukaszo/picar_worhshop It's just proof of concept and a lot of work is required but it works.

It doesn't work on Pi2. I will be rewriting it to use pigpio soon.
by slmaws
Mon Mar 09, 2015 3:53 pm
Forum: Beginners
Topic: Best methods to control Pi Robot
Replies: 5
Views: 845

Re: Best methods to control Pi Robot

All methods mentioned by you will work. Personally I used python on Pi, Javascript and websockets for communication.
by slmaws
Thu Mar 05, 2015 5:38 pm
Forum: Off topic discussion
Topic: Pi Projects - Sketchbook Friday (2nd Update)
Replies: 6
Views: 1409

Re: Pi Projects - Sketchbook Friday

Looks very interesting. Can you post bigger images? I can't see too much :(
by slmaws
Wed Mar 04, 2015 6:25 pm
Forum: Python
Topic: Showing an image with gpio
Replies: 23
Views: 6253

Re: Showing an image with gpio

Don't use time.sleep as some of the guys suggest, you may miss some clicks. Use wait_for_edge function: #!/usr/bin/env python import RPi.GPIO as GPIO from PIL import Image im=Image.open("/home/pi/Rock.png").convert("RGB") buttonPin = 25 GPIO.setmode(GPIO.BCM) GPIO.setup(buttonPin,GPIO.IN) while True...
by slmaws
Wed Mar 04, 2015 6:16 pm
Forum: Beginners
Topic: bash: cvlc: command not found
Replies: 5
Views: 15032

Re: bash: cvlc: command not found

You shouldn't have any errors. Did you run sudo apt-get update first? Please past the errors from you command.
by slmaws
Fri Feb 27, 2015 4:56 pm
Forum: General discussion
Topic: Is a quad core really 4 times faster than a single core?
Replies: 22
Views: 5645

Re: Is a quad core really 4 times faster than a single core?

I made some Python implementation tests (for CPython and PyPy) and it looks like, by just switching to Pi2 your Python code on ONE core can be from 2x to 3.5x faster. And you still have 3 more cores to use :) Here is a link to my benchmarks http://rpitips.com/python-and-pypy-on-raspberry-pi-1-nad-2-...
by slmaws
Thu Feb 26, 2015 10:44 pm
Forum: General discussion
Topic: Pi 2 GPIO numbering scheme
Replies: 18
Views: 14544

Re: Pi 2 GPIO numbering scheme

DougieLawson wrote:The interactive option: http://pi.gadgetoid.com/pinout which is what I use all the time.

I'll usually use BOARD numbers as they're countable when I'm staring at my RPis.
It's a discovery of the week for me :) Very useful site
by slmaws
Wed Feb 25, 2015 4:34 pm
Forum: Troubleshooting
Topic: Can't get Python RPi.GPIO to work on Pi 2
Replies: 11
Views: 4881

Re: Can't get Python RPi.GPIO to work on Pi 2

Don't think this is correct... In the topic you link to the user used different numbering schemes for wiringpi and python. Here the OP uses the same schemes: 'gpio -g' and 'GPIO.setmode(GPIO.BCM)' both refer to BCM numbering scheme. Yeah, you are right. I didn't notice that he uses the same scheme....
by slmaws
Wed Feb 25, 2015 8:54 am
Forum: Troubleshooting
Topic: Can't get Python RPi.GPIO to work on Pi 2
Replies: 11
Views: 4881

Re: Can't get Python RPi.GPIO to work on Pi 2

See this thread: http://www.raspberrypi.org/forums/viewt ... 8&t=101464

You have two solutions. Choose ONE:
- In RPi.GPIO change pin to 11
- instead of 'BCM', use 'BOARD':

Code: Select all

GPIO.setmode(GPIO.BOARD)
by slmaws
Tue Feb 24, 2015 6:40 pm
Forum: Troubleshooting
Topic: Quake 3 on the Pi 2: SimonJHall and Kernel Panic
Replies: 12
Views: 2496

Re: Quake 3 on the Pi 2: SimonJHall and Kernel Panic

If you have facebook see my video here https://www.facebook.com/groups/malinow ... 127629977/

FPS 40-100
40 during a shooting
by slmaws
Sun Feb 22, 2015 10:47 pm
Forum: General discussion
Topic: Motor control : which accessories for the Raspberry PI
Replies: 7
Views: 1405

Re: Motor control : which accessories for the Raspberry PI

@letmecraft I assumed that you know the current and you asked for viable options. You actually should measure it first.
by slmaws
Sun Feb 22, 2015 10:11 pm
Forum: General discussion
Topic: Motor control : which accessories for the Raspberry PI
Replies: 7
Views: 1405

Re: Motor control : which accessories for the Raspberry PI

Gertboard is overkill for such a project. L293D is good enough for your motor. Motor is also good enough to do your task. You can control speed with PWM.
by slmaws
Sat Feb 21, 2015 10:38 pm
Forum: Automation, sensing and robotics
Topic: Wirelessly Control Servos
Replies: 14
Views: 3991

Re: Wirelessly Control Servos

What kind of chip is it? What protocol does it use?
by slmaws
Sat Feb 21, 2015 9:15 pm
Forum: Automation, sensing and robotics
Topic: Wirelessly Control Servos
Replies: 14
Views: 3991

Re: Wirelessly Control Servos

So you want from RPi remotly send signals to servos? You still need something to control the servos. It may be another RPi or Arduino or just simple Atmega processor. Then you can choose various protocols for communication like Infra Red, Bluetooth, wi-fi or radio waves.
by slmaws
Fri Feb 20, 2015 5:17 pm
Forum: Troubleshooting
Topic: Quake 3 on the Pi 2: SimonJHall and Kernel Panic
Replies: 12
Views: 2496

Re: Quake 3 on the Pi 2: SimonJHall and Kernel Panic

I used this tutorial http://www.raspberrypi.org/forums/viewt ... 78&t=18853 on new Pi 2 weeks ago and it worked very well.
by slmaws
Fri Feb 20, 2015 5:13 pm
Forum: Networking and servers
Topic: Web Server running only on Solar Power
Replies: 50
Views: 24769

Re: Web Server running only on Solar Power

It's really amazing project. Can you post a link to the relay timer which are you using?
by slmaws
Thu Feb 19, 2015 9:58 pm
Forum: General discussion
Topic: Building 24 Raspberry Pi2 Cluster
Replies: 29
Views: 17589

Re: Building 24 Raspberry Pi2 Cluster

Heater wrote: Drive 96 USB ports. Or collect images from 24 cameras. Or drive a 24 screen video wall. Or heck, provide 24 UARTs.
You don't need to create "cluster" to do it. Actually I also have plans to build cluster but just for fun :)
by slmaws
Thu Feb 19, 2015 6:14 pm
Forum: General discussion
Topic: best practice for automatic updates?
Replies: 5
Views: 2433

Re: best practice for automatic updates?

There is one problem here. If there is a security problem usually you need to restart some services. Like with "shellshock" you need to restart all ssh sessions and with "heartbleed" you need to at least restart apache/nginx.
by slmaws
Wed Feb 18, 2015 10:04 am
Forum: Beginners
Topic: Pi basics.
Replies: 8
Views: 1102

Re: Pi basics.

Moderator, I followed the URL at point 3. But could not find any reference to the Order Code or CPU register definitions. Is that because I should be looking on the ARM Web Site for documentation relating to the CPU that is used by the Raspberry Pi product? ...and if so, is there any particular inf...
by slmaws
Wed Feb 18, 2015 9:50 am
Forum: General discussion
Topic: Building 24 Raspberry Pi2 Cluster
Replies: 29
Views: 17589

Re: Building 24 Raspberry Pi Cluster

A cluster of Pi's does not give you a big powerful computer, it gives you a network of small computers, and its up to you to give each of them a workload. It was true for old Pi, on Pi2 you have 4 cores and each core is about 3x faster than old CPU. 24 new Raspberry Pis still will be slower than my...
by slmaws
Mon Feb 09, 2015 10:43 pm
Forum: General discussion
Topic: Pi2 (de)compression speed improvement
Replies: 4
Views: 1390

Re: Pi2 (de)compression speed improvement

AndyD wrote:Thanks for the tip. I wonder if there is a parallel implementation of bzip2.
Sure it is http://compression.ca/pbzip2/ It uses 100% of all cores during compression and decompression. On RPi2 compression is 3 times faster than standard bzip and decompression almost 4 times faster.

Go to advanced search