WEB API CALL On EMS (Get Data From Sensors)
Hello,
I'm newbie on Thingworx technilogie and after doing the guides am trying now to develop my first application.
The idea is simple:
1- Use Raspberry pi as Gateway (Done)
2-Connect EMS to IOT Thinworx (Done)
3- Configure my first Thing : Pi_Thing with auto_bind and connect it to the remote thing on the platform (Done)
4- On Mu PiTemplate, i want to develop a lua script to get json result , parse it and sent the resut to a remote property on thingworx platform.
Reading the LUA Doc i think i have to user tw_http request:
Some thing like: tw_http.get(host, port, path, headers, query)
For test reason im using a public api just to test if it works:
https://pokeapi.co/api/v2/pokemon/ditto/
Can you help with the lua script to get the JSON result from the API on the file Pi_Template
I created to property:
properties.JsonTest={baseType="Json", pushType="ALWAYS", value="{}"}
when i call the api:
properties.JsonTest = tw_http.get("https://pokeapi.co", "", "api/v2/pokemon/ditto/", "", "")
an error occur !
ERROR] 2019-06-21 08:47:03,171 luaScriptProxy::execute: [1979708496] Error executing script PiThing, Error = Error: .../EMS/microserver/etc/custom/templates/PiTemplate.lua:49: Error allocating HTTP Client
Can you help me.
Thank you

