Talked with support they can’t help me anymore than they have, I am sure that my parsing is good, but there is a problem with the code (I think) if there is nothing wrong with the Webhook, the format is in JSON and the webhook worked before but i just don’t know how to get any data to come from the webhook sent to the particle and shown on the lcd screen.
I have changed the code (put the basic code given by in the console) i have switched particles (tried with another one didn’t work (and yes the webhook settings are set to any device), I talked to support I srsly don’t know what to do anymore and I have been working on this project for like 6 months now, HELP!!!
Yeah the String(data) thing was left there from when I was troubleshooting to try and get any data respons,
Anyways now I have 2 errors, one in relations to the mutableCopy:
pubtrans.ino:29:12: ‘mutablyCopy’ was not declared in this scope
and another one which I don’t really know how to fix:
pubtrans.ino:48:67: no matching function for call to ‘CloudClass::publish(const char , void (&)(const char*, const char*), Spark_Subscription_Scope_TypeDef)’
And the String was suggested to me from the documentation so thats why I used it, if you have any suggestions, please write!
As my code looks like now I have other problems than previously mentioned, why I tried to start a new topic but I will continue it here now since this is not stackoverflow and I don’t have to care of starting a new topic every time my hands itch.
The main problems now are these: On my lcd the three lines of next times when the bus is going to arrive are not showing (my lcd is 20x4) and the one time that is showing sometimes just “times-out” and stops showing anything…
E.g. it shows
and then nothing for some reason and then maybe again
Nu (which means “Now” in swedish)
Any reasons why this might happen, and any ways I can make my particle get a better and faster connection to the webhook, since I feel like it’s taking a long time for it to receive the hook-response.
These two lines should replace the strdup() line (#18 in your pastebin) and you’d need to remove the free(mutableCopy) line from the handler.
For the String data = String(data); issue, you can remove that entirely - since you are not actually using data for anything - and just write Particle.publish("PubTrans", PRIVATE) as said above.
To address your other question we’d need to know what the actual input data you are receiving is when that happens.
For that you may want to Serial.print() the entire data string and post it here - or give us a link to the service you are getting the data from, for us to request a set ourselves.
The timing of the webhook response depends for a big part on the time the target server needs to reply. If you watch the event log in console.particle.io/logs you should get a feeling for where most time is lost - it shouldn’t be the device<->cloud communication.