stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Serial Communication in RPI3

Fri Jun 14, 2019 11:22 am

Hello people,

I'm quite new into serial communication and I'm integrating a manometer on the RPI3 b+ for my Thesis. The manometer has a USB cable so I'm connecting it into a USB to TTL serial adapter through a female-female usb plug.

The manometer is the PCE-P05: https://www.pce-instruments.com/english ... _61709.htm

The usb to TTL is the PL2303HX: https://topelectronics.gr/electronics/c ... module-el/

PCE provides drivers and software for only older versions of windows, which I can't use and I thought it would be cool to acquire data from it using the Raspberry PI, since I've integrated another sensor on the RPI (BME280 for temperature pressure humidity with I2C) for my Thesis also.

So far my connections are:

- Manometer's usb to female-female usb adapter
- Female Female adapter connected with USB to TTL Serial
- Adapter's RX to RPI's TX
- Adapter's TX to RPI's RX
- Adapter's ground to RPI's ground
- (?) Adapter's +5V to RPI's 5V. (Am I supposed to use the 3.3V instead? Not sure about this but the TTL converter has a pin that is named "3V3")

I've also enabled UART from raspi-config.

I emailed PCE and they sent me the serial protocol with the baudrates, parities, stopbits, etc.

I've tried tutorials on youtube for serial communication, but everything is for RPI - PC connection. I've written some code in Python with the Serial Library with the manometer's baudrate, parity, etc, which seems to run fine, but I don't get any data from it. I suppose I'm thinking too simple, as matching the settings would "get it work" now seems to me pretty stupid.

I also don't get how the serial ports on raspberry pi work. I've read some stuff about it being switched with the bluetooth port which really confused me.

- How would I know my setup is correct and communication is possible over a device that doesn't have a terminal, operating system or whatever?
- How do I use and check the serial ports in raspberry pi 3 and what about them?
- And then how do I acquire data from the manometer?

I'm a physicist and I barely know anything about networks, so if you could explain something to me like I'm a complete idiot, I would appreciate it.

Thanks in advance, and sorry for the long post.
Been scratching my head for quite some time

User avatar
topguy
Posts: 5494
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Serial Communication in RPI3

Fri Jun 14, 2019 3:07 pm

From the manometers webpage.
Also included in the delivery contents are PC-compatible software and a USB cable.
Have you tried to connect this directly to a USB port on the Pi ?

( Because the use of the female-female-usb and usb2serial adapter does not make sense, and can not work. )
Last edited by topguy on Fri Jun 14, 2019 3:20 pm, edited 1 time in total.

User avatar
topguy
Posts: 5494
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Serial Communication in RPI3

Fri Jun 14, 2019 3:19 pm

This is my standard procedure for checking unknown USB device on Pi ( or any other Linux machine )

- Boot the Pi without the device plugged in.
- Open a terminal window or console, or log in with SSH if you have no screen.
- Run the command "lsusb" which lists all usb devices.
- Plug in your device and wait a couple of seconds.
- Run the "lsusb" command again. You should now have a new entry, take note of this entry.
- Then run the "dmesg" command.

dmesg produces a lot of output but the interesting part is at the end. There will be some lines related to how the kernel interprets the device.
If you are really lucky there will be a reference in there for a new serialport device like "ttyUSB0" or "ttyACM0" which means that you can just refer to this name as the serialport in your code.

If you can not see any good references in the output then its good if you post those lines here, maybe together with the output from "lsusb".

drgeoff
Posts: 9260
Joined: Wed Jan 25, 2012 6:39 pm

Re: Serial Communication in RPI3

Fri Jun 14, 2019 4:33 pm

stzanos wrote:
Fri Jun 14, 2019 11:22 am
So far my connections are:

- Manometer's usb to female-female usb adapter
- Female Female adapter connected with USB to TTL Serial
- Adapter's RX to RPI's TX
- Adapter's TX to RPI's RX
- Adapter's ground to RPI's ground
- (?) Adapter's +5V to RPI's 5V. (Am I supposed to use the 3.3V instead? Not sure about this but the TTL converter has a pin that is named "3V3")
Yes you should use the RPi's 3.3 volt not 5 volt. Connecting 5 volt TTL signals to any RPi GPIO pin (including the UART Rx) is an easy way to fatally damage the RPi. The GPIOs are not 5 volts tolerant.

stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Re: Serial Communication in RPI3

Fri Jun 14, 2019 4:37 pm

topguy wrote:
Fri Jun 14, 2019 3:19 pm
This is my standard procedure for checking unknown USB device on Pi ( or any other Linux machine )

- Boot the Pi without the device plugged in.
- Open a terminal window or console, or log in with SSH if you have no screen.
- Run the command "lsusb" which lists all usb devices.
- Plug in your device and wait a couple of seconds.
- Run the "lsusb" command again. You should now have a new entry, take note of this entry.
- Then run the "dmesg" command.
I have tried this, but the weird part is that the PI recognises the usb cable instead of the device itself. I suspect this is because there's no driver for linux? But I have searched the forum previously and people say that you need to use UART to connect some serial device to the PI.

B.Goode
Posts: 7754
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Serial Communication in RPI3

Fri Jun 14, 2019 4:46 pm

Partially quoting your initial query:
I emailed PCE and they sent me the serial protocol with the baudrates, parities, stopbits, etc.

I've tried tutorials on youtube for serial communication, but everything is for RPI - PC connection. I've written some code in Python with the Serial Library with the manometer's baudrate, parity, etc, which seems to run fine, but I don't get any data from it. I suppose I'm thinking too simple, as matching the settings would "get it work" now seems to me pretty stupid.

I also don't get how the serial ports on raspberry pi work. I've read some stuff about it being switched with the bluetooth port which really confused me.

- How would I know my setup is correct and communication is possible over a device that doesn't have a terminal, operating system or whatever?
- How do I use and check the serial ports in raspberry pi 3 and what about them?
- And then how do I acquire data from the manometer?

I'm a physicist and I barely know anything about networks, so if you could explain something to me like I'm a complete idiot, I would appreciate it.

I agree with what @topguy has said about this possibly being a usb-serial device already, and the potential incompatible adapter. He has documented some troubleshooting for the usb aspects of your problem.



Turning to the serial communication side. You don't need to know anything about networking - this is a simple direct connection between two devices. And you can make progress, just as in your field of Physics, by reducing everything to the basics and introducing change in small controlled steps.

The Raspberry Pi Foundation documentation for the built-in serial ports is here: https://www.raspberrypi.org/documentati ... on/uart.md
It isn't simple, but it is comprehensive.

If your usb device creates a virtual serial port (ref: @topguy) you may not need this information.

If you ever do need to check serial communication on the RPi board itself, start with a data loopback test. With the RPi board turned off, put a simple f-f jumper cable between physical pins #8 and #10 on the 40-way header. Those are the transmit and receive data lines for the built-in serial port. Then run any simple serial port test program - there is one provided with every standard installation of Python, as on Raspbian. https://pyserial.readthedocs.io/en/late ... intro.html

Check that in that simplest case the data you type at the keyboard is echoed back to you. That gives you a confidence test that the RPi serial port itself is working. Then you incrementally add elements to the external connection and retest as you go.

But, to repeat, this is almost certainly not applicable to the usb-connected device in this case.

stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Re: Serial Communication in RPI3

Fri Jun 14, 2019 5:48 pm

B.Goode wrote:
Fri Jun 14, 2019 4:46 pm
I agree with what @topguy has said about this possibly being a usb-serial device already, and the potential incompatible adapter. He has documented some troubleshooting for the usb aspects of your problem.
So since I dont need the usb to TTL adapter, I just have to plug it in like a keyboard or a mouse and try to setup something like a driver?
B.Goode wrote:
Fri Jun 14, 2019 4:46 pm
Check that in that simplest case the data you type at the keyboard is echoed back to you. That gives you a confidence test that the RPi serial port itself is working. Then you incrementally add elements to the external connection and retest as you go.


I will try this on Monday as the RPI is at my office.
B.Goode wrote:
Fri Jun 14, 2019 4:46 pm
But, to repeat, this is almost certainly not applicable to the usb-connected device in this case.
You mean the usb to TTL setup? Or the echo?

stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Re: Serial Communication in RPI3

Fri Jun 14, 2019 5:50 pm

drgeoff wrote:
Fri Jun 14, 2019 4:33 pm
Yes you should use the RPi's 3.3 volt not 5 volt. Connecting 5 volt TTL signals to any RPi GPIO pin (including the UART Rx) is an easy way to fatally damage the RPi. The GPIOs are not 5 volts tolerant.
I had the 5V GPIO pin of the RPI connected to the adapter's 5V, not to a TTL signal. But now I shut it down remotely to avoid damage and I will switch to 3.3V if I stick to this plan.

Thanks!

stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Re: Serial Communication in RPI3

Fri Jun 14, 2019 5:57 pm

topguy wrote:
Fri Jun 14, 2019 3:07 pm
From the manometers webpage.
Also included in the delivery contents are PC-compatible software and a USB cable.
Have you tried to connect this directly to a USB port on the Pi ?
Yes, as I mentioned above, this is only for older versions of windows. Vista and earlier versions to be specific to which I don't have access to. However I did connect it and used lsusb which only recognised the generic usb cable product
topguy wrote:
Fri Jun 14, 2019 3:07 pm
( Because the use of the female-female-usb and usb2serial adapter does not make sense, and can not work. )
I trust you but I really dont understand why :lol: . In my head it's quite simple:
Signal moves through USB -> Through female female reaches the TTL adapter -> Through the adapter and the pins reaches the serial port

drgeoff
Posts: 9260
Joined: Wed Jan 25, 2012 6:39 pm

Re: Serial Communication in RPI3

Fri Jun 14, 2019 7:11 pm

stzanos wrote:
Fri Jun 14, 2019 5:50 pm
drgeoff wrote:
Fri Jun 14, 2019 4:33 pm
Yes you should use the RPi's 3.3 volt not 5 volt. Connecting 5 volt TTL signals to any RPi GPIO pin (including the UART Rx) is an easy way to fatally damage the RPi. The GPIOs are not 5 volts tolerant.
I had the 5V GPIO pin of the RPI connected to the adapter's 5V, not to a TTL signal. But now I shut it down remotely to avoid damage and I will switch to 3.3V if I stick to this plan.

Thanks!
You missed the point.

If you power the adapter from 5 volts it will give 5 volt TTL logic levels from its Tx pin. You have connected that pin to the Rx GPIO of the RPi. That may already have damaged that GPIO and it is usual for such damage to sooner or later spread within the chip and render the complete RPi non-functional,

User avatar
topguy
Posts: 5494
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Serial Communication in RPI3

Sat Jun 15, 2019 1:12 am

stzanos wrote:
Fri Jun 14, 2019 4:37 pm
I have tried this, but the weird part is that the PI recognises the usb cable instead of the device itself.
Then its obviously not JUST a cable, I still suggest posting the results from my procedure, because without that we are just throwing darts in the dark here.

Also what does the end of the cable that connects to the device actually look like ?
- https://en.wikipedia.org/wiki/Registered_jack
- https://en.wikipedia.org/wiki/D-subminiature
- one of these https://en.wikipedia.org/wiki/USB_hardw ... ectors.svg
- .. or something else.
But I have searched the forum previously and people say that you need to use UART to connect some serial device to the PI.
Not if there already is a serial2usb involved in the device or in the cable. Its a lot easier to deal with since you dont usually care about that 3.3V vs 5V bovine-excrement.

stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Re: Serial Communication in RPI3

Wed Jun 19, 2019 11:39 am

Hi guys again,

I have read your comments over and over again and now Im starting to get a grasp of things and I really thank you for it.

So:
- Using the TTL adapter doesnt make sense since the USB cable already makes the signal serial. @topguy @B.Goode
- Giving the adapter 5V Voltage was a silly move and to be honest I had no idea how critical that would be. @drgeoff
Luckily, I havent sent or received any data through code from the RX, TX GPIOs so I guess fortunately it didn't cause any damage. My other sensor also works just fine, just like the rest of the RPI so I guess Im lucky here.

Following @topguy 's procedure:

Code: Select all

[email protected]:~ $ lsusb
Bus 001 Device 004: ID 0424:7800 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
and after plugging the manometer:

Code: Select all

[email protected]:~ $ lsusb
Bus 001 Device 006: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Bus 001 Device 004: ID 0424:7800 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
So I suspect my device is the number 6, UART Bridge. Which as I told you is the cable itself, which is connected to the manometer

running dmesg gives alot of output, but I suspect this is the line of interest:

Code: Select all

[  102.552125] usb 1-1.2: new full-speed USB device number 6 using dwc_otg
[  102.698708] usb 1-1.2: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
[  102.698726] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  102.698736] usb 1-1.2: Product: CP2102 USB to UART Bridge Controller
[  102.698745] usb 1-1.2: Manufacturer: Silicon Labs
[  102.698754] usb 1-1.2: SerialNumber: 0001
[  102.755782] usbcore: registered new interface driver usbserial_generic
[  102.755853] usbserial: USB Serial support registered for generic
[  102.761204] usbcore: registered new interface driver cp210x
[  102.761286] usbserial: USB Serial support registered for cp210x
[  102.761463] cp210x 1-1.2:1.0: cp210x converter detected
[  102.765248] usb 1-1.2: cp210x converter now attached to ttyUSB0
So from the last line, device 6 (the cable) is right now assigned to the port ttyUSB0. In that case, I can now freely run scripts in python with the PySerial Library using the ttyUSB0 port, sending and receiving data through the cable and eventually with the manometer?

Is there any other step you would suggest me complete? Something else I should note from the dmesg?

And again, thanks alot for your time and patience

B.Goode
Posts: 7754
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Serial Communication in RPI3

Wed Jun 19, 2019 11:48 am

So from the last line, device 6 (the cable) is right now assigned to the port ttyUSB0. In that case, I can now freely run scripts in python with the PySerial Library using the ttyUSB0 port, sending and receiving data through the cable and eventually with the manometer?


That is what I would expect. So Yes, try reading/writing /dev/ttyUSB0.

stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Re: Serial Communication in RPI3

Wed Jun 19, 2019 1:48 pm

B.Goode wrote:
Wed Jun 19, 2019 11:48 am
That is what I would expect. So Yes, try reading/writing /dev/ttyUSB0.
The instrument's protocol says:
Communication Protocol
9600 bit, no stop bit,8 bit transmitting, without parity check
So my code so far is this:

Code: Select all

import time
import serial

print("Program start...")

port = serial.Serial(port = '/dev/ttyUSB0', 
                baudrate = 9600,
                parity = serial.PARITY_NONE,
                bytesize = serial.EIGHTBITS,
                writeTimeout = 0)

if(port.isOpen() == True):
        print("Serial Port opened.")
else:
        print("Serial Port has not opened.")

Code: Select all

[email protected]:~ $ python3 serial_test.py
Program start...
Serial Port opened.
So the port seems to be opened.

To get a grasp of what Im doing and start reading data, Im doing a bit of trial and error. The protocol says:
Data Transmitting Protocol

The first & second byte fixed at 0xaa 0x56, which is data identification code.
The unit for the third, fourth, fifth byte is hex, which is for data unit, sign bit and low voltage bit.
Following five digits transmit ASCII code with five byte.
Check code is the hex which is gotten from unit, sign bit, low voltage. The data is from byte and
hex.
Also, in the end of the PDF they have a table of the command words, their transmitting ID and their function:
The communication protocol from SCM to PC
The command style of PC:
So I have the manometer off and Im trying to turn it on with code so Im sure ive enstablished communication. What im doing is:

Code: Select all

port.write([0x55, 0xaa, 0x04])
0x04 is the command word for Turn On, but it doesnt seem to work. The manometer's screen is still off. Could it be "on" just not displaying anything?

User avatar
topguy
Posts: 5494
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Serial Communication in RPI3

Wed Jun 19, 2019 3:31 pm

Can I suggest that you start a little simpler if possible, by just trying to read all the bytes that the device sends.

I guess you can turn the meter on manually with a physical button ?
Do the manual specify if the meter will automatically start sending data when turned on or when manually entering some measuring "mode".
( I dont event know how to operate such a device or even what it measures, but it should not be important )

So if you just add a loop to your code that reads 1 byte from the port and then print that value, and then repeat doing that for 100 iteration or until you break the program.

B.Goode
Posts: 7754
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Serial Communication in RPI3

Wed Jun 19, 2019 4:11 pm

To get a grasp of what Im doing and start reading data, Im doing a bit of trial and error. The protocol says:
Data Transmitting Protocol

The first & second byte fixed at 0xaa 0x56, which is data identification code.
The unit for the third, fourth, fifth byte is hex, which is for data unit, sign bit and low voltage bit.
Following five digits transmit ASCII code with five byte.
Check code is the hex which is gotten from unit, sign bit, low voltage. The data is from byte and
hex.


It looks as though trial and error is your only recourse.

I've done more than my share of fiddling with serial protocols, and to be frank the document you quote doesn't make any sense to me. I suspect the 'truth' behind it might become clearer if you manage to crack the protocol despite its hindrance.

But unless it was a typo in your reply there are errors in the command bytes you are using to turn the device on: wrong order, and a fixed byte is incorrect.


Incidentally, I find it odd that a supplier would sell a device for which the only software support is for a long-obsoleted Operating System.


Good luck...

stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Re: Serial Communication in RPI3

Wed Jun 19, 2019 7:54 pm

topguy wrote:
Wed Jun 19, 2019 3:31 pm
I guess you can turn the meter on manually with a physical button ?
Do the manual specify if the meter will automatically start sending data when turned on or when manually entering some measuring "mode".
( I dont event know how to operate such a device or even what it measures, but it should not be important )
Yes, there is a physical button. Basically, the device is a differential manometer, it measures pressure very precisely. It has two probes, one that is exposed to the environment and another one that calculates changes with point of reference the measuring from the other.
So, when you turn it on, you calibrate it and then it keeps measuring changes forever, showing it on screen.

That being the case, I would suspect it produces data all the time.
topguy wrote:
Wed Jun 19, 2019 3:31 pm
So if you just add a loop to your code that reads 1 byte from the port and then print that value, and then repeat doing that for 100 iteration or until you break the program.
Reading from the port:

Code: Select all

data = port.read(1)
print(data)
produces this:

Code: Select all

[email protected]:~ $ python3 serial_test.py
Program start...
Serial Port opened.
b''
Which from what I've searched up online is an empty bit stream? or something

I'm really confused here. The protocol has also some command words, which I suspect I must first send to start receiving data, but I have already tried it. I dont know if its ok to upload pictures of the protocol, but at this point I dont really care, I've bought the product so here goes:
Page 1: http://prntscr.com/o41stq
Page 2: http://prntscr.com/o41t0u
Page 3: http://prntscr.com/o41u64

Does this make any sense to you guys? Am I missing something important? I've tried sending the command word 1 first, and then 4. And then read. And backwards. And whatever.

Is it even possible to just plug the usb of a non known device in RPI and then just start draining data from it?
At this point this sounds to me as the coolest thing ever

Could it even be that I have damaged the RPI as @drgeoff have said earlier?
Last edited by stzanos on Wed Jun 19, 2019 8:07 pm, edited 1 time in total.

B.Goode
Posts: 7754
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Serial Communication in RPI3

Wed Jun 19, 2019 8:06 pm

Is it even possible to just plug the usb of a non known device in RPI and then just start draining data from it?
At this point this sounds to me as the coolest thing ever

Yes, it is possible. But only if the connected device works in that way.

Most GPS receivers that I have encountered simply spit out a continuous stream of data that can be interpreted to extract the location information encoded in it.

But some other devices work on a Command and Response basis, where the device only sends data in response to a deliberate query being received.

I think you are hampered by having documentation that seems to have been prepared by someone without a sound grasp of the English language.

stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Re: Serial Communication in RPI3

Wed Jun 19, 2019 8:09 pm

B.Goode wrote:
Wed Jun 19, 2019 8:06 pm
I think you are hampered by having documentation that seems to have been prepared by someone without a sound grasp of the English language.
I take it that the protocol doesn't make any sense at all :lol:

B.Goode
Posts: 7754
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Serial Communication in RPI3

Wed Jun 19, 2019 8:28 pm

I haven't looked at the software download on the vendor website.

Is use of Microsoft Windows Vista mandatory, or is that a minimum requirement?

Do you have any kind of Microsoft Windows workstation you could try the software on?

Not an admission of defeat, but it would confirm that the device and cable actually work.

And it might be possible to 'snoop' on the data in transit to see how the communication protocol works in practice.



Edit: (Re-read thread, and realised my questions were already answered. So not a possible way to get purchase on the issue.)

Some not fully exhaustive Googling suggests that you might be breaking new ground interfacing this device.
Last edited by B.Goode on Wed Jun 19, 2019 8:36 pm, edited 1 time in total.

B.Goode
Posts: 7754
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Serial Communication in RPI3

Wed Jun 19, 2019 8:30 pm

stzanos wrote:
Wed Jun 19, 2019 8:09 pm
B.Goode wrote:
Wed Jun 19, 2019 8:06 pm
I think you are hampered by having documentation that seems to have been prepared by someone without a sound grasp of the English language.
I take it that the protocol doesn't make any sense at all :lol:
I'd be a little more guarded and say that the lack of detail and examples makes it difficult to interpret..

Andyroo
Posts: 2964
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Serial Communication in RPI3

Wed Jun 19, 2019 8:33 pm

I would not try printing the characters to start with -but try to print the value of anything received

A read through seems to say you need to turn the serial port on - is there a config menu on the unit that you can do that with? Failing that try sending 0x55 0xaa 0x01 but the notes for the check digit above is a waste of ink!

You could try adding the bytes together and taking the least significant byte (lsb) - other methods exist but this is a common check digit calculation:

0x55 + 0xaa + 0x01 = 0x100 -> lsb = 0x00
Need Pi spray - these things are breeding in my house...

Andyroo
Posts: 2964
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Serial Communication in RPI3

Wed Jun 19, 2019 8:40 pm

Sorry - just noticed:

Add

Code: Select all

stopbits=0, xonxoff=0, rtscts=0
to your open statement to make sure the number of stop bits and flow controls match the device - not sure if these are the default/standard values or not so its best to play safe...
Need Pi spray - these things are breeding in my house...

stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Re: Serial Communication in RPI3

Wed Jun 19, 2019 9:11 pm

Andyroo wrote:
Wed Jun 19, 2019 8:40 pm
Sorry - just noticed:

Add

Code: Select all

stopbits=0, xonxoff=0, rtscts=0
to your open statement to make sure the number of stop bits and flow controls match the device - not sure if these are the default/standard values or not so its best to play safe...
stopbits = 0 gives me that it is not a valid stopbit size. As it is pointed out by the PySerial Library also, the only valid entries are STOPBITS_ONE, STOPBITS_ONE_POINT_FIVE, STOPBITS_TWO

Ive tried putting xonxoff and rtscts on false in the past, didnt give me some clarity :(

stzanos
Posts: 21
Joined: Mon Nov 26, 2018 11:37 am

Re: Serial Communication in RPI3

Wed Jun 19, 2019 9:15 pm

B.Goode wrote:
Wed Jun 19, 2019 8:28 pm

Not an admission of defeat, but it would confirm that the device and cable actually work.

And it might be possible to 'snoop' on the data in transit to see how the communication protocol works in practice.
I have tried it on my Windows 10 laptop, installed their software and KINDA connected to the device but I guess since the driver is super old and for another version of windows, it doesnt work on windows 10. I'm not 100% sure but I'd say the device works fine. However, about the data spitting ...
B.Goode wrote:
Wed Jun 19, 2019 8:28 pm
Some not fully exhaustive Googling suggests that you might be breaking new ground interfacing this device.
This put a smile on my face

Return to “Beginners”