Navigation

    Welcome to the Pycom forum

    Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Tags
    3. threading
    Log in to post

    • T

      check if thread is running
      MicroPython • threading watchdog • • tttadam  

      3
      0
      Votes
      3
      Posts
      43
      Views

      J

      @Gijs Thought of about the same thing. I would just add a short sleep at the end of the loop, so that in case it fails very quickly it doesn't go into a tight loop, especially if the code in the thread is sending anything (over the network or to a device connected via I2C or SPI etc.). Of course it relies on the contents of the function being able to restart a second time. I'm not sure this is 100% fool proof as I believe there are cases when some conditions will not result in proper exceptions being thrown, so of course using and feeding WDT (or an external watchdog) may be a good idea as well.
    • T

      Dual processor operation?
      Discussion • pycom threading dual core dual processor • • troy salt  

      3
      0
      Votes
      3
      Posts
      432
      Views

      P

      @crumble said in Dual processor operation?: @troy-salt User code runs only on one core. The other is used for network related stuff. @troy-salt has it correct.
    • J

      no execution after lora thread
      LoPy • lora mqtt threading • • james  

      5
      0
      Votes
      5
      Posts
      816
      Views

      C

      @robert-hh Hello there Robert. Thanks for the reply. Both of my threads have 60 sec sleeps inside. The lora thread have other sleeps as well.
    • J

      mqtt in another thread
      LoPy • lopy lora mqtt threading mqtt bugs • • james  

      1
      0
      Votes
      1
      Posts
      434
      Views

      No one has replied

    • G

      threading - thread starts, but main does not run
      MicroPython • thread threading • • gregcope  

      9
      0
      Votes
      9
      Posts
      1779
      Views

      G

      @seb said in threading - thread starts, but main does not run: https://github.com/pycom/pycom-libraries/issues Ta. Opened; https://github.com/pycom/pycom-micropython-sigfox/issues/158
    • G

      threading error (NameError: name 'xxx' is not defined)
      MicroPython • thread threading • • gregcope  

      4
      0
      Votes
      4
      Posts
      2489
      Views

      T

      Functions and methods are actually different things and exist in different scopes. You can't look up a method by name without the self. (or similiar) prefix. Unless you bind it to another name in the current scope. The same applies to class methods.
    • G

      Anyone used microGPS with pytrack, threads?
      Discussion • pytrack gps threading nmea • • gregcope  

      4
      0
      Votes
      4
      Posts
      830
      Views

      G

      Hi Not noticed the lTE issues as this does not work in the uk. It should keep the almanac and other data when in sleep mode, however the sleep architecture is one where essentially recovering from sleep is a (re)boot, so you need to design accordingly. Also, do not use an SDCard as this will stop the sleep current from going below 5mA. I have not progressed this for over a year. Sorry.
    • N

      Best practice - Threading, Events, Interrupts and Memory
      MicroPython • sipy micropython interrupt threading alarm • • nathanh  

      4
      0
      Votes
      4
      Posts
      2100
      Views

      N

      @robert-hh Thanks for that (and your assistance on my other question). I would be interested in your thoughts on how the "main" thread would check these flags as that goes back into using some kind of event/interrupt to know the timer/sensor readings have read something in. My first thoughts would be a while loop with a sleep count and checking periodically but feels like that is not the correct way to go about it. At this stage I am currently working with two or three period alarms executed from the "main" thread and a single secondary thread that is in a while loop and constantly sleeping looking for values at certain intervals which it then does the "heavy" processing and sending. @crumble - Yes I must admit I need to get out of some of my older habits to focus more on efficiency than simplicity/readability. However, I must admit I have been struggling to find material on how Micropython, specifically, works with allocation of memory for objects/variables/functions and what is the most efficient practice. Most examples go back to pure Python requiring multiple libraries to do memory statistics, even then not actually demonstrating what is the best way. Simple questions as to how the GC works, if I need to set variables to 'None' at the end of a function, or the use of a list over three distinct variables. The only way I am really finding it is by doing it both ways and testing it with gc.mem_free() which is time consuming and feels more like guess work. Would be interested on your point 4 about modules and compiling at boot time.
    • T

      ImportError: no module named 'threading'
      LoPy • lopy thread threading • • thomand1000  

      3
      0
      Votes
      3
      Posts
      3073
      Views

      seb

      try _thread
    • A

      HW needed for development with WiPy2.0
      Discussion • threading https host connection • • Ajit.Sarnaik  

      7
      0
      Votes
      7
      Posts
      2022
      Views

      A

      Thanks guys for the information.
    • E

      LoPy multiple cores?
      LoPy • lopy threading dual core multicore • • emil-jacero  

      6
      0
      Votes
      6
      Posts
      1710
      Views

      E

      @jmarcelino Great, then work is being done :) Thanks for the reply!
    • S

      Lora<->Wifi Gateway and Threading
      LoPy • threading lora gateway lora wifi • • spookyrufus  

      1
      0
      Votes
      1
      Posts
      841
      Views

      No one has replied

    • A

      How to get line from stacktrace inside thread
      MicroPython • micropython thread threading exception • • Andrea Filippini  

      1
      0
      Votes
      1
      Posts
      857
      Views

      No one has replied

    • A

      Freeze trying to open file on SD
      MicroPython • lopy micropython thread sdcard threading • • Andrea Filippini  

      6
      0
      Votes
      6
      Posts
      2070
      Views

      A

      UP Anybody got a clue?
    • 1 / 1