Den 2016-01-07 kl. 10:11, skrev Stefano Miccoli:
On 06 Jan 2016, at 12:32, Henrik Östman <tryc...@gmail.com> wrote:


And that's it. Just one thread to not confuse the bus and the good thing is that I no 
longer experience the "found 0 devices"-problem I had before when running 
multiple thread and doing a bus scan. Probably the threads was lock too long in Owserver 
so somekind of timeout was reached as you suggested.
While writing my python owserver client I encountered a similar problem, see 
https://github.com/miccoli/pyownet/pull/1

A not well documented feature of owserver is that it sends keep-alive packets 
to the client when an operation takes longer than a given amount of time. The 
client has to discard these packets and keep waiting. (This is a common 
pitfall, see http://sourceforge.net/p/owfs/mailman/message/34211145/ )

Thanks that's good to know. However the developers of jowfsclient have already implemented that as far as I can see:

public String read(String path) throws IOException, OwfsException {
        ResponsePacket response;
RequestPacket request = new RequestPacket(Enums.OwMessageType.READ, OWNET_DEFAULT_DATALEN, config.getFlags(), path);
        sendRequest(request);
        do {
            response = readPacket();
            // Ignore PING messages (i.e. messages with payload length -1)
        } while (response.getHeader().getPayloadLength() == -1);

        disconnectIfConfigured();
        return response.getPayload();
    }

However I still having problem getting the simultaneous reading of temperature 
devices to work. I disconnected my whole 1-wire network from the Abiowire-card 
and solder on two DS18S20 on a short 10 cm cable, with 5v power, and connected 
it to the card. Just to rule out long cables and faulty soldering from the 
equation. I run my above program and recorded the times between each of these 
steps:

2016-01-05 21:30:33,973 [owfsAdapter-mainloop-1410803762] DEBUG 
se.liquidbytes.jel.owfs.OwfsAdapter - Mainloop execution statistics: command 
0ms, simultaneous 147ms, fastdevices 0ms, temperaturedevices 1280ms, 
voltagedevices 0ms, busscan 0ms.

Many of the above steps reported 0 ms since there was no queued command, no 
other devices was present except temperaure-sensors, and no bus scan occured. 
Writing to /simultaneous/temperature took 147 ms, reading from the sensors took 
1230 ms.

If I got it right, when owserver returns from the write to 
/simultaneous/temperature, fresh temp values can be read from the cache. If you 
read from /uncached, you trigger a fresh conversion.

- write to /simultaneous/temperature
- immediately read temperatures from the cache (and not from /uncached)

S.M.

Yes I found out that too. Reading from /uncached always seems to trigger a single conversion. Reading the cached one was the way to go, however it's a bit "dangerous" since if I forget to write to simultaneous or that code for some reason does not work I will get an old(15 secs) cached reading. For my purpose it is better if the fallback was to /uncached.


------------------------------------------------------------------------------
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to