【发布时间】:2018-09-20 16:37:01
【问题描述】:
我有一个嵌入式板,它从 IMU 传感器发送信息以及从 RTC 模块接收到的时间戳。
时间戳来自Adafruit's RTClib
代码有一个名为unixtime() 的函数,它为我提供如下时间戳:
1537466106
1537466107
1537466109
如果我在Online Epoch Converter 中输入上述时间戳,它会为我提供截至今天的正确时间。
我通过 HTTP 发送此信息,信息存储在 InfluxDB 中的imu 测量下,如下所示:
查询:SELECT * FROM imu LIMIT 100
time eul_x eul_y eul_z liac_x liac_y liac_z location nodeid status
---- ----- ----- ----- ------ ------ ------ -------- ------ ------
1537466106 273.25 -0.88 4.06 -0.06 -0.74 9.81 front node1 0
1537466107 273.25 -0.88 4.12 -0.09 -0.87 9.72 front node1 0
1537466109 273.25 -0.88 4.12 -0.09 -0.86 9.62 front node1 0
1537466110 273.25 -0.88 4.12 -0.07 -0.84 9.67 front node1 0
1537466111 273.25 -0.88 4.12 -0.1 -0.85 9.71 front node1 0
1537466112 273.25 -0.88 4.12 -0.08 -0.86 9.74 front node1 0
1537466113 273.25 -0.88 4.12 -0.04 -0.83 9.7 front node1 0
1537466114 273.25 -0.88 4.12 -0.07 -0.84 9.7 front node1 0
1537466115 273.25 -0.88 4.12 -0.07 -0.85 9.67 front node1 0
1537466116 273.25 -0.88 4.12 -0.06 -0.85 9.67 front node1 0
1537466117 273.25 -0.88 4.12 -0.06 -0.84 9.66 front node1 0
1537466118 273.25 -0.88 4.12 -0.07 -0.83 9.66 front node1 0
1537466119 273.25 -0.88 4.12 -0.09 -0.83 9.68 front node1 0
1537466120 273.25 -0.88 4.12 -0.08 -0.84 9.7 front node1 0
1537466121 273.25 -0.81 4.12 -0.08 -0.87 9.52 front node1 0
1537466123 272.12 -0.81 -3.06 -0.15 0.54 9.74 front node1 0
现在我在机器上运行一个 Chronograf Instance 来可视化上述测量中获得的数据
计时查询
奇怪的是,表格总是显示时间戳指向 1970 年
从数据库中查询单个字段会提供以下输出:
研究
我阅读了 InfluxDB 的文档,它们的时间戳为 nanoseconds 精度。
相反,我上面提到的时间戳其实是正确的,但为什么Chronograf/ InfluxDB不能正确掌握呢?
案例
我从RTClib 获得时间戳为uint32_t,但我不确定如何将其转换为纳秒精度。
我将时间戳信息作为字符串发送,将零连接到字符串是否明智? If So 可能需要多少个零?
【问题讨论】:
标签: arduino influxdb epoch chronograf