Mita with Sntp and MQTT
Answer
8/13/19 6:23 AM

Hello community,

 

I'm working since a few days with mita. My goal is to send the sensor data to a broker via MQTT. The Connection to WiFi and also MQTT is working already. 

Now I want into the payload of the messages next to the sensor value also a timestamp. 

 

While searching how to integrate a the timestamp I found 'this'

 

I have copied the code for "systime.h" as described. 

Also the right timestamp is printed into the console. Therefore I'm sure the connection to the SNTP-Server is also working. 

 

But now to my Problem, I have no idea how to get the timestamp from the c-file into the mita file. 

It would be nice, if someone knows how to declare the timestamp that it is callable in mita. 

 

Thanks in advance!

Felix

0 (0 Votes)
RE: Mita with Sntp and MQTT
Answer
8/13/19 7:46 AM as a reply to Felix Kühn.

Hi Felilx,

Here is a description of how to make a function written in native C known to Mita:
https://www.eclipse.org/mita/language/foreignfunctioninterface/#native-functions

regards

Saeid

0 (0 Votes)