move files and fix weird workaround with proper more stack

This commit is contained in:
Thomas Farstrike
2025-05-21 08:59:27 +02:00
parent a00137c69f
commit 57814037d3
8 changed files with 6 additions and 8 deletions
@@ -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
+1 -1
View File
@@ -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, ())
+4 -3
View File
@@ -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()