Faces kit badly needs intro card



  • Greeting everybody, new user here. A couple of days ago I received a "Faces" kit", and before anything else I'd like to say that from a hardware point of view I'm extremely impressed: it appears to be a good design well-implemented.

    Having said that, I immediately ran up against some problems and found myself writing an intro card which could potentially be shipped in the box or which I could hand out to colleagues etc. Unfortunately I still found problems caused by documentation and libraries being spread around all over the place, so thought that the best thing to do might be to post the text I've done already in the hope that somebody else can "fill in the gaps": I have limited time and I'm afraid that at the moment this isn't at the top of my stack.

    -----8<-----
    The unit is shipped loaded with MicroPython, and can be expected to report something like this when powered up:

    OSError: [Errno 2] ENOENT
    MicroPython v1.9.2-453-g4c14d0d6-dirty on 2017-12-23; ESP32 module with ESP32
    Type "help()" for more information.

    If you've got this far then you might have already discovered that pressing the red button on the left powers it on. While MicroPython is running pressing the button twice in rapid succession will turn it off (this might change if you load a custom application program).

    • Will a Python program on an SD-card be automatically executed? Where is the name etc. of this documented?

    • For somebody programming locally (i.e. with a USB connection) then these points are relevant:

    • What exactly is preloaded in Flash, and are there any status etc. commands useful to somebody connected via a terminal?

    • How is a python program put into Flash etc.?

    • Where can the variant of MicroPython that's loaded on the unit as shipped be found? What else is needed to /exactly/ recreate its shipped state?

    • Does the unit as shipped have a standard Arduino loader on it, so that it can be programmed directly from the Arduino IDE with the ESP32 extensions?

    • Sources for the Atmel microcontrollers on the "Faces" keyboards may be found at https://github.com/m5stack/FACES-Firmware But what is needed to compile them, and what has to be running on the ESP32 to load the binary onto the keyboard (or does this need AVR programmer hardware)?

    • For somebody programming remotely, i.e. using a "cloud-based" IDE, then these points are relevant:
    • Description of setting up Wi-Fi and any other prerequisites here.

    • URLs of cloud development tools here.

    I'd really appreciate having the above information to hand so that when I come back to this (or when I have the odd five minutes to spare) I can see better how everything hangs together.

    MarkMLl

    p.s. That lanyard's a bit of a swine to fit :-)

    pps Can somebody confirm that the charging base is power-only, i.e. a unit's not visible to an attached computer if connected via the base.



  • Welcome to the forum.
    I don't see any attachments?
    Please feel free to share the card in the Documentation sections as documentation is still a work in progress (noting can ever be completed with technology)

    Single and double presses are normal throughout all core models.
    No, code is not loaded from the sdcard (as far as I know) they are loaded from inside the main storage and must be called main.py.

    Python is installed using M5Burner found on the main page download section.
    Currently the M5Stack uses a varient of Loboris Mycropython port but work is underway on a specific dedicated port.
    My document is around showing how to install UIFlow/micropython firmware and update the firmware on M5Stack and M5Sticks.
    I've haven't got to the section on updating atmega firmware yet but I have all the tools and software (Arduino) installed.

    As I said there is still a back log of documentation being developed by @m5-docs and myself that need pulling together and compiling into a single document. I am currently working on the UIFlow Blocky side for beginners and there is interest in developing the Micropython docs by another forum member.



  • First off we'd like to thank you for buying the faces kit and thanks for the commendation on the hardware. We are deeply sorry about the state of information resources for the faces and it's definitely something we are working on to improve. To address your questions.

    1. The python program that is set to run on boot is first boot.py followed by main.py in the flash partition of the device. If you wanted to have a .py file on the sd card boot you would need to alter the boot.py file to cause it to do so.

    2. On the stock faces there is simply a one line boot.py file. In future we will try to release a firmware for the faces kit which has the most up to date build of our flavour of micropython and the REPL combined.

    3. python scripts and other files can be transferred to the devices flash partition using programs such as Ampy, Rshell or Upycraft

    4. Here is the stock firmware for faces keyboard https://github.com/m5stack/M5-3D_and_PCB/tree/master/FACES (odd place to put it I know)

    5. Since M5Stack is using the esp32 it can easily be programmed with the Arduino IDE, follow this guide to get started and make sure to install the m5stack libraries here

    6. The keyboard firmware should be able to be reflashed by using the files you mentioned with any avr programmer (an arduino in avr-isp mode will do)

    7.Uiflow Micropython builds come with a standard menu system that allows you to connect to wifi by first connecting to the m5stacks access point and then configuring your wifi credentials. M5cloud seems to be inactive, I haven't tried it myself in some time.

    Great idea about a getting started card, I think our German distributor Conrad has a decent manual that comes with the faces kit, but I don't know why we don't.

    Hope that helps, please don't hesitate to ask if you need more information

    Best

    Luke



  • I'm still here :-)

    Thanks both for the comments. I've been working through a backlog of stuff, and one of the jobs was going through a number of Arduino-type development boards. One of these had an ESP32 on it, and after I loaded https://dl.espressif.com/dl/package_esp32_index.json into the Arduino IDE I could see m5stack support... didn't go beyond that pending working out the Python side of things.

    Noted your comment about boot.py etc., and the Python scripts for accessing Flash. I presume that that means that it can't be persuaded to look like a filesystem to an attached computer (FUSE on Linux or whatever). Presumably it;s a custom boot.py which would allow it to select scripts from an SD-Card.

    I presume from what you said that the keyboards need to be connected directly to an Arduino or suitable device programmer for programming, rather than via bridge software running on the core module itself.

    I still think it's a particularly nicely-executed unit, so please don't feel you have to apologise for anything. Even if it is a bit small for a custom APL keyboard ;-)

    I'll continue tinkering but I've got rather a lot on my plate at the moment.

    Best wishes, MarkMLl



  • The firmware on the arduinos can be updated with a USB to UART adapter. I only mentioned the arduino because I'm using it to program an adapter I'm developing, the UART connections are broken out on the side of the keyboard.

    I have asked about the ability to have the M5Stack appear as a USB device but I'm not sure about where the issue lies, all I know is that you can use REPL over USB and access the file structure using additional programs.



  • @ajb2k3 OK, so hook the keyboard to be updated onto a Bus Pirate or whatever rather than expecting the core module to provide a bridge.

    The core unit appears as a USB serial device allowing interaction with MicroPython using a terminal emulator, hence things like Rshell appear to be in the spirit of e.g. rsh/rcp i.e. the user (or user's desktop computer) tells the core to e.g. output a file, rather than there being a filesystem API.

    Apropos documentation, I'm afraid I've been left with very definite ideas as to how things should be done after a student on a course I was supporting wrote an extremely methodical dissertation on how to interact with the university's mainframe operating system. For each command she covered, she summarised

    • What it did.
    • Its prerequisites (in today's terms, whether it required a GUI etc.).
    • How to back out of it without changing anything.
    • And only then went onto the meaty stuff.

    The operating system was called Multics, I doubt anybody there has heard of it :-)

    Best wishes, MarkMLl



  • After coming from Arduino, esp32 based products can be confusing. We are use to pins being certain things on an Arduino but with the Esp32 most pins have loads of different functions 10+ per pin. M5STACK have done an admirable job of understanding and untangling these functions for us to understand.

    Take a look at the data sheet for the esp32 in you will be amazed at what has been squashed into the tiny chip!



  • I'd hardly describe myself as "coming from Arduino" :-) I come from punched cards and bare-metal embedded systems, and if Arduino has a place in my affections it's simply that it's a useful abstraction that a lot of people have agreed on.

    MarkMLl



  • @markmll I didn’t meet you I meant me!