Skip to main content
Unix - I compiled the Unix port of MicroPython. It is useful for writing a program prototype before using it in a microcontroller. Sure, micropython on Linux does not have modules like those included for esp32 or esp8266.

As I have mentioned earlier, MicroPython firmware for microcontrollers compiled by me does not include webrepl and upip modules.

Here where micropython for Linux can be useful. Follow the following transcript to install any modules:

$ micropython -m upip install micropython-upip
Installing to: /home/sharil/.micropython/lib/
Warning: micropython.org SSL certificate is not validated
Installing micropython-upip 1.2.4 from https://micropython.org/pi/upip/upip-1.2.4.tar.gz

I got two new files under the installing directory namely; upip.py and upip_utarfile.py

You can then copy these files to /pyboard in your rshell session. I assumed the modules are already nearly bug-free. I usually copy a mpy file to my microcontrollers.

Use mpy-cross to compile any py file to mpy, for example:

$ mpy-cross upip.py
$ ls -l upip.*
-rw-r--r-- 1 sharil sharil 4320 Oct 10 12:03 upip.mpy
-rw-r--r-- 1 sharil sharil 8205 Oct 10 11:27 upip.py

MicroPython mpy-cross for micropython1-10 will produce a mpy file for micropython1-10 only. Make sure you use mpy-cross for micropython1-11 if your firmware is 1-11-*.

When both py and mpy files exist under /pyboard, for example, mod.py and mod.mpy, micropython will use the mod.py file.

I will upload the latest firmware build to my GitHub repository. The unix, windows micropython and mpy-cross for Linux are here.

Now for something different, programming your brain. I believe I can program my brain to give a better mind. My brain is like my esp32, and my mind is like the latest micropython firmware.

Our brains take in anything, positive or negative. We were told to meditate. Therein lies the problem. A quiet brain invites negative thoughts unless it is trained not to do so.

Here is the deal. I use God Mantra to program my brain for a better mind. Repeat these lines slowly and with conviction during your meditation:

I am everywhere
I am everything
I am the past, I am the future
I am here and now

I am healthy
I am wealthy
I am happy
I am lucky

I am what I am
I am

Here I have four positive personal assertions. You can choose anything you like - kind, brave, beautiful, clever, or any positive words. Be sure to use positive assertive words only. Do this fifteen minutes each day. You will upgrade your mind and will have a better life.

Comments

Popular posts from this blog

Custom made - Sometimes, it is nice to be able to build custom made things. Thanks to Damien George and all the clever people at micropython.org for making it easy. So that, to custom build a micropython is not that difficult. Why do you want to build customize firmware anyway? Well, you might want to include some functionalities of your own and removed some functionalities from the standard distribution. The choices are there for you to make. I have a few changes that I want to make in micropython. version header -kaki5 (pronounce kaki-lima) an additional thread cleanup function for esp32 add frozen modules CryptoXo and uasyncio remove help, upip, and webrepl camera C module for esp32 camera board These are accomplished by modifying and adding files. py/makeversionhdr.py py/modthread.c extra/CryptoXo.py, extra/uasyncio.py, and manifest.py mpconfigport.h main.c and modcamera.c I also want to remove some modules specifically, help, upip, and webrepl from esp32
Multi-threading : I previously used an uasyncio webcam server. This time around, I am testing a multi-thread webcam server. The result is promising. A multi-thread server seems to give a better throughput. The program logic is simpler when compared to the server based on uasyncio. The server is a four threaded application, two for port 80, one for port 81, and port 82 runs on the main thread, which blocks the REPL.  You can start a dedicated thread for port 82 if you do not want to block the REPL. I found pix/7 gives the best performance. A spe/2 will reduce the image size but give you a grayscale image. Please see my previous blog if all these seem mysterious to you. I have compiled a new firmware, MicroPython v1.11-571-g7e374d231.  You can download the new firmware from my repository at GitHub. The soft reset is not functioning properly. You need to do a hard reset. I also include four new functions in modcamera.c: pixformat agcgain aelevels aecvalue The pixformat chan
Micropython - v1.11-498 introduced a few changes in the source-code directory structure. Changes to specific files, as previously described in esp32-cam , will no longer work. A simple working summary on how to build esp32-cam firmware is described below: Make a recursive copy of ports/esp32 to ports/esp32-cam, and you will need to modify the following files: 1) ports/esp32-cam/main.c 2) ports/esp32-cam/Makefile 3) ports/esp32-cam/modcamera.c 4) ports/esp32-cam/mpconfigport.h 5) ports/esp32-cam/boards/manifest.py 6) ports/esp32-cam/boards/sdkconfig.base Or, you can just download a precompiled Micropython v1.11-498 from firmware.bin at GitHub if you want to save some work. However, I encourage you to compile the firmware yourself. You will learn a lot and you can choose to modify anything to your liking. The modcamera.c includes something new. The still photo was taken using these settings; pix =8, con =2, qua =10, and spe =2. You will understand those parameters, later