Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using uart1 or uart2 does not work #26

Closed
JanHouwers opened this issue May 1, 2017 · 2 comments
Closed

Using uart1 or uart2 does not work #26

JanHouwers opened this issue May 1, 2017 · 2 comments
Assignees
Labels

Comments

@JanHouwers
Copy link

Hello,
I am trying to read serial data from a PMS1003 dust sensor. The dust sensor works correct and i receive valid data when using a 3.3v serial to USB convertor. The sensor sends every 2 seconds a 32 byte string.
When connecting the sensor to port 9 and 10 (uart1) no valid data is returned to the LUA program.
When connecting a 3.3v serial to USB converter instead of the sensor only the first byte is returned until the queue is empty.

Also when using:

print (uart.read(uart.UART1, "*l", 1000))
you get:
stdin:1: bad argument #3 to 'read' (boolean expected, got number)
stack traceback:
[C]: in field 'read'
stdin:1: in main chunk
[C]: in ?
It does not matter if anything is received first. Also when using:
print (uart.read(uart.UART1, "*c", 1000))

Nothing valid returns..

Regards, Jan

@jolivepetrus jolivepetrus self-assigned this May 2, 2017
@jolivepetrus
Copy link
Contributor

@JanHouwers, thanks for report this.

I think that problem is caused by UART pin maps. We have done some UART driver refactory that allows to customize the UART pin maps.

Pin maps for WHITECAT N1, ESP32 THING, and ESP32 CORE, boards have been updated:

WHITECAT N1:

RX0: GPIO3
TX0: GPIO1
RX1: GPIO26
TX1: GPIO25
RX2: GPIO2
TX2: GPIO15

ESP32 THING:

RX0: GPIO3
TX0: GPIO1
RX1: GPIO12
TX1: GPIO13
RX2: GPIO16
TX2: GPIO17

CORE BOARD:

RX0: GPIO3
TX0: GPIO1
RX1: GPIO12
TX1: GPIO13
RX2: GPIO2
TX2: GPIO17

Please, try again with this commit: da240ae.

@JanHouwers
Copy link
Author

Hello,

Just tested with the Whitecatboard and i can read the data from the PMS1003 sensor in a reliable manner..

Regards, Jan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants