Contenido principal

Resultados de

Javascript based plugins no longer working properly (in private views). Its just not displayed in channels. (Shown as field Sections are empty)

Jeff
Jeff
Última actividad el 15 de Abr. de 2021

I can no longer open and view my Thingspeak results in Firefox. It gets stuck in a loop which alternates between telling me I've logged in and authenticating. I've tried clearing Thingspeak cookies and rebooting the PC.

The same page works in Chrome, but I prefer to use Firefox as my browser. Any ideas what is wrong ?

Hello

From earlier today a project i've been working on has stopped working. It was working for the last couple of weeks with no coding updates in the mean time.

The error i'm only now getting is

"from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."

Im transferring four readings from thingspeak to a web page

the get command i'm using is. xhttp.open("GET", "https://api.thingspeak.com/channels/752230/feeds/last", false); xhttp.send();

Why would i only start receiving this error today. If more information is needed i will send it on.

any insights would be much appreciated.

Thanks

Trev

Dirk Steinkopf
Dirk Steinkopf
Última actividad el 14 de Abr. de 2021

Hello, since today 14:00 CEST (UTC+2) (= 12:00 UTC = 4 hours ago) none of my thinkspeak clients running on Arduinos using PubSubClient are able to connect to mqtt.thingspeak.com. Until then, they have been running happily for months.

I tried to send some data manually but didn't succeed:

mosquitto_pub -d -h mqtt.thingspeak.com -u TESTTerrasseWemos -p 1883 -P xxxx -t "channels/cccc/publish/yyyy" -m "field1=10&field2=60" ; echo $?
Client mosq-xxxxxxx sending CONNECT
Error: Unknown error.
19

The exact errors differ from try to try. But I don't know if my call is definitely correct.

Any help or information what might have changed at mqtt.thingspeak.com?

Thank you very much.

Santosh Kasula
Santosh Kasula
Última actividad el 19 de Jul. de 2022

We are introducing Scratch Pad in Cody to support iterative problem solving. Scratch Pad will enable you to build your solution line-by-line, experiment with different MATLAB functions, and test your solution before submitting.

Try it out and let us know what you think.

Arman Ilmak
Arman Ilmak
Última actividad el 10 de Abr. de 2021

Hi. Im using sim800 for sending data to thingspeak channels when connecting to api.thingspeak.com with port 80 everything is ok. But after sending" update?api_key=YYP2Q3T8UZ2WBP6H&field1=0 " by sim800 it closes the connection and 400 Bad Request error appears on the debug session. I tried this with hercules serial terminaal and same results .

Hello

I am currently having a hard time to install thingspeak server standalone on Debian 10 (Buster). I used the following docs: https://www.teracomsystems.com/blog/how-to-install-local-thingspeak-server/ https://angryelectron.com/how-to-install-a-thingspeak-server/

It breaks on "bundle install" with wrong gem dependencies, several tries to resolve the dependencies didn't work.

Anyone had luck installing thingspeak latest on Debian 10? Is there an installation documentation for thingspeak on Buster?

Thank you, Thomas

Niall
Niall
Última actividad el 14 de Abr. de 2021

Hi - I'm currently using the code from this article: https://uk.mathworks.com/help/thingspeak/continuously-collect-data-and-bulk-update-a-thingspeak-channel-using-an-arduino-mkr1000-board-or-an-esp8266-board.html

My plan was to use this so as to update my Thingspeak server every second with data recorded on my arduino of higher than 1Hz. I am currently taking vibration sensor data that for my project requires a higher sample rate than Thingspeak is able to handle naturally - thus I found bulk updates to be the solution.

I have gotten this to work as specified in the article - updates every 2 minutes with data points at every 15 seconds. I have gotten this as far as data points every second with an update to the server every 10 second - however the system fails at any data point shorter than a second. I believe this to be a problem with using delta_t but I am not sure.

To clarify I do not have a computer science background, this is currently a project I'm working on in Mechanical engineering and I've truly hit a wall with this problem. Any help would be appreciated!

My system is an Arduino MEGA 2560 with an ethernet shield - in the sample code they use RSSI to output sample data, I simply changed this to a random number between 0-50.

mostafa mousa
mostafa mousa
Última actividad el 7 de Abr. de 2021

I have a channel in thing speak with 1 field but the field visualization shows the date is yet to come "2022 </matlabcentral/discussions/uploaded_files/4532/data>

I am new to the subject but I want to learn, I wanted to know how I use my esp32 to activate a relay (to connect devices and or lamps) from a distance with my cell phone. what do I have to use for this or what procedures should I follow, thank you

Daniel Daniel
Daniel Daniel
Última actividad el 5 de Abr. de 2021

how can we modify the parameters to have a value with one decimal after the comma ?

thank you in advance,

This is a very basic thing but I am just beginning and I can't find the solution. When I increase the iframe width and height, the outside frame gets bigger but the graphs itself stay the same size. I read in a forum that suggests "auto" sizing feature by changing the iframe's src URL to something like the following:

http://thingspeak.com/channels/423600_ID/charts/2?width=auto&height=auto

I did and the size of the graph did scale well. However, the Number of entries to retrieve is default, which 100. Which means that after the first 100 points, as more entries comes, the first ones disappears. Please how can i increase the number of entries, lets say to the maximum?

Thank you in advance.

Hey guys! i recentlly written a code for patient health monitoring system using arduino and configured with that thingspeak api so that i could collect the data gathered by my pulse rate sensor and temparature sensor to thingspeak cloud and things went very fine my programe is executing fine but the data is not coming on thingspeak cloud..please guys it's so urgent for me cause i have to show this project as mu finao year demonstration project please help me or call me my email is durgeshc1402@gmail.com and call me on 7355104033.. it's so urgent for me to get this project working . below is the code

#include LiquidCrystal.h

LiquidCrystal lcd(12, 11, 5, 4, 3, 2); #include SoftwareSerial.h #include ThingSpeak.h float pulse = 0; float temp= 0; SoftwareSerial ser(9,10); String apiKey = "KT8O9XXE4K5WMVWA"; // Variables int pulsePin = A0; // Pulse Sensor purple wire connected to analog pin 0 int blinkPin = 7 ; // pin to blink led at each beat int fadePin = 13; // pin to do fancy classy fading blink at each beat int fadeRate = 0; // used to fade LED on with PWM on fadePin

// Volatile Variables, used in the interrupt service routine!

volatile int BPM; // int that holds raw Analog in 0. updated every 2mS volatile int Signal; // holds the incoming raw data volatile int IBI = 600; // int that holds the time interval between beats! Must be seeded! volatile boolean Pulse = false; // "True" when User's live heartbeat is detected. "False" when nota "live beat". volatile boolean QS = false; // becomes true when Arduoino finds a beat.

// Regards Serial OutPut -- Set This Up to your needs static boolean serialVisual = true; // Set to 'false' by Default. Re-set to 'true' to see Arduino Serial Monitor ASCII Visual Pulse volatile int rate[10]; // array to hold last ten IBI values volatile unsigned long sampleCounter = 0; // used to determine pulse timing volatile unsigned long lastBeatTime = 0; // used to find IBI volatile int P = 512; // used to find peak in pulse wave, seeded volatile int T = 512; // used to find trough in pulse wave, seeded volatile int thresh = 525; // used to find instant moment of heart beat, seeded volatile int amp = 100; // used to hold amplitude of pulse waveform, seeded volatile boolean firstBeat = true; // used to seed rate array so we startup with reasonable BPM volatile boolean secondBeat = false; // used to seed rate array so we startup with reasonable BPM

void setup() { lcd.begin(16, 2); pinMode(blinkPin,OUTPUT); // pin that will blink to your heartbeat! pinMode(fadePin,OUTPUT); // pin that will fade to your heartbeat! Serial.begin(115200); // we agree to talk fast! interruptSetup(); // sets up to read Pulse Sensor signal every 2mS

// IF YOU ARE POWERING The Pulse Sensor AT VOLTAGE LESS THAN THE BOARD VOLTAGE,

// UN-COMMENT THE NEXT LINE AND APPLY THAT VOLTAGE TO THE A-REF PIN

// analogReference(EXTERNAL);

lcd.clear(); lcd.setCursor(0,0); lcd.print(" Patient Health"); lcd.setCursor(0,1); lcd.print(" Monitoring "); delay(4000); lcd.clear(); lcd.setCursor(0,0); lcd.print("Initializing...."); delay(5000); lcd.clear(); lcd.setCursor(0,0); lcd.print("Getting Data...."); ser.begin(9600); ser.println("AT"); delay(1000); ser.println("AT+GMR"); delay(1000); ser.println("AT+CWMODE=3"); delay(1000); ser.println("AT+RST"); delay(5000); ser.println("AT+CIPMUX=1"); delay(1000);

String cmd="AT+CWJAP=\"durgesh\",\"eeeeeeee\""; ser.println(cmd); delay(1000); ser.println("AT+CIFSR"); delay(1000); }

// Where the Magic Happens void loop() { serialOutput(); if (QS == true) // A Heartbeat Was Found {

// BPM and IBI have been Determined // Quantified Self "QS" true when arduino finds a heartbeat fadeRate = 255; // Makes the LED Fade Effect Happen, Set 'fadeRate' Variable to 255 to fade LED with pulse serialOutputWhenBeatHappens(); // A Beat Happened, Output that to serial. QS = false; // reset the Quantified Self flag for next time } ledFadeToBeat(); // Makes the LED Fade Effect Happen delay(20); // take a break read_temp(); esp_8266(); } void ledFadeToBeat() { fadeRate -= 15; // set LED fade value fadeRate = constrain(fadeRate,0,255); // keep LED fade value from going into negative numbers! analogWrite(fadePin,fadeRate); // fade LED } void interruptSetup() { // Initializes Timer2 to throw an interrupt every 2mS. TCCR2A = 0x02; // DISABLE PWM ON DIGITAL PINS 3 AND 11, AND GO INTO CTC MODE TCCR2B = 0x06; // DON'T FORCE COMPARE, 256 PRESCALER OCR2A = 0X7C; // SET THE TOP OF THE COUNT TO 124 FOR 500Hz SAMPLE RATE TIMSK2 = 0x02; // ENABLE INTERRUPT ON MATCH BETWEEN TIMER2 AND OCR2A sei(); // MAKE SURE GLOBAL INTERRUPTS ARE ENABLED } void serialOutput() { // Decide How To Output Serial. if (serialVisual == true) { arduinoSerialMonitorVisual('-', Signal); // goes to function that makes Serial Monitor Visualizer } else { sendDataToSerial('S', Signal); // goes to sendDataToSerial function } } void serialOutputWhenBeatHappens() { if (serialVisual == true) // Code to Make the Serial Monitor Visualizer Work { Serial.print("*** Heart-Beat Happened * "); //ASCII Art Madness Serial.print("BPM: "); Serial.println(BPM); } else { sendDataToSerial('B',BPM); // send heart rate with a 'B' prefix sendDataToSerial('Q',IBI); // send time between beats with a 'Q' prefix } } void arduinoSerialMonitorVisual(char symbol, int data ) { const int sensorMin = 0; // sensor minimum, discovered through experiment const int sensorMax = 1024; // sensor maximum, discovered through experiment int sensorReading = data; // map the sensor range to a range of 12 options: int range = map(sensorReading, sensorMin, sensorMax, 0, 11); // do something different depending on the // range value: switch (range) { case 0: Serial.println(""); /////ASCII Art Madness break; case 1: Serial.println("---"); break; case 2: Serial.println("------"); break; case 3: Serial.println("---------"); break; case 4: Serial.println("------------"); break; case 5: Serial.println("--------------|-"); break; case 6: Serial.println("--------------|---"); break; case 7: Serial.println("--------------|-------"); break; case 8: Serial.println("--------------|----------"); break; case 9: Serial.println("--------------|----------------"); break; case 10: Serial.println("--------------|-------------------"); break; case 11: Serial.println("--------------|-----------------------"); break; } }

void sendDataToSerial(char symbol, int data ) { Serial.print(symbol); Serial.println(data); } ISR(TIMER2_COMPA_vect) //triggered when Timer2 counts to 124 { cli(); // disable interrupts while we do this Signal = analogRead(pulsePin); // read the Pulse Sensor sampleCounter += 2; // keep track of the time in mS with this variable int N = sampleCounter - lastBeatTime; // monitor the time since the last beat to avoid noise // find the peak and trough of the pulse wave

if(Signal < thresh && N > (IBI/5)*3) // avoid dichrotic noise by waiting 3/5 of last IBI { if (Signal < T) // T is the trough { T = Signal; // keep track of lowest point in pulse wave } } if(Signal > thresh && Signal > P) { // thresh condition helps avoid noise P = Signal; // P is the peak } // keep track of highest point in pulse wave // NOW IT'S TIME TO LOOK FOR THE HEART BEAT // signal surges up in value every time there is a pulse if (N > 250) { // avoid high frequency noise if ( (Signal > thresh) && (Pulse == false) && (N > (IBI/5)*3) ) { Pulse = true; // set the Pulse flag when we think there is a pulse digitalWrite(blinkPin,HIGH); // turn on pin 13 LED IBI = sampleCounter - lastBeatTime; // measure time between beats in mS lastBeatTime = sampleCounter; // keep track of time for next pulse

if(secondBeat) { // if this is the second beat, if secondBeat == TRUE secondBeat = false; // clear secondBeat flag for(int i=0; i<=9; i++) // seed the running total to get a realisitic BPM at startup { rate[i] = IBI; } } if(firstBeat) // if it's the first time we found a beat, if firstBeat == TRUE { firstBeat = false; // clear firstBeat flag secondBeat = true; // set the second beat flag sei(); // enable interrupts again return; // IBI value is unreliable so discard it } // keep a running total of the last 10 IBI values word runningTotal = 0; // clear the runningTotal variable for(int i=0; i<=8; i++) { // shift data in the rate array rate[i] = rate[i+1]; // and drop the oldest IBI value runningTotal += rate[i]; // add up the 9 oldest IBI values } rate[9] = IBI; // add the latest IBI to the rate array runningTotal += rate[9]; // add the latest IBI to runningTotal runningTotal /= 10; // average the last 10 IBI values BPM = 60000/runningTotal; // how many beats can fit into a minute? that's BPM! QS = true; // set Quantified Self flag // QS FLAG IS NOT CLEARED INSIDE THIS ISR pulse = BPM; } } if (Signal < thresh && Pulse == true) { // when the values are going down, the beat is over digitalWrite(blinkPin,LOW); // turn off pin 13 LED Pulse = false; // reset the Pulse flag so we can do it again amp = P - T; // get amplitude of the pulse wave thresh = amp/2 + T; // set thresh at 50% of the amplitude P = thresh; // reset these for next time T = thresh; } if (N > 2500) { // if 2.5 seconds go by without a beat thresh = 512; // set thresh default P = 512; // set P default T = 512; // set T default lastBeatTime = sampleCounter; // bring the lastBeatTime up to date firstBeat = true; // set these to avoid noise secondBeat = false; // when we get the heartbeat back } sei(); // enable interrupts when youre done! }// end isr void esp_8266() { // TCP connection AT+CIPSTART=4,"TCP","184.106.153.149",80 String cmd = "AT+CIPSTART=4,\"TCP\",\""; cmd += "184.106.153.149"; // api.thingspeak.com cmd += "\",80"; ser.println(cmd); Serial.println(cmd); if(ser.find("Error")) { Serial.println("AT+CIPSTART error"); return; } String getStr = "GET /update?api_key="; getStr += apiKey; getStr +="&field1="; getStr +=String(temp); getStr +="&field2="; getStr +=String(pulse); getStr += "\r\n\r\n"; // send data length cmd = "AT+CIPSEND=4,"; cmd += String(getStr.length()); ser.println(cmd); Serial.println(cmd); delay(1000); ser.print(getStr); Serial.println(getStr); //thingspeak needs 15 sec delay between updates delay(3000); } void read_temp() { int temp_val = analogRead(A1); float mv = (temp_val/1024.0)*5000; float cel = mv/10; temp = (cel*9)/5 + 32; Serial.print("Temperature:"); Serial.println(temp); lcd.clear(); lcd.setCursor(0,0); lcd.print("BPM :"); lcd.setCursor(7,0); lcd.print(BPM); lcd.setCursor(0,1); lcd.print("Temp.:"); lcd.setCursor(7,1); lcd.print(temp); lcd.setCursor(13,1); lcd.print("F"); }

I'm trying upload data on thingspeak it is not getting updated. We are getting readings on serial monitor. Please advice

Hello:

I am trying to read the position (latitude and longitde) from thingSpeakRead and the terror appears: Dot indexing is not supported for variables of this type

This is my code from MATLAB Visualizations code:

data = thingSpeakRead(1299642, 'location',true)
lon = data.Longitude;
lat = data.Latitude;
figure
geoplot(lat,lon,'red-*')
geobasemap("topographic")
title("Ground Truth Trajectory")

And this is the output: data =

     []

Dot indexing is not supported for variables of this type.

Error in Posicion (line 3) lon = data.Longitude;

Someone knows what is happening?

Thank you

Adam Danz
Adam Danz
Última actividad el 17 de Oct. de 2023

Starting in MATLAB R2021a, name-value arguments have a new optional syntax!

A property name can be paired with its value by an equal sign and the property name is not enclosed in quotes.

Compare the comma-separated name,value syntax to the new equal-sign syntax, either of which can be used in >=r2021a:

  • plot(x, y, "b-", "LineWidth", 2)
  • plot(x, y, "b-", LineWidth=2)

It comes with some limitations:

  1. It's recommended to use only one syntax in a function call but if you're feeling rebellious and want to mix the syntaxes, all of the name=value arguments must appear after the comma-separated name,value arguments.
  2. Like the comma-separated name,value arguments, the name=value arguments must appear after positional arguments.
  3. Name=value pairs must be used directly in function calls and cannot be wrapped in cell arrays or additional parentheses.

Some other notes:

  1. The property names are not case-sensitive so color='r' and Color='r' are both supported.
  2. Partial name matches are also supported. plot(1:5, LineW=4)

The new syntax is helpful in distinguishing property names from property values in long lists of name-value arguments within the same line.

For example, compare the following 2 lines:

h = uicontrol(hfig, "Style", "checkbox", "String", "Long", "Units", "Normalize", "Tag", "chkBox1")
h = uicontrol(hfig,  Style="checkbox",    String="Long",    Units="Normalize",    Tag="chkBox1")

Here's another side-by-side comparison of the two syntaxes. See the attached mlx file for the full code and all content of this Community Highlight.

Dear Community Staff

I have two channels, the first is working good the second not working, my license is free, I don't know what happens.

The configuration is the same, Somebody has any idea? how to solve this?

thank you

Rafael

Abhinav abhi
Abhinav abhi
Última actividad el 5 de Abr. de 2021

how can i update my thingspeak using mit app (sending value through mit app to thingspeak for a particular fiels)

Jose Arratia
Jose Arratia
Última actividad el 24 de Mzo. de 2021

Hello community, I am trying to subscribe using the MQTT protocol.

The problem occurs when I try to request the subscribe, I send the subscribe and my connection with the server is closed.

tiledlayout, introduced in MATLAB R2019b, offers a flexible way to add subplots, or tiles, to a figure.

Reviewing two changes to tiledlayout in MATLAB R2021a

  1. The new TileIndexing property
  2. Changes to TileSpacing and Padding properties

1) TileIndexing

By default, axes within a tiled layout are created from left to right, top to bottom, but sometimes it's better to organize plots column-wise from top to bottom and then left to right. Starting in r2021a, the TileIndexing property of tiledlayout specifies the direction of flow when adding new tiles.

tiledlayout(__,'TileIndexing','rowmajor') creates tiles by row (default).

tiledlayout(__,'TileIndexing','columnmajor') creates tiles by column.

.

2) TileSpacing & Padding changes

Some changes have been made to the spacing properties of tiles created by tiledlayout.

TileSpacing: sets the spacing between tiles.

  • "loose" is the new default and replaces "normal" which is no longer recommended but is still accepted.
  • "tight" replaces "none" and brings the tiles closer together still leaving space for axis ticks and labels.
  • "none" results in tile borders touching, following the true meaning of none.
  • "compact" is unchanged and has slightly more space between tiles than "tight".

Padding: sets the spacing of the figure margins.

  • "loose" is the new default and replaces "normal" which is no longer recommended but is still accepted.
  • "tight" replaces "none" and reduces the figure margins. "none" is no longer recommended but is still accepted.
  • "compact" is unchanged and adds slightly more marginal space than "tight".
  • Reducing the figure margins to a true none is still not an option.

The release notes show a comparison of these properties between r2020b and r2021a.

Here's what the new TileSpacing options (left column of figures below) and Padding options (right column) look like in R2021a. Spacing properties are written in the figure names.

.

And here's a grid of all 12 combinations of the 4 TileSpacing options and 3 Padding options in R2021a.

.

Code used to generate these figures

%% Animate the RowMajor and ColumnMajor indexing with colored tiles 
fig1 = figure('position',[200 200 560 420]); 
tlo1 = tiledlayout(fig1, 3, 3, 'TileIndexing','rowmajor');
title(tlo1, 'RowMajor indexing')
fig2 = figure('position',[760 200 560 420]); 
tlo2 = tiledlayout(fig2, 3, 3, 'TileIndexing','columnmajor');
title(tlo2, 'ColumnMajor indexing')
colors = jet(9);
drawnow()
for i = 1:9
    ax = nexttile(tlo1);
    ax.Color = colors(i,:);
    text(ax, .5, .5, num2str(i), 'Horiz','Cent','Vert','Mid','Fontsize',24)
      ax = nexttile(tlo2);
      ax.Color = colors(i,:);
      text(ax, .5, .5, num2str(i), 'Horiz','Cent','Vert','Mid','Fontsize',24)
      drawnow
      pause(.3)
  end
%% Show TileSpacing options
tileSpacing = ["loose","compact","tight","none"];
figHeight = 140;  % unit: pixels
figPosY = fliplr(50 : figHeight+32 : (figHeight+30)*numel(tileSpacing)); 
for i = 1:numel(tileSpacing)
    uif = uifigure('Units','Pixels','Position', [150 figPosY(i) 580 figHeight], ...
        'Name', ['TileSpacing: ', tileSpacing{i}]);
    tlo = tiledlayout(uif,1,3,'TileSpacing',tileSpacing(i)); 
    h = arrayfun(@(i)nexttile(tlo), 1:tlo.GridSize(2));
    box(h,'on')
    drawnow()
end
%% Show Padding options
padding = ["loose","compact","tight"];
for i = 1:numel(padding)
    uif = uifigure('Units','Pixels','Position', [732 figPosY(i) 580 figHeight], ...
        'Name', ['Padding: ', padding{i}]);
    tlo = tiledlayout(uif,1,3,'Padding',padding(i)); 
    h = arrayfun(@(i)nexttile(tlo), 1:tlo.GridSize(2));
    box(h,'on')
    drawnow()
end
%% Show all combinations of TileSpacing and Padding options
tileSpacing = ["loose","compact","tight","none"];
padding = ["loose","compact","tight"];
[tsIdx, padIdx] = meshgrid(1:numel(tileSpacing), 1:numel(padding));
figSize = [320 220]; % width, height (pixels)
figPosX = 150 + (figSize(1)+2)*(0:numel(tileSpacing)-1); 
figPosY = 50 + (figSize(2)+32)*(0:numel(padding)-1);
[figX, figY] = meshgrid(figPosX, fliplr(figPosY));
for i = 1:numel(padIdx)
    uif = uifigure('Units','pixels','Position',[figX(i), figY(i), figSize], ...
        'name', ['TS: ', tileSpacing{tsIdx(i)}, ', Pad: ', padding{padIdx(i)}]);
    tlo = tiledlayout(uif,2,2,'TileSpacing',tileSpacing(tsIdx(i)),'Padding',padding(padIdx(i))); 
    h = arrayfun(@(i)nexttile(tlo), 1:prod(tlo.GridSize));
    box(h,'on')
    drawnow()
end