-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
start() hangs #1
Comments
There are timing issues with starting and then stopping straight away. Of course I never do that in my own usage so I forget. As a work around a time.sleep(1) before the stop() works for me. How are you running the code? From a Linux machine I guess as Windows would give a different error message. Are you running the code on a Pi or on a box on the same network as the Pi? Are you typing the code into a Python interpreter or are you running a script? |
Direct access (ssh) and running on the Pi from the script as: |
You don't need the sudo (you only need to use sudo to start the pigpiod daemon). I can't reproduce the error you get. I get
|
I've added sleep(1), but, as I feared, it changed nothing.
Again the same --> the error is in start() which never finishes (normally). The script:
|
All I can think of is that you are using a version of pigpio prior to that which supports in band socket notifications. Did you make/make install to install the latest pigpio and python module or did you just extract the tar and do a sudo python setup.py install yourself? Do a grep for the pigpio version in /usr/local/include. |
I followd this:
all passed OK. This is the (grep for) version:
|
I have now cloned the GitHub source.
Version:
Same problem (after kbd interrupt):
|
Did you sudo pigpiod after building? |
yes |
I'm stumped. I think you need to give full details of your setup and versions. I've used the module on Windows (Vista, Python 3.3), laptop (Linux 3.11-2-amd64, Python 3.3, Python 2.7.6), Pi 1 (Raspbian Linux 3.10.25, Python 2.7.3, Python 3.2.3) Pi 2 (Debian Linux 3.10.25, Python 2.7.3, Python 3.2.3). ######################################################################### Does pigs br1, pigs br2 return hex numbers (confirms pigpiod is running). Do the pigpio pipes exist? There should be /dev/piopio, /dev/pigout, /dev/pigerr Does cat /dev/pigerr & report any errors? Leave cat /dev/pigerr & running in the background and switch on pigpio debugs by sending a signal to the daemon. sudo killall -USR2 pigpiod Each -USR2 increases the debug level, -USR1 decreases the debug level. Then do python test.py You should see.
|
Same.
When I run the python script, there is no pigerr output until I press Ctrl+C. |
The only thing I can think of is that port 8888 is being used by another process and you are talking to that rather than pigpiod. However in that case I would have expected sudo pigpiod to have thrown up an error about port in use. I just used netstat --listen to find ports being listened to on my local machine. I chose one at random and specified that as PIGPIO_PORT and started Python. I get similar but not identical results (straight away though).
I suggest the following. netstat --listen | grep 8888
I'm afraid this is beyond my experience and am at a bit of a loss as to know how to proceed. Have you got a funny firewall setting? Could you try running the Python from a different networked machine? |
The 8888 port was reserved by RPi-Monitor. Since I wasn't using it, I removed it and pigpio is now working (at least the test.py script doesn't hang and exits as expected, can't test more as I'm not at home now). Strange how the export PIGPIO_PORT did not fix the problem... |
The export was deliberately to a bad port (a port used by a different service) to try to get the same problem as you were seeing. What is RPi-Monitor? If a lot of people use it I might have to search for another port to use by default. pigpio by default uses 8888 but may be started with another port. However anything that uses pigpio must also be started with that port. If you are happy this issue is resolved I will close it. |
RPi-Monitor: http://bit.ly/1cipgEh You can close the case. Thanks. |
You might like to note the "Unofficial" use of port 8888 on, say, here at Wikipedia . It is a good central place that people might look at! 😀 Looking at the code of PiMonitor though - it does use the same default port of 8888 see ./rpimonitor/daemon.conf so - given that neither project has the explicit LANA "ownership" of it - it suggests a few extra words in the feedback to users that there may be something else (and perhaps quote "RPi-Monitor" as a specific case) that may also be trying to use the same Port might be helpful. |
* Create CONTRIBUTING.md * Update CONTRIBUTING.md
Code:
Result (only comes after Ctrl+C):
The text was updated successfully, but these errors were encountered: