Strange Character on LCD when using bash to send over serial

Hi all

Hoping that this is the right part of the forum, I'm not sure if the issue is on my computer or the arduino or the LCD itself.

I have started using a SainSmart LCD shield (16x2) and have had some success with writing out times, custom text etc.

Sending text over the Arduino IDEs built in serial monitor works fine (up to 16 chars) as can be seen below.


I have started writing a bash script that will allow more control over the serial monitor etc.

I am using the following code to send text to the arduino:

$ echo hello > /dev/cu.usbmodem621

Which gives the following output

I get a weird character / glyph at the end of the string i send through, no matter what the string is.

I have tried adding single and double quotes in my bash script, but it is always the same

I think it may be something to do with an end of line character but I am not sure.

Does anyone know if the arduino has difficulties parsing end of line characters?

If it does, is it possible to strip the last character from a serial read in Arduino?

If not, does anyone have any ideas as to how to go about fixing this / experienced similar things before? I would post this to stack overflow in a bash section, but I doubt bash people would have much experience using arduino.

Thanks in advance.

Could it be a LF/CR? I noticed the same when I tried a serial lcd test.
Try turning them on, in your IDE & see if you get the same result.

I think it may be something to do with an end of line character but I am not sure.

That’s what it looks like to me.

Does anyone know if the arduino has difficulties parsing end of line characters?

It’s not the Arduino, it is the LCD controller. The LCD treats these characters, which are either 0x0A , 0x0D, or both as normal ASCII codes, not control codes. This ultimately results in the LCD controller trying to display one or two of the ‘custom characters’ which I doubt that you have defined.

So, you have to avoid sending them to the LCD module which means you can’t use println() or any other technique that ultimately does the same thing.

Don

Try “echo -n echo-string

I had the same strange character and it was the serial monitor
must be set to " no line ending "

radar21c:
I had the same strange character and it was the serial monitor
must be set to " no line ending "

His problem was with the LCD display not the serial monitor and the answer in reply #2 is still the correct one.

Don