Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build to include main files in pycom firmware base #112

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

CrispyCrafter
Copy link

This PR simply serves to automatically include boot.py and main.py in the base folder path of pycom firmware builds.
This simplifies the configuration effort by no longer needing to manually include these files during device provisioning.

Obviously this has side effects where _main.py is executed prior to running the userspace version of main.py.

As such I include this PR simply as a POC in case other users of the community wish to solve a similar issue.

I don't anticipate all users to want to make use of this approach.

@CrispyCrafter
Copy link
Author

Perhaps this could be included as a build flag?

@amotl
Copy link
Member

amotl commented Jun 14, 2022

Dear Bernard,

thank you very much for submitting this patch.

At first, I want to appreciate to hear back from you, because it tells us that there are actually active users of Terkin out there. The project where it was originally conceived for has ended in 2020 already and we haven't been able to put in much time in terms of continued maintenance beyond a short stunt together with @Tonkenfo where we improved compatibility with Dragino and compatibility with CPython in general.

In this spirit, we would very much like to hear about where Terkin is used within other projects, specifically on MicroPython, which would be a very motivating factor for us to keep the project going, at least in maintenance mode. If you like, let us continue an eventual discussion about this topic elsewhere.

With respect to your patch, without wrapping my mind into the details and consequences too much right now, I think it would be a good idea to bring it in, specifically if that supports your workflow better. A build flag would be perfect to be able to handle both situations, feel free to make it that way to handle your case as the default one.

With kind regards,
Andreas.

@CrispyCrafter
Copy link
Author

Hi Andreas

Excited to finally make contact with you and the terkin community.
I would very much enjoy chatting about how we are using terkin for an agricultural project in South Africa.
Would you be open to a hangouts call or something along the lines at your convenience?

With respect to the PR, I'm concerned that some the proposed approach would be problematic without additional changes.
The major issue here is the import of settings in main.py that would fail on the first run if no file could be found.

I've addressed this on my side with the following behaviour:
_main.py

print('[main.py] INFO: Loading settings')
try:
    import settings
except ImportError:
    # Defaults to looking for user-settings.json
    print('[main.py] INFO: No python settings detected')
    settings = None

@amotl
Copy link
Member

amotl commented Sep 17, 2022

Dear Bernard,

apologies for the late reply.

Excited to finally make contact with you and the terkin community.
I would very much enjoy chatting about how we are using terkin for an agricultural project in South Africa.
Would you be open to a hangouts call or something along the lines at your convenience?

It is very sweet to hear back from users of Terkin. We appreciate it and look forward to a call.

With respect to the PR, I'm concerned that some the proposed approach would be problematic without additional changes. The major issue here is the import of settings in main.py that would fail on the first run if no file could be found.

I see.

I've addressed this on my side with the following behaviour [...]

That looks very reasonable. We will definitively take it into consideration within the next development cycle. Thanks again for your contribution!

With kind regards,
Andreas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants