Prevent anyone can download my code over serial
I am starting product line that use wiPy 3.0.
I just see that any one can connect he board and download and copy all my code and credentials.
There is any way to prevent code download from board?
aaahhh, you are right. Micropython is python 3 but the build tool uses python 2. Totally forgot that this still exists on PCs
@crumble I am far from an Python expert, so just guessing... Could it be that you use pip3 instead of pip that I use (I think I got som problems trying to use Python 3)? What if you run "pip list", does pyserial show up as installed?
I used pip3 to install pyserial-3.4 But serial cannot be found
ImportError: No module named serial
@crumble I managed to build and encrypt the WiPy firmware (should be the same) using Windows Subsystem for Linux (https://docs.microsoft.com/en-us/windows/wsl/install-win10) running Ubuntu. I installed pyserial with "pip install pyserial". What is the error you get?
I tried to follow the instructions to build the firmware for a LOPY but esptools.py failed on
Adding pyserial with pip3 was not the solution. Running this on a hyper-v debian. Big plan was to compile on VM and use windows host for upload. Does the python module works only when a serial is present?
^this is likely the best way to help avoid the code being dumped.
@robert-hh Hello Robert thanks for your replay.
How can I Embed your code as frozen bytecode?
robert-hh last edited by
@dserrano You dio in in several levels/step, which both require the ability for you to create your own images:
- Level 1: Embed your code as frozen bytecode. Then it is not visible at the command prompt level, but still a falsh dump woudl get access to the bytecode, which then has to be disassembled. The only visible part of the code would be boot.py and optionally main.py. But these can be short and almost empty, just calling your embedded code.
- Level 2: Additionally, encrypt the flash. This is supported by the build environment.
One crazy-out-there-idea ... is for you to compile your own firmware ...
A) write your code into the firmware source code ... like in your own custom library ...
B) compile it and flash your WiPy with your own custom firmware
C) then all you have to do is Improt your custom lib ... and run your custom function ...
Import My_Custom_LIB My_Custiom_funcion(ANY-DEFINED-PARAMETERS)