Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4151

MicroPython • Re: Get file from server and execute it, http/Rest

$
0
0
I'd like my Pico W to boot up - do an API Rest call to my server, retriver the "Sensor.py" file - save it locally on the Pico W and then execute the file.

Is that possible?
Yes, but an "API Rest call" may not be what needs to be used.
Should I have my "get file" code in the boot.py? And save the sensor.py as main.py?
I wouldn't recommend either. I would leave 'boot.py' as is, have 'main.py' call 'download.py' to load the latest and then run the latest 'sensor.py' you have.
My goal is to have the Pico W get the latest version of its code everytime it reboots
Should be achievable.
Any sample projects that I can look at?
Not that I know of. Google may know better.

The basic Proof of Concept code should be fairly trivial so, when I get a few moments to spare, I'll see what I can create.

Statistics: Posted by hippy — Sat Apr 27, 2024 1:34 pm



Viewing all articles
Browse latest Browse all 4151

Trending Articles