1
votes

Background: I'm currently drawing up a project using a simple Arduino and a GPRS module that connects with UDP protocol to a RPi configured as an MQTT client, with an online MQTT Broker.

Arduino--GPRSMod--RPIMQTTClientPubl--Broker--WebclientSubscrib

I have not done anything yet, except gathering information about the plausibility of this project and figuring out the time and effort (The GPRS Module with UDP protocol to RPi is based on somebody else's project, and I'm not sure yet how it works, I thought in theory I could just send it directly to the Broker, but not sure which protocol I'm suppsed to use) and familiarized myself with Windows Mosquitto, just to try out MQTT.

Question: Is it possible to have two (or more) different sensors connected to the Arduino (Say, US, Temp and a normal Switch) and have them all sent as three different topics to the MQTT broker through one MQTT client?

US -------|

Temp ----|--Arduino--GPRSMod--RPIMQTTClientPubl--Broker--WebclientSubscrib

Switch ---|

I have a feeling that although in theory the three different inputs at the Arduino side, can be recognized and sent as three different signals (sent at different times) to the GPRSModule, however the GPRS Module||MQTT Client, can only publish to one topic, isn't it? Then do I really have to have three different GPRSModule||MQTTClients so I can send three different topics?

Thanks in advance!

1

1 Answers

1
votes

Any given MQTT client can publish to as many topics as they like. You should only need 1 GSM/GPRS module