Git Product home page Git Product logo

Comments (7)

AlexDavies501 avatar AlexDavies501 commented on July 19, 2024 1

Many thanks for the quick turn around.

Will try to test a fix next week.

The actual system in question is several thousand miles away...
thankfully ssh makes that not too much of a problem!

from mbusd.

AlexDavies501 avatar AlexDavies501 commented on July 19, 2024 1

Apologies for the late response - the well the device was on was shut for a several weeks. System turned off.

We've been using the fix on some other sites and have not seen the original error messages there.

So i would vote to close the issue. Many thanks for the fast response and fix!

from mbusd.

AlexDavies501 avatar AlexDavies501 commented on July 19, 2024

One more datapoint...

We have also seen those errors with errno set to EFAULT eg.

mbusd[25373]: 30 Oct 2021 13:30:40 tty: error in read() (Bad address)
mbusd[25373]: 30 Oct 2021 17:38:18 tty: error in read() (Bad address)

from mbusd.

3cky avatar 3cky commented on July 19, 2024

@AlexDavies501 thanks for the report! Could you provide some additional info about the software and hardware environment you're running? Kernel version, platform, etc.

from mbusd.

AlexDavies501 avatar AlexDavies501 commented on July 19, 2024

Hi.

Edited uname -a output (removed the computer name) below:

Linux datahub 4.1.15-g33f8ed0f5cb3 #4 SMP PREEMPT Tue May 1 13:54:29 MST 2018 armv7l GNU/Linux

The hardware is a Technologics 7970 embedded computer. Has two serial ports. We run mbusd against one of these.

/usr/local/bin/mbusd -d -v2 -L - -c /usr/local/etc/mbusd/mbusd-ttyS1.conf -p /dev/ttyS1

The config file now looks like:

# Serial port device name
device = /dev/ttyS1

# Serial port speed
speed = 9600

# Serial port mode
mode = 8n1

# RS-485 data direction control type (addc, rts, sysfs_0, sysfs_1)
trx_control = addc

# Sysfs file to use to control data direction
# trx_sysfile =

############# TCP port settings #############

# TCP server address to bind
address = 0.0.0.0

# TCP server port number
port = 12502

# Maximum number of simultaneous TCP connections
maxconn = 32

# Connection timeout value in seconds
timeout = 60

######### Request/response settings #########

# Maximum number of request retries
retries = 0

# Pause between requests in milliseconds
pause = 100

# Response wait time in milliseconds
wait = 500

With the above config i see a dozen tty: error in read() (Resource temporarily unavailable) errors for today, and 3 or 4 for each of the previous 4 days.

Originally, when we saw a lot more of these errors (several hundred per day), the config had retries=3 and wait=1000.

There are 3 regular callers that create Modbus master connections to the TCP side of mbusd. These tend to do a poll of a handful of registers every 5 seconds. Also some occasional scripts manually called from the cmdline that make connections too.

There are two slave devices on the 485 network: a gateway device and a pressure transmitter.

from mbusd.

3cky avatar 3cky commented on July 19, 2024

Hi, thanks for the info!

I've pushed some fixes regarding handling EAGAIN read() result. Сould you test mbusd compiled from the latest sources?

from mbusd.

3cky avatar 3cky commented on July 19, 2024

Glad to hear the problem is sorted out! So I'm closing this issue, please feel free to reopen if needed.

from mbusd.

Related Issues (20)

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.