Hello
Welcome to my corner on the web! My name is Ignas Bukys and I am excited to share my thoughts, experiences, and insights with you.
On this blog, you will find a diverse range of topics including technology and programming. All my projects (ongoing & finished) are listed here.
Whether you are here for personal growth, to learn something new, or simply to be entertained, I hope you find value in what I have to share. Thank you for stopping by and I hope you enjoy your visit.
Latest Blog messages
My Love-Hate Relationship with the Elecrow CrowPanel 5.79" e-Paper Display
The Elecrow CrowPanel 5.79“ e-paper display initially seemed like a dream come true. A large, high-resolution display for all my e-ink project ideas? Sign me up! However, my journey with this display was a rollercoaster of emotions, filled with both excitement and frustration.
How it begun
Few weeks ago in Facebook Micropython group I've saw invitation to win E-Paper device based on ESP32 and gave it a go- filled in form. Only name and email was required. We live in spam world already, so I've decided to give it a go. To my surprise, I have received email asking me what model would I like to receive. Decided to try my luck on Elecrow CrowPanel 5.79. To my surpize- I have received parcel in my mail box. Unexpected, but very pleasant. In exchange for free item, Annie from Elecrow marketing asked me to share project on it. Searching for any library for the screen- nothing was found on the web. As it was not available- I've decided try and create it myself. Already had some experience on python coding, but writing low level communication for chips using non-full documentation and poorly documented code (but working Arduino samples from Elecrow website) was challenging task. Begun working on it and stumbled on fact, that screen is controlled by two SSD1683 chips.
The Challenge: Dual SSD1683 Drivers
One of the biggest hurdles I encountered was the presence of two SSD1683 driver chips within the display. This dual-chip setup added a layer of complexity to the control signals and data transmission. The documentation, while helpful, wasn't always straightforward, and I spent countless hours debugging communication issues. There are absolutely no details how to control SSD1683, which is in slave mode. It was trial and error journey from Arduino code samples provided.
The Phantom Middle: Conquering the Display Glitch
The most frustrating issue I faced was a peculiar display glitch. A portion of the screen, roughly in the middle, would remain blank or display corrupted data. After much head-scratching and experimentation, I discovered that the issue stemmed from a two SSD1683's controlling one screen. Screen row basically consist of 792 pixels, which is 99 bytes. But to display correctly, each chip has to receive 50 bytes of information. Screen on the left 50 leftmost and screen on the right- 50 rightmost. But as there is only 99 bytes available- one byte must be shared between chips. That solved my problem and I was finally able to coax the display into showing the full image.
Lessons Learned and Future Directions
This project, despite its challenges, taught me valuable lessons about hardware-software interaction, debugging techniques, and the importance of thorough documentation. While I wouldn't necessarily recommend this specific display for beginners due to its complexity, I believe the experience has significantly improved my embedded systems development skills.
In the future, I plan to explore alternative e-paper display options with simpler driver configurations. I also intend to create a more robust and user-friendly library for controlling the CrowPanel, making it easier for others to utilize this unique display.
TODO
- SDCard support
- Button
- Library for CrowPanel 4.2”
Overall:
The CrowPanel 5.79“ e-paper display was a challenging but rewarding project. It pushed my technical limits and provided valuable insights into the world of embedded systems. While I encountered significant obstacles, the feeling of accomplishment upon finally overcoming the display glitch was immensely satisfying.
If you have CrowPanel 4.2” panel on you hand and would like to help Micropython community with CrowPanel library I encourage you to share your own tips or tricks you've discovered along the way!
Disclaimer: This blog post is based on my personal experience and may not reflect the experiences of others.
Bicycle computer XOSS Nav Plus review
As an active cyclist, I'm always looking how to enhace my rides. One of the option is to have navigation available. You plan route in advance and you just execute it on the road. For this reason I was looking for bicycle computer, that would have GPS and could lead me on the road. Basicly, there are two ways how navigation could be executed: just breadcrumb of your path and highlighted path on maps. Having offline maps in liquid screen display was tempting. After some research I've decided to try XOSS company NAV+ device as my bicycle computer.
Specifications
- Dimension: 88mmx55mmx19mm
- Weight: about 67g
- Screen: 2.4 inch
- Resolution: 240×160
- Battery: 600mAh rechargeable lithium battery
- Working temperature: -10~50 ℃
- Waterproof level: IPX7
- Battery life: 33h in standard mode; 40h in low-power mode (affected by usage environment and temperature)
- Charging interface: USB-C
- Memory Capacity: about 10,000 hours
XOSS NAV+ features
- GNSS support (GPS, Galileo, Beidu)
- BT and ANT+ sensors
- Offline maps
- Various metrics
The XOSS NAV+ arrived in a well-packaged box, including mounts, a USB-C charging cable, and the main unit. The device uses Garmin-type mounts for easy attachment. Pairing with the mobile app was straightforward, and I also purchased additional accessories like a protective case and compatible sensors for speed and cadence, which were easy to set up.
I've rode few 100's kilometer before writing this review, so everything is from my experience.
Pros
- Liquid crystals display- clear to seen in bright light. Screen also has backlight, if needed;
- Beeping is loud enough to be heard durind busy city riding;
- GPS is accurate and connects to sattelite within 5 seconds. Mob app updates this when required, and you can force refresh if needed;
- Offline maps is accurate and shows most of paths. You can zoom in/out the current location, but you can not pan to sides to look around;
- Plenty of batery for multiple rides. It's is declared 33hours. I would not say that this endurance is possible, I would say 20-25 hours. Have not tested it though;
- Connects to XOSS Vortex speed and cadense sensors and Garmin heart sensor without issues;
- Route planning functionality inside applications works good. It also accepts GPX files (maybe some other types also) then you can upload path to device. There are plenty pre-made by comunity, that you can upload to device and ride.
Cons
- Map is always north oriented, not possible to rotate according riding direction;
- Map doesn't update, if you did not start tracking, even if the maps screen is not open;
- You can have up-to 20 routes, uploaded to device. Routes does not have name, only numeric ID- so sometime it is dificult to understand which route is the needed;
- Odometer is not moving, if not started tracking, even if speed sensor is connected. Speed is shown on screen, but odometer do not move;
- Imposible to reset odometer, so if handed over to a friend- it's not possible to start from fresh;
- Charging does not start, if i don't turn-on device. Tested with USB power meter- battery simply does not fill. Ihave to turn it on, device starts charging itself, and then I can turn it off and leave it to charge;
- When managing layout, there are some layouts in mobile application, when transfered to device- metrics shown switched places.
- Does not show any notifications from mobile phone on call or message;
- Very slow map transfer speed into device. Speed of the copying is about 300kb/s;
- Can not change GNSS configuration, it always stays GPS+Beidu;
- Once had a glich, that computer started, but screen did not shown anything. Just heard from the beeps that device active. Managed to shut-down and start again- it started normally;
- Missed possibility to track gear, how my kilometers rode with chain or tires or whatever you would like to track;
Evaluation
While there are several software-related issues that could be improved, the XOSS NAV+ is a solid and budget-friendly choice for cyclists. It may not match high-end Garmin or Hammerhead models, but for €60, it adds significant value to your rides. Considering its features and performance, I would rate it 6/10.
MPY-CROSS: The ultimate MicroPython precompilation tool. Download available
What exactly is Micropython?
MicroPython is a straightforward and effective Python version created for microcontrollers and other devices with limited resources. One of MicroPython's key features is the ability to execute Python code that has been precompiled to bytecode, which can help the interpreter operate better and consume less memory.
MPY-CROSS
Mpy-cross is one of the programs that is most frequently used to precompile Python code for MicroPython. With the help of this command-line utility, Python code created in a MicroPython program can be translated into bytecode that can be run on a device that supports MicroPython. iteration 6 of mpy-cross is the most recent iteration. This version has bug fixes and additional features.The main feature of this version is that it supports the latest version of MicroPython and it includes a new option to control the optimization level of the generated bytecode, which can help to reduce the size of the generated code and improve performance.
Another feature is that it now supports the compilation of Python modules, which can be used to improve the performance of the interpreter and reduce the amount of memory used by the program. Additionally, mpy-cross can be used to create standalone MicroPython executables that can be run on devices without a full MicroPython installation.
Using mpy-cross is very simple. Once you have installed the tool, you can use it to convert Python code into bytecode by running the following command:
mpy-cross myfile.py
Full information about its capabilities is available in help text bellow:
usage: mpy-cross-6.exe [<opts>] [-X <implopt>] <input filename> Options: --version : show version information -o : output file for compiled bytecode (defaults to input with .mpy extension) -s : source filename to embed in the compiled bytecode (defaults to input file) -v : verbose (trace various operations); can be multiple -O[N] : apply bytecode optimizations of level N Target specific options: -msmall-int-bits=number : set the maximum bits used to encode a small-int -march=<arch> : set architecture for native emitter; x86, x64, armv6, armv6m, armv7m, armv7em, armv7emsp, armv7emdp, xtensa, xtensawin Implementation specific options: emit={bytecode,native,viper} -- set the default code emitter heapsize=<n> -- set the heap size for the GC (default 2097152)
RAM Memory
In addition to the performance benefits, mpy-cross is also a useful tool when working with MicroPython scripts that are short on RAM memory. When running a MicroPython script, the interpreter must load the entire script into memory in order to execute it. This can be a problem for devices with limited RAM, as it may not be able to load large or complex scripts.
By precompiling the script using mpy-cross, the size of the script is reduced, which means that less memory is required to load and execute the script. This can be particularly beneficial when working with memory-constrained devices, such as those with limited RAM or flash storage.
For example, if you have a script that is using up all of the available RAM on your device, you can use mpy-cross to precompile the script and see if that reduces the amount of memory used by the script. You can also use the new option to control the optimization level of the generated bytecode, which can further help to reduce the size of the generated code and improve performance.
In summary, mpy-cross is a valuable tool for MicroPython developers working with memory-constrained devices. By precompiling Python scripts into bytecode, it can help to reduce the amount of memory required to load and execute the script, which can improve the performance of the device and enable the execution of more complex scripts.
The -O[n] key in command
The -O option is a command-line switch that can be used when running mpy-cross to control the level of optimization that is applied to the generated bytecode. When using this option, you can specify a numerical value from 0 to 3, with 0 indicating no optimization and 3 indicating the highest level of optimization.
The higher the optimization level, the more aggressive the optimization will be. At level 3, the mpy-cross will try to make the code as small as possible and run as fast as possible, but this may increase the compilation time.
The optimization level can have a significant impact on the size and performance of the generated bytecode. For example, at level 0, the generated bytecode will be larger and may run slower, while at level 3, the generated bytecode will be smaller and may run faster.
The default optimization level is -O2, which provides a good balance between code size and performance. If you are working with a device that has limited flash storage and/or RAM, you may want to try using a higher optimization level, such as -O3, to reduce the size of the generated bytecode.
It's worth noting that when you are using mpy-cross to compile modules, the -O option applies only to the module and not to the whole project.
In summary, the -O option in mpy-cross is used to control the level of optimization that is applied to the generated bytecode. By specifying a numerical value from 0 to 3, you can determine how aggressive the optimization should be and make trade-offs between code size and performance. Keep in mind that the default optimization level is -O2, which provides a good balance between code size and performance, and if you are working with a memory-constrained device, you may want to try using a higher optimization level to reduce the size of the generated bytecode.