Search found 19 matches

by VladVons
Thu Jun 14, 2018 5:51 am
Forum: General Discussion and Questions
Topic: How to free memory after unused imports?
Replies: 8
Views: 689

How to free memory after unused imports?

My pure free memory is 30720 Than i import App.py (free memory 17216) Than i try to free App (free memory still 18688) >>> os.uname() MicroPython v1.9.4-8-ga9a3caad0 on 2018-05-11; ESP module with ESP8266 >>> gc.collect() >>> gc.mem_free() 30720 >>> globals() { 'bdev': <FlashBdev object at 3ffef610>...
by VladVons
Mon Jun 11, 2018 10:01 am
Forum: Programs, Libraries and Tools
Topic: external C library
Replies: 3
Views: 514

Re: external C library

No working howto examples found.

Dynamically loadable native object code is definitely a feature that MicroPython wants to have, it would be very useful
(Damien George, Sep 11, 2017)
by VladVons
Sat Jun 09, 2018 7:19 pm
Forum: Programs, Libraries and Tools
Topic: external C library
Replies: 3
Views: 514

external C library

is it possible to write external C library, save compiled file as SomeFile.so and call it from a python?
Something like plugins or libraries
Other words move trash outside micropython core and reduce its size with more ussage flexibility
DHT
cc3000
lcd160cr
....

import SomeFile
SomeFile.SomeMethod()
by VladVons
Sat Jun 09, 2018 5:08 am
Forum: Drivers for External Components
Topic: DHT21 humidity sensor doesnt work
Replies: 2
Views: 480

DHT21 humidity sensor doesnt work

I have DHT21 sensor, 3 wires, 4,7 k resistor. It causes exception ETIMEOUT import dht import time aPin = 14 #Pin = machine.Pin(aPin, machine.Pin.IN, machine.Pin.PULL_UP) Pin = machine.Pin(aPin) Obj = dht.DHT22(Pin) time.sleep_ms(250) Obj.measure() -> exception : ETIMEOUT native GitHub micropython dr...
by VladVons
Thu Jun 07, 2018 5:54 am
Forum: General Discussion and Questions
Topic: SOLVED. print() doesnt echo in ESP8266 daily builds
Replies: 3
Views: 354

SOLVED. print() doesnt echo in ESP8266 daily builds

Found the problem.

in earlier build versions there was not line

Code: Select all

uos.dupterm(machine.UART(0, 115200), 1)
i just owerrided boot.py with my edition with no uos.dupterm
by VladVons
Wed Jun 06, 2018 10:35 pm
Forum: General Discussion and Questions
Topic: SOLVED. print() doesnt echo in ESP8266 daily builds
Replies: 3
Views: 354

Re: print() doesnt echo in ESP8266 daily builds

How to fix it?

daily builds mostly used by developers/testers and any print information is important.
what is the reason to silent the print()?
other info functions dont work too.
micropython.mem_info() etc...
by VladVons
Wed Jun 06, 2018 7:19 am
Forum: General Discussion and Questions
Topic: SOLVED. print() doesnt echo in ESP8266 daily builds
Replies: 3
Views: 354

SOLVED. print() doesnt echo in ESP8266 daily builds

I didnt notice such problem in 1.9.3-XXX
in terminal 1.9.4-XXX builds there is no print output from a *.py, but in REPL everething is ok.

Code: Select all

#boot.py:
print('Hello') # no output

MicroPython v1.9.4-119......
>>> print('Hello') # output ok
Hello
by VladVons
Tue Mar 28, 2017 10:00 pm
Forum: ESP8266 boards
Topic: [SOLVED] exec() function doesnt return result?
Replies: 8
Views: 6139

Re: [SOLVED] exec() function doesnt return result?

eval calculates epressions only.

it cant call and execute methods or functions

Code: Select all

eval("print('Hello World')")
SyntaxError: invalid syntax
by VladVons
Mon Mar 27, 2017 9:36 pm
Forum: ESP8266 boards
Topic: [SOLVED] exec() function doesnt return result?
Replies: 8
Views: 6139

Re: exec() function doesnt work?

thanks. works!

Code: Select all

def Exec(aValue = "Result = (2+3)*2"):
    Vars = {}
    try:
        exec(aValue, globals(), Vars)
        Result = Vars.get('Result')
    except Exception as E:
        Result = E
    return Result