• check if thread is running

    MicroPython watchdog threading
    3
    0 Votes
    3 Posts
    57 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.
  • Dual processor operation?

    Discussion pycom dual core dual processor threading
    3
    0 Votes
    3 Posts
    437 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.
  • no execution after lora thread

    LoPy lora mqtt threading
    5
    0 Votes
    5 Posts
    831 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.
  • mqtt in another thread

    LoPy lopy threading lora mqtt mqtt bugs
    1
    0 Votes
    1 Posts
    436 Views
    No one has replied
  • 0 Votes
    9 Posts
    2k 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
  • 0 Votes
    4 Posts
    2k 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.
  • Anyone used microGPS with pytrack, threads?

    Discussion gps nmea pytrack threading
    4
    0 Votes
    4 Posts
    832 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.
  • 0 Votes
    4 Posts
    2k 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.
  • ImportError: no module named 'threading'

    LoPy lopy thread threading
    3
    0 Votes
    3 Posts
    3k Views
    sebS
    try _thread
  • 0 Votes
    7 Posts
    2k Views
    A
    Thanks guys for the information.
  • LoPy multiple cores?

    LoPy lopy threading multicore dual core
    6
    0 Votes
    6 Posts
    2k Views
    E
    @jmarcelino Great, then work is being done :) Thanks for the reply!
  • Lora<->Wifi Gateway and Threading

    LoPy lora gateway lora wifi threading
    1
    0 Votes
    1 Posts
    845 Views
    No one has replied
  • 0 Votes
    1 Posts
    872 Views
    No one has replied
  • 0 Votes
    6 Posts
    2k Views
    A
    UP Anybody got a clue?