Search found 61 matches

by manseekingknowledge
Fri Aug 02, 2019 4:38 pm
Forum: ESP8266 boards
Topic: Unexpected __slots__ behavior
Replies: 5
Views: 3620

Unexpected __slots__ behavior

I'm on a crusade to reclaim RAM so I thought I would give slots a try. I was looking at the example here which says it shouldn't be possible to dynamically create a new attribute: class S(object): __slots__ = ['val'] def __init__(self, v): self.val = v x = S(42) print(x.val) x.new = "not possible" I...
by manseekingknowledge
Fri Aug 02, 2019 8:06 am
Forum: ESP8266 boards
Topic: JSON loading and dumping efficiently with sockets
Replies: 0
Views: 2339

JSON loading and dumping efficiently with sockets

I use the code below to send/receive JSON data via sockets. I'm looking for ways to improve memory efficiency where the functions json.loads() and json.dumps() are called. In the send function json.dumps() is called and then the return string is encoded. I'm pretty sure the encode() function is maki...
by manseekingknowledge
Fri Aug 02, 2019 7:41 am
Forum: ESP8266 boards
Topic: What is maximum valid heap size
Replies: 9
Views: 7204

What is maximum valid heap size

main.c has this line: STATIC char heap[38 * 1024]; I've slowly been increasing this in an effort to process larger strings. I've seen some behavior I don't understand and I'm hoping someone can enlighten me. When I have the ESP running in station mode I'm able to have the heap set to 47KB and things...
by manseekingknowledge
Fri Aug 02, 2019 7:29 am
Forum: ESP8266 boards
Topic: Help deciphering WDT reset error
Replies: 2
Views: 2263

Help deciphering WDT reset error

My ESP randomly resets and produces errors similar to the one seen below. Sometimes it will run for hours with no issue, but sometimes it will reset 2 or 3 times within a minute. I have been messing with the heap allocation in main.c so I'm not sure if that has caused this. Regardless, I would still...
by manseekingknowledge
Sat Jul 13, 2019 4:43 pm
Forum: ESP8266 boards
Topic: Creating larger ROMs
Replies: 23
Views: 15272

Re: Creating larger ROMs

Below are some updates that can be made to makeimg.py to allow automatic creation of a file system with files baked into firmware-combined.bin. Just create a directory named micropython/ports/esp8266/fs_files and put the files you want on your ESP8266 into that directory. If the the fs_files directo...
by manseekingknowledge
Wed Jul 10, 2019 4:09 am
Forum: ESP8266 boards
Topic: Creating larger ROMs
Replies: 23
Views: 15272

Re: Creating larger ROMs

If you could let me know what the exact mkfs command you used was that might be helpful. I would expect the generated file system to not have a boot sector. Do you agree? Just `mkfs.fat fat.fs` on a 512kiB image -- all the other parameters seemed like they matched the default. The result was a fat1...
by manseekingknowledge
Tue Jul 09, 2019 3:31 pm
Forum: ESP8266 boards
Topic: Creating larger ROMs
Replies: 23
Views: 15272

Re: Creating larger ROMs

Just to confirm, you are saying the method you described worked? If so, I see one of my errors by looking at your hexdump. The hexdump shows the file system starting at 0x99000 (626688), not your esp.flash_user_start() value of 622592 which is where I was expecting it to start in my previous post. I...
by manseekingknowledge
Tue Jul 09, 2019 7:25 am
Forum: ESP8266 boards
Topic: Creating larger ROMs
Replies: 23
Views: 15272

Re: Creating larger ROMs

I've been trying to flash a pre-made FAT file system to my ESP8266 all night unsuccessfully. I create the file system as follows: 1.) Determined the max size of the FAT file system by using info from flashbdev.py and some esp module calls: esp.flash_user_start() = 1048576 # Exactly 0x100000. This is...
by manseekingknowledge
Tue Jul 09, 2019 5:51 am
Forum: ESP8266 boards
Topic: Creating larger ROMs
Replies: 23
Views: 15272

Re: Creating larger ROMs

So what is the largest value that irom0_0_seg can be set to maximize the space for frozen modules? @pythoncoder set it to a value of 0xa7000 according to his post here . Based on the code below from esp8266_common.ld I would guess the max valid size for irom0_0_seg is 0xF7000. Is this correct? I gue...