Solved - import femtosip - MemoryError: - Too large modul?
Posted: Sun Jun 13, 2021 2:47 pm
Update: Resolved by using "mpy-cross" compiler. This compile the "too large" module to be imported.
Hi,
I tried to import an excellent custom SIP - VOIP module. https://github.com/astoeckel/femtosip
(This great SIP protocol implementation allows ringing voip line. I need this for to make a remote belldoor ring with ESP8266.)
In spite of its name implies "femto" (very small) - it seems still too big for ESP8266.
Unfortunately i have this error message:
I assume this is because this microcontroller has too small memory.
My ESP01 has 1Mbyte only.
Then i tried with Wemos D1. ESP12 4MB Flash - but same error message.
As i understand ESP01 and ESP12 RAM size is the same...
>>> micropython.mem_info(1)
stack: 2128 out of 8192
GC: total: 37952, used: 3936, free: 34016
No. of 1-blocks: 24, 2-blocks: 12, max blk sz: 21, max free sz: 506
GC memory layout; from 3ffeee80:
00000: h=hhhhhMh=Dh=hDBBBhB=hhhB=h===h===h==h=================h=======h
00400: =======h=h==Bh=B..hh=h=.......h=hBMD.h..h=......h=..............
00800: .............h=======h=====.....................................
00c00: ...............................h=======.........................
01000: ...............................................................h
01400: ==========.....h=======.........................................
01800: ................................................................
01c00: ............h=======............................................
02000: ..h=======......................................................
02400: ...........................................h=======.............
(5 lines all free)
03c00: ......h=======..................................................
04000: ................................................................
04400: ............................h====================...............
04800: ...........................................................h====
04c00: ===.............................................................
05000: ...h=======.....................................................
05400: ................................................................
05800: ..........................h=======..............................
05c00: ................................................................
06000: ......................h=======..................................
(7 lines all free)
08000: ........................h=======................................
08400: ................................................................
08800: ............................h=======............................
08c00: ................................................................
09000: .................................................h=======.......
09400: ....
Then i tried to compile this module to .mpy as i read it will provide frozen code.
Unfortunately this rose another error:
Any advice how to resolve memory issue? femtoSIP module maker advised to try to reduce module size with eliminate some libraries,
but im not good enought python programmer to do.
Or any advise to resolve mpy compatibility issue?
best regards,
Robert.
Hi,
I tried to import an excellent custom SIP - VOIP module. https://github.com/astoeckel/femtosip
(This great SIP protocol implementation allows ringing voip line. I need this for to make a remote belldoor ring with ESP8266.)
In spite of its name implies "femto" (very small) - it seems still too big for ESP8266.
Unfortunately i have this error message:
Code: Select all
>>> import femtosip
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError:
>>>
My ESP01 has 1Mbyte only.
Then i tried with Wemos D1. ESP12 4MB Flash - but same error message.
As i understand ESP01 and ESP12 RAM size is the same...
>>> micropython.mem_info(1)
stack: 2128 out of 8192
GC: total: 37952, used: 3936, free: 34016
No. of 1-blocks: 24, 2-blocks: 12, max blk sz: 21, max free sz: 506
GC memory layout; from 3ffeee80:
00000: h=hhhhhMh=Dh=hDBBBhB=hhhB=h===h===h==h=================h=======h
00400: =======h=h==Bh=B..hh=h=.......h=hBMD.h..h=......h=..............
00800: .............h=======h=====.....................................
00c00: ...............................h=======.........................
01000: ...............................................................h
01400: ==========.....h=======.........................................
01800: ................................................................
01c00: ............h=======............................................
02000: ..h=======......................................................
02400: ...........................................h=======.............
(5 lines all free)
03c00: ......h=======..................................................
04000: ................................................................
04400: ............................h====================...............
04800: ...........................................................h====
04c00: ===.............................................................
05000: ...h=======.....................................................
05400: ................................................................
05800: ..........................h=======..............................
05c00: ................................................................
06000: ......................h=======..................................
(7 lines all free)
08000: ........................h=======................................
08400: ................................................................
08800: ............................h=======............................
08c00: ................................................................
09000: .................................................h=======.......
09400: ....
Then i tried to compile this module to .mpy as i read it will provide frozen code.
Code: Select all
./micropython-master/mpy-cross/mpy-cross -mcache-lookup-bc femtosip.py
Code: Select all
>>> import femtosip
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: incompatible .mpy file
>>>
but im not good enought python programmer to do.
Or any advise to resolve mpy compatibility issue?
best regards,
Robert.