Merge branch 'master' of https://git.xpub.nl/XPUB/SI21
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>
|
<pre>
|
||||||
SI21 - test
|
special issue 21
|
||||||
Hello world!
|
experimental publishing
|
||||||
|
|
||||||
|
_ _
|
||||||
|
| |_| |_ _ _
|
||||||
|
| __| __| | | |
|
||||||
|
| |_| |_| |_| |
|
||||||
|
\__|\__|\__, |
|
||||||
|
|___/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
week 2
|
||||||
|
<a href="enconv/enconv.html">Encoding Converter</a>
|
||||||
</pre>
|
</pre>
|
||||||
|
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 934 KiB |
After Width: | Height: | Size: 884 KiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 741 KiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 1013 KiB |
After Width: | Height: | Size: 909 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 698 KiB |
After Width: | Height: | Size: 965 KiB |
@ -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
|
After Width: | Height: | Size: 1.9 MiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 979 KiB |
After Width: | Height: | Size: 928 KiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 753 KiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 932 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 726 KiB |
After Width: | Height: | Size: 1017 KiB |