No serial access over USB through Expansion Board

Questions and discussion about The WiPy 1.0 board and CC3200 boards.
Target audience: Users with a WiPy 1.0 or CC3200 board.
Post Reply
User avatar
jeancf
Posts: 8
Joined: Fri Apr 29, 2016 9:05 am

No serial access over USB through Expansion Board

Post by jeancf » Fri Apr 29, 2016 9:14 am

Hi,

I received my new Wipy yesterday. I managed to connect through Wi-Fi (both telnet and ftp work fine). I also managed to connect to UART0 with a USB-to-serial converter attached to pins G1 and G2 on the expansion board.

The thing that refuses to work is serial connection thjrough a USB cable connected to the expansion board. Based on what I read on thr site I have pasted this code into boot.py and rebooted:

from machine import UART
import os
uart = UART(0, baudrate=115200)
os.dupterm(uart)

I then connect to dev/ttyUSB0 on my PC using moserial on linux with the corresponding parameters. I receive no confirmation of connection and no thing at all when I send any command.

What am I missing?

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: No serial access over USB through Expansion Board

Post by platforma » Fri Apr 29, 2016 10:08 am

What are you connection settings in moserial? The snippet otherwise is correct.

User avatar
Frida
Posts: 45
Joined: Sat Jan 30, 2016 2:20 pm
Location: Middelfart, Denmark

Re: No serial access over USB through Expansion Board

Post by Frida » Fri Apr 29, 2016 1:26 pm

I have put the following in my /etc/udev/rules.d folder: wipy.rules

wipy.rules:

Code: Select all

# To go in /etc/udev/rules.d/
# Makes Wipy's serial port accessible to non-SU users
ATTRS{idProduct}=="6015", ATTRS{idVendor}=="0403", MODE="664", GROUP="poul"

Code: Select all

Chance GROUP="to your name"
Restart Linux .
Yes Frida is my watchdog!

User avatar
jeancf
Posts: 8
Joined: Fri Apr 29, 2016 9:05 am

Re: No serial access over USB through Expansion Board

Post by jeancf » Sun May 01, 2016 9:26 am

Frida: thanks. Instead I added myself to the 'dialout' group that has rw control on /dev/ttyUSBx which has the same result without the need to touch udev rules.

Platforma: My moserial settings are:
* Baudrate: 115200
* Data Bits: 8
* Stop Bits: 1
* Parity: None
* Handshake: Hardware and Software
* Access Mode: Read and Write

(Why can't I use BBCode on this forum? I see other people can.)

User avatar
jeancf
Posts: 8
Joined: Fri Apr 29, 2016 9:05 am

Re: No serial access over USB through Expansion Board

Post by jeancf » Sun May 01, 2016 9:43 am

I wrote a test case to check serial communication over USB.

I put this in main (sorry, tabulations get removed but the forum so I used '.' instead):

from machine import UART
import utime
uart = UART(0, baudrate=115200)
while True:
....uart.write('Listening... send me something.\n')
....while uart.any() == 0:
........uart.write('.')
........utime.sleep(2)

....line = uart.readline()
....uart.write("\nYou wrote: " + line.decode())

When I connect to UART0 (pins G1 and G2 of the Expansion Board) using my USB-to-Serial adapter on /dev/ttyUSB1 on my laptop the script behaves as expected: it displays a dot every 2 seconds and echoes everything I send.

However when I connect using the USB cable on /dev/ttyUSB0 on my laptop I see the dot every other second but it never echoes what I send. Besides, when I click 'disconnect' Moserial freezes and I have to KILL it to exit.

Doesn't this suggest that the TX link between the USB interface and the UART0 pin on the Expansion Board is defective?

Post Reply