Mark Quinn in MATLAB Answers
上次活动时间: 2024-11-1

I have a ThingHTTP request that parses my local council website and extracts the bins which are collected each week. I then display this on an arduino with colour LEDs. This worked fine for years but now for some reason the Thingspeak request cannot parse the website any more??? The conucil website is: https://www.salford.gov.uk/bins-and-recycling/bin-collection-days/your-bin-collections/?UPRN=100012691624 This isn't my address but a random house nearby ;) I've copied the XPath for the string about this week (//*[@id="standard-page"]/div/div/div[2]/p[1]/text()[2]) Then used the GET request on thingspeak - This used to work fine. Now it gives me : Error parsing document, try a different parse string. Any ideas?
NHON NGUYEN in Discussions
上次活动时间: 2023-1-24

There is exactly the same tutorial for my topic but I couldn't make it work. It worked like a charm on SMS service but it wasn't on call. Authentication shouldn't be a problem cause it's similar to SMS configuration. The remaining information that I've doubt is the "Body" part. I filled it like: From={+Twilio number}&To={+myNumber}&Body=CO2 concentration is exceeding the threshold value and being at :%%channel_1372010_field_3%% And also, the API URL is: https://api.twilio.com/2010-04-01/Accounts/{My AuthSID}/Calls.json I replaced my own information on the above items but It didn't make a call at all even when the TimeControl app run it. Hope to get your help. Make phone calls with Twilio using ThingHTTP Here is the POST format from the <https://www.twilio.com/docs/voice/make-calls# Twilio doc> . It looks like there isn't a body parameter or key. curl -X POST https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Calls.json \ --data-urlencode "Url=http://demo.twilio.com/docs/voice.xml" \ --data-urlencode "To=+14155551212" \ --data-urlencode "From=+15017122661" \ -u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN From twilio i want to get a call with voice response having channel data and text to speech part. say, the voice i want as 'Temperature is 100 degree farenhite, here 100 is the channel data. What i shall write in thingHTTP body to get the voice in call response along with data and text as speech. I am getting data voice but facing problem with that text part. Please help I think that question is better posed on a Twillio community. thinghttp twilio
Zachariah Belding in Discussions
上次活动时间: 2022-12-15

When making a ThingHttp request via POST, the server response header does not include: "Content-Length:". Instead it is using "Transfer-Encoding: chunked". This makes it dificult to confirm that the entire response has been recieved. Any way to change this? 21:09:55.812 -> POST /apps/thinghttp/send_request HTTP/1.1 21:09:55.812 -> Host: api.thingspeak.com 21:09:55.812 -> Content-Type: application/x-www-form-urlencoded 21:09:55.812 -> Content-Length: 60 21:09:55.812 -> 21:09:55.812 -> headers=false&api_key=[removed]&message=Arduino Reset 21:09:55.906 -> 21:09:57.040 -> 21:09:57.040 -> 21:09:57.040 -> HTTP/1.1 200 OK 21:09:57.040 -> Date: Thu, 15 Dec 2022 02:09:57 GMT 21:09:57.040 -> Content-Type: text/html; charset=utf-8 21:09:57.040 -> Transfer-Encoding: chunked 21:09:57.040 -> Connection: keep-alive 21:09:57.040 -> Status: 200 OK 21:09:57.040 -> Cache-Control: max-age=0, private, must-revalidate 21:09:57.040 -> X-Request-Id: 798bbb62-da97-4ff8-a15b-c60b68fd60d3 21:09:57.040 -> ETag: W/"408e73c03e9c23fc2318c396c21c09e8" 21:09:57.040 -> 21:09:57.040 -> 2d 21:09:57.040 -> Congratulations! You've fired the alert event 21:09:57.040 -> 0 21:09:57.040 -> ThingHTTP server response header using "Transfer-Encoding: chunked" There is no control for the headers used in ThingHTTP, though you can ask ThingSpeak to reduce the headers sent to a device in some cases. I would guess that the client that is accepting the ThingHTTP request should be able to do the right HTTP thing. Are you writing a custom receiver/client? Does it run on a device? If you really needed to send length information, you can be able to calculate the length in a MATLAB analysis, and then use webread and webwrite to send the response to your device or whomever else is listening. You can control the headers explicitly in MATLAB. Thanks, yes this is a custom library written for an LTE Modem. As a more broad question, do you know why "Transfer-Encoding: chunked" is being used at all? This is usually only used for large amounts of data or for streaming. I have never seen it used for APIs. According to these two sources, "chunked" is be depreciated: https://everything.curl.dev/http/post/chunked "This assumes that you know you do this against an HTTP/1.1 server. Before 1.1, there was no chunked encoding, and after version 1.1 chunked encoding has been deprecated." https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding "Note: HTTP/2 disallows all uses of the Transfer-Encoding header" thinghttp transfer-encoding: chunked
Derek Huether in MATLAB Answers
上次活动时间: 2022-6-20

Did a project that uses an ESP8266 and WS2812B, using ThingHTTP to pull MarketWatch data to display live stock symbols, trending prices, and trending percentages. Overall, everything works. I then discovered that during trading hours (09:30-16:00), all of the data displays on both the LED matrix and serial monitor as jumbled characters. Am I missing some neccessary and obvious line of code that allows me to pull live data curing market hours? Any direction is appreciated. Rather than including the ino code here, I'll just point to my public Github repo. https://github.com/derekhuether/stockticker Thank you in advance!
Bernd Pilgram in MATLAB Answers
上次活动时间: 2022-3-11

Hello, iˋm using a ThingHTTP GET request to my Shelly Cloud to receive a single temperature value. Calling this ThingHTTP-request from my browser i get back the right single value (after setting up the right PARSE STRING). Calling this request from the REACT app there seems to be no connection to any field of my channel. How can I add the Information to add this single temp value to field1 of my channel ? thanks 2 all Bernd
João Machado in Discussions
上次活动时间: 2021-2-26

Hi guys, I'm using Thingspeak to log data for my small weather station project. The data then gets sent to an Airtable using React and ThingHTTP. When I check the exported CSV from Thingspeak I can see the data being logged at regular intervals — every 5 minutes, 3 seconds in. However, something happens with React/ThingHTTP, because the Airtable log doesn't match. Every hour or so, the entry will have an added minute (13:01, 17:01, etc). Why does this happen? React is programmed to use ThingHTTP whenever Field1 is different from 0. React/ThingHTTP adding 1 minute every hour Think of thingHTTPs that are triggered by React to be a queue of work. ThingSpeak has worker processes that pull tasks off the FIFO work queue and execute it. Occasionally, if there is a lot of work to be done and all the workers are busy, the work queue will back up and the task is executed when a worker becomes available. This may introduce some delay which explains what you are seeing. Thank you for your answer! Is there a way to use thingHTTP to pass the original timestamp of the record? The documentation provides %%datetime%% but that only sends the timestamp of the instance when the data is actually sent. I would like to be able to access the created_at property and send that. Rather than use thingHTTP, can your device send it to ThingSpeak and directly to Airtable? The timestamp on your device will be a more accurate measure of when the measurement was made and you have built a system with redundancies if either service goes down. I will consider it, but I actually moved from that system because the ThingSpeak library seemed more reliable over time. I can run the device for weeks without ever getting an error. Do you know if the created_at property can be passed using thingHTTP? Thank you. thinghttp react
David Strip in MATLAB Answers
上次活动时间: 2020-12-22

I've created a ThingHTTP request with the following values: When I invoke this using the test URL provided to the right side of the page, the response is "Unauthorized". I copy/pasted the apiKey from my key list. What am I doing wrong?
Sheila Hill in MATLAB Answers
上次活动时间: 2020-12-8

I hate to ask but I have been struggling with this and just can't get it working. I set up a Twilio trial account and tested it sending an SMS to my cell phone. I set up a Thingspeak REACT to respond to data in one of my channels and then use ThingHTTP to write data to another channel. The part I can't get working is for a REACT to use ThingHTTP to get Twilio to send an SMS to my cell. I have read several tutorials and watched videos but just can't get there. The ThingHTTP screen has the following: API Key XXXYYYYZZZZ // there is a long key that thingspeak generates - as far as I know I don't use this anywhere URL https://api/twilio.com/2014-04-01/Accounts/xxxxmynumberyyyy/Messages // have aslo tried ...mynumberyyy/SMS/Messages HTTP Auth Username XXXXmyTwilioAccountSIDyyyy HTTP Auth Password XXXmyTwilioAuthTokenyyyy Method POST Content Type application/x-www-forms-urlencoded HTTP Version 1.1 HOST I left this blank Headers None added Body From=+15875555555&To=+15875555555&Body=Test Message 1 // not my real hone numbers Parse String I left this blank Any pointers would be greatly appreciated.
Mehran Rahmani in MATLAB Answers
上次活动时间: 2020-10-25

The issue was addressed by finding the API webpage of the main website. Then, I requsted an API-Key via an online form. They provided me an API key for accessing some basic data. However, more data needed a paid membership.
Wade Campbell in MATLAB Answers
上次活动时间: 2019-12-1

I am using the example (to send an SMS from an Arduino) at https://www.instructables.com/id/Send-SMS-from-Arduino-over-the-Internet-using-ENC2/ I have triple checked the Twilio credentials entered into the ThingHTTP project and the ThingHTTP project's API key. The Arduino code and the serial output text are below... /* Send SMS from Arduino over the Internet using ENC28J60 and Thingspeak Change one line to use with ethernet shield Add sensor readings in the loop and a time interval Using Arduino UIP library from https://github.com/ntruchsess/arduino_uip Code based on Sparkfun's data logging service data.sparkfun.com URL encode function from http://hardwarefun.com/tutorials/url-encoding-in-arduino */ #include <SPI.h> //change the following line to #include <Ethernet.h> to use the eithent shield #include <Ethernet.h> // Enter a MAC address for your controller below. byte mac[] = { 0x00, 0x24, 0xd6, 0x7f, 0xa2, 0x54 }; //thingspeak server char server[] = "api.thingspeak.com"; //if DHCP fails, use a static IP IPAddress ip(192,168,0,199); // Initialize the Ethernet client library EthernetClient client; //API key for the Thingspeak ThingHTTP already configured const String apiKey = "<<my API code fromn ThingHTTP project>>"; //the number the message should be sent to const String sendNumber = "<<my cell phone number>>"; // format "+1nnnnnnnnnn" void setup() { Serial.begin(9600); //set up Ethernet: setupEthernet(); //send the sms Serial.println("Sending SMS"); //this function will send the sms //the first argument is the number to send to, formatted like this +12345678901 //the second argument is the body of the text message, which must be within URLEncode() sendSMS(sendNumber, URLEncode("Hello World!")); } void loop() { } void sendSMS(String number,String message) { // Make a TCP connection to remote host Serial.print(F("server: ")); Serial.println(server); // Serial.print("client.connect(server,80): "); // Serial.println(client.connect(server, 80)); if (client.connect(server, 80)) { //should look like this... //api.thingspeak.com/apps/thinghttp/send_request?api_key={api key}&number={send to number}&message={text body} Serial.println("client.connect(server, 80) is true"); client.print("GET /apps/thinghttp/send_request?api_key="); client.print(apiKey); client.print("&number="); client.print(number); client.print("&message="); client.print(message); client.println(" HTTP/1.1"); client.print("Host: "); client.println(server); client.println("Connection: close"); client.println(); Serial.print("GET /apps/thinghttp/send_request?api_key="); Serial.print(apiKey); Serial.print("&number="); Serial.print(number); Serial.print("&message="); Serial.print(message); Serial.println(" HTTP/1.1"); Serial.print("Host: "); Serial.println(server); Serial.println("Connection: close"); Serial.println(); Serial.println(F("TS Connection succeeded")); } else { Serial.println(F("TS Connection failed")); } // Check for a response from the server, and route it // out the serial port. if (client.connected()) { Serial.println(F("Server response...")); } while (client.connected()) { if ( client.available() ) { char c = client.read(); Serial.print(c); } } Serial.println(); Serial.println("End of reading from server"); client.stop(); } void setupEthernet() { Serial.println("Setting up Ethernet..."); // start the Ethernet connection: if (Ethernet.begin(mac) == 0) { Serial.println(F("Failed to configure Ethernet using DHCP")); // no point in carrying on, so do nothing forevermore: // try to congifure using IP address instead of DHCP: Ethernet.begin(mac, ip); } Serial.print("My IP address: "); Serial.println(Ethernet.localIP()); // give the Ethernet shield a second to initialize: delay(1000); } String URLEncode(const char* msg) { const char *hex = "0123456789abcdef"; String encodedMsg = ""; while (*msg!='\0'){ if( ('a' <= *msg && *msg <= 'z') || ('A' <= *msg && *msg <= 'Z') || ('0' <= *msg && *msg <= '9') ) { encodedMsg += *msg; } else { encodedMsg += '%'; encodedMsg += hex[*msg >> 4]; encodedMsg += hex[*msg & 15]; } msg++; } return encodedMsg; }
Zdenek Svezen in MATLAB Answers
上次活动时间: 2019-11-18

Hello, I have this in ThingHTTP body: {"src":"013025819299","dst":"+420605555555","text":"ALARM"} It works fine, but I need to insert timestamp inside it, like this: {"src":"013025819299","dst":"+420605555555","text":"ALARM at %%timestamp%%"} Is it possible? How to do it?

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.