Using ESP Wroom32E . I am not finding a library which works for me , i already have a connection made ESP with max485 to TTL converter. I want to use Q-modmaster software tool for application and as master for my application...
Can anyone share me a test library which works directly after flashing. (For switching coils from Qmodmaster to my 8 channel Relay controller.)
I'm afraid there are no such libraries. Any library is just a collection of methods added to your code. For them to work, you must write the main code.
You will get faster and better help if you describe your problem in detail and post your code as requested by the forum guidelines. Read the forum guidelines to see how to properly ask a question and some good information on making a good post.
I did not found the definition of slave address of the device and any functions related to reading / writing into a coil gpio in the library you provided . My requirement is the coils should be switched ON/Off if i write 0/1 in selected Slave ID and the start address or a particular register address.
bus tools asks for these details from device as shown in picture and then responds accordingly.....
W
You can test a software if you have matching this application with ESP wroom32E, this tool is opensource and extremely easy to use.
It doesn't involve any slave ID in your library, and i am not sure how it should be written so that my Software tool can read the parameters like ---slave ID, register address, and ON/OFF on my coils by writing 0/1 on registers. And after reading it should give the original current state of coil.
Well, the documentation is poor, only one simplistic example, but the library have everything you need. I'm using PlatformIO IDE with intellisense autocomplete that helps a lot and you can find all the methods of the library.
For example you need only this in void setup();
modbus.configureCoils(bool coils[], uint16_t numCoils);
modbus.begin(uint8_t id, unsigned long baud);
When I coded my project, I tried it with Qmodmaster too and yes it works. I said in my first post, the library works.
I have modbus device whit this library working for 6 months without any problems.
Ok, so you think that arduino libraries work only with Arduino IDE ??
No clairvoyant members here, so without the code, no help. Did you know that?
When you want to repair your car, you don't have to get it to the service?
Ok, I'll try it later when I have time. In the meantime, Please read the forum rules, in what form you have to post the code etc.
I hope it's a language barrier, when you say "I request your feedback", it sounds like you're my boss and I have to do it, like it or not...
took some care in deciding coil pins..
not all pins are outputs and some are straps that should be avoided..
think i got it right, unless you're using a port expander..
you do realize the esp32 is 3.3 v, not sure how you be driving the coils??
then there's your 485 adapter, not sure what that is either, hoping it's 3.3v??
the code is only half, hook ups and components all have to be correct too..
Ok, there are several things that need to be cleared.
I am using this software : https://qmodbus.sourceforge.net/
It is very similar to yours and I've used it in the past to test my ESP slave devices.
I have edited the code posted above.
For a start, in this version of code all coils are set as outputs, and it works, I can turn ON/OFF desired coils.
The code was missing setting coil pins as OUTPUT and you must use Serial2.begin(38400);
without this, code compiles, but won't work.
So this is the working and tested example: