Arduino Serial Monitor shows strange ASCII characters - arduino

I connected an ArduiMU v3+ via a FTDI-cable to my Mac (OS X 10.10) (latest VC FTDI driver is installed and loaded).
Inside the Arduino-software the Serial Monitor (monitoring /dev/cu.usbserial-AJ038NZ3) shows
a lot of weird ASCII characters.
What could be the reason for this problem?

Instead of using the Arduino Serial Monitor, use OS X's ability to determine the baud rate automatically. Whenever, I use my FTDI cable, I monitor the input using the screen command.
In this case you can grep for the name of the device:
ls /dev | grep tty\.[Uu]sb | awk '{print "/dev/"$1}' | xargs screen
check out man screen for a bit more background.
or use the simple version by finding the name of the port in the /dev folder then using
screen <name_of_FTDI>

Related

Android Things: Connect to Serial Debug Console

I've been trying to connect to the serial console of a Raspberry Pi 3 with Android Things using USB to TTL cable from my Linux (Ubuntu) machine. Despite I connected the cable as per the documentation, all I get when executing the minicom command is the following
with no chance to type in any character. So I neither can see any kernel messages nor shell into the device.
What am I missing?
Linux (Ubuntu)
What's in?
GNU Screen
Minicom
minicom one-line-command (short answer)
minicom UI (long answer, detailed)
GNU Screen
Run in terminal
sudo screen port_name 115200
See below (step 2) to find out port_name, e.g /dev/ttyUSB0. Hit Ctrl-A, then K, then Y to exit screen. Execute sudo apt-get install screen if not installed.
Minicom
Short answer
Run in terminal
sudo minicom -b 115200 -o -D port_name
See below (step 2) to find out port_name, e.g /dev/ttyUSB0. Hit Ctrl-A, then X to exit minicom.
Long answer (UI)
minicom should be properly configured in order to open the connection. The general steps are as follows:
Install minicom with
sudo apt-get install minicom
Connect Rpi3 with your host machine using USB-to-TTL cable and open the terminal. Find the tty connections with
dmesg | grep -e tty
In my case I get
where ttyUSB0 is the board.
Run minicom and select the serial port setup with
sudo minicom -s
You should see
Check (or set) the settings for the tty connection. Make sure that /dev/ttyX corresponds to your connection, the one you get in the step 2 instead of X, and Bps/Par/Bits set as per the documentation.
Similar to
Now hit Exit and, if everything had been properly set up, the connection should be running. If you type the ls command you should see Android Thing's root directory
For exiting minicom hit Ctrl-A, then hit Q, then Yes:
Windows (with PuTTY)
Install PuTTY
Connect the board to machine with USB-to-TTL cable and find out the COM port using Windows Device Manager. You should look for the the one called USB Serial Port (in my case it was COM3).
Run PuTTY and set it up. Use the speed as per the documentation (115200):
Hit Open and type a command in a terminal window popped up.
I'm going to suggest some troubleshooting advice based in my own experience:
Make sure you have the Tx and Rx cables connected correctly because all the other settings won't give you any warning, minicom would connect beautifully to the USB adapter but no info on your screen from your Pi.
I didn't use a USB to TTL like the one you are using, mine has the labels for Tx and Rx inverted on the board. Took me some time and the help of an oscilloscope to figure out what was going on.

printing gatttool notification data in file

I am running sensortag 2650 to read notification from sensor to my computer.I am using gatttool (bluez) to do this.My output gets displayed on the console, while the sensor is on the run. BTW I am using ubuntu 14.0.4.
Now the issue is I am not able to make the output data get written in a file instead of displaying on the console. I tried the normal re-direct >>/> operator but that doesnt work.
I am using the following link, just that I am using Linux on my system instead of Raspberry Pi.
https://github.com/codeplanner/TI-CC2650-1
Any clue would be highly appreciated.
Thanks,
Shankhadeep
Do the following:
sudo gatttool -b XX:XX:XX:XX:XX:XX >> output.txt
Then the terminal won´t show anything. BUT! type connect and press enter.
Now the bluetoothmodule is paired with your device!
Normaly, everytime when you get a notification, this will be write in the output.txt.
I tested it with my bluetooth module HM-10 and a Raspberry Pi and it works!
I know its 6 years too late but:
what worked for me was sudo gatttool -b XX:XX:XX:XX:XX:XX -I >> output.txt
putty_capture
This is not ideal for me because im only interested in the received raw data not the ascii console dump, but it is what OP asked for...
Another option would be to use hcidump with some filters

Can´t upload code to Arduino Uno using stino and Ubuntu 12.04 (Precise Pangolin)

I have installed stino on Sublime Text 2 succesfully, but when I try to upload my code to Arduino Uno, the output is the following:
Uploading /home/lucas/Arduino_Build/programa_teste/programa_teste.hex to Arduino Uno...
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device
[Stino - Error while uploading.]
I have the Arduino IDE installed, and it is working fine, only Sublime Text can´t upload the code.
well, as #Bibhas says, your problem is that /dev/ttyACM0 is having the wrong permissions, and that has nothing to do with Arduino or sublime text. It's the linux kernel who creates character devices per default with no user permissions.
But good thing is that it can be changed!
The fast and easy solution is to add your current user to the dialout group:
sudo adduser YOU dialout
where YOU is your username and then log out and log back in to have those new permissions propagated into your shells.
Hint:
There's a solution that is a bit more complicated, is to create a udev rule such as:
/etc/udev/rules.d/48-arduino.rules
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="arduino_end"
SUBSYSTEM=="tty", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", MODE="660", GROUP="arduino", SYMLINK+="arduino.leonardo"
LABEL="arduino_end"
which creates a /dev/arduino device readable and writable by the arduino group, that you need to create (or you can use the default dialout group which is perfectly fine):
addgroup arduino
adduser YOU arduino
and then reload your rules:
sudo udevadm control --reload-rules
The nice thing about that second hint is that when you unplug replug your arduino, you won't have it change device number oddly, it will be kept to the name. If you're not using an arduino leonardo, you can check your device idvendor/idproduct using lsusb:
% lsusb
… ↓↓↓↓ ↓↓↓↓
Bus 006 Device 105: ID 2341:0036 Arduino SA
…
HTH
Accoding the Troubleshooting doc, I use
sudo usermod -a -G tty yourUserName
sudo usermod -a -G dialout yourUserName
fix my problem.
I have the same problem today, and the incredible happend. The USB cable gave power to the Arduino, but doesn't allow the communication. The solution for us was to change the USB cable, and after that everything worked

Agilent 66332A DC Source RS232 Ubuntu 12.04 SCPI

I have an Agilent 66332A DC Source, and I want to program it so that I can set the current, voltage, and output on/off. I'm using Ubuntu 12.04 64bit so the drivers don't work. I've contacted Agilent support, and they gave me nothing. I know that the DC source uses SCPI. Is there some way that I can talk to the DC source using the terminal and send SCPI commands? I've tried minicom, but I couldn't get it to work. I'm using a RS232 connection.
There might be manual for this DC source so read SCPI commands from there.
I assume that minicom sends line-feed character after each enter you press, but SCPI requires \n for command separator. Hence the Minicom does not work.
However you can just echo commands to serial port from bash command line.
Setup serial port
stty -F /dev/ttyS0 raw speed 9600 -cstopb cs8 -ixon
Echo commands to /dev/ttyS0
echo -en '*RST\n' > /dev/ttyS0
Notice: I'm assuming your device is connected to /dev/ttyS0.

Two instances of BusyBox on separate Serial lines (ttySn)

I am working on an arm board which has two serial ports, accessible through /dev/ttyS0 and /dev/ttyS1.
Busybox runs on /dev/ttyS0.
I am able to write data on /dev/ttyS1 using 'echo' command like so
#echo "microMolvi" > /dev/ttyS1
I was wondering if there is a way to run another instance of busybox(shell) on /dev/ttyS1, so that I may be able to work with two virtual terminals simultaneously.
After some research I found out that the first shell, that runs on ttyS0, was configured to behave so in the /etc/inittab file.
This line in /etc/inittab was responsible for invocation of the default shell at ttyS0:
ttyS0::respawn:/sbin/getty -L ttyS0 38400 vt100 # GENERIC_SERIAL
So, based on my gut feeling, I put a getty on the second serial port by adding the following line in /etc/inittab
ttyS1::respawn:/sbin/getty -L ttyS1 38400 vt100 # GENERIC_SERIAL
It worked like a charm.
Hope this helps someone someday.

Resources