You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
move files and fix weird workaround with proper more stack
This commit is contained in:
+1
-4
@@ -40,15 +40,12 @@ def printevents():
|
||||
print(f"at the start, thread stack used: {micropython.stack_use()}")
|
||||
print("relaymanager")
|
||||
relay_manager = RelayManager()
|
||||
time.sleep(3)
|
||||
#relay_manager.add_relay("wss://nostr-pub.wellorder.net")
|
||||
print("relaymanager adding")
|
||||
#relay_manager.add_relay("wss://relay.damus.io")
|
||||
relay_manager.add_relay("wss://relay.damus.io")
|
||||
relay_manager.add_relay("wss://relay.primal.net")
|
||||
time.sleep(3)
|
||||
print("relaymanager subscribing")
|
||||
relay_manager.add_subscription(subscription_id, filters)
|
||||
time.sleep(3) # allow the connections to open
|
||||
print("opening connections") # after this, CPU usage goes high and stays there
|
||||
relay_manager.open_connections({"cert_reqs": ssl.CERT_NONE}) # NOTE: This disables ssl certificate verification
|
||||
time.sleep(2) # allow the connections to open
|
||||
@@ -17,7 +17,7 @@ class Thread:
|
||||
#_thread.stack_size(10*1024) # might not be enough
|
||||
#stacksize = 12*1024
|
||||
# small stack sizes 8KB gives segfault directly
|
||||
stacksize = 12*1024
|
||||
stacksize = 24*1024
|
||||
print(f"starting thread with stacksize {stacksize}")
|
||||
_thread.stack_size(stacksize)
|
||||
_thread.start_new_thread(self.run, ())
|
||||
|
||||
@@ -23,9 +23,10 @@ if sys.platform == "esp32":
|
||||
apps.auto_connect()
|
||||
else:
|
||||
# On unix/desktop, at least 24KB of stack size is needed in the REPL to make nostr work there
|
||||
import _thread
|
||||
_thread.stack_size(24*1024) # on unix/desktop, at least 24KB is needed for doing nostr connections from the REPL
|
||||
_thread.start_new_thread(dummy, ()) # not just setting the stack_size but actually starting a thread to apply this globally
|
||||
#import _thread
|
||||
#_thread.stack_size(24*1024) # on unix/desktop, at least 24KB is needed for doing nostr connections from the REPL
|
||||
#_thread.start_new_thread(dummy, ()) # not just setting the stack_size but actually starting a thread to apply this globally
|
||||
pass
|
||||
|
||||
apps.restart_launcher()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user