How to format my variable/metadata to make it flexible?

Hello,

I am starting to design my messages and data structure, however, to make it scalable as well as flexible to add new features, it would require a good data structure from the beginning. I think I need a kind of guideline with good practices from your experience might be what I need as a start.

In my case: One farm might have several cell phones which use few physical sensors and read the same quantity from some tank. I am unable to freeze a set cell phone + sensor to a specific water tank, the user of course will tell what is the tank he is going to acquire data. In other words, a farm can pick any cell phone, any physical sensor and acquire data from any water tank and the user will input in the app what is the tank and sensor that he is going to read. The farm people might buy more cell phones or sensors or replace them at any time as well.

Once these quantities are stored in the cell phone, they will be reported to Tago.io server though API.

My question is then, how I would generate tokens and data (variable and metadata) formats that make the system scalable and flexible?

Hi Campos,

First thing you need to do is to create your own Network. That will allow you to get more control over your device tokens.

With the Network, you also need to create a Connector for your sensors. Notice that you can have many networks and use them to find devices that are both related to real sensors or customers.

With the Network and your own connector, you will now have access to the Network token, which allow you to find any device created within the Network using it’s serial number. The serial number is defined by you, just make sure you’re using serial that are unique for each device. Our official networks uses the Device EUI in most cases to be able to identify the sensor.

At this point, I’m unsure if you’re developing your own sensors or if you’re buying them for a 3rd party manufacturer. If you’re developing your sensor, you can make use of the mobile feature > Setup Wi-FI device, which allow you to communicate with the sensor using TCP/IP or Bluetooth protocol.

Using the Setup Wi-Fi will allow you to provision your device using the network-token to get the device-token you need to do API call to TagoIO. For most secure protocol, I highly recommend to have a middleware service (your own server) just to provision the device, that way you don’t need to have the Network token

On the application side, I recommend you to check our Kickstarter Application to see how we organize the variables and devices for real applications in production: https://github.com/tago-io/analysis-kickstarter

Let me know if that helps you.