Arduino Uno serial monitor printing garbage
I am using Arduino Uno and GSM sim800l for a project and looks like something is wrong and I don't know what it is. Here is my code:
#include <AltSoftSerial.h>
AltSoftSerial altSerial;
void setup() {
Serial.begin(19200);
Serial.println("AltSoftSerial Test Begin");
altSerial.begin(19200);
altSerial.println("Hello World");
}
void loop() {
char c;
altSerial.print("altSerial is working.");
if (Serial.available()) {
c = Serial.read();
altSerial.print(c);
}
if (altSerial.available()) {
c = altSerial.read();
Serial.print(c);
}
}
Its output was like this:
AltSoftSerial Test Begin (linebreak)
Hello World (linebreak)
ltSerial is ok⸮⸮M⸮ɥ⸮⸮⸮is okalt //insert long random garbage here
I tried changing the baud rate of the code and serial monitor to keep it matched but it is not working, I tried to lower it as low as 300 and tried up to 19200 as well.
Any ideas would help. I also tried Tools-> Fix encoding and reload but it still didn't solve the problem. It is my first time using this type of hardware so please bear with me. My goal is to use it to send SMS messages but right now I'm trying a smaller task with it to try and understand it better.
Btw, the Arduino IDE I am using is 1.8.7
arduino serial-port arduino-uno gsm baud-rate
add a comment |
I am using Arduino Uno and GSM sim800l for a project and looks like something is wrong and I don't know what it is. Here is my code:
#include <AltSoftSerial.h>
AltSoftSerial altSerial;
void setup() {
Serial.begin(19200);
Serial.println("AltSoftSerial Test Begin");
altSerial.begin(19200);
altSerial.println("Hello World");
}
void loop() {
char c;
altSerial.print("altSerial is working.");
if (Serial.available()) {
c = Serial.read();
altSerial.print(c);
}
if (altSerial.available()) {
c = altSerial.read();
Serial.print(c);
}
}
Its output was like this:
AltSoftSerial Test Begin (linebreak)
Hello World (linebreak)
ltSerial is ok⸮⸮M⸮ɥ⸮⸮⸮is okalt //insert long random garbage here
I tried changing the baud rate of the code and serial monitor to keep it matched but it is not working, I tried to lower it as low as 300 and tried up to 19200 as well.
Any ideas would help. I also tried Tools-> Fix encoding and reload but it still didn't solve the problem. It is my first time using this type of hardware so please bear with me. My goal is to use it to send SMS messages but right now I'm trying a smaller task with it to try and understand it better.
Btw, the Arduino IDE I am using is 1.8.7
arduino serial-port arduino-uno gsm baud-rate
did you set the baud rate in Serial Monitor to 19200 baud?
– Juraj
Nov 24 '18 at 11:19
yeah, when I change the baud rate in the source code I change the baud rate in arduino serial monitor as well. I make sure that they always match.
– Need2learn
Nov 25 '18 at 8:40
how do you get both outputs to one Serial Monitor?
– Juraj
Nov 25 '18 at 8:43
add a comment |
I am using Arduino Uno and GSM sim800l for a project and looks like something is wrong and I don't know what it is. Here is my code:
#include <AltSoftSerial.h>
AltSoftSerial altSerial;
void setup() {
Serial.begin(19200);
Serial.println("AltSoftSerial Test Begin");
altSerial.begin(19200);
altSerial.println("Hello World");
}
void loop() {
char c;
altSerial.print("altSerial is working.");
if (Serial.available()) {
c = Serial.read();
altSerial.print(c);
}
if (altSerial.available()) {
c = altSerial.read();
Serial.print(c);
}
}
Its output was like this:
AltSoftSerial Test Begin (linebreak)
Hello World (linebreak)
ltSerial is ok⸮⸮M⸮ɥ⸮⸮⸮is okalt //insert long random garbage here
I tried changing the baud rate of the code and serial monitor to keep it matched but it is not working, I tried to lower it as low as 300 and tried up to 19200 as well.
Any ideas would help. I also tried Tools-> Fix encoding and reload but it still didn't solve the problem. It is my first time using this type of hardware so please bear with me. My goal is to use it to send SMS messages but right now I'm trying a smaller task with it to try and understand it better.
Btw, the Arduino IDE I am using is 1.8.7
arduino serial-port arduino-uno gsm baud-rate
I am using Arduino Uno and GSM sim800l for a project and looks like something is wrong and I don't know what it is. Here is my code:
#include <AltSoftSerial.h>
AltSoftSerial altSerial;
void setup() {
Serial.begin(19200);
Serial.println("AltSoftSerial Test Begin");
altSerial.begin(19200);
altSerial.println("Hello World");
}
void loop() {
char c;
altSerial.print("altSerial is working.");
if (Serial.available()) {
c = Serial.read();
altSerial.print(c);
}
if (altSerial.available()) {
c = altSerial.read();
Serial.print(c);
}
}
Its output was like this:
AltSoftSerial Test Begin (linebreak)
Hello World (linebreak)
ltSerial is ok⸮⸮M⸮ɥ⸮⸮⸮is okalt //insert long random garbage here
I tried changing the baud rate of the code and serial monitor to keep it matched but it is not working, I tried to lower it as low as 300 and tried up to 19200 as well.
Any ideas would help. I also tried Tools-> Fix encoding and reload but it still didn't solve the problem. It is my first time using this type of hardware so please bear with me. My goal is to use it to send SMS messages but right now I'm trying a smaller task with it to try and understand it better.
Btw, the Arduino IDE I am using is 1.8.7
arduino serial-port arduino-uno gsm baud-rate
arduino serial-port arduino-uno gsm baud-rate
edited Nov 24 '18 at 18:52
Federico Grandi
3,08821229
3,08821229
asked Nov 24 '18 at 11:03
Need2learnNeed2learn
188
188
did you set the baud rate in Serial Monitor to 19200 baud?
– Juraj
Nov 24 '18 at 11:19
yeah, when I change the baud rate in the source code I change the baud rate in arduino serial monitor as well. I make sure that they always match.
– Need2learn
Nov 25 '18 at 8:40
how do you get both outputs to one Serial Monitor?
– Juraj
Nov 25 '18 at 8:43
add a comment |
did you set the baud rate in Serial Monitor to 19200 baud?
– Juraj
Nov 24 '18 at 11:19
yeah, when I change the baud rate in the source code I change the baud rate in arduino serial monitor as well. I make sure that they always match.
– Need2learn
Nov 25 '18 at 8:40
how do you get both outputs to one Serial Monitor?
– Juraj
Nov 25 '18 at 8:43
did you set the baud rate in Serial Monitor to 19200 baud?
– Juraj
Nov 24 '18 at 11:19
did you set the baud rate in Serial Monitor to 19200 baud?
– Juraj
Nov 24 '18 at 11:19
yeah, when I change the baud rate in the source code I change the baud rate in arduino serial monitor as well. I make sure that they always match.
– Need2learn
Nov 25 '18 at 8:40
yeah, when I change the baud rate in the source code I change the baud rate in arduino serial monitor as well. I make sure that they always match.
– Need2learn
Nov 25 '18 at 8:40
how do you get both outputs to one Serial Monitor?
– Juraj
Nov 25 '18 at 8:43
how do you get both outputs to one Serial Monitor?
– Juraj
Nov 25 '18 at 8:43
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457467%2farduino-uno-serial-monitor-printing-garbage%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457467%2farduino-uno-serial-monitor-printing-garbage%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
did you set the baud rate in Serial Monitor to 19200 baud?
– Juraj
Nov 24 '18 at 11:19
yeah, when I change the baud rate in the source code I change the baud rate in arduino serial monitor as well. I make sure that they always match.
– Need2learn
Nov 25 '18 at 8:40
how do you get both outputs to one Serial Monitor?
– Juraj
Nov 25 '18 at 8:43