Skip to content

Commit

Permalink
fix from jscrivani to work around the initial failed connection
Browse files Browse the repository at this point in the history
  • Loading branch information
flyinghead committed Feb 5, 2025
1 parent b9df7d3 commit d6f3ca9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/dreampi/dreampi.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def updater():


logger = logging.getLogger("dreampi")

first_run = 1

def check_internet_connection():
""" Returns True if there's a connection """
Expand Down Expand Up @@ -578,9 +578,15 @@ def reset(self):
def start_dial_tone(self):
if not self._dial_tone_wav:
return
global first_run
i = 0
while i < 3:
try:
if first_run:
first_run = 0
subprocess.Popen("/home/pi/dreampi/dcnet.rpi")
time.sleep(2)
subprocess.call("sudo killall dcnet.rpi".split())
self.reset()
self.send_command(b"AT+FCLASS=8") # Enter voice mode
self.send_command(b"AT+VLS=1") # Go off-hook
Expand Down

0 comments on commit d6f3ca9

Please sign in to comment.