Code Monkey home page Code Monkey logo

Comments (4)

sandeepmistry avatar sandeepmistry commented on June 15, 2024

Hi @Nickyy-b,

Could you please provide more insight on how things are wired/connected?

I also believe since the Pro Mini only has a single Serial instance, any sketches should avoid Serial.println(...) statements and let the Modbus library have full control of the Serial port.

from arduinomodbus.

Nickyy-b avatar Nickyy-b commented on June 15, 2024

Thanks for replying, sorry for the delay in returning.
I connected the client (Mega) and the server (Pro mini) directly Rx to Rx and Tx to Tx, that programming I attached is from mega, and the Serial window is the answer from Pro mini (server) returns to mega. The programming of the server is modified only with a char that makes a led flash, just this, I'm not using serial.print, strangely only this function of reading a single coil is returning me -1, the others read / change multiple registers / Coils work normally, I can change to read less than 10, 3 for example, but ModbusRTUClient.coilread returns me -1, can you help me?

from arduinomodbus.

sandeepmistry avatar sandeepmistry commented on June 15, 2024

@Nickyy-b please share the exact sketches you are using. Are you able to also use a logic analyzer to trace what is being sent and received on the wire?

from arduinomodbus.

Nickyy-b avatar Nickyy-b commented on June 15, 2024

The codes !!
Edited.zip

What didn't catch was the function in "if serial == d", this function returns me -1. Do you think I can replace it with the requestFrom function or RTU.beginTransmission, without any problem?

from arduinomodbus.

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.