Good pickup, Nicolas. Your detailed analysis made the problem obvious!
That "anydevices_no" is set whenever the DS2482 undergoes a 1-wire reset. It
senses if there is a presence pulse.
In this case, the test was made before the reset -- leaving the bus is the
"no device, so no reset needed state.
The presence pulse test is optional in any case -- just adds some efficiency
since the bus doesn't need to be fully "discovered" if there is no device
seen on reset.
In any case, I'll move the test until after the reset, which should solve
the problem.
And, of course, I'll have to look at the other bus masters to make sure the
same error isn't present. Thanks for finding this!
Paul
On Sun, Jul 3, 2011 at 2:22 PM, Nicolas Leonard
<[email protected]>wrote:
> Hello,
>
> I'm using owserver with a DS2482 host adapter (i2c <-> 1wire chip), and
> found an issue which prevent one-wire devices to be discovered.
> I'm using owfs 2.8p10, and the iButton devices are simple DS1990 id
> buttons.
>
> To reproduce it :
> 1. launch the server (owserver --foreground --i2c=/dev/i2c-0:0
> --error-level=9)
> 2. connect a DS1990 iButton
> 3. call 'owget /uncached' => it finds and prints the 01.XXXXXXXXXXXX id
> 4. disconnect the iButton
> 5. call 'owget /uncached' => it doesn't find any device, as expected
> 6. reconnect a DS1990 (same one or other one)
> 7. call 'owget /uncached' => it doesn't find any device, and I have to
> restart the server to make it work again.
>
> If I never call 'owget' when there are no devices connected, and just
> switch from iButton to another, it works. (doing the step above, without 4/
> and 5/)
>
> I've looked to the code and the problem seems to lie in *
> ow_ds2482.c:DS2482_next_both*().
> When owget without any devices is called, it seems to stuck the *
> DS2482_next_both*() in a state where the following code is always executed
>
>> if (pn->selected_connection->AnyDevices == anydevices_no) {
>> ds->LastDevice = 1;
>> }
>
> .. resulting in no device discovery at all.
>
> Just for testing, I just commented this block .. and it works perfectly.
> But I've seen that the way a lot of other master adapters are working so I
> don't think it's the right way to fix it.
>
> Just for information, I've already used owfs a lot, but with an USB
> adapter, which has a built-in identification Chip, so the previous case can
> never happen.
>
> This problem is critical to me, I will really appreciate if someone could
> have a look on it.
> I can also do more testing if anybody wants.
>
> Thanks,
>
> Nicolas
>
>
> --
> Nicolas Léonard
> Oxecom - Gérant
> +33 (0) 6 12 83 65 35
> [email protected]
>
>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers