Main Content

Results for

Hi there,
I hope someone can help me on this.
I have written a code to connect my SIM7600 to Thingspeak using MQTT. It is basically an aruidino code. All instructions are echo's with an OK message so assume those instrictions are correct. However, the final step, publishing the message to the MQTT server return an error : CMQTTCONNLOST : 0,1.
Any idea which instructions might be wron?
I included the commands send.
10:09:09.031 -> AT+CMQTTPUB=0,0,60,0,0
10:09:09.031 -> +CMQTTPUB: 0,0
10:09:09.031 ->
10:09:09.031 -> OK
10:09:09.031 ->
10:09:09.031 -> +CMQTTCONNLOST: 0,1
The program :
SerialAT.begin(115200, SERIAL_8N1, RXD2, TXD2);
delay(1000);
SerialAT.println("AT+CRESET"); // Reset the SIM7600 module
Read_Response(30000);
SerialAT.println("AT+IPR=115200"); // Set Baudrate of the SIM7600 module
Read_Response(30000);
SerialAT.println("AT+CSQ"); // Check signal level
Read_Response(10000);
SerialAT.println("AT+COPS?"); // Query network information
Read_Response(10000);
SerialAT.println("AT+CMQTTSTOP"); //Stop MQTT service
Read_Response(10000);
SerialAT.println("AT+CMQTTSTART"); //Start MQTT service
Read_Response(10000);
SerialAT.println("AT+CSSLCFG=\"sslversion\",0,3"); //Configure SSL contect ssl_ctxindex,sslversion <0,TLS1.2>
Read_Response(10000);
SerialAT.println("AT+CSSLCFG=\"authmode\",0,0"); //Establishing MQTT Connection <ssl_ctx_index,authmode<0,no autentification>
Read_Response(10000);
SerialAT.println("AT+CMQTTACCQ=0,\"Username\",0,4"); // Acquire a client <client_index,client_ID>
Read_Response(10000);
SerialAT.println("AT+CMQTTSSLCFG=0,0"); // Set the SSL context <session_id,ssl_ctx_index> ssl_ctx_index check AT+CSSLCFG command
Read_Response(10000);
SerialAT.println("AT+CMQTTCONNECT=0,\"tcp://mqtt3.thingspeak.com:1883\",90,1,\"Username\",\"password\""); //Connect to MQTT server <client_index,server_addr,keep_alive time,clean_session,username,password>
Read_Response_Ignore_OK(3000);
String payload="\"channels/"+ String(ChannelId)+"/publish\"";
int Payload_Length;
Payload_Length=payload.length();
SerialAT.println("AT+CMQTTTOPIC=0,"+String(Payload_Length)); // Input the publish message topic <client_index,req_length>
SerialAT.println(payload);
Read_Response_Ignore_OK(3000);
payload="field1=12&field2=13&status=MQTTPUBLISH";
Payload_Length=payload.length();
SerialAT.println("AT+CMQTTPAYLOAD=0,"+String(Payload_Length)); // input the publish message body <client_index,req_length>
SerialAT.println(payload);
Read_Response_Ignore_OK(1000);
SerialAT.println("AT+CMQTTPUB=0,0,60,0,0"); // Publish a message to the server <client_id,qos,pub_timeout,retained>
Read_Response_Ignore_OK(1000);
Serial.print(Receive_buffer);
Serial.println("And we are done");
goc3
goc3
Last activity on 6 Nov 2023

Have you ever learned that something you were doing manually in MATLAB was already possible using a built-in feature? Have you ever written a function only to later realize (or be told) that a built-in function already did what you needed?
Two such moments come to mind for me.
1. Did you realize that you can set conditional breakpoints? Neither did I, until someone showed me that feature. To do that, open or create a file in the editor, right click on a line number for any line that contains code, and select Set Conditional Breakpoint... This will bring up a dialog wherein you can type any logical condition for which execution should be paused. Before I learned about this, I would manually insert if-statements during debugging. Then, after fixing each bug, I would have to delete those statements. This built-in feature is so much better.
2. Have you ever needed to plot horizontal or vertical lines in a plot? For the longest time, I would manually code such lines. Then, I learned about xline() and yline(). Not only is less code required, these lines automatically span the entire axes while zooming, panning, or adjusting axis limits!
Share your own Aha! moments below. This will help everyone learn about MATLAB functionality that may not be obvious or front and center.
(Note: While File Exchange contains many great contributions, the intent of this thread is to focus on built-in MATLAB functionality.)
Moja
Moja
Last activity on 13 Oct 2023

The carot symbol on my keyboard (ˆ shift+6) doesn't work on matlab. Matlab doesn't recognize it so I can't write any equation with power symbol. I tried every possible solution on the web and it doesn't work. even in the character viewer I don't have any result when I search ''caret".
Exciting news for students! 🚀Simulink Student Challenge 2023 is live! Unleash your engineering skills and compete for exciting rewards. Submission deadline is December 12th, 2023!
Over the weekend I came across a pi approximation using durations of years and weeks (image below, Wolfram, eq. 89), accurate to 6 digits using the average Gregorian year (365.2425 days).
Here it is in MATLAB. I divided by 1 week at the end rather than multiplying by its reciprocal because you can’t divide a numeric by a duration in MATLAB (1/week).
weeks = @(n)n*days(7);
piApprox = ((years(13)-weeks(6))/years(13) + weeks(3)) / weeks(1)
% piApprox = 3.141593493469302
Here’s a breakdown
  • The first argument becomes 12.885 yrs / 13 yrs or 0.99115
  • Add three weeks: 0.99115 + 3 weeks = 21.991 days
  • The reduced fraction becomes 21.991 days / 7 days
Now it looks a lot closer to the more familiar approximation for pi 22/7 but with greater precision!
This person used computer version to build a keyboard input, and used standard flag semaphore for the positions.
Flag semaphore is used mostly by sailors to be able to communicate optically over a distance; it does not need anything more than make-shift flags (but binoculars or telescopes can help.) Trained users can go faster than you might guess.
Chen, Rena, and I are at a community management event. It's great to be with others talking about relationships, trust, and co-creation.
A research team found a way to trick a number of AI systems by injecting carefully placed nonsense -- for example being able able to beat DeepMind's Go game.
This video discusses the "Cody" bridge, which is a pedestrian bridge over a canal that has been designed to move up and out of the way when ships need to travel through. The mathematics of the bridge movement are discussed and diagrammed. It is unique and educational.
Recently developed: a "microscope" based on touch and stereo vision.
Using touch removes the possibility of optical confusion -- for example, black on touch is only due to shape, not due to the possibility that the object has a black patch.
Sorry, you might need a Facebook account to watch the video.
Adam Danz
Adam Danz
Last activity on 6 Mar 2024

I'm curious how the community uses the hold command when creating charts and graphics in MATLAB. In short, hold on sets up the axes to add new objects to the axes while hold off sets up the axes to reset when new objects are added.
When you use hold on do you always follow up with hold off? What's your reasoning on this decision?
Can't wait to discuss this here! I'd love to hear from newbies and experts alike!
Calling all students! New to MATLAB or need helpful resources? Check out our MATLAB GitHub for Students repository! Find MATLAB examples, videos, cheat sheets, and more!
Visit the repository here: MATLAB GitHub for Students
The way we've solved ODEs in MATLAB has been relatively unchanged at the user-level for decades. Indeed, I consider ode45 to be as iconic as backslash! There have been a few new solvers in recent years -- ode78 and ode89 for example -- and various things have gotten much faster but if you learned how to solve ODEs in MATLAB in 1997 then your knowledge is still applicable today.
In R2023b, there's a completely new framework for solving ODEs and I love it! You might argue that I'm contractually obliged to love it since I'm a MathWorker but I can assure you this is the real thing!
The new interface makes a lot of things a much easier to do. Its also setting us up for a future where we'll be able to do some very cool algorithmic stuff behind the scenes.
Let me know what you think of the new functionality and what you think MathWorks should be doing next in the area of ODEs.
Shore
Shore
Last activity on 11 Oct 2023

I wanted to write to my public channel 2278931 with 8 different values to 8 different gauge widgets.
Here is my link.
https://api.thingspeak.com/update.json?api_key=xxxxxxxxxxxxxxxx&field1=1&field2=2&field3=3&field4=4&field5=5&field6=6&field7=7&field8=8
You can change values and in the link to change gauge values. On edit I edited my write key to make it not work for others but it will work with your own key.

Up until a few weeks ago, there was a "channels shared with me" option in Thingspeak. I was able to access the channel created by a different user, only once. The next time me and my groupmate tried to open the channel, there wasn't a "channels shared with me" option anymore. Why is that and how can this be resolved?

Is there any problem from thingspeak side, from last month my data is not uploading
Currently, I am trying to setup MATLAB and Simulink to connect with Unity. But I have some questions about the installation of ROS on my computer and ROS Toolbox. I found that there are several ROS installations, so, could you please kindly help and support? Hoping that your support will help a lot to my master's thesis.
i want make web site for pre registation to the vachile in thish project i can not thinke how to register in port and how to make .....????