Send a downlink message to TTN via thingsboard - thingsboard

I have integrated thingsboard and ttn to view uplink messages and creating dashboards. I'm interested in sending downlink messages as well. The examples I read ,take input from the uplink and add it as a payload field to the downlink and trigger the message by some change in attributes.
I want to send a custom payload (6 bytes) every hour and also change it based on user input.
Any help is appreciated.
Sorry for silly questions, newbie here...
Cheers

Related

send message from metatrader4 to telegram bot in python

I am working on automating the trade signals generated in metatrader 4. Idea is to encode the buy/sell signals into message and send to a python telegram receiver code which will decode the message and take appropriate action (like placing orders with broker using broker provided python APIs). any idea how this can be done?
I have so far tried below code, which receives message from my telegram account and replies same text back.
https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot2.py
my requirement is instead of using telegram account on mobile, i need it in the metatrader
today with bit of struggle i figured out a way to achieve my requirement. not an efficient solution but its working. so i am explaining below,
MT4 EA code: once buy/sell signals generated, a message is sent to my first telegram bot (call it A_bot).
A_bot: forwards the received message to second bot(call it B_bot)
python server on vps: same token as that of B_bot is listening to incoming messages. in other words python version of B_bot is listening to incoming messages.
so when A_bot forwards the message recieved by MT4 EA to B_bot, copy of same message is received is received by python server. So in python server code now i am able to process the message and place order accordingly.
so the original problem is i can't do this with just A_bot. there is an extra step involved to forward message from one telegram bot to another to make it work. for this i am using android app Tforwarder.

In MQTT, can i send a message to single client? Or only in a topic?

I have an application using MQTT, with clients connected on various topics, however, I have the need to send a message only to a client, not to an entire topic. Is that possible?
No, MQTT is a pub/sub protocol, messages are published on topics and there may be 0 to many subscribers to that topic
The closest you can do is pick a topic that you know only the client you want will be subscribed to.

Twilio: How to get answers from message log with just phone number

I want to get received messages of the same day of a phone number with the help of API or anything.
(I have purchased ofcourse a phone number)
**
Requirement :
**
I have a twilio app which sends 5 questions to 1000 user and users reply's to it. Like a survey. App is deployed on Azure.
I will get 5000 messages in log.
I am planning to retrieve messages by phone number and update my database from the user.
Implemented :
Implemented this https://www.twilio.com/docs/guides/sms/how-to-receive-and-reply-in-csharp. Any other idea for the requirement is also appreciated.
Twilio developer evangelist here.
I see that you've implemented the basic flow for responding to incoming SMS messages. If you are implementing surveys across a number of users my advice would be to expand on that application.
Firstly, you would need to run through your database to get all your users' phone numbers and send the first question to all of them using the Twilio REST API to send each a text message.
Then, when you receive an incoming message from one of your respondents you can find out the number that sent the message by inspecting the From parameter on the incoming request body. You can then look up your user in your database by phone number and save that response for them. Then you can use the TwiML <Message> to respond to the user and send them the next question.
This way you can collect the responses as they come in, rather than call the REST API to list all responses.
Let me know if that helps at all.

what a real mqtt message looks like

I want to publish a message from the device to the mqtt server,but I don't know how to send this message with the correct format, something like json ?please give me some help to figure out this .Thanks a lot.
There is no "correct format" - MQTT is only a transport, it does not define the payload format.
You can send JSON , String , Integer etc... There is no specific format. Whatever you send you will reach the client which subscribed it.Clients connect to a broker by subscribing and/or publishing to topics and accessing the information.

How can I know, to which topic the arrived message belongs?

I am developing an App and I am using MQTT protocol supported by Paho library.
I am subscribing to 10 topics, and there will be a messgae(s) published for one at least one topic. now, when I get notified about the arrival of a new messae, how can i know to which topic it belongs?
Update:
The object that you get when the message arrives should have a destination field which will contain the topic.

Resources