LMIC library - how upload data using multiple ports on same application

Hello everyone!

In context with the LMIC library, I have this use case where I want to use a Lora channel to upload gsp data for TTN mapper purposes and in the same application use another channel to upload sensor information (e.g. tank level). My first intuition is to use a port counter and in every do_send call toggle the port, but I am not sure if that is the approach.

Thanks for any advices.

You can use the port numbers 1 to 223 for any thing you want to help distinguish between different situations or payload formats or message types or what ever you want.

The port is NOT a channel - that’s a radio frequency definition.

The port is NOT a counter, it’s just a number, like a mailbox number at a block of flats.

You can’t toggle the port as it’s not binary, you just use the port number you want to use.

The port is just a number in software and as long as you use the permitted range of 1 to 223, nothing bad can happen by you trying things out - which is by far the best way to learn.

You can’t just send using different ports when ever you require, you still have to adhere to the fair use policy and any legal limits.

It does make sense to send TTN Mapper format on one port and use another port for sensor level - interested to know if it’s the fuel tank on this moving item, if so, the port number is the least of your worries, I’d concentrate on the sensor!

Appreciate the concepts clarification. My main question is about implementation. My first approach consists in upload port 1 data at a given transmit window, and in the next one send the port 2 the sensor data (I think I misused the word toggle in my last post and the counter word). Until now I just have 2 sensors (gps and level sensing) but later more sensors could be used. I was wondering if it was possible to upload 2 ports payload at same transmision window, but now seems to me that that is not possible. I already made some calculations and there won’t be any issues with the fear use policy.
About the use case: it’s a water tank in a truck used to re-fill other tanks. The sensor subsystem proof of concept has been already tested and resolved. This is for a personal hydroponic entrepreneurship where the water savings and efficient use is critical.
Thanks descaertes for your reply.

No possibility, the port number is embedded in the header of the LoRaWAN packet.

Thank you!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.