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

Raspberry Pico #1

Closed
varna9000 opened this issue Mar 11, 2021 · 7 comments
Closed

Raspberry Pico #1

varna9000 opened this issue Mar 11, 2021 · 7 comments

Comments

@varna9000
Copy link

Hi, first of all thanks for the great library! I successfully used it with esp32. I'm now trying to get it working on Raspberry Pico.
I've hardcoded the UART config in the start() function, since micropython Pico port doesn't have uart.init() built in. Therefore I initialise itt like this:

self.serdev=UART(1, 9600,tx=Pin(8),rx=Pin(9)) 

However the start function is stuck on sending the config bytes:

UART(1, baudrate=9600, bits=8, parity=None, stop=1, tx=8, rx=9)
1 1 1
[192, 0, 2, 26, 2, 68]

In the above debug message, I'm printing the uart instance and the values of the three pins: m0,m1 and aux - in this case they are struck on high.

Do you know where the problem could be? Module works ok and emits the signal, if I write a string to it directly like this:

uart.write('test')
@varna9000
Copy link
Author

Ok, found the problem. You are currently waiting fixed 50 milliseconds after writing a command to the module UART. if you remove the sleep and wrap the data wait in if self.serdev.any(): it works.

@nicklf3nick
Copy link

Does this lib be used on raspberry pi rather than ESP32?

@effevee
Copy link
Owner

effevee commented Jul 14, 2021 via email

@nicklf3nick
Copy link

It was developed for ESP32, but can be adapted for any microcontroller
supported by MicroPython which can do simple UART

Op wo 14 jul. 2021 om 09:53 schreef nicklf3nick @.***>:

Does this lib be used on raspberry pi rather than ESP32?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1 (comment), or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AN3LGQKMOMFNLZXFWOBZYVTTXU66DANCNFSM4ZAZZWBA
.

--
Bezoek Effevee's reisblog op www.effevee.be

Thanks for your reply!!

But i have a problem that RPi may not support the lib "machine", are there any solutions for it?

@effevee
Copy link
Owner

effevee commented Jul 14, 2021 via email

@varna9000
Copy link
Author

varna9000 commented Jul 15, 2021

A while ago I modified it to work with Raspberry Pi, but I don't have it on GitHub. Basically you have to change how UART works i.e. replace machine.UART with pyserial module which enables Serial for Rasperry Pi.

@nicklf3nick
Copy link

A while ago I modified it to work with Raspberry Pi, but I don't have it on GitHub. Basically you have to change how UART works i.e. replace machine.UART with pyserial module which enables Serial for Rasperry Pi.

Thanks for your reply:)

I tried it. Because i am unfamiliar with pyserial module and UART module, so there still some error occurred.

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

No branches or pull requests

3 participants