UART HANG



  • Hello,
    Dear micropythonist,
    I wan't to read continually UART 1 but uart hang
    Try to call idle, sleep
    Using select.poll don't work more.
    Thanks !!

    com = UART(1,pins=("G23","G24"))
    while 1:
    ... print(com.readline())
    ... sleep_ms(500)
    ...
    ...
    ...
    b'RMC,100605.000,A,4935.9761,N,00106.8144,E,1.22,8.53,221016,,,A69\r\n'
    b'$GPVTG,8.53,T,,M,1.22,N,2.26,K,A
    34\r\n'
    b',,3.65,2.04,3.02*0E\r\n'
    b'$GP763,N,00106.8144,E,1,05,2.04,85.7,M,47.1,M,,58\r\n'
    b'$GPGSA,A,3,27,16,10,11,08,,,,,,,,3.65,2.04,3.02
    0E\r\n'
    b'$GPRMC,100606.000,A,4935.9'
    None
    None
    None



  • @jobbyworld said in UART HANG:

    I will test with next firmware.

    Seems fixed in 0.9.3.b1
    Cheers



  • @SmileyChris
    Hi I confirm the hangs, i use UART(1) for dupterm :

    import os
    from machine import UART
    uartTerm = UART(1, baudrate=115200,pins=("G16","G17"))
    os.dupterm(uartTerm)
    

    when i enter some keys on term, this keys are display only when some data are received in UART(0).
    I will test with next firmware.
    Cheers.



  • Hi Daniel -- this looks like the same issue I'm having.

    I was also trying the 'G23', 'G24' pins because I found them in forum here for UART1. Probably this post :P
    I tried your recommended 'G22', 'G17' pins and the issue is still the same (except it doesn't mess with the rgb led any more).

    The "hang" seems to be related with input from UART0. If I send any character over the primary uart (0) channel then the UART1 reads again (until its buffer is full, then it stops again until another character is read)



  • @jobbyworld

    Can you try with G22 and G17? I don't think your hardware is damaged. G3 is connected to VBAT via a resistor divider, so ti should be OK.

    Cheers,
    Daniel



  • @daniel
    First I remove the four jumper of the Expansion Board :
    TX, RTS, RX, CTS
    With UART(0,9600) (P0,P1) the problem is fixed, thanks.
    Thanks for solution.

    But i tried to use other UART port.
    Which pins are safe to use with Expansion Board :
    I've try G3 G4, but my (second) board don't appreciate : i realize probably one of this pins is connected to vbat ?
    Now all my UART(1) seem didn't work.
    Any chance to rescue them ?
    Thanks anyway.
    Cheers



  • @daniel said in UART HANG:

    Yes, it's probably interference caused by the RGB led. We have updated the docs to mentions this:

    https://docs.pycom.io/lopy/lopy/quickref.html

    Pin P2 (G23) is also connected to the LED. Please try to use a different pin and let us know if the results change. Thanks.

    Cheers,
    Daniel

    There are few typos in Warning:

    as this pins are used byt the SPI bus -> as these pins are used by the SPI bus



  • Yes, it's probably interference caused by the RGB led. We have updated the docs to mentions this:

    https://docs.pycom.io/lopy/lopy/quickref.html

    Pin P2 (G23) is also connected to the LED. Please try to use a different pin and let us know if the results change. Thanks.

    Cheers,
    Daniel



  • I have a gps connect to G23 G24 which sends trame every second.

    from machine import UART
    from time import sleep_ms
    com = UART(1, baudrate=9600, bits=8, parity=None, stop=1,pins=("G23","G24"))
    >>> for i in range(10):
    ...     print(com.readline())
    ...     sleep_ms(1000)
    ...     
    ...     
    ... 
    b',,,D*61\r\n'
    b'$GPVTG,239.25,T,,M,0.56,N,1.04,K,D*31\r\n'
    b'64,1.35,0.92*03\r\n'
    b'$GPRMC,230234.000,A,4935.9669,N,00106.8135,E,0.56,239.25,251016,294.47,251016,,,D*61\r\n'
    b'$GPVTG,294.47,T,,M,0.33,N,0.60,K,D*32\r\n'
    b'$GPGGA,230244.000,4935.9230243.000,A,4935.9686,N,00106.8116,E,0.3'
    None
    None
    None
    None
    >>> 
    

    I think my loop block update of incomming data from UART
    Perhaps i missed a function (idle?)
    Or there is some interference between rgbled and uart?
    Cheers.



  • Hello jobbyworld,

    Could you please post the full script that reproduces your problem (using markdown please)? Thanks.

    Cheers,
    Daniel


Log in to reply
 

Pycom on Twitter