Reference to table : tc.positions

technomap3 years ago

Hello mister Anton,
i have a question please about the references between the two tables tc.devices & tc.positions
i founded that there is a relation of one to many between the two tables and the foreign key used is the " deviceid " in the table " tc.positions " .. my question is how the value of the collumn "deviceid " in each row in tc.position is generated on every POST from the parser ?

i have created an custom parser of teltonika devices and i created a new Data base with two tables the same like "tc.devices" and "tc.positions" when the parser send POST of data always i find the collumn "deviceid" NULL is there is something missing in my case ?
Thank you

Anton Tananaev3 years ago

Please don't address questions specifically to me. It discourages others from participating. It's a forum for community around Traccar, not an "Anton's Q&A".

technomap3 years ago

Sorry .. i just sayed my topic respectfully because you are the founder .. sorry for that again

Anton Tananaev3 years ago

You need to set device id in your decoder.

technomap3 years ago

Yes i thinked about this and i tryed to use IMEI but i was not sure ..
How the decoder will get the device id that is already registred on tc.devices and Post it with parameters because device id will be genetated Automatically on each device registred

Anton Tananaev3 years ago

Have you looked at other decoders? The source code is open, so you should be able to find answers in the code much faster than asking on the forum.

technomap3 years ago

I tried but i founded it a little bit hard to understand .. i'am just C# developer .. the path of the code source is this ? : main/protocol

technomap3 years ago

Hello .. what if i make the decoder make an GET " tc.devices " where the IMEI = the IMEI decoded, if the IMEI macht the IMEI decoded than send POST to tc.positions with deviceid ? This way will not degreed the performance of the decoder ?

technomap3 years ago

Can you please give me an idea to how to implement it