Hi, I'm using the python examples in the starter kit found here: SAP/iot-starterkit · GitHub
This far I've been capable of sending messages from the sensor to hana, and of controlling the sensor device using the push message option from the IoT cockpit, using this to change the state of the led or to display a message.
My problem comes when trying to do the same using the python example for pushing messages:
First of all: I receive a 200 response, it should be ok, but it's not.
with that response comes an html page that if I access and click a button send the data to hana and give me the following message:
{"msg":"Parse error. Expected [messageType] of type [string]"}
I've been using firebug to see how it's done when pushing from the cockpit and I'm using the same code in the python example, getting always this response.
It should be easy enough: just use srt() and it's a string, but no, it doesn't work.
The original line:
body='{"method":"http", "sender":"Push test UI", "messageType":"' + str(config.message_type_id_To_device) + '", "messages":[{"oper":"' + str(opcode) +
'", "data":"' + str(operand) + '"}]}'
The custom line: (like the one used from the IoT cockpit)
body = '{"messageType":"m0t0y0p0e3","messages":[{"opcode":"switch on","operand":"led 1"}],"method":"http","sender":"IoT App"}'
What am I missing here?
Thanks