Go Down

Topic: Problem with characters when communicating through the serial port in OpenWRT (Read 218 times) previous topic - next topic

DenSyo

Sketch sends date and time on serial port, an example on the upper screen in screenshot. When connecting Arduino to OpenWRT have invalid characters in console, example on the bottom screen in screenshot. Use tail utility gives similar results. In terminal session uses encoding UTF-8, when changing encoding to others, from the Arduino nothing arrives. Arduino does not respond to messages sent to her on the serial port, it also receives spoiled characters.



What could be the reason and how to fix it?

Robin2

What operating system are you using?

I have had no problem using various terminal programs on Puppy Linux or (now) Linux Mint. My usual terminal program is Minicom.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

DenSyo

Arduino connect on asuswrt-merlin, modification of native firmware asuswrt.
version: Linux version 2.6.22.19 (merlin@ubuntu-dev) (gcc version 4.2.3) #1 Wed Mar 29 00:39:44 EDT 2017

ieee488

Arduino connect on asuswrt-merlin, modification of native firmware asuswrt.
version: Linux version 2.6.22.19 (merlin@ubuntu-dev) (gcc version 4.2.3) #1 Wed Mar 29 00:39:44 EDT 2017

He's asking about your PC's OS not your router's OS.


Robin2

Two or three hours spent thinking and reading documentation solves most programming problems.

DenSyo

What's the black screen shot taken from?

Is that from Windows?
Yes, black screen is a Windows ssh-client PuTTY. White screen is a Windows Arduino IDE.

Robin2

Yes, black screen is a Windows ssh-client PuTTY.
But that is only a view of the operating system on another PC. What is the other PC?

I was thinking Windows would not understand cat /dev/ttyUSB0

AFAIK even if you were working directly on a Linux PC cat /dev/ttyUSB0 won't show the output of an Arduino properly.

Can you use SSH to run puTTY on the other PC? Or maybe MINICOM might be better because it shows the output directly in the terminal window.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

DenSyo

PuTTY is a Windows program for terminal access to Linux computers. All that on a black screen is a Linux session. Session started from Windows. But that's not the point, where the session starts is not important. Today connected Arduino on the PC with Ubuntu, screenshot taken off the his session. Here we can see the correct data coming from Arduino. Most likely the problem is in the OS settings on my router, but I do not understand where.




Add to above. Apparently the problem is in the driver of the USB device. For the serial port was placed driver of the USB modem:

Quote
cat /proc/tty/driver/usbserial

usbserinfo:1.0 driver:2.0
0: module:option name:"GSM modem (1-port)" vendor:1a86 product:7523 num_ports:1 port:1 path:usb-0000:00:04.1-1.2

Robin2

PuTTY is a Windows program for terminal access to Linux computers.
Yes. I am aware of that but it is not exclusive to Windows. PuTTY also works on Linux.

When I asked back in Reply #1 what OS you are using I wanted to know what OS is on the PC that the Arduino is connected to. I'm still not sure if you have answered that.

Quote
Today connected Arduino on the PC with Ubuntu, screenshot taken off the his session. Here we can see the correct data coming from Arduino.
Is that the same PC that you were connecting to with PuTTY ?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

DenSyo

When I asked back in Reply #1 what OS you are using I wanted to know what OS is on the PC that the Arduino is connected to. I'm still not sure if you have answered that.
Is that the same PC that you were connecting to with PuTTY ?

Arduino i want to connect to my router with asuswrt-merlin, it is essentially the same openwrt.
Sketches I write on PC with Windows, PuTTYl I run on it. Computer with ubuntu is another computer.


As I previously assumed a problem in the drivers. The router assigns a modem driver for the serial port.

Here the guys solve a similar problem:
https://www.snbforums.com/threads/libftdi-usbserial.18231/

ftdi_sio is missing from my drivers on the router, i think how to install it...

Robin2

I suggest you ask on some openWrt forum about how you configure it for serial over USB.

Can you load a program such as PuTTY or Minicom onto the router?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

DenSyo

Minicom was in the repository, installed. But the results he gave the same as the cat.
it is necessary to compile the driver of the serial port, I'll do it the other day.

Go Up