# Downlink to TagoIO MQTT relay issue?

**URL:** <https://community.tago.io/t/downlink-to-tagoio-mqtt-relay-issue/1774>\
**Category:** Devices and Connectors\
**Created:** [October 28, 2025, 1:46pm UTC](https://community.tago.io/t/downlink-to-tagoio-mqtt-relay-issue/1774 "2025-10-28T13:46:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![akimmels6969](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@akimmels6969](https://community.tago.io/u/akimmels6969)\
**Post date:** [October 28, 2025, 1:46pm UTC](https://community.tago.io/t/downlink-to-tagoio-mqtt-relay-issue/1774/1 "2025-10-28T13:46:04Z")

</div>

Hi,

I have installed TagoIO relay and Mosquitto broker on an AWS EC2 instance, and am using DNS service.  
I am able to forward MQTT uplinks from my device to TagoIO using this setup, but am not able to get downlinks through.

I made this test script:

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

i_mport { Analysis, Network } from “jsr:@tago-io/sdk”;_

_const network = new Network({  
token: “9c0c4050-d679-47aa-a\*\*\*\*\*\*\*\*\*”,  
});_

_async function run(context) {  
// Publish to Relay: topic and payload for your external broker_

_await network.publishToRelay({  
device: “68c91a3d19a78f\*\*\*\*\*\*\*”,  
topic: “device/down/1026”,  
message: “test”,  
options: { qos: 0 }, // optional_

_});_

_console.log(“Published via Relay”);  
}_

_Analysis.use(run);_

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

The log shows this result:

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

_[2025-10-28 14:21:47] Starting Analysis…_

_[2025-10-28 14:21:47] error: Uncaught (in promise) “Error on Relay: Request failed with status code 404 Not Found: [https://test1395.xxxxx.xxx/publish](https://test1395.xxxxx.xxx/publish)”_

_[2025-10-28 14:21:47] [TagoIO Analysis] Error executing Deno analysis: 1_

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

I see that the network middleware is correct (test1395.xxxxx.xxx), but would have expected the port 3001 to be included, otherwise it will not reach the relay, I think?

In another script and from postman I tested a direct fetch on [https://test1395.xxxxx.xxx:3001/publish](https://test1395.xxxxx.xxx:3001/publish) when setting the relay in unsafe mode, and then the relay receives the downlink.

If I try to set the middleware address in the network to test1394.xxxxx.xxx:3001, it will not save.

Could it be that there is an issue in the publishToRelay() function, such that it fails to include the port 3001?

---

<div class="post-metadata">

**Author:** ![vitorfdl](https://yyz2.discourse-cdn.com/flex034/user_avatar/community.tago.io/vitorfdl/32/1728_2.png) [@vitorfdl](https://community.tago.io/u/vitorfdl)\
**Post date:** [October 29, 2025, 4:08pm UTC](https://community.tago.io/t/downlink-to-tagoio-mqtt-relay-issue/1774/2 "2025-10-29T16:08:48Z")

</div>

Hello @arturcarvalho  
Thank you for flagging the issue with the Middleware Endpoint. We’ve reproduced the behavior on our side: your service requires a port in the network domain, and our API is currently not accepting ports as part of that field.

Our engineering team is already working on this. We’ll update you as soon as support for ports in the network configuration is available.

In the meantime, if a temporary workaround would help, two common options are:

- Using a reverse proxy or load balancer on a standard port (80/443) that forwards traffic to your service port.
- Updating DNS to point to a service that terminates on 80/443 and routes to your target port internally.

---

<div class="post-metadata">

**Author:** ![akimmels6969](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@akimmels6969](https://community.tago.io/u/akimmels6969)\
**Post date:** [October 31, 2025, 3:00pm UTC](https://community.tago.io/t/downlink-to-tagoio-mqtt-relay-issue/1774/3 "2025-10-31T15:00:30Z")

</div>

Hi Vitor,

Ok, thank you for your update and proposal for workaround.

Looking forward to a quick resolution of this issue.

Kind regards,

Arthur

---

<div class="post-metadata">

**Author:** ![carolina.hidalgo](https://yyz2.discourse-cdn.com/flex034/user_avatar/community.tago.io/carolina.hidalgo/32/1602_2.png) [@carolina.hidalgo](https://community.tago.io/u/carolina.hidalgo)\
**Post date:** [November 4, 2025, 10:35pm UTC](https://community.tago.io/t/downlink-to-tagoio-mqtt-relay-issue/1774/4 "2025-11-04T22:35:13Z")

</div>

Good news @akimmels6969!

The issue with the Middleware Endpoint has been fixed.

Our API now fully supports ports in the network configuration field, so everything should be working normally again.

Thanks for reporting it and for your patience!

Best Regards,

Carolina
