Search found 147 matches

by liudr
Mon Sep 10, 2018 4:15 am
Forum: ESP32 boards
Topic: changing GPIO36 pins as INPUT or OUTPUT
Replies: 5
Views: 621

Re: changing GPIO36 pins as INPUT or OUTPUT

Not only is GPIO36 an input-only pin, it also does NOT feature pull-up/down resistors: Note 2 The following pins are input-only. These pins do not feature an output driver or internal pull-up/pull-down circuitry: SENSOR_VP (GPIO36), SENSOR_CAPP (GPIO37), SENSOR_CAPN (GPIO38), SENSOR_VN (GPIO39), VDE...
by liudr
Mon Sep 10, 2018 4:07 am
Forum: ESP32 boards
Topic: Esp32 & micropython connect to console via wlan
Replies: 4
Views: 828

Re: Esp32 & micropython connect to console via wlan

I am running a fork of the official firmware by loboris. The firmware has FTP server and Telnet server. If you set them up in main.py you can get remote access through Telnet (same as REPL) and upload files with FTP, simultaneously.

https://github.com/loboris/MicroPython_ ... _LoBo/wiki
by liudr
Mon Aug 20, 2018 4:49 pm
Forum: General Discussion and Questions
Topic: Need some help how to distribute features between main.py and scripts on sd card
Replies: 13
Views: 1678

Re: Need some help how to distribute features between main.py and scripts on sd card

No. Have the module with the logging function run import os This forum is to support MicroPython: users assume a knowledge of Python. Your queries are elementary ones about the Python language. I would advise you to learn the language using Python on a PC with a book or online course. That was the ...
by liudr
Sun Aug 19, 2018 9:45 pm
Forum: General Discussion and Questions
Topic: Need some help how to distribute features between main.py and scripts on sd card
Replies: 13
Views: 1678

Re: Need some help how to distribute features between main.py and scripts on sd card

...Since you don’t have great control over when a module runs (at first import), it typically shouldn’t do anything else than define functions and classes, and possibly initialize some things. Any code that needs to run at a determined time should be inside those functions and classes. I got it now...
by liudr
Sun Aug 19, 2018 9:43 pm
Forum: General Discussion and Questions
Topic: Need some help how to distribute features between main.py and scripts on sd card
Replies: 13
Views: 1678

Re: Duck Typing

Python uses Duck Typing . It is normal to do things like: import machine i2c = machine.I2C(1) import my_module my_module.run(i2c) my_module only needs to import machine if "machine" appears in its sourcecode. The module can feely call I2C methods against the passed I2C instance: Python determines t...
by liudr
Sun Aug 19, 2018 5:05 pm
Forum: General Discussion and Questions
Topic: Need some help how to distribute features between main.py and scripts on sd card
Replies: 13
Views: 1678

Re: Need some help how to distribute features between main.py and scripts on sd card

I am mainly using MP on ESP32 with Loboris port so I do all my editing via a FTP server. I setup in filezilla that it will open *.py with my selected IDE (note++ ha ha) then I just edit it and click save and filezilla will auto update it over FTP then I just swap to my puTTY terminal window(either ...
by liudr
Sat Aug 18, 2018 3:36 am
Forum: General Discussion and Questions
Topic: Need some help how to distribute features between main.py and scripts on sd card
Replies: 13
Views: 1678

Re: Need some help how to distribute features between main.py and scripts on sd card

OK, I am coming up with an idea. Currently my logger script has both functions and code. If I turn it entirely to functions, and call the logging function after I import the logger script, then there is no need to let the code know the namespace of main while import runs the code. I will let main ha...
by liudr
Sat Aug 18, 2018 12:48 am
Forum: General Discussion and Questions
Topic: Need some help how to distribute features between main.py and scripts on sd card
Replies: 13
Views: 1678

Need some help how to distribute features between main.py and scripts on sd card

I am trying to find a sensible way to distribute features between main.py and other scripts on sd card. My application is data logger. In doing so, I need a few things. Here is what I came up with: Flash • boot.py (don't plan on adding anything here in case it gets messed up) • main.py (decide which...
by liudr
Sat Aug 18, 2018 12:37 am
Forum: ESP32 boards
Topic: Sparkfun ESP32 board
Replies: 9
Views: 1309

Re: Sparkfun ESP32 board

Thanks. I'll try and learn more scripting (maybe more docs to write about how to do scripting so I can read about it when I forget). It's really hard to remember things the way I used to.
by liudr
Thu Aug 16, 2018 4:53 pm
Forum: ESP32 boards
Topic: Sparkfun ESP32 board
Replies: 9
Views: 1309

Re: Sparkfun ESP32 board

You never posted what flashing command you used that caused your dev board to crash though. I bet the crashes were caused by the command. One needn't to do wild guesses. I have done a dozen or two flashes and everything it went correctly. I keep the command in a document. It's a good idea to log wha...