add devices by sql insert

opengrace8 years ago

Hi,

I want to insert multiple device,
because we have 100 unit devices to add.

how to insert,
i tried one record

INSERT INTO `devices` (`id`, `name`, `uniqueid`, `lastupdate`, `positionid`, `groupid`, `attributes`, `phone`, `model`, `contact`, `category`) VALUES (NULL, 'Driver 3', '110738868852', NULL, NULL, '34', '{}', '', '', '', '');

But traccar platform not show up this device.
please help

Anton Tananaev8 years ago

Traccar has internal cache. You have to restart service if you add data manually to the database.

opengrace8 years ago

thx you for help

Gantz8 years ago

Hi,
theres a way to avoid the restart of the service?? or in wich way does traccar does it without restarting??

Thanks in advance.

Anton Tananaev8 years ago

If you want to avoid restart, you have to use Traccar API.

Gantz8 years ago

thansk for the quick response, excuse me if this is dumb but, can you give an example of how use the POST of the device api plz

Anton Tananaev8 years ago

Look at what the official app sends for an example.