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?
No serial access over USB through Expansion Board
Re: No serial access over USB through Expansion Board
What are you connection settings in moserial? The snippet otherwise is correct.
Re: No serial access over USB through Expansion Board
I have put the following in my /etc/udev/rules.d folder: wipy.rules
wipy.rules:
Restart Linux .
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"
Yes Frida is my watchdog!
Re: No serial access over USB through Expansion Board
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.)
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.)
Re: No serial access over USB through Expansion Board
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?
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?