How to get Device infos from m5stack Devices



  • Im working on a plugin for Eventghost ....
    which enables communication via tcp and udp sockets
    and I was wondering if I could get Device info from the m5stack devices...

    For example , using a M5Stick C plus ....
    I would want to get something like this
    {model : M5Stick C plus }

    Is there a function I could run which would give me this for every m5stack device ?

    If there is more info accesivle like maybe
    firmware version ...
    batterie status ,
    saved wifi networks , password...
    or whatever ... I would like to know ;)

    Maybe you can point me to the place where I should look
    ty.



  • you could refer to this program to get the battery status info:

    https://github.com/m5stack/M5StickC/tree/master/examples/Basics/AXP192

    but before you compile it. you need to download the M5StickC-Plus lib for you device. and change the program include code.

    https://github.com/m5stack/M5StickC-Plus



  • @m5stack said in How to get Device infos from m5stack Devices:

    you could refer to this program to get the battery status info:

    https://github.com/m5stack/M5StickC/tree/master/examples/Basics/AXP192

    but before you compile it. you need to download the M5StickC-Plus lib for you device. and change the program include code.

    https://github.com/m5stack/M5StickC-Plus

    Wait so there is no way to get info for Model name ?
    , or firmware version ? {"model : M5Stick C plus , firmware : v1.1.1}

    Which is what im mainly intersted in.

    I just want some indicator I can acces to figure out what m5stack model it is
    (using micopython) ? Workarounds would work for me too

    I want to send a message ... and the m5stack device should tell me what model it is (Response : "I am a M5Stick Model C)

    No ideas ?

    Edit : Im using UIflow



  • Maybe you could scan the appropriate i²c buses, and based on what addresses are detected on which pins, you can determine what type of hardware is and on what platform.

    You should view some files on flash like boot.py and main.py in root folder on spifss in your device. and there is also file with probably cfg extension (its contain some information stored).

    In uiflow you could use execute block: with
    print( VERSION )
    or
    print(m5base.get_version())
    statement to get uiflow firmware wersion.

    You need add two underscore characters after and before VERSION name (these characters aren't displayed in post)



  • @medy you could use API to get the firmware version.

    import uiflow 
    uiflow.get_version()
    

    about the device model Info API. we will add it in the next version. thank you.



  • @m5stack said in How to get Device infos from m5stack Devices:

    about the device model Info API. we will add it in the next version. thank you.

    That will be great to have. Thanks!



  • @m5stack
    Ohh that would be great.
    Thank You ... This will make things easier.

    When the things is implemented .... where can I read about the added functions ?

    can you point me to the place @github ?
    I only found that get_version is imported by
    import m5base

    but I couldnt find m5base code on github :D



  • we didn't open-source all firmware code.

    this function would add it in the next version. we will release it this week or next week.

    the API would be like that

    import deviceCfg
    deviceCfg.get_board_name() 
    


  • @m5stack

    Alright.

    Guess I will just have to ask again in a couple weeks in case the function doesnt show up somewhere in the uiflow repo.

    Thanks for adding the stuff



  • @m5stack

    btw I just ordered the new e-ink model ....

    I havent messed with deep sleep yet ... is there somewhere I can read up on sleep modes and how to use them with the m5stack ?
    I was hoping I could use the ink model efficiently by geting data via wifi once a day and then power it down and wake up automaticall if thats possible ?

    If I remember correctly the esp32 should be able to do this right ?



  • There is a way to get the information as M5Burner queries the information before attempting to erase the firmware.

    Look at esptool.py and see how it queries the port.



  • @ajb2k3 said in How to get Device infos from m5stack Devices:

    There is a way to get the information as M5Burner queries the information before attempting to erase the firmware.

    Look at esptool.py and see how it queries the port.

    I have no idea what you are talking about.

    I just wondered if deep sleep works out of the box on m5stack like described here :?
    deep sleep esp32

    or if there is anything else I need to look out for. I just want :
    1- make device sleep
    2-wake up after 24 hrs
    3 - run script
    4- repeat

    So I could put it somewhere on a single charge ... and it would maybe last a month or more

    Edit .. nvm I think you were still talking about the device info .. myy bad ..
    Already marked this as solved in my head ... as I will just wait for the update as @m5stack mentioned ... and use that for device info.



  • Hello @Medy

    a word of advise regarding deep sleep: while the ESP32 chip by itself consumes very little energy in deep sleep (in the microamps range) a complete M5Stack device with its internal overhead of voltage regulators still takes a couple of milliamps even with the display off.

    According to the schematics the new CoreInk model uses a similar internal structure, first boosting the battery voltage up to 5 volts (boost IC) and then reduce it back down to 3.3 volts (step down IC). Both are lossy conversions.

    As already mentioned in other posts, M5Stack devices are made for educational purposes and not primarily trimmed for real low power consumption, at least not in a sense of what an ESP32 could achieve.

    So I'd be surprised if you could get more than a couple of days deep sleep out of one battery charge.

    That said, I don't yet own an CoreInk model so my conclusions for that model could be completely wrong. For the other models (M5Stack, M5StickC and M5Core2) I made some measurements while in light or deep sleep. You can find the results though the link in my signature.

    Thanks
    Felix



  • @felmue

    thanks for the heads up ... I would hope that they made some kind of effort in that regard ... for this particular model.... if anywhere .. I would expect it here..

    Quote :
    ", RTC(BM8563) for controlling accurate timing and deep sleep funcionality. "

    Sure its educational ... so it will be worth to me regardless...

    if not ... it will still be good to get me started for maybe my own project with a regular esp32 or smth...

    E-ink combined with low power is intersting to me .
    Already had my eye on a combination of waveshare e-ink displays combined with a esp32 setup....

    So this is a good start ;)



  • @felmue Do you have CoreInk schematic? I cannot find it. Eg. pin 35 seems to be used to measure battery voltage in samples, but no word in docs. Also DeepSleep seems to be supported in some newer unreleased libraries and does not work whne CoreInk is on USB power.



  • @martin8bity said in How to get Device infos from m5stack Devices:

    @felmue Do you have CoreInk schematic? I cannot find it. Eg. pin 35 seems to be used to measure battery voltage in samples, but no word in docs. Also DeepSleep seems to be supported in some newer unreleased libraries and does not work whne CoreInk is on USB power.

    There are no know schematics for the coreink however I have been trying to create some.



  • Hello @Martin8bity

    only what has been published as overview schematics. And yes, GPIO35 seems to have been assigned to read the battery voltage.

    Thanks
    Felix



  • @m5stack said in How to get Device infos from m5stack Devices:

    we didn't open-source all firmware code.

    this function would add it in the next version. we will release it this week or next week.

    the API would be like that

    import deviceCfg
    deviceCfg.get_board_name() 
    

    I installed the latest firmware so was it included ? What is the name of the funciton ?
    Can I rely on this working across all devices ? otherwise I may just need to let the user name devices themselves. ;)



  • @felmue Thank you. The overview schematic is not complete and dos not contain enough information.
    @m5stack It is very hard to develop anything for your devices if your libraries are incomplete, buggy and poorly documented (sorry, but they are) and the detailed schematic is non existent. Either create a working libraries or allow people to do it themselves, which is really hard without schematic. Without this I cannot use your devices in my projects (I have thousands of users, who buy your products just because of my projects). I do it for free asn Open Source. I am excited with all new product and I am also big evengelist for the M5Stack, but with more and more products I spent tens of hours just by finding how it works and I am starting to be frustrated from it. Sad.



  • @m5stack said in How to get Device infos from m5stack Devices:

    you could refer to this program to get the battery status info:

    https://github.com/m5stack/M5StickC/tree/master/examples/Basics/AXP192

    but before you compile it. you need to download the M5StickC-Plus lib for you device. and change the program include code.

    https://github.com/m5stack/M5StickC-Plus

    Hi, thanks for you answer,

    But is secure that use this files, the AXP192 library files from StickC in the CoreInk board? I did see that in axp.begin() method you enable some voltages but the board is different, maybe I could be damage my CoreInk?