Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with I2C communication #75

Open
akshulg opened this issue Mar 1, 2021 · 9 comments
Open

Not working with I2C communication #75

akshulg opened this issue Mar 1, 2021 · 9 comments

Comments

@akshulg
Copy link

akshulg commented Mar 1, 2021

I had successfully implemented this library with Arduino as an I2c slave. So one arduino modbus slave + I2c slave works. But right now I have interfaced a I2C sensor with arduino, and modbus is not working, not able to scan registry on a modbus master end. Arduino modbus slave + I2C master won't work. I have tried with some flags but still not working. Any ideas on what might be the issue?

@yaacov
Copy link
Owner

yaacov commented Mar 1, 2021

Hi, thank you for the issue.

Both I2C and Modbus are buses that solve the problem of master/slaves communication, so when using the same line you will have two masters, one for I2C and one for Modbus, My guess guess is that they want to talk/recive the same time and interfere.

@akshulg
Copy link
Author

akshulg commented Mar 1, 2021

@yaacov yes that's what I observe, that both are trying to communicate and hence there is conflict. Is there any way to implement both things?

I am trying external interrupt right now. So I have connected the INT1 (pin 3) of arduino to RX of arduino. RX pin is connected to TTL to RS485 converter pin. So when arduino receive the request from a modbus master then interrupt should trigger and sensor (which is on I2C) data should poll. But what I observe is that the RX pin is always on. Any idea on this method?

@yaacov
Copy link
Owner

yaacov commented Mar 1, 2021

Is there any way to implement both things?

I don't think so, even if you can shut down one server, it's clients will continue to interfere with the other bus communication

@akshulg
Copy link
Author

akshulg commented Mar 1, 2021

@yaacov Do you have any other idea that I can try and implement?

@falahati
Copy link
Contributor

falahati commented Mar 1, 2021

use a virtual serial library for the Modbus's line if you can afford one set of additional wires. (e.g. AltSoftSerial)

@akshulg
Copy link
Author

akshulg commented Mar 1, 2021

I am already using AltSoftSerial for debugging and programming purpose. Programming of slave id, baud rate and other parameters. But can interchange Serial and AtlSoftSerial purpose. Will try that.

@akshulg
Copy link
Author

akshulg commented Mar 2, 2021

@falahati It's not working with AltSoftSerial as well. I am stuck now with no ideas!

@Apulanta
Copy link

Apulanta commented Mar 2, 2021 via email

@akshulg
Copy link
Author

akshulg commented Mar 3, 2021

@Apulanta That's the same configuration I am using with Arduino UNO. But it's not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants