Search found 29 matches

by laukejas
Fri Apr 03, 2020 3:01 pm
Forum: General Discussion and Questions
Topic: Getting the size of an object in MicroPython
Replies: 7
Views: 2145

Re: Getting the size of an object in MicroPython

I don't know a solution but have a question: what do you want to know *exactly*, what do you want to do? 'The size of an object' is open for interpretion. Some comments: As you see, this list takes up 100 bytes. 1 byte per member, which sounds logical. Depends on how you look at it: I find it hard ...
by laukejas
Fri Apr 03, 2020 1:59 pm
Forum: General Discussion and Questions
Topic: Getting the size of an object in MicroPython
Replies: 7
Views: 2145

Getting the size of an object in MicroPython

Hi, I was exploring various ways to store large 2D list in Python, when I discovered that there is no sys.getsizeof() call in MicroPython. Does anyone know what alternative I can use to determine the exact size of an object? Right now, I am trying to estimate it by comparing what gc.mem_free() print...
by laukejas
Thu Apr 02, 2020 6:17 pm
Forum: ESP8266 boards
Topic: Server connection reset issue
Replies: 3
Views: 906

Re: Server connection reset issue

Thank you for your reply, Jimmo, I had almost lost hope by now! You were right, it must be something related to generating that string. I am not entirely sure what, but in any case, I used the suggestions you provided, and now it's much better. There were only a few slight changes regarding the crea...
by laukejas
Wed Apr 01, 2020 10:53 pm
Forum: ESP8266 boards
Topic: Server connection reset issue
Replies: 3
Views: 906

Re: Server connection reset issue

Testing this further, I tried creating an array of bytes through the use of array.array('B') , since these take far less memory than traditional Python lists. The memory usage is clearly lower, and yet still I can't make that table variable any larger without getting server connection reset when ope...
by laukejas
Tue Mar 31, 2020 2:36 am
Forum: ESP8266 boards
Topic: Server connection reset issue
Replies: 3
Views: 906

Server connection reset issue

Hi, I am trying to host a webpage from my NodeMCU that displays a table of random integers (0 or 1). NodeMCU is in station mode. My code that creates the table and hosts the page looks like this: import socket from utilities.mathUtils import randint N = 19 table = [[randint(0,1) for i in range(N)] f...
by laukejas
Sat Mar 21, 2020 9:23 pm
Forum: ESP8266 boards
Topic: Problem getting HMC5883L to work
Replies: 14
Views: 3010

Re: Problem getting HMC5883L to work

Replaced them... I had cheap Chinese jumpers there, now I replaced with proper quality wires. But I'm still getting random things happening. I did three attempts to read. First attempt: ENODEV error. Second read: command hung up and had to be aborted. Third attempt: reading was successful, but x, y ...
by laukejas
Sat Mar 21, 2020 8:00 pm
Forum: ESP8266 boards
Topic: Problem getting HMC5883L to work
Replies: 14
Views: 3010

Re: Problem getting HMC5883L to work

Calling qmc5883.i2c.readfrom_mem(QMC5883.ADDR, QMC5883.X_LSB, 6) returns: b'\x00\x00\x00\x00\x00\x00' And calling qmc5883.i2c.readfrom_mem(QMC5883.ADDR, QMC5883.X_LSB, 14) returns: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Please also see my edits in the previous reply... Something...
by laukejas
Sat Mar 21, 2020 6:07 pm
Forum: ESP8266 boards
Topic: Problem getting HMC5883L to work
Replies: 14
Views: 3010

Re: Problem getting HMC5883L to work

Hey, Roberth, sorry to bother you again, but I still get some problems running that code for QMC5883 that you wrote. The device worked fine for a few days, and now suddenly it freezes on function read_raw. For example, if I run it via the normal way, calling x, y, z, temp = qmc5883.read_scaled() the...
by laukejas
Tue Mar 17, 2020 4:50 pm
Forum: ESP8266 boards
Topic: Problem getting HMC5883L to work
Replies: 14
Views: 3010

Re: Problem getting HMC5883L to work

The HMC5883 has the different I2C address. And it might need pull-up resistors. Are these two boards exactly identical, besides the chip? Edit: Besides sometimes unexpected long delivery times, I never had serious getting stuff from China. I just got a delivery notice for a part ordered in December...
by laukejas
Tue Mar 17, 2020 1:52 am
Forum: ESP8266 boards
Topic: Two different PWM frequencies at the same time
Replies: 3
Views: 1330

Re: Two different PWM frequencies at the same time

Then why do all tutorials I can find on PWM (regardless of the language or programming environment) show examples in which PWM frequency is set for pins individually, often doing it multiple times (though frequency is always the same)? Isn't that kind of misleading? Shouldn't there be some global se...