<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Raspberry Pi EMS Value Stream in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/603659#M35300</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have established Raspberry Pi connection to Thingworx server with Edge microserver and Lua Script Resource and the property values update correctly. (&lt;A href="https://developer.thingworx.com/resources/guides/thingworx-raspberry-pi-quickstart" target="_blank" rel="noopener"&gt;https://developer.thingworx.com/resources/guides/thingworx-raspberry-pi-quickstart&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can we get the values to be logged to a value stream?&lt;/P&gt;
&lt;P&gt;Value stream is defined and connected to the PiThing. Properties from RaspberryPi are bind and marked as "persistent" and "logged" (for example cpu_temperature). Initial record to the value stream is created when LSR is started but after this no new records are added. The initial record with the original time stamp just gets a new value (eg. cpu_temperature). I am querying the value stream with "QueryPropertyHistory" service.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are we missing here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;ThingWorx 8.4.2-b2151&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Apr 2019 15:39:42 GMT</pubDate>
    <dc:creator>jsaynava</dc:creator>
    <dc:date>2019-04-05T15:39:42Z</dc:date>
    <item>
      <title>Raspberry Pi EMS Value Stream</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/603659#M35300</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have established Raspberry Pi connection to Thingworx server with Edge microserver and Lua Script Resource and the property values update correctly. (&lt;A href="https://developer.thingworx.com/resources/guides/thingworx-raspberry-pi-quickstart" target="_blank" rel="noopener"&gt;https://developer.thingworx.com/resources/guides/thingworx-raspberry-pi-quickstart&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can we get the values to be logged to a value stream?&lt;/P&gt;
&lt;P&gt;Value stream is defined and connected to the PiThing. Properties from RaspberryPi are bind and marked as "persistent" and "logged" (for example cpu_temperature). Initial record to the value stream is created when LSR is started but after this no new records are added. The initial record with the original time stamp just gets a new value (eg. cpu_temperature). I am querying the value stream with "QueryPropertyHistory" service.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are we missing here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;ThingWorx 8.4.2-b2151&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 15:39:42 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/603659#M35300</guid>
      <dc:creator>jsaynava</dc:creator>
      <dc:date>2019-04-05T15:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Raspberry Pi EMS Value Stream</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/603775#M35312</link>
      <description>&lt;P&gt;The steps seems to correct, so could you upload the wsems, and lua logs?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 08:14:01 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/603775#M35312</guid>
      <dc:creator>chiwatashi</dc:creator>
      <dc:date>2019-03-29T08:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Raspberry Pi EMS Value Stream</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/603787#M35314</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;attached you can find logs for both.&lt;/P&gt;
&lt;P&gt;At the moment it is pushing only "humidity" to Thingworx.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 09:34:51 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/603787#M35314</guid>
      <dc:creator>jsaynava</dc:creator>
      <dc:date>2019-03-29T09:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Raspberry Pi EMS Value Stream</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/603800#M35316</link>
      <description>&lt;P&gt;Thank you for the logs.&lt;/P&gt;
&lt;P&gt;You are using "EMS Version 5.4.0.114", and there is an issue about connectivity (non-SSL) between wsems and lua.&lt;/P&gt;
&lt;P&gt;The reference article is&amp;nbsp; below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EMS and LSR are unable make a connection to SSL enabled ThingWorx server using EMS 5.4.0&lt;BR /&gt;&lt;A href="https://www.ptc.com/ja/support/article?n=CS281541" target="_blank"&gt;https://www.ptc.com/ja/support/article?n=CS281541&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Easy way is that download&amp;nbsp;WSEMS5.4.1 and later which fixed the issue.&lt;/P&gt;
&lt;P&gt;If you still see the issue after update the wsems, could you send the config.json and config.lua?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 09:55:13 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/603800#M35316</guid>
      <dc:creator>chiwatashi</dc:creator>
      <dc:date>2019-03-29T09:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Raspberry Pi EMS Value Stream</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/604071#M35355</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using&amp;nbsp; EMS 5.4.5 did not correct the issue.&lt;/P&gt;
&lt;P&gt;Configured the connection with SSL and self-signed certificate but the behaviour is still the same: Value stream does not get new records. Properties are available from the thing and update correctly in the "Properties and Alerts" page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Attached the config files and new logs.&lt;/P&gt;
&lt;P&gt;There are no errors after LSR is started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank You in advance for any help.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 10:43:25 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/604071#M35355</guid>
      <dc:creator>jsaynava</dc:creator>
      <dc:date>2019-04-01T10:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Raspberry Pi EMS Value Stream</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/604297#M35399</link>
      <description>&lt;P&gt;I checked logs and config, and it looks like no problem.&lt;/P&gt;
&lt;P&gt;I did quick test and saw the same phenomenal, the value stream is not added, but value is changed.&lt;/P&gt;
&lt;P&gt;I checked the timestamp of updated value and looked like the sample lua (PiTemplate.lua)&lt;/P&gt;
&lt;P&gt;sent all same timestamp.&lt;/P&gt;
&lt;P&gt;Could you check if you use "refresh" bottom of Thing property to add the value (value stream)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 09:58:23 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/604297#M35399</guid>
      <dc:creator>chiwatashi</dc:creator>
      <dc:date>2019-04-02T09:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Raspberry Pi EMS Value Stream</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/604542#M35430</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The LSR does indeed send the data with the same timestamp everytime.&lt;/P&gt;
&lt;P&gt;I digged around the lua files and modified file "/EMS/microserver/etc/thingworx/lua/utils.lua" so that it adds the &lt;EM&gt;os.time()&lt;/EM&gt; instead of &lt;EM&gt;prop.time.&lt;/EM&gt;&amp;nbsp; This way the timestamp updates and data gets logged to the value stream.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;function toVariantVTQ(prop)
local t = {}
local name = prop.name or "value"
t['value'] = { baseType = prop.baseType, value = prop.value } -- variant format for JSON
-- t['time'] = prop.time or os.time() * 1000
t['time'] = os.time() * 1000 or os.time() * 1000
t['quality'] = prop.quality or "UNKNOWN"
return t
end&lt;/PRE&gt;
&lt;P&gt;I'm not sure whether this is intended behaviour of the LSR or not but at least now it works.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 10:01:02 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Raspberry-Pi-EMS-Value-Stream/m-p/604542#M35430</guid>
      <dc:creator>jsaynava</dc:creator>
      <dc:date>2019-04-03T10:01:02Z</dc:date>
    </item>
  </channel>
</rss>

