Error code 101 "DHT11 with MODBUS slave"

Hi , i am using Arduino uno with MODBUS slave to read DHT11 sensor , and i receive an error code "101" , can any one tell me what is the meaning of it , and also is it associated to the sensor or the board ?

Thank you in advance ....

Hi , i am using Arduino uno with MODBUS slave to read DHT11 sensor

There are about half a dozen ModBus slave libraries for Arduino and about twice as many DHT libraries. Would you mind to provide links to the libraries you're using?

i receive an error code "101"

That's a very wild guess but is it possible to you're getting this on a server using libmodbus (PC)? In that case it means the request timed out.

Provide much more information about your setup and complete code!

Thank you Mr. Pylon for you reply

please see the attachments for the whole details of this case ;

this is the link of the library i am using :

and here is the link for the code :

i also attached the mentioned items , hope this give the complete picture of the case

thank you in advance

MODBUS.zip (7.54 KB)

sorry for inconvenience , Here is the code file

EMS_MODBUSslave.pdf (18.2 KB)

Please don't post links to Google Drive. If you don't have a link to the original location where you downloaded the library (and Google cannot find it), attach it to your post. The Google Drive links will expire and future readers of this thread will not be able to follow.
Post your own code directly into the message using code tags (that's the </> button in the editor).

Please learn to format code. The IDE helps you by providing the Auto Format option in the Tools menu.

To your actual problem:
The library you're using is not maintained for about 6 years and it's the most complex of all ModBus libraries known to me. Are you sure you need all the features it offers you?

You're adding about 50 registers to your ModBus instance. I got the impression that you simply copied that code over from the example without having understood what it does. I'm pretty sure you don't need that code although you didn't described what you're trying to achieve yet.
You're currently using 3 of these registers.

You still didn't tell us where you get that error code. Your DHT library also has an error code 101. But in your code you would get the output

Read DHT11 failed, err=101

in which case it's clear the error is caused by the DHT sensor (wrong wiring).

If you get above error message you did the wiring wrong, so you should post a wiring diagram of your complete setup.

In any way you have a double usage of the serial interface. The ModBus library is using it for communication and you're using it for debugging purposes. This cannot work. If you need the debugging functionality, you should consider buying a hardware that supports multiple serial interfaces (Leonardo, Mega2560) but even if you have it, you have to patch the used library as it doesn't support changing the serial interface (Serial is hard-coded).

Thank you for advice ,

i am sure i did correct wiring because i can read the sensor in the IDE interface without Modbus sketch.

Post the exact error message you get! Best post the complete output you get!

Hi everyone

i was searching for the error code i got and i found a DHT11 sketch showing some explanation , so i thought to share with you to see if it can help to solve this issue .

BTW : when i use an Arduino UNO i seethe following error :Read DHT11 failed, err= 101
and when i use Arduino MEGA 2560 isee 2 errors :
Read DHT11 failed, err=101
Read DHT11 failed, err=105
no more info is shown about these errors
for the sams attached sketch

regards

DHT 11 error code.pdf (308 KB)

Post the code that works with exactly the same wiring as you currently have. And don't post PDFs of your code, use the code tag in the editor (that's the </> button)!