I've been digging a bit further. Issuing a 'owwrite /bus.0/interface/settings/reconnect 1' when the bus has hanged itself, will issue the required config commands upon the next transaction (such as dir). So, how to do that automatically?
The reconnection flag is only set if a reset fails. I propose that we set reconnect_state to reconnect_error if these occurs. Just doing +=1 wont work, since reset on next try would clear it. Would there be any scenarios that I'm unaware of where this would cause issues? Example patch, tested and works for this particular scenario: --- a/module/owlib/src/c/ow_bus_data.c +++ b/module/owlib/src/c/ow_bus_data.c @@ -24,32 +24,34 @@ static GOOD_OR_BAD BUS_sendback_data_bitbang(const BYTE * data, BYTE * resp, con GOOD_OR_BAD BUS_send_data(const BYTE * data, const size_t len, const struct parsedname *pn) { BYTE resp[len]; if (len == 0) { return gbGOOD; } if ( BAD( BUS_sendback_data(data, resp, len, pn) ) ) { STAT_ADD1_BUS(e_bus_errors, pn->selected_connection); return gbBAD ; } if ( memcmp(data, resp, len) != 0 ) { LEVEL_DEBUG("Response doesn't match data sent"); STAT_ADD1_BUS(e_bus_errors, pn->selected_connection); + pn->selected_connection->reconnect_state = reconnect_error; // Flag for forced reconnection + LEVEL_DEBUG("Bad response error. Reconnection %d/%d",pn->selected_connection->reconnect_state, reconnect_error); return gbBAD ; } return gbGOOD; } Regards Johan On 03/07/15 18:40, Johan Ström wrote: > Hi, > > every now and then I've noticed how my DS2480B-based adapter on my lab > network seems to stop responding. Restarting OWFS has always solved the > issue for the moment. > TLDR: Shouldn't DS2480_big_configuration be called on comm failure? > > Longer version: > --- > The reset & Presence command works fine, but when it tries to send data > to the network it fails: > > DEBUG: ow_select.c:(70) Selecting a path (and device) path=/uncached > SN=00 00 00 00 00 00 00 00 last path=00 00 00 00 00 00 00 00 > DEBUG: ow_select.c:(84) Continuing root branch > TRAFFIC OUT <write> bus=0 (/dev/cua-labdesk) > --000: E3 C5 > TRAFFIC IN <NETREAD> bus=0 (/dev/cua-labdesk) > --000: E5 > TRAFFIC OUT <write> bus=0 (/dev/cua-labdesk) > --000: E1 F0 > TRAFFIC IN <NETREAD> bus=0 (/dev/cua-labdesk) > --000: E5 > DEBUG: ow_tcp_read.c:(113) read: 1 - 0 = 1 > DEBUG: ow_bus_data.c:(38) Response doesn't match data sent > > > After some digging I've realized that it for some reason looses its > configuration. Exiting OWFS and manually reading out the config > registers gives me: > > Written => Received > E3 => (nothing) ( go data mode) > C5 => CD (device present) > 03 => 00 (read PDSRC; 15V/μs) > 05 => 08 ( read PPD, 512μs) > 07 => 08 ( read SPUD; 524mS) > 09 => 00 ( read W1LT, 8μs) > 0B => 00 (Read DSO/W0RT: 3μs) > 0F => 00 (read RBR, 9.6kbps) > 0D => 08 (read LOAD?, 3.0mA) > > This is identical to the power-up configuration, and apparently does not > work on my lab network. Most likely due to the 3μs DSO, which OWFS > configures to 8μs on startup. Since my lab net is currently loaded with > ~300m of cable to the farthest slave, this is probably just too little > delay. > > The actual config-param-reset can be reproduced by just removing the > power from the device. Why it actually reset I don't really know, if it > is due to bad power, or something else.. > --- > > The issue I'd like to address here is that OWFS does not seem to call > DS2480_big_configuration to try to re-initialize the device, when it has > repeatedly failed to communicate using it. > Where would this fit in? > > Regards > Johan > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Owfs-developers mailing list > Owfs-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/owfs-developers ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers