USB bluetooth dongle with PuTTY - bluetooth

I have a USB Bluetooth dongle that I am trying to use in order to extract information from an ELM327 OBD-II interface.
I am trying to communicate with the ELM327 through PuTTY. According to the ELM327 documentation, I need to use baud rate 38,400 if the PP 0C pin hasn't been changed or 9,600 if pin 6 = 0 V.
I tried setting PuTTY according to the Device Manager details with:
Baud rate 9,600 or 38,400
8 data bits
No parity
1 stop bits
No flow control
When I open PuTTY, the window is blank, and I cannot send commands to the device.
What could be the issue here?

Your problem might be with PuTTY and Windows 10. Neither PuTTY nor Hyperterminal allowed me to connect to my ELM327 on Windows 10 (I am using the USB connection for talking to ELM327). It might be some kind of problem of these software on the latest version on Windows.
Looking for a similar software that works well on Windows 10 I found RealTerm. You can download it from this link. A brief tutorial about how to use RealTerm is available here (pay attention to the procedure to open a serial port by clicking twice on the button "open", an how to send commands from the send tab).
After downloading it, just configure your serial connection with the values you were using:
Baud rate 38,400 (or 9,600)
8 data bits
No parity
1 stop bits
No flow control
Also, do not forget to add a CR (carriage return) at the end of the commands you send to the ELM327, if you forget it, the ELM327 will ignore the commands. You can do it by clicking on the EOL options shown in the figure below.
This solved my problem and now I am able to talk to the ELM327 and receive its answers, e.g. the commands atz returns the ELM327 version. The OBD2 command 0100 returns the PIDs available on a car's ECU. I don't know why but the CR is shown on the RealTerm display and hides some characters (as it happens with the 'a' of the "atz" command in the figure).
I hope this helps you.

Related

Is there a reliable way to reconnect a paired ZAGG - Logitech Bluetooth Keyboard upon power-up?

I have a bluetooth keyboard that I use on a regular basis. It has a Logitech logo, but is manufactured by ZAGG and has model number Y-R0023.
I have paired the keyboard with my Ubuntu desktop and it works great.
Upon powering up my computer and keyboard, I can sometimes reconnect without having to pair again, but other times I have to remove the existing pairing and reconnect before Ubuntu can receive keystrokes.
Extra information: Ubuntu displays a bluetooth symbol as a status when it connects (regardless if it is able to receive keystrokes or not). This symbol will appear and disappear roughly every 10 seconds until the two devices are able to successfully negotiate a valid connection.
I notice that I have best success when I press 'delete-delete-enter-enter' after powering the ZAGG keyboard up. (Sometimes, just repeatedly pressing a key every second or so seems to work too.)
I am wondering if the "delete-delete-enter" keystroke combination (or some other that I haven't discovered) is recognized by the Logitech BIOS as a special sequence to help retry a paired re-connection. I'd be interested in finding out if this trick works for devices other than those made by ZAGG. Otherwise, it would help just to know if there is a reliable script I can run that calls bluetoothctl to help improve the re-connection. (I want to avoid having to enter a pairing code on subsequent connections).
ZAGG sites and Logitech ones don't say anything about this key combination. So I don't think it's recognized as a special sequence, only advice they give is to re-pair the device when it's not working.
In summary I'm sure they would include this troubleshooting option in manual and/or troubleshooting guide if it was present.

Sending files over Half-duplex interface

I'm trying to send files over a half-duplex interface (RS-485) between a box PC running debian (4.19) and a SBC with an im6xDL.
Thanks to this community I can successfully transfer simple data between the units using picocom or by echoing/reading.
The box PC supports half-duplex RS-485 natively and has automatic RTS functions so that you can read/send data without any issue. The SBC on the other hand needs to be toggled to change into RX or TX mode.
This turned out to be a problem when I tried to send files from the box PC to the SBC.
On the box PC:
picocom /dev/ttyUSB0 -b 9600 -fn
C-a,C-S
***file: /home/user/test.txt
Transfer incomplete
*** exit status: 128
On the SBC
picocom /dev/ttymxc2 -b 9600 -fn -et
C-a,C-r
Terminal ready
�000000
As you can see something is terribly wrong, it is like it cannot interpret the bits when a file is being transferred.
My questions:
Is it possible to send files from the command line in half-duplex systems? (The SBC needs to be in RX mode the entire time).
Is there another way to achieve this that is more intuitive?
As always, thanks for the help and support :)
/W
See here:
Pymodbus - Read input register of Energy meter over rs485 on uart of raspberry pi3
The solution I presented there using pylibmodbus should work for any hardware with UART and one or two GPIO lines accessible from user space in Linux.
If, on the other hand, what you want to do is use something like picocom or minicom then you can take a look at the hardware-only solution using a 555 timer.
Of course, if prototyping circuits is not for you, you can always buy a USB to RS485 with half-duplex support. You have many available but those based on the MAX13487 IC seem to work very well.
EDIT: The solution using the 555 timer is not in the post I linked above but here together with some more background material on half-duplex RS485 links: RS485: Inappropriate ioctl for device

testing serial connections using screen

I have two usb to serial cables collected to a null modem and then the two usb connections connected two seperate usb ports on my linux machine
I want to write a program that allows them to communicate back and forth through a terminal, and wanted to test the two ports using screen
I type screen ttyUSB0 115200 but it just comes up with a blank terminal with no text, i realize i am supposed to use commands but I cant find a guide anywhere on how to use this to test to make sure the serial ports are sending/receiving data among other things, could someone point me in the right direction?
I have two usb to serial cables ...
Those are not just "cables", but rather adapters.
Besides the copper wire, there is an IC with a microprocessor, RAM, and ROM inside that dongle. Your PC will recognize each USB-to-serial adapter as a (USB-based) serial port.
IOW you have two serial ports.
Therefore you need two (not just one) instances of a terminal emulator program (e.g. screen), one for each serial port.
Unless you have both terminals perfectly configured, you may have confusing issues such as no echo (what you type shows up in the other terminal, but is not displayed in the terminal where you're typing), and the Enter key only responds as a new line with vertical movement of the cursor and no horizontal movement.
I want to write a program that allows them to communicate back and forth ...
That's possible so long as you open() both serial terminal devices.

USB-Serial communication giving strange output

I'm trying to get data from a mercury analyzer (Seefelder-Messtechnik Hg Analyzer 3000) that gives output to a 9-pin R232 serial port to my OSX 10.10 laptop.
I've followed the steps described here to install the PL-2303 driver:
http://pbxbook.com/other/mac-tty.html
The device manual (http://www.seefelder-messtechnik.com/V71-3-02-21e.pdf) lists the communication protocol as "9600 Baud, 8 data bit, 1 stop bit, no log,
no parities".
I attempt to read from the device by using the 'screen' command:
screen /dev/tty.usbserial 9600
The result is a string of seemingly non-sensical characters that print to the screen in a regular interval:
�8b4����b��8b48bs��8G�8b�8���8������8����< 8�8��b��KW��\b����8b����b� �b�b����KW�K �8b��\G�� �<���8�8b�"��΁�[؁��؉���bG�3�ˁ�G��\K��[W�pb�8��΁8ʱ�\pa���ʁ�c t��8�h¡�38b�8�q�؁����\�8���bS�8b8�8�q���X��8��<��£8���2�8�����ؖ�ؖ�ؖ�8bS��\�܉�ؖ����[S�8��s���fq�8�����������8fq����������S�܊��b���b�؉����\���S��K���ݎ����S��b��b��S����S�\������KS��S�؊��\S�1S�\b�S�؉�\�ذ����KS�\����S����bS�؉�����1S�؊��[؂����ز������؉\�؂��ز��\����i���$\�$���\��8���$��\�\����܂�زXk�B��7��\k�\X�<��8Xkz��Yj��L�������H�\���]j�،k:��Yj�؈��
I've also tried using 'minicom' rather than screen, and get a different ("?]???ܰ??Yk??2"), but also non-sensical result. I saw that there was another SO query similar to mine that remains unsolved: weird characters displayed during serial communication OSX
Any tips? It looks to me that I'm not interpreting the output correctly, but I don't know what to try next.
The solution was to read from the machine at a higher baud rate (~57600), despite what the manual and online reference said. Reading at 57600 baud made the result plain-text and usable. Thanks for your ideas!
I've followed the steps described here to install the PL-2303 driver
I've also had occasional electrical ground problems with Prolific USB-RS232 adapters. Problem would manifest as garbled data that looked similar to a baud rate issue or what you posted.
You can check if it's a ground issue by measuring for continuity between the ground pin (pin #5) on the DE-9 (aka DB-9) side of the Prolific adapter and the ground pin of the USB side (pin #4, "far left", of the A connector). You'll probably measure infinite resistance with a multimeter. Try the same with a FTDI USB-RS232 adapter, and instead I get a dead short between the ground pins as expected.
Be sure to plug the instrument's and PC's power supplies into the same power strip.
As a last resort try grounding the instrument's chassis/case with the PC using copper wire

Use serial-console as display, but computer keyboard for standard-input

I have a 40x7 VFD that functions as a serial terminal. It has a dedicated keypad that provides hex-entry, however, I would like to use a keyboard for the standard input. Basically, I want to be able to use the VFD as a display for a Linux bash prompt, but use the keyboard connected to the computer as the means of input. Instead of connecting a monitor, the serial terminal will be the monitor. I can get the login prompt displayed on the VFD with agetty, but since it only has hex-entry, how can I change where the system is looking for standard input?
Thanks,
Core_Module
I think the best method would be to create a pseudo terminal. In doing so you create a fake terminal device with a /dev/pts/[n] name that acts like a real input/output device. A program could connect the console (keyboard) as input and the VFD as output and send and receive that data over the pseudo device. You can then point agetty at the /dev/pts/[0] device instead of a /dev/ttyS[n] device. Some ideas on doing this can be found in many tutorials online. From the link:
A pseudo-terminal is a pair of character mode devices also called pty. One is master and the other is slave and they are connected with a bidirectional channel. Any data written on the slave side is forwarded to the output of the master side. Conversely, any data written on the master side is forwarded to the output of the slave.
I found another StackOverflow question that may also be of assistance. See this link. It could be adapted to suit your needs.

Resources