miccoli / pyownet

Pure python client library for accessing OWFS via owserver protocol.
http://pyownet.readthedocs.io/
GNU Lesser General Public License v3.0
10 stars 6 forks source link

ConnError #10

Closed ghost closed 7 years ago

ghost commented 7 years ago

Any ideas why this is all of a sudden happening on a new RPI3B. I had everything running fine a week ago on an older RPI3B

from pyownet import protocol owproxy = protocol.proxy(host="localhost", port=4304) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.4/dist-packages/pyownet/protocol.py", line 727, in proxy raise ConnError(*lasterr) pyownet.protocol.ConnError: [Errno 111] Connection refused

miccoli commented 7 years ago

This error usually means that the owserver process is dead. It is easy to verify if owserver is running:

$ netstat -tl
$ pstree

If there is no owserver process listening, please simply restart it.

ghost commented 7 years ago

I thought it was running purely from the fact that I can see the devices in the directory below. See below.

It also should be noted that I am using i2c interface to the 1wire devices. Perhaps is my problem with the i2c setup? It is hard to find a proper instruction for OWFS i2c setup. There are a few posts on it but they all contradict each other. If you have any other links to help me get this running I would greatly appreciate it.

My terminal session below: /mnt/1wire# ls 28.FF100E2E0400 28.FFDF22161502 alarm bus.1 bus.3 bus.5 bus.7 simultaneous structure uncached 28.FF345F2C0400 28.FFF88B2D0400 bus.0 bus.2 bus.4 bus.6 settings statistics system /mnt/1wire# netstat -t1 bash: netstat: command not found /mnt/1wire# pstree systemd─┬─apache2───5[apache2] ├─dirmngr ├─owfs───2[{owfs}] ├─systemd-journal └─systemd-udevd

agentmnm commented 7 years ago

the devices are displayed in the directory form not by owserver, but by owfs, which uses fuse. This is meant for testing only...

owserver has a uptodate manpage. Another great source for information is the owfs developers mailing list at owfs-developers@lists.sourceforge.net

On 07/01/2017 04:09 AM, ralphfurley wrote:

I thought it was running purely from the fact that I can see the devices in the directory below. See below.

It also should be noted that I am using i2c interface to the 1wire devices. Perhaps is my problem with the i2c setup? It is hard to find a proper instruction for OWFS i2c setup. There are a few posts on it but they all contradict each other. If you have any other links to help me get this running I would greatly appreciate it.

My terminal session below: /mnt/1wire# ls 28.FF100E2E0400 28.FFDF22161502 alarm bus.1 bus.3 bus.5 bus.7 simultaneous structure uncached 28.FF345F2C0400 28.FFF88B2D0400 bus.0 bus.2 bus.4 bus.6 settings statistics system /mnt/1wire# netstat -t1 bash: netstat: command not found /mnt/1wire# pstree systemd─┬─apache2───5[apache2] ├─dirmngr ├─owfs───2[{owfs}] ├─systemd-journal └─systemd-udevd

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/miccoli/pyownet/issues/10#issuecomment-312404361, or mute the thread https://github.com/notifications/unsubscribe-auth/AB4vC0kTXY1LTjGyeSSw4Bd4T_Y7-i9Sks5sJapLgaJpZM4OKqB-.

miccoli commented 7 years ago

I do not think that the problem is related to I2C specifically but to the general OWFS setup. It appears that you have an owfs server running and querying directly the I2C bus, but this is a deprecated setup, which actually prevents running owserver .

The suggested configuration (which is reflected in the default Debian /etc/owfs.conf) has a master owserver that all other OWFS components (owhttpd owfs ...) and clients (like pyownet) should query.

@ralphfurley While I'm very happy to help you here, your issue is not linked to pyownet. Please consider closing this issue and asking for help on the owfs-developers mailing list: https://sourceforge.net/p/owfs/mailman/owfs-developers/ where you will find better advice on owfs configuration, I2C, etc. If you post a question on the list, remember to include a copy of your /etc/owfs.conf file and info on your installation (distro, owserver version, hardware setup.)

Another side note: you can get netstat by installing the net-tools package. If owserver is up and running you should get something like

$ netstat -tl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
... other lines
tcp        0      0 *:4304                  *:*                     LISTEN     
... other lines

( the command is ''netstat dash tee ell'' not ''netstat dash tee one'')

miccoli commented 7 years ago

Closing since this issue, according the information available, is not linked to the pyownet client but to the owserver setup. Compare also to issue #3.