@ajb2k3 Thank you for your reply. Thank you also for your hint about creating a log on hackster.io. By now I created a v2 of my document. I changed the titel into "My first steps with the M5Stack UIFlow IDE". In the document I refer to it as "my notes". The Intro I changed. I digged a bit into what is 'Blockly'. At the end I wrote a paragraph "About me". I uploaded v2 and I deleted the initial version. OK about pm or email. I'll contact you soon.
Paulskpt
@Paulskpt
See also my profile description and my repos on Github. See also my Github Gists. Currently experimenting with: Rpi Pi Pico, Pimoroni Pico Lipo 16MB, Adafruit Feather's, ESP32, ESP32S2 and ESP32S3. I own various UM's TinyS3, FeatherS3 and ProS3. I own various M5Stack device like: TOUGH, Faces, Core2, Fire. Espressif ESP32-S3-Box.
Best posts made by Paulskpt
-
RE: Does there exist a doc/explanation of all commands/blocks used in UI Flow
-
FACES /apps/game.py doesn't run properly (solved)
Hi, I just got a FACES set delivered.
When exploring the apps that came with the UIFlow firmware (V1.3.3) I discovered the following:
The script/apps/game.py
did not run properly. It showed only the small icon image above the btnB position and a bigger version of this icon in the upper half of the display. However the latter did not change (which it should).
I discovered that the source of the problem was: filenames of the image files that had more than 8 characters.
In the folder/flash/img
I changed file names of these three image files to:rock.jpg
,paper.jpg
andscissors.jpg
.rps_img = (
'img/rock_128.jpg',
'img/paper_128.jpg',
'img/scissors_128.jpg'
)lcd.clear(lcd.WHITE)
lcd.image(48, 200, 'img/rock_128.jpg', 2)
lcd.image(143, 200, 'img/paper_128.jpg', 2)
lcd.image(238, 200, 'img/scissors_128.jpg', 2)This fact did not crash the script but it worked only partially.
I made the following modifications:
a)rps_img = (
'img/rock.jpg',
'img/paper.jpg',
'img/scissors.jpg'
)b) since there was already defined
rps_img
, I used this in the following commands:lcd.image(48, 200, rps_img[0], 2)
lcd.image(143, 200, rps_img[1], 2)
lcd.image(238, 200, rps_img[2], 2)Another problem occurred after I flashed the device with the latest UIFlow firmware (V1.9.4) using M5Burner.
Now thescript /apps/game.py
crashed because the functionmachine.random()
does not exist anymore.
The command:rand = machine.random(2)
I replaced by:
from random import randint
rand = randint(0,2)
Now the script ran again OK.
-
RE: DS3231 on M5Stack - Need your Help
@morguane I just saw your topic (of almost a year ago). I guess you solved your problems with the external RTC by now. But anyway liked to inform you about the repo I published on GitHub, using a D3231 RTC with a M5Stack Core1 (BASIC). DS3231 on M5Stack_DS3231_uRTC.
Regards, -
RE: UIFlow 2.0.0 firmware preview version
Hi,
I just recently stepped into the 'world of M5Stack'. I am learning fast :-). Yesterday I published a small repo for M5Stack on GitHub and posted this fact in this Community forum. Thank you for your efforts to improve the firmware for M5Stack devices. The past ten years I experimented with Arduino, Raspberry Pi's (all models) , ESP32-S2. I prefer to write in Python but also built projects in C, C++. While trying to get aquainted to the M5Stack firmware I used REPL in Thonny to see which modules/functions are present in the several libraries. I discovered that there exist (at least appear in the dir() listings issued in REPL of Thonny).doubling of functions in the various library modules
, for example: in 'vfs' exist: mount, umount, mkdir, chdir etcetera. These same functions also exist in the 'uos' module: mount, umount, mkdir, chdir and more. The module 'os' has the same contents as 'uos'. To me this is: a)confusing
; b) if it are not a kind of 'links' (or say: 'redirection' -- my expression to this phenomenon) of a function in library 'x' to a function in libary 'y', then it will be awaste of memory
too; c) this fact does not help to improve the quality and reliability of programs. I think that a function should be unique: be in one place only. This will also make writing and reading code more easy; helps preventing bugs and so on. But this is just a thinking on my side. I am not familiar with the internals of the current set of modules that make up the micropython firmware for the M5Stack family of devices. I started programming around 1978 with a 'computer' having only 64kB of RAM. Learning all kind of tricks, e.g.: re-use of RAM at runtime. If your intention is to 'optimize' the firmware you could start with a 'cleanup session' by taking out these confusing doublings.Question
: is there a reason to have the same function in more than one library/module? This isjust my first impression
which I wanted to share with you since you asked: '...that you help us develop and test firmware...'
Regards,
Paulus Schulinck (@Paulskpt) -
Does there exist a doc/explanation of all commands/blocks used in UI Flow
HI, a second post of this newby in UI Flow.
I unsuccessfully searched the internet to find a document that explains all the commands/blocks used in UI Flow. I found some but they are not complete. Or did I miss something?
E.g.: In the UI Flow part UI > Switch, there is the "set swtich(n) toggle". It is not clear to me what this block does:
a) toggles the switch(n) logic state: if the state was: "off", it switches the switch state to "on" and viceversa; or
b) the switch(n) is with this block assigned to be of the type "toggle switch".I ask this because it confuses me . I saw that there are two other blocks for switches in the same section: "set switch(n) on" and "set switch(n) off".
-
RE: Does there exist a doc/explanation of all commands/blocks used in UI Flow
@ajb2k3 The past days I studied and experimented a lot, mainly with a M5Stack Core2 and a M5Stack CardKB. I learned a lot, partly with help from your Handbook. Thank you for publishing it. I have the custom to make notes of my experiments. This is my way of learning. It also helps me, in later moments, to remember myself what I did in that moment of experimenting. I used your handbook as a start. I decided to rework it and add to it things that I discovered. The document is now 37 pages. I saved as a .pdf file. In the final paragraphs I added a description how I managed to download (backup) all files that were on the device. At first I was, for instance, not able to download .IMG, .JPG, .PNG and some other filetypes. Then I used a method that uses the Thonny app to write files to a Raspberry Pi Pico, to download files from the M5Stack device to the host PC using Thonny. I want to share the file with you. I would appreciate to hear from you what you think about it. Unfortunately, this forum interface does not allow to upload .docx or .pdf files. only images, so I copied the .pdf to a Dropbox folder. Here is the link to that folder:
[link https://www.dropbox.com/sh/5cy7v623ksp8mp1/AAADNdYm3x8P5-iSQzkyDFx0a?dl=0].
I'll keep this Dropbox folder available for some time.
Latest posts made by Paulskpt
-
M5Stack Cardputer NTP synchronized clock
Hi, FYI, just published on Github a repo called "M5Stack Cardputer syncd clock".
See: repo -
RE: How To Overwrite Text Without Flash?
@JonnyMac Hi Jonny, your post is quite old however I want to share with you (and anyone else) my experience.
I had the same "flash" or "flickering" while updating data on the M5Stack Core display. In my case update of elapsed seconds (every 10 seconds).
It was caused by the fact that quite a bit of redrawing took place in a same second. So I wrote the following lines to prevent redraw in the same second:See especially the following set of lines of code:
int elapsedSecsMod = elapsed_secs_t % 10; if (elapsedSecsMod > 0) elapsedSecs_shown = false; // reset flag if (start || (!elapsedSecs_shown && elapsedSecsMod == 0)) { sprintf(charVal, "%6lu", elapsed_secs_t); disp_nr(120, charVal); // Display elapsed seconds elapsedSecs_shown = true; // set flag. Prevents value get redrawn many times in the same second }
Below the lines above in the total example:
unsigned long start_t; unsigned long curr_t; unsigned long elapsed_msecs_t; unsigned long elapsed_secs_t; unsigned long elapsed_mins_t; unsigned long elapsed_mins_old_t = 0; unsigned long interval_t; int cur_h = 10; int cur_v = 10; void setup() { M5.begin(); M5.Lcd.fillScreen(BLACK); Serial.begin(115200); start_t = millis(); M5.Lcd.setCursor(cur_h, cur_v+120); M5.Lcd.print("Elapsed Secs:"); } void disp_nr(int v_incr, const char* sNr) { int cur_h_new = 0; M5.Lcd.setTextPadding(M5.Lcd.width() - 50); cur_h_new = 80; // NOTE: the 4th parameter to M5.Lcd.fillRect() must be at least 14 to cover all the height of a digit of M5.Lcd.setTextSize(2) !!! M5.Lcd.fillRect(cur_h_new, cur_v + v_incr, 100, 14, BLACK); // erase partial place for updating data if (strlen(sNr) > 0) { M5.Lcd.setTextSize(2); M5.Lcd.drawString(sNr, 100, cur_v + v_incr); M5.Lcd.setTextSize(1); } } bool start = true; bool elapsedSecs_shown = false; void loop() { char es2[] = "Elapsed Secs: "; int le = 8; char charVal[le]; curr_t = millis(); elapsed_msecs_t = curr_t - start_t; elapsed_secs_t = (long) elapsed_msecs_t / 1000; elapsed_mins_t = (long) elapsed_secs_t / 60; int elapsedSecsMod = elapsed_secs_t % 10; if (elapsedSecsMod > 0) elapsedSecs_shown = false; // reset flag if (start || (!elapsedSecs_shown && elapsedSecsMod == 0)) { // Every 10 seconds sprintf(charVal, "%6lu", elapsed_secs_t); disp_nr(120, charVal); // Display elapsed seconds elapsedSecs_shown = true; // set flag. Prevents value get redrawn many times in the same second } // [ more code here ] if (start) start = false; }
-
M5Stack boards package for Arduino causes compile errors
Hello,
On Friday 2022-12-02 on a desktop PC with MS Windows 11 Pro, and runing the Arduino IDE v1.8.19, a sketch
for a M5Stack Core2 would not compile while this sketch built successfully on 2022-04-24.To investigate the problem, I turned on 'File > Preferences > Show detailed messages during compilation'.
I discovered that the name of the folder of the M5Stack board package contained a '+' character (ASCII decimal value 43, hexadecimal value 2B).
The compiler reported that it could not find (the) file(s). (see below).There are some sources that describe the limitations of which characters can be used in the Microsoft Filesystems.
For example:
a) Naming Files, Paths and Namespaces;
b) Wikipedia Filename.As far as I understand it: for the current Microsoft filesystem, NTFS, the '+' character is not a 'reserved character'.
That is probably why there is no error generated when installing the M5Stack board package with the '+' in the name,
however source b above mentions limitations in FAT12, FAT16 and FAT32 file systems. See the text in the most right column,
the text I marked with an orange rectangle. Here the '+' character is listed as 'reserved character'. In other words: one cannot
use the '+' character in file or folder names for these file systems:
.Despite a successful install of the M5Stack board package, the compiler was not able to find files because of
the '+' character in the folder name.Fortunately I was able to install the package with version ID: '2.0.5-1.0'. Next I was able to delete the package with version ID: '2.0.5+1.0'.
After this correction the sketch compiled and built successfully (again)Here the last part of the build session with the compile error:
The offending folder location and name was:
C:\Users<User>\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.5+1.0Today, when using the newest version of the Arduino IDE (version 2.0.3), I was asked to update a boards package from M5Stack.
While the version 2.0.5-1.0 was installed, the Arduino IDE suggested me to install the M5Stack version 2.0.5+1.0. Again the version
with the '+' sign in the version (and sure, the folder name too). With my previous experience I did not install the proposed update. (See the partial screenshot below):Maybe I address the wrong persons with this post.
Perhaps I should report this problem to the maintainer(s) of the compiler used in the Arduino IDE.Can I ask the moderators of this M5Stack forum to look into the matter and take corrective measures, if you think that is necessary?
Thank you. -
Not M5Stack product but 'family' ESP32-S3-Box MSFS2020 GPSout GPRMC and GPGGA data to 'esp-box'
The Espressif ESP32-S3-Box is a product that looks like some M5Stack products. I own quite a bunch of M5Stack products. When the Espressif ESP32-S3-Box (V 2.5) came out, I bought it. It was my intention to port my ongoing MSFS2020 GPSout project to the 'esp-box' (the (nick)name that Espressif uses for this device). It was until last weekend when through @Neradoc and @hathach, the maintainer of Adafruit tinyuf2 bootloader repo, on my request, had added the 'esp-box' to the list of boards compatible for the tinyuf2 bootloader. From that moment I was able to build a tinyuf2 bootloader firmware for the 'esp-box'. When that was done, I was able to copy the latest version of CircuitPython (V8.0.0-beta.2) to the device. Finally I was able to port my project to the 'esp-box'.
That is why I created this post here so you can read about the existance of my project. See my repo on Github.
Below some REPL output:
soft reboot Auto-reload is on. Simply save files over USB to run them or enter REPL to disable. code.py output: ]0;🐍Wi-Fi: off | code.py | 8.0.0-beta.2\ loop(): my_machine= "ESP32-S3-Box-2.5 with ESP32S3" MSFS2020 GPS GPRMC data reception decoder script by @PaulskPt. Number of loops in this run: 99 ........................ Start of loop 1 ck_uart(): nr of bytes= 120 ck_uart(): rcvd data: bytearray(b'$GPRMC,215807.00,A,5837.7935,N,13810.7771,W,164.0,319.8,161022,18.2,E*72\r\n$GPGGA,215807.00,5837.7935,N,13810.7771,W,1,05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') ck_uart(): nr of bytes= 33 ck_uart(): rcvd data: bytearray(b',0.0,4266.7,M,0.0,M,0.0,0000*51\r\n810.7771,W,164.0,319.8,161022,18.2,E*72\r\n$GPGGA,215807.00,5837.7935,N,13810.7771,W,1,05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') ck_uart(): nr of bytes= 153 ck_uart(): rcvd data: bytearray(b'$GPRMC,215811.00,A,5837.9408,N,13811.0171,W,164.0,319.6,161022,18.2,E*76\r\n$GPGGA,215811.00,5837.9408,N,13811.0171,W,1,05,0.0,4266.7,M,0.0,M,0.0,0000*5B\r\n\x00\x00\x00\x00\x00\x00\x00') ck_uart(): * at -11, $GPRMC at 0, $GPGGA at 74, n4 =114 loop(): characters rcvd: 153 loop(): split_types() result = True is_ac_stopped(): value of gs = 164.0, len(gs) = 5 is_ac_stopped(): value of v_gs = 164 loop(): handling msg nr: 01 lcd_pr_msgs(): Duration rx -> lcd: 241 mSecs loop(): gc.mem_free()= 8148128 Waiting for serial com line to become available... End of loop 1 ........................
Note: because the 'terminalio.font' doesn't have a glyph for the 'degrees' character I used the caret '^' instead,
until I have added a font that can display the degrees character.For some other microcontroller i have ports of the same project on Github.
-
RE: M5Stack D3231 uRTC module
PROBLEM SOLVED
At startup :
if flag 'power_lost' is True:
the external DS3231 is set with pre-determined datetime (adjust by hand)
next the built-in RTC is started with the datetime from the DS3231if the flag 'power_lost is False:
the built-in RTC is started with the datetime from the DS3231During the main loop displaying the datetime from the built-in RTC.
I put a short video in the images folder inside the dropbox folder (see the link in my post above).
-
RE: M5Stack D3231 uRTC module
I have some experience with programming RTC modules but this problem I am not (yet) able to solve.
Is there anyone who read my post above and has looked into the code to see if he/she can give me a hint
to solve this problem of RTC not updating ?See my tweet in May 2021:
.
-
RE: M5Stack D3231 uRTC module
Troubleshooting
The past week I am trying 2 different external DS3231 devices on a m5stack FIRE. I have a GROVE Hub (with 3 I2C connectors) connected to the Port A of the Fire. The DS3231 I connected to the I2C Hub. I connected a MiniWare LA104 analyzer to a 2nd port otf the I2C Hub. a M5 RGB LED I connected to Port B of the Fire. The main script I programmed to let the middle RGB LED blink at the moment the script calls rtc.datetime(). Everything works except the readings from the DS3231 clock register (Addresses 0x0 - 0x6) remain mostly static. I don't see the seconds increase. I see the minutes increase but after 3 increases jump back to zero, e.g.: time is 18:40:00 After a minute the time shows 128:41:00, then 18:42:00 and then back to 18:40. This while at that moment the script runs inside a loop. So, the initial setting of the datetime registers only occur at the startup moment.
I created a link to a Dropbox folder with the script main.py, the rtc classes in urtc.py and other files used during a run. Also a subfolder with various images that will give some impressions about the setup and signals visualized.
Link: RTC_folder_in_DropboxQuestion:
Why are the datetime rtc registers not updating?Note:
I modified the urtc.py file. Added various functions. Also added some try...except... blocks to prevent crashes in case functions receive a NoneType value or in case an I2C bus error occurs (this happened once in a while since I have the I2C analyzer connected to the bus. Mayby the handling of the analyzer did cause some noises on on or more lines. -
RE: Where do I find game Super Mario for M5 FACES ?
@flypeek Thank you! Never thought I should look in the 'Lessons' section.
-
Where do I find game Super Mario for M5 FACES ?
The M5Stack advertisements for the M5 FACES core all show an image of the game Super Mario used on the FACES device. Also, I saw videos on YouTube about this game being played on the M5 FACES device. Unfortunately, I am unable to find a link to where one can download that retro game. Stange that M5Stack uses this game a lot for marketing purposes but does not furnish their clients with a link. The page Learn doesn't show the game as an learning example. I don't mind if I must buy the game.
-
FACES /apps/game.py doesn't run properly (solved)
Hi, I just got a FACES set delivered.
When exploring the apps that came with the UIFlow firmware (V1.3.3) I discovered the following:
The script/apps/game.py
did not run properly. It showed only the small icon image above the btnB position and a bigger version of this icon in the upper half of the display. However the latter did not change (which it should).
I discovered that the source of the problem was: filenames of the image files that had more than 8 characters.
In the folder/flash/img
I changed file names of these three image files to:rock.jpg
,paper.jpg
andscissors.jpg
.rps_img = (
'img/rock_128.jpg',
'img/paper_128.jpg',
'img/scissors_128.jpg'
)lcd.clear(lcd.WHITE)
lcd.image(48, 200, 'img/rock_128.jpg', 2)
lcd.image(143, 200, 'img/paper_128.jpg', 2)
lcd.image(238, 200, 'img/scissors_128.jpg', 2)This fact did not crash the script but it worked only partially.
I made the following modifications:
a)rps_img = (
'img/rock.jpg',
'img/paper.jpg',
'img/scissors.jpg'
)b) since there was already defined
rps_img
, I used this in the following commands:lcd.image(48, 200, rps_img[0], 2)
lcd.image(143, 200, rps_img[1], 2)
lcd.image(238, 200, rps_img[2], 2)Another problem occurred after I flashed the device with the latest UIFlow firmware (V1.9.4) using M5Burner.
Now thescript /apps/game.py
crashed because the functionmachine.random()
does not exist anymore.
The command:rand = machine.random(2)
I replaced by:
from random import randint
rand = randint(0,2)
Now the script ran again OK.