How to read data through RS485/Modbus

Hi,

In my project I am getting DHT11 sensor data in Display as well as in Wifi ( used NODEMCU ESP8266),
I want the same data through RS485/Modbus.
can any one help me how to write the code for the same?

can any one help me how to write the code for the same?

What hardware are you using (links!)? Do you want to provide the data to other devices or request it from other devices?

used hardware is TTL to RS485 module.
I wand to read data in laptop through modscan software.
want to provide the data to other devices

used hardware is TTL to RS485 module.

That's not a link to the product. TTL usually means 5V logic. Do you use a level converter to fix that?

So you want to provide the DHT11 data to other devices connected to the same RS485 bus? In that case you need a slave software. Do you have any restriction on the register addresses or anything like that?

You need to know the modbus frame and I suggest to research it well since its not easy and send your data serially in this manner

ID (same as the master request)
Number of bytes ( 2 for each analog reading?
your data
CRC calculation ( you need the calculation code which I forgot how to do it corret)

Therefore if your ID is 10 and you have one register with 255 value (value always 2 bytes) our frame will look something like this

0A 02 00 FF crc crc

Don’t have any restriction on the register addresses .

venusbp1:
Don't have any restriction on the register addresses .

This is the library I based my development on. It should work as a slave.

I still wait for the hardware links.