master
Stephen Kerr 12 months ago
commit 02866f974d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Before

Width:  |  Height:  |  Size: 1002 KiB

After

Width:  |  Height:  |  Size: 1002 KiB

@ -1,4 +1,19 @@
<pre>
SI21 - test
Hello world!
special issue 21
experimental publishing
_ _
| |_| |_ _ _
| __| __| | | |
| |_| |_| |_| |
\__|\__|\__, |
|___/
week 2
<a href="enconv/enconv.html">Encoding Converter</a>
</pre>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1013 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 965 KiB

@ -4,7 +4,7 @@ import os
import time
import subprocess
import random
#logging.getLogger().setLevel(5)
logging.getLogger().setLevel(5)
sim800l = SIM800L(port='/dev/serial0', baudrate=115000, timeout=3.0)
audios = ["love1.wav", "love2.wav", "love3.wav"]
@ -17,9 +17,8 @@ time.sleep(3)
while True:
activecall = sim800l.command("AT+CPAS\n") #check if someone is calling or not
if "+CPAS: 3" in activecall: #if someone is calling
print("some one is calling")
time.sleep(3) #wait 3 seoncds
if "3" in activecall: #if someone is calling
print("some one is calling")
sim800l.command("ATA\n") #answer the phone
audio = rando`m.choice(audios)
print("playing python file")
@ -29,5 +28,5 @@ while True:
callisactive = sim800l.command("AT+CPAS\n")
if "+CPAS: 0" in callisactive: #call is not active anymore
print ("call stopped")
os.system("killall play")
os.system("sudo killall play")
break

@ -2,7 +2,7 @@ from sim800l import SIM800L
import logging
import os
import time
import subprocess
#import subprocess
#logging.getLogger().setLevel(5)
sim800l = SIM800L(port='/dev/serial0', baudrate=115000, timeout=3.0)
@ -20,15 +20,15 @@ while True:
time.sleep(3) #wait 3 seoncds
sim800l.command("ATA\n") #answer the phone
print("playing python file")
# os.system("play test.wav &")
p = subprocess.Popen([sys.executable, 'audio.py'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
os.system("play test.wav &")
#p = subprocess.Popen([sys.executable, 'audio.py'],
#stdout=subprocess.PIPE,
#stderr=subprocess.STDOUT)
while True:
#check if call is still active
callisactive = sim800l.command("AT+CPAS\n")
if "+CPAS: 0" in callisactive: #call is not active anymore
print ("call stopped")
# os.system("killall play")
p.terminate()
os.system("killall play")
#p.terminate()
break

@ -0,0 +1,53 @@
from sim800l import SIM800L
import logging
import os
import time
logging.getLogger().setLevel(5)
play = False
call = False
audios = ["love1.wav", "love2.wav", "love3.wav"]
sim800l = SIM800L(port='/dev/serial0', baudrate=115000, timeout=3.0)
print(sim800l.command("ATS0=0\n"))
time.sleep(2)
print(sim800l.command("AT\n"))
time.sleep(5)
#print(sim800l.command("AT+DDET=1\n"))
#time.sleep(3)
#print("<>")
time.sleep(3)
while True:
if call is False:
try:
activecall = sim800l.command("AT+CPAS\n", waitfor=1500) #check if someone is calling or not
except:
activecall = ""
print(activecall)
r = sim800l.check_incoming()
print(r)
if r[-1] is not None and "3" in r[-1] and call is False: #if someone is callin
print("some one is calling")
call = True
time.sleep(1) #wait 3 seoncds
sim800l.command("ATA\n") #answer the phone
if play is False:
print("playing sound file")
import random
audio = random.choice(audios)
os.system("play " + audio + " &")
play = True
#check =sim800l.command("AT+DDET=?\n")
#print(check)
while True:
#check if call is still active
callisactive = sim800l.command("AT+CPAS\n")
r = sim800l.check_incoming()
print(r)
if r[-1] is not None:
if "0" in r[-1]: #call is not active anymore
print ("call stopped")
os.system("sudo killall play")
call = False
play = False
break

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 KiB

Loading…
Cancel
Save