I am using my ESP8266 device and have installed Micropython as firmware on it.
I wrote some python code to fetch environmental data through a DHT11.
The scripts I'm running with the ampy module, specifically, the command "ampy --port COM5 put file.py" and the command "ampy --port COM5 run file.py".
For some scripts the execution is successful, but with a particular script, in which I import a library called "micropython modbus", the program returns this error:
Now I ask you if by chance you can give me some advice to solve this problem.
Do you know an alternative to run python scripts on the ESP8266? Am I doing something wrong??
I wrote some python code to fetch environmental data through a DHT11.
The scripts I'm running with the ampy module, specifically, the command "ampy --port COM5 put file.py" and the command "ampy --port COM5 run file.py".
For some scripts the execution is successful, but with a particular script, in which I import a library called "micropython modbus", the program returns this error:
This error apparently shows a memory leak in my ESP8266.Traceback (most recent call last):
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\Scripts\ampy.exe\__main__.py", line 7, in <module>
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\site-packages\click\core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\site-packages\ampy\cli.py", line 338, in run
output = board_files.run(local_file, not no_output, not no_output)
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\site-packages\ampy\files.py", line 309, in run
self._pyboard.execfile(filename, stream_output=True)
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\site-packages\ampy\pyboard.py", line 285, in execfile
return self.exec_(pyfile, stream_output=stream_output)
File "C:\Users\carmi\AppData\Local\Programs\Python\Python38\lib\site-packages\ampy\pyboard.py", line 279, in exec_
raise PyboardError('exception', ret, ret_err)
ampy.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n File "<stdin>", line 5, in <module>\r\n File "/lib/umodbus/tcp.py", line 20, in <module>\r\nMemoryError: memory allocation failed, allocating 72 bytes\r\n')"
Now I ask you if by chance you can give me some advice to solve this problem.
Do you know an alternative to run python scripts on the ESP8266? Am I doing something wrong??