hi,.so my project create temperature monitoring system using nodeMcu and DHT11 sensor,.and add telegram notification if temperature above normal,
the proble is,the code not work along between thinger code and telegram send message code…
if i disable thinger source code (thing.handle() function.),program successfully send message to telegram,especially
below my source code
Hello @Prema_Pradana, this is a really interesting project, congratulations!
Let’s see if we can help you make it works, I have two suggestions:
delete delay instructions from the loop routine, this will make your device lose the connection with the router, so thing. handle routine will need to reconnect every time. You can implement the same logic by using something like:
try to stop thinger communication before calling myBot.sendMessage() instruction using WiFi.disconnect(); and also would be interesting to include a mechanism to prevent the device to call this instruction ALWAYS the temperature is over the threshold, for example:
I guess it could be something with the connection, you declare two wifi setups (one for telegram, one for thinger), but of course is just one.
Reading @JorgeTrincado response, it could work, if the instruction myBot.sendMessage(id, "check your sever"); tries to connect wifi with telegram established wifi credentials.
The only doubt I have is if after sending the telegram message, it could run the thinger process, because the wifi interface will be active with the telegram client, I think it is needed an instruccion to disable this client and left the wifi adapter available again for the thinger process.
Of course it would be really good just the need of one wifi setup and both process run over the same wifi connection, don’t know if this could be done easily, I’ve done something like this, running two different clouds clients at the same micrcocontroller by the same wifi connection, but just left the thinger’s wifi setup and modified the other client to run over this connection, nothing hard, just verify it is connected and send data, the thinger client was on charge to warrantee there is a connection always.
Hi,many thanks for your reply and suggestion,.
i have try your suggestion,especially for insert WiFi.disconnect();`before sending telegram message. result is :
hi @ega thank you for your reply,do you have any idea to release the wifi interface ?or how to use just one wifi connection for both telegram and thinger?
Working with the endpoint is a better solution than implement the client at the microcontroller.
But in case you still want to apply the microcontroller’s client, what I would do is to modify the telegram’s library to avoid the attempt connection to wifi and just verify that it is connected to it (this will be after the thinger process runs, of course), so it will check that it is connected and should send the message with no issue, and everything with the thinger’s client wifi connection.
i didn’t ever know there is such a feature like this,.and yeeaayyy finally now i can show data on thinger dasboard and send telegram notification…many thanks for your support…
and antoher thing,.
how to make the notification text that will be sent via telegram dinamically get data from the sensor…
for example &text=your server temperature is : [temp_value].
i hope you understand what i mean…
I tried the latest type of “Telegram send message” endpoints, but I didn’t get the notification like it should. can someone help me to solve this problem?
Hi, Looking for some advise using the Endpoint integration, getting the following error:
“error”: {
“message”: “Host not found (non-authoritative), try again later”
}
As mentioned, when trying to use the Telegram Send Message as an endpoint, with the correctBot token and Chat Identifier, I do not receive any messages. I am able to receive Telegram messages using the http endpoint - using the same Bot token and chat identifier.