Can't get M5Stack to work properly



  • Anyone knows what the issue is this time?



  • @justsomeguy

    It's still working for me. What region of the world are you are in?
    Can you access the data with a browser? https://tillierscout.herokuapp.com/api/v1/entries?count=1



  • "SGVIabel (in big letters with DiffSCVI over it"

    This usully means that you have the same label set for both out puts or the same screen location for both labels.



  • @world101 Yours? Yes. But I'm accessing the nightscout for my niece: https://lmnightscout.herokuapp.com/api/v1/entries?count=1

    Region is Europe, Croatia to be more precise



  • @justsomeguy

    Ah, okay. It's not actually my data. It is Chris-O's (author of the program). I thought you were still trying to get the app working with Chris' API and couldn't access his data feed (due to some firewall blocking issue, geolocation blocking, etc.).

    Let me see if I can figure out how to get his program working with your niece's data feed. Her feed seems to be only missing the dateString, but I'm not sure he's using that anyway. I'm curious though, what does "Tomato" mean in her data feed? Chris' data feed has "share2" at the end.



  • @justsomeguy

    I got it working now with her data feed and also made a few improvements to the program. Here you go:
    uiFlow file
    MicroPython file

    Don't forget to change the wifi settings before running on the device.



  • Seems to work now.

    Just one final question - how do I get the values in mmol (as they are on the Nightscout).
    I assume it's the SVG value and I saw no conversion in the code itself, which means the SVG is the value in whatever units are used in the US?

    Can I just edit a line like this (bolded is changed):
    SGVlabel.setText(str((str('') + str(round(sgv / 18),1))))

    Also, I see no alarm sounding in the code, so I added
    speaker.sing(240, 10/16)
    right under the svg value check for color. Can anyone tell me what the two values represent? I want it really loud.



  • @justsomeguy said in Can't get M5Stack to work properly:

    Seems to work now.

    Just one final question - how do I get the values in mmol (as they are on the Nightscout).
    I assume it's the SVG value and I saw no conversion in the code itself, which means the SVG is the value in whatever units are used in the US?

    Can I just edit a line like this (bolded is changed):
    SGVlabel.setText(str((str('') + str(round(sgv / 18),1))))

    Yes. Chris-O's dashboard displays the SVG value in mg/dL and it looks like the conversion between mg/dL and mmol/L is to divide mg/dL by 18. So you got it.

    Also, I see no alarm sounding in the code, so I added
    speaker.sing(240, 10/16)
    right under the svg value check for color. Can anyone tell me what the two values represent? I want it really loud.

    speaker.sing(frequency, beats) where beats are: 1/16, 1/8, 1/4, 1/2, 1, 2, or 4
    you could also do speaker.tone(frequency, duration) where duration is time in milliseconds

    For loudness you want speaker.setVolume(int) where int is 0 (no sound) to 1 (full/highest volume). 0.5 is half volume.



  • Well,...

    I got everything working...and then I accidently hit ERASE in M5 Burner (ended up uploading a dozen different version of the app trying to get it to work, and read that you only delete apps trough the burner) and now the entire thing is DEAD, doens't react to anything anymore.


    I have no words.



  • @justsomeguy

    Don't be discouraged. It's somewhat hard to brick the m5stack devices. Just do erase again (to be sure), next burn uiFlow v1.6.2 firmware, and then load the latest known working version of your program.

    There used to be a way to delete apps from the App menu on the device, but that functionality has been lost in the last few revs of firmware (not sure why). What I typically do is connect to the REPL and manually delete what I want from the /flash/apps directory on the device. Or you could use Thonny or Mu IDE to do the same.



  • Thank you again. It works (again)!