Although my physical gateway device has the real date and time , at the /rx topic in the mqtt broker i get packets like this {“rxInfo”:{“mac”:“1dee18c14948a955”,“time”:“0001-01-01T00:00:00Z”,“timestamp”:47425548,“frequency”:868300000,“channel”:1,“rfChain”:1,“crcStatus”:1,“codeRate”:“4/5”,“rssi”:-43,“loRaSNR”:11.2,“size”:20,“dataRate”:{“modulation”:“LORA”,“spreadFactor”:9,“bandwidth”:125}},“phyPayload”:“gFY0EjoABAABNbRksF/2R8KBIOE=”}.
How can i configure the time to have the real value?
The lora-gateway-bridge config file hasn’t any parameter for the time.
Any ideas?
Essentially i would like to know the actual time a packet is published in my mqtt broker.
I am using my gateway’s packet forwarder and i bind the lora gateways bridge endpoint inside the gateway…should i use this one?
I wilm search for mine and if i cant configure it i will send you pm!
If you want to modify source code just add this line
else {
// Add system time if we dont have a GPS
time_t t_local = time(NULL);
x = gmtime(&t_local);
buff_index += snprintf((char *)(buff_up + buff_index), TX_BUFF_SIZE-buff_index, ",\"time\":\"%04i-%02i-%02iT%02i:%02i:%02i.0Z\"", (x->tm_year)+1900, (x->tm_mon)+1, x->tm_mday, x->tm_hour, x->tm_min, x->tm_sec); /* ISO 8601 format */
}
I added the lines of code and i restart the lorank.service but nothing changes.
You can see that despite the fact that the stats topic has the real date and time , my rx topic hasn’t it.
I don’t know what happens!
As you can see on the attatched image on a previous comment ,i can see the time field which the bridge publishes on the mqtt broker,the problem is that it is always with a wrong value of the default 0001-01-01T00:00:00Z
When i change the script adding your code…i only have to execute a make command in order to be compiled all .C files, Correct?
Or i missunderstand something about the compilation?