Adding scripts and libraries to Board

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Adding scripts and libraries to Board

Post by Yadnik » Fri Jul 23, 2021 3:01 pm

I am not able to add scripts or libraries to my board.I am using the zephyr port of MicroPython.I have tried using ampy, rshell and even IDEs like Thonny(cant use upip as board is not networked).The only way I am able to run applications is using REPL.Can someone please confirm whether only REPL can be used for this particular port, or I am making some mistake.
Thank you very much!!

User avatar
aivarannamaa
Posts: 171
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Adding scripts and libraries to Board

Post by aivarannamaa » Fri Jul 23, 2021 6:14 pm

If you are able to connect to this board in Thonny, then you should be able to use it for installing packages as well (Tools => Manage packages). Thonny would use it's own internet connection for downloading the packages and serial connection for uploading to the device.

Have you tried it?
Aivar Annamaa
https://thonny.org

User avatar
aivarannamaa
Posts: 171
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Adding scripts and libraries to Board

Post by aivarannamaa » Fri Jul 23, 2021 6:26 pm

I now noticed your message in Thonny's forum. I'm replying here, because this forum is more relevant.

It looks like Thonny is trying to write modules into the root directory of your device and fails to do so (Errno 19 ENODEV). Please tell me more information about your device -- sys.path, current directory and content of the root directory. With Pico I would query it like this:

Code: Select all

>>> import sys
>>> sys.path
['', '/lib']
>>> import uos
>>> uos.getcwd()
'/'
>>> os.listdir("/")
['lib']
Best regards,
Aivar
Aivar Annamaa
https://thonny.org

Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Re: Adding scripts and libraries to Board

Post by Yadnik » Fri Jul 23, 2021 6:30 pm

I get this error on following (Tools => Manage packages):
Package manager is not available for this interpreter(no absolute lib directory in sys.path)
I am using the generic Micropython interpreter.I can take the bottom shell into use by running applications on repl but cant add external libraries or scripts.
Also I don't have a generic firmware flashed I am using the zephyr port.

Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Re: Adding scripts and libraries to Board

Post by Yadnik » Fri Jul 23, 2021 6:33 pm

Even while saving main.py file onto my board I get an error like:
WARNING: Could not sync device's clock: can't import name RTC
ERROR thonny.backend: PROBLEM WITH THONNY'S BACK-END
Error Could not open file /main.py for writing, output:
[Errno 19] ENODEV
It would be very grateful if you could please help me.I had also asked this on the Thonny google group.
Thank you very much Aivar.
Last edited by Yadnik on Fri Jul 23, 2021 6:38 pm, edited 1 time in total.

Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Re: Adding scripts and libraries to Board

Post by Yadnik » Fri Jul 23, 2021 6:37 pm

The output is as follows:
>>> import sys
>>> sys.path
['']
>>> import uos
>>> uos.getcwd()
'/'
>>> import os
>>> os.listdir("/")
[]

User avatar
aivarannamaa
Posts: 171
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Problem writing files with Zephyr port

Post by aivarannamaa » Fri Jul 23, 2021 8:25 pm

I haven't used Zephyr port myself, but I suspect your flash or filesystem might be misconfigured. I changed the subject of this thread - maybe someone else can recommend something.

BTW. Which device are you using?
Aivar Annamaa
https://thonny.org

Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Re: Adding scripts and libraries to Board

Post by Yadnik » Sat Jul 24, 2021 2:09 pm

I am working on a board called BeagleConnect Freedomhttps://github.com/jadonk/beagleconnect ,it is based on the TI CC1352R.I also tried doing the same for the cc1352r launchxl, using the zephyr port of MicroPython as well, however getting the same error there as before.
I think this problem exists with the zephyr port in general, as I have religiously followed all the instructions as given here https://github.com/micropython/micropyt ... /README.md .
It would be very helpful if you could suggest any alternatives or ways to get applications working as I can only access repl for currently.
Thank you very much!!

Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Re: Adding scripts and libraries to Board

Post by Yadnik » Sat Jul 24, 2021 2:09 pm

I am working on a board called BeagleConnect Freedomhttps://github.com/jadonk/beagleconnect ,it is based on the TI CC1352R.I also tried doing the same for the cc1352r launchxl, using the zephyr port of MicroPython as well, however getting the same error there as before.
I think this problem exists with the zephyr port in general, as I have religiously followed all the instructions as given here https://github.com/micropython/micropyt ... /README.md .
It would be very helpful if you could suggest any alternatives or ways to get applications working as I can only access repl currently.
Thank you very much!!

User avatar
aivarannamaa
Posts: 171
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Adding scripts and libraries to Board

Post by aivarannamaa » Sat Jul 24, 2021 3:23 pm

I see that you have started your quest here: viewtopic.php?f=15&t=10852

The question Jimmo asked is crucial. I recommend you continue in that thread. Jimmo certainly knows more about this.
Aivar Annamaa
https://thonny.org

Post Reply