Thanks Guys. I appreciate the tips and help. Ok @ScruffR, I made all the changes you suggested except for the transmitMode( ). Did not understand that one.
I have some old code that you helped me with that I have copied below. but I am stuck on where to put the webhook variable “cf”. So my webhook event name is called “EF” and my variable is “cf” with the data now being “flow” instead of “F”.
Old code.
Particle.publish("EF",
"{\"cf\":\"" + F +
"\"}", 60, PRIVATE, NO_ACK);
New code from one of your previous tips to me.
char publishStateString[256];
void loop() {
float flow = map(adc,2139.0, 10614.0, 0.0, 200.0);
if (Particle.connected() && millis()-lastpub > 60000) {
lastpub = millis();
snprintf(publishStateString, sizeof(publishStateString), "%.2f:",flow );
Particle.publish("EF", publishStateString, 60, PRIVATE, NO_ACK);
}
Where do I put the variable in the publish to trigger the webhook? or do I need to change my webhook? Note the data goes to a google sheet. Here is how my webhook is formatted.
{
"event": "{{{PARTICLE_EVENT_NAME}}}",
"data": "{{{PARTICLE_EVENT_VALUE}}}",
"coreid": "{{{PARTICLE_DEVICE_ID}}}",
"published_at": "{{{PARTICLE_PUBLISHED_AT}}}",
"Flow": "{{{cf}}}",
}
Hi @Rftop, I don’t think I changed anything so that’s what’s really strange. It is possible but not likely as I have been using this same code for some time.
It’s possible that there is local interference as it is an electronics manufacturing facility. There could be all kinds of crazy stuff going on there. If I can get this new code to publish on my other electron here at the office then I will do an over the air flash. I am already eating through data with all the disconnects and reconnects. I am at 0.3 mb in just 24 hours.
Thanks for taking a look at this and offering suggestions. You and @ScruffR have really helped me out.