Code Monkey home page Code Monkey logo

Comments (4)

hrford avatar hrford commented on July 3, 2024

I have a RPi 1B (From 2012) which I could coax out of retirement?

from epevermodbus.

na7q avatar na7q commented on July 3, 2024

Retrying is an absolute MUST. I on some occasions would get failures, for whatever reason with my very simple setups. On Pi's or other mini computers.
My more advanced setups, multiple devices are accessing the server via SSH to the server device that is connected to the controller. Retrying allows it work without issue. Never once had a problem since switching to this code that retries.

from epevermodbus.

hrford avatar hrford commented on July 3, 2024

I feel that unbounded retries can cover up underlying issues.

In python, errors should be handled by exception and retry carried out only if necessary, not by default.

If the resource (device) is contended, of course retries would appear to make the problem "go away", but why is the resource contended in the first place?

In the example given by @na7q , they talk about multiple clients SSHing onto a host and (I assume) then trying to run the same code to access the device creating contention.

Using retries in this situation could lead to undeterministic results due to the ordering of commands so I feel should be avoided.

In this case, I think the actual fix is to write an aggregator and queue the commands avoiding retries entirely.

from epevermodbus.

na7q avatar na7q commented on July 3, 2024

Part of my issue is running different software to pull data from the controller for different tasks. Since they are done at different intervals which eventually cross paths timewise, a simple retry like in this code was the perfect method. Before finding this repo, I consistently had missing data here and there. Even when I tried running my code manually. Using an exception and retry was more complicated and only presented more issues because some of us aren't fluid in python.
This repo resolved everything by 100% thanks to the reasonable usage of retries.

With the software I use (ham radio related) there is no reasonable or easy way to que anything to avoid the timing problems. Not everyone has the know how to extensively modify code either. I certainly don't. I make things work, not always pretty. I'm thankful for this code and the retries. It's well written and easy to modify to my needs anyway. I hope it stays the way it is.

from epevermodbus.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.