Search found 145 matches

by liudr
Tue Aug 14, 2018 7:45 pm
Forum: General Discussion and Questions
Topic: [SOLVED] UART.readline() not using timeout
Replies: 8
Views: 1138

Re: UART.readline() not using timeout

Loboris, Thanks for your quick response! The wiki indicates that the function will wait until timeout but my experience has been "it doesn't". The real reason was that timeout was in milliseconds in MicroPython but in seconds in PC pyserial. Neither explicitly mentions on the constructor what time u...
by liudr
Tue Aug 14, 2018 5:59 pm
Forum: General Discussion and Questions
Topic: [SOLVED] UART.readline() not using timeout
Replies: 8
Views: 1138

[SOLVED] UART.readline() not using timeout

[EDIT] timeout in MicroPython machine.UART is in milliseconds instead of seconds in PC Python pyserial module. I did some tests and realized that UART.readline() doesn't timeout. Instead, it immediately returns an empty byte string. I am puzzled at why we can specify timeout if this call doesn't uti...
by liudr
Tue Aug 14, 2018 5:29 pm
Forum: General Discussion and Questions
Topic: RPi and micropython
Replies: 6
Views: 871

Re: RPi and micropython

Post links to those resources you're using. That might help those that want to help you to get started.
by liudr
Tue Aug 14, 2018 1:03 am
Forum: General Discussion and Questions
Topic: Exception FileNotFoundError is not defined
Replies: 2
Views: 707

Re: Exception FileNotFoundError is not defined

Thanks. It works on both MicroPython and PC Python.
by liudr
Thu Aug 09, 2018 8:54 pm
Forum: General Discussion and Questions
Topic: Exception FileNotFoundError is not defined
Replies: 2
Views: 707

Exception FileNotFoundError is not defined

Here is my script's snippet: def load_paras(): # Load operating parameters from default dictionary. # The function returns a dictionary, which has keys for all parameters needed in the program. # Any err loading parameters will result in default parameters and False. try: f = open(config_file_name, ...
by liudr
Thu Aug 09, 2018 7:35 pm
Forum: General Discussion and Questions
Topic: uos vs os
Replies: 2
Views: 553

uos vs os

I am still uncertain after reading official doc on the uos vs os (or u-anything vs anything). Can someone give me a quick explanation? http://docs.micropython.org/en/latest/esp8266/library/index.html Anyway, trying to use uos instead of os in my MicroPython code but I still want to share as much cod...
by liudr
Thu Aug 09, 2018 4:25 am
Forum: General Discussion and Questions
Topic: How exactly does import work (like #include??)
Replies: 2
Views: 525

Re: How exactly does import work (like #include??)

I'm learning Python myself, with a C background. I would recommend you to do a skeletal module and main.py to investigate and learn. From what I read on a python book, import executes all code in the imported library and adds the imported code's name space to the current name space. Say you: import ...
by liudr
Mon Aug 06, 2018 8:27 pm
Forum: General Discussion and Questions
Topic: Can main.py and REPL share any variables?
Replies: 1
Views: 351

Re: Can main.py and REPL share any variables?

It's odd. I wasn't able to access variables I defined in main.py in REPL before but now I can. Maybe it's because I ran into some syntax errors in main.py

Hope that was the reason.
by liudr
Mon Aug 06, 2018 7:54 pm
Forum: General Discussion and Questions
Topic: Can main.py and REPL share any variables?
Replies: 1
Views: 351

Can main.py and REPL share any variables?

This may be a very simple question to those experienced: I have in my main.py import logger_setup.py that does all the initialization: main.py from logger_setup import * logger_setup.py import machine import uos import utime import network pin27=machine.Pin(27, machine.Pin.OUT) # Power pin for SDI-1...
by liudr
Mon Aug 06, 2018 2:33 am
Forum: ESP32 boards
Topic: Connection fails to ESP32, with MicroPython 1.9.4 after uploading python code
Replies: 13
Views: 1666

Re: Connection fails to ESP32, with MicroPython 1.9.4 after uploading python code

If you need telnet, you can try loboris firmware, which is working pretty pretty well with telnet.