Giter VIP home page Giter VIP logo

modbusino's Introduction

GitHub Statistics Top Languages

modbusino's People

Contributors

gregradion avatar karlp avatar oakwhiz avatar stephane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modbusino's Issues

Dip-switch for adress

Bonjour
Bravo pour votre développement Modbus sur Arduino.
Je vais réaliser des vrais modules (entrées sorties tout ou rien) et j'ai besoin de faire une modification.
Je vais remplacer la saisie du numéro d'esclave qui est faite par soft, en utilisant des dip-swith sur la platine (4 dip-switch soit 16 adresses possible).
Ceci restant dans le monde du libre.
Si vous avez un conseil à me donner (je ne suis pas programmeur).
Yves
Ingénieur thermicien et GTC


Hello
Congratulation for your Modbus development Arduino.
I'll make real modules (digital inputs outputs) and I need to make a change.
I will replace the input of the slave number that is made by software, using dip swith on the board (4 dip-switch can be 16 addresses).
This remaining in the free world.
If you have any advice for me (I'm not a programmer).
Yves
HVAC and Building automation engineer

Flush function

Hello,
Since the newer version of Arduino IDE It appears that the Serial.flush method doesn't clear the rx buffer but the TX Buffer:

"Waits for the transmission of outgoing serial data to complete. (Prior to Arduino 1.0, this instead removed any buffered incoming serial data.)"
(Source arduino.cc )

I use the following function with success :
static void flush(void)

{
int i = 0;//Wait 3 Char lenght after last incomming byte
while (i <= _MODBUS_3_C_TIMEOUT) {
if (Serial.available()) {
Serial.read();
i = 0;
}
else {
i++;
}
delayMicroseconds(1);
}
}
thank you.

Multiplexing

Hi there

Just wanted to thank you for a great tool.

I've changed Serial to be an extern to a sub classed Stream object that buffers the data from an XBee API2 request. And your library works just fine. Much appreciated.

Reply from non requested slave

Hello,

I'm trying to use Modbusino in attiny402 project. It consists of several slaves controlled by (for now) a PC master.
Everything works fine when tere is only one slave on the bus and it is addressed. Issue atarts when I try to provide (on purpose) wrong, non-existing slave ID. Then non addressed slave send some weird response.
Sample request: [20][03][00][00][00][0A][C3][7C].
Sample (wrong) answer from slave: [21][80][01][81][CA][21][8A][01][87][6A] (sometimes only one or two bytes as response).
Clearly visible that request was sent to ID 0x20 and response comes from ID 0x21 (an error to function 00...).

I saw previous issue #7 - I already use patched version.

Arduino 1.8.19, target IC attiny402/804.
RS485 biased and terminators at both ends.

BTW, I already changed to _MODBUSINO_RTU_MAX_ADU_LENGTH 30 as tiny402 has 256B (I only need 10 registers) of RAM and declared req[_MODBUSINO_RTU_MAX_ADU_LENGTH] as static, otherwise I had memory leaks and some random data sent.

What can be an issue? May it be a memory leakage somewhere else due to really small RAM resources?

Regards

Connection timed out problem

I use libmodbus for linux and modbusino for my mcu. I realize that mcu does not respond to libmodbus request. As a consequences, libmodbus throw "Connection timed out". How can I solve it. Could you help me? My connection is checked and true. Both circuit common grounded.

Coils?

Just wondered if you had a version of the code that wrote and read coils/bits?

Thanks

Constructor error

I found a logical AND error in the constructor of the Modbusino.cpp file and caused a compilation warning.

ModbusinoSlave::ModbusinoSlave(uint8_t slave)
{
    if (slave >= 0 && slave <= 247) {
        _slave = slave;
    }
}

Modbusino with more than one slave error

If you have a network with more than one slave there will be wrong responses (exception responses that shouldn't be done).
Supose that master makes a query to slave 1, then slave 2 sees the answer and sends "something", that I suppose is "response_exception".
The same applies to other slaves... more slaves more mess...

Basic solution: eliminate or comment the answer "response_exception" in Modbusino.cpp, line 191 and line 214.
Better solution: Make a better analyse of the frame to see it's not a answer from other slave...
Hope this will be corrected because it's an nice modbus library for Arduino.

_MODBUSINO_RTU_MAX_ADU_LENGTH is wrong

I started using rather larger modbus tables, and starting hitting all sorts of buffer overflows :( (I have a very old fork, that was missing some of the earlier fixes for this)

But immediately, the define for RTU_MAX_ADU is just wrong. Setting this to 256 properly, as per page 5 of modbus app proto 1.1b3 results in requests for more than 64 registers succeeding, but requesting 128 registers for instance, passes validation but overflows. I know this is the "very very very cut down" version, so I'm not hanging out for a heap of fixes, just letting you know.

How do you use this LIB?

I see no other way to post, so post issue.

This looks like it might be something I would like to use, however the documentation, what this is of it, does not explain how this LIB works with the Arduino. Can you provide a near real world example?

For example, does this LIB only handle the comms between master and slave or will it read and write arduino inputs and output? If so what function are mapped to what I/Os?

-Ryan

modbusino ignores slaveid

It responds to everything for normal cases, and only checks for slaveid when it is considering whether to respond to an exception.

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.