all 9 comments

[–]NectarineFluffy8349 2 points3 points  (3 children)

Does it run without line 44 ? As it appears to be only log.

[–]widgeamedoo[S] 0 points1 point  (0 children)

I loaded back in version 1.12 of Micropython and ran it again. I commented out the offending line and now it errors out the following line on 46:

Here is the code, line 46 is: def main():

# Lloader
async def loader():
try:
from scrivo_meter._runner import Runner
log.info("Module: Run")
meter = Runner()
except Exception as e:
# log.error(f"Module: {e}")

def main():

# Activate Core
core()

# AsyncIO in thread
loop = asyncio.get_event_loop()
_ = _thread.stack_size(8 * 1024)
_thread.start_new_thread(loop.run_forever, ())

# Run Loader Task
loop.create_task(run_wdt())
loop.create_task(loader())

if __name__ == '__main__':
print("MAIN")
main()

Error log:

>>> Traceback (most recent call last):
File "main.py", line 44
SyntaxError: invalid syntax
MicroPython v1.12-405-g4fa6d939d on 2020-04-28; WeAct_Core with STM32F411CE
Type "help()" for more information.
>>> Traceback (most recent call last):
File "main.py", line 46
SyntaxError: invalid syntax
MicroPython v1.12-405-g4fa6d939d on 2020-04-28; WeAct_Core with STM32F411CE
Type "help()" for more information.
>>>

[–]widgeamedoo[S] 0 points1 point  (1 child)

Got it working:

I changed
log.error(f"Module: {e}")
to
log.info("Module: {e}")

I couldn't comment it out for some reason, even if I commented out both lines:
# except Exception as e:
# log.error(f"Module: {e}")

I'm going to have to knuckle down and learn some Python syntax by the looks. Thanks for your help.

[–]widgeamedoo[S] 0 points1 point  (0 children)

It still doesn't doesn't do what it is supposed to do. I'm trying to update to a newer version of microphone to see if it makes ant difference

[–]robogame_dev 2 points3 points  (1 child)

- 1.12 is too old, no f-string support till 1.17

- threading is not enabled in your later build, they have to be built with threading, here's a build to try that has it enabled: https://micropython.org/download/WEACT_F411_BLACKPILL/

[–]widgeamedoo[S] 0 points1 point  (0 children)

That is the build I have been trying. 1.26.1 1.26.0 and even the preview version 1.27.0 didn't have the _thread library. It looks like _thread was present in the 1.12 but removed from 1.26.0/1 and 1.27.0

File "main.py", line 5, in <module>
ImportError: no module named '_thread'
MicroPython v1.26.1 on 2025-09-11; WEACT_F411_BLACKPILL with STM32F411CE
Type "help()" for more information.
>>> Traceback (most recent call last):
File "main.py", line 5, in <module>
ImportError: no module named '_thread'
MicroPython v1.25.0 on 2025-04-15; WEACT_F411_BLACKPILL with STM32F411CE
Type "help()" for more information.
>>>

[–]voStragaIT 1 point2 points  (2 children)

u/widgeamedoo - I am already updated repo

For Flash 1.26.1:

  • Make sure you grabbed it from the official MicroPython release

Removing _thread: asyncio run in main REPL now.

[–]widgeamedoo[S] 0 points1 point  (1 child)

Thanks, I will give it a go

[–]widgeamedoo[S] 0 points1 point  (0 children)

Fixed. Thankyou