Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Foxhound
    F
    • Continue chat with Foxhound
    • Start new chat with Foxhound
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    Foxhound

    @Foxhound

    4
    Reputation
    21
    Posts
    1909
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online

    Foxhound Follow

    Posts made by Foxhound

    • RE: [Solved]Exceptions & timeouts with GET Requests

      @m5-docs so it turns out I was forgetting to close the response.

      try:
          lResponse = urequests.get( URL , headers = self.fHeaders )
          content = ujson.loads( lResponse.content )
          lResponse.close()
          return abs( content )
      except:
          return 0
      

      Solved the issue.

      posted in Micropython
      F
      Foxhound
    • RE: [Solved]Exceptions & timeouts with GET Requests

      @m5-docs said in Exceptions & timeouts with GET Requests:

      pass

      Thanks for your response, but a little confused with how this differs from mine?

      I'd love to do a timeout, is there a way to write a function that will timeout, similar to eventlib in Python? Or is there a different way I am supposed to be doing a get request that won't block.

      posted in Micropython
      F
      Foxhound
    • RE: Continue to try Wifi Connection indefinitely, and go back to the connection/reboot if a try fails.

      @ajb2k3

      Awesome, of course, I needed to call lcd.FONT_DejaVu24.
      However, I did manage to get lcd.font(lcd.FONT_DejaVu24) to work fine for me. I just called it at the top of my script and all is well.

      @lukasmaximus
      Thanks, I'll take a look at that, so far DejaVu24 is working well for me. But if i need to make it larger I'll be sure to check that out.

      posted in Micropython
      F
      Foxhound
    • [Solved]Exceptions & timeouts with GET Requests

      Hi,

      Thanks everyone on this forum for their help. Currently finishing off my project. However, somtimes my GET request fails, and it's causing my device to crash. What's the proper way to set a timeout or catch an error?

      I'm currently trying the following.

      try:
              lResponse = urequests.get( URL , headers = self.fHeaders )
              content = ujson.loads( lResponse.content )
              return abs( content )
          except:
              return 0
      

      However, this doesn't seem to be solving it. Any pointers would be greatly appreciated.

      Kind Regards,
      Fox

      posted in Micropython
      F
      Foxhound
    • RE: Continue to try Wifi Connection indefinitely, and go back to the connection/reboot if a try fails.

      @m5-docs

      Good idea, thanks mate!

      Also, can you tell me how to properly change the font? I'm trying to increase the size.

      lcd.font(FONT_DejaVu18)
      

      Doesn't compile

       lcd.font("FONT_DejaVu18")
      

      Doesn't do anything?

      posted in Micropython
      F
      Foxhound
    • RE: Continue to try Wifi Connection indefinitely, and go back to the connection/reboot if a try fails.

      @lukasmaximus

      esptool.py --chip esp32 --port /dev/${port} --baud 921600 --before default_reset --after no_reset write_flash -z \
      --flash_mode dio --flash_freq 80m --flash_size detect \
      0x1000 bootloader.bin \
      0xf000 phy_init_data.bin \
      0x10000 MicroPython.bin \
      0x8000 partitions_mpy.bin \
      0x170000 spiffs_image_0x170000.img
      

      I have a feeling however, I did not do this properly. However everything seems to be working fine besides not being able to get into the system, and not being able to change font..

      posted in Micropython
      F
      Foxhound
    • RE: Continue to try Wifi Connection indefinitely, and go back to the connection/reboot if a try fails.

      Yep sure will, I'll get it for you tonight.

      posted in Micropython
      F
      Foxhound
    • RE: Continue to try Wifi Connection indefinitely, and go back to the connection/reboot if a try fails.

      @lukasmaximus

      Hey Luke,
      thanks for getting back to me. I flashed with the flash.sh (I'm on linux) including all the .spiffs file.

      However, when I try to get I get the following.

      0_1556078818398_caf04472-80f1-4d4e-96a8-89d0f7ae5bfa-image.png

      posted in Micropython
      F
      Foxhound
    • RE: Continue to try Wifi Connection indefinitely, and go back to the connection/reboot if a try fails.

      @ajb2k3

      Quick one, do you know where the source code for m5base is?

      ALso, with ampy, have you been able to get into directories past /flash.

      WHenever I try and list things inside say lib(/flash/lib), it say it isn't a directory?

      posted in Micropython
      F
      Foxhound
    • RE: Continue to try Wifi Connection indefinitely, and go back to the connection/reboot if a try fails.

      @ajb2k3
      Okay awesome, thanks mate, have it working well now. Just need to make some modifications.

      Auto connect seems to only work when called, and looks like it will throw an error if not connecting. I've found the code on the repo, so I'll modify that to continue trying when booting up if no wifi is found, and upon disconnection, call the function again.

      Won't get much time to work on it for a little bit but will report back next week with my progress. Thanks very much for your assistance.

      Also, download didn't work but ampy working really well now, thankyou!

      posted in Micropython
      F
      Foxhound