Hi,
I am having a very annoying problem, which i cannot see to find out why it occurs. I use Particle Photon to publish data to Azure IoT Hub. I then use Stream Analytics to get the inputStream and output it to a database. I use the database to expose data to my webapi so i can create a nice webview with angularJS.
Its working for some messages, but after 8 messages i get this message:
Encountered error trying to write 1 event(s): Cannot convert from property ‘temperature’ of type ‘System.String’ to column ‘temperature’ of type ‘System.Double’
My question is… why is the first messeges going through and suddenly after a while my temperature gets converted to a string?
I was first sending every 3 seconds, but that made it crash. Now i send it every 2 minutes, but still after 7-8 readings it gets output error. I believe this has more something to do with stream analytics and how i manipulate my data.
Hmm, my guess is that it’s not the string->double conversion, but that something is putting a non-numeric string in your temperature field. Any chance you can log out the raw value when that exception gets thrown?
Hmmm no… but seems like its working again now… magically o.o
But i noticed that when the warning occured my data was outputting nothing. Comparing with particle console and stream analytics in my particle console, the data gets published, but my stream analytics somehow are having troubles with outputting the inputstream from IoT Hub.
interesting! So the data is getting to iot hub fine, but stream analytics is having an issue? We can ping the Microsoft folks and see if they have an issue on their end. If you had some specific dates / times, and specific stream jobs / iot hub IDs and other info, that would probably help their team see what’s going on.
I notice that the data field contains escaped double quotes. These slashes should not be here in the message, the JSON format does not expect that the quotes of the string themselves are escaped. Only characters within strings can be escaped.
As seen in this thread I finally managed to get it working, thanks to the enhanced JSON. There is still a question left in that thread, the enhanced JSON does not accept values without quotes. So all values are strings in the end. Please check it out, thanks again!