{"id":99,"date":"2020-09-07T14:53:17","date_gmt":"2020-09-07T14:53:17","guid":{"rendered":"http:\/\/www.yattaphone.org\/?p=99"},"modified":"2020-09-19T10:46:22","modified_gmt":"2020-09-19T10:46:22","slug":"software","status":"publish","type":"post","link":"http:\/\/www.yattaphone.org\/index.php\/2020\/09\/07\/software\/","title":{"rendered":"Software"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Once you have <a href=\"http:\/\/www.yattaphone.org\/index.php\/2020\/09\/01\/hardware\/\">built your Yattaphone<\/a>, you need to connect it to the internet and have a software that lets you make phone calls.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The connection script<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Prior to running the script that you can find hereafter, you need to install some packages (in order to do that, connect the Raspberry to internet using <a rel=\"noreferrer noopener\" href=\"https:\/\/www.raspberrypi.org\/documentation\/configuration\/wireless\/desktop.md\" target=\"_blank\">WiFi<\/a> or an <a rel=\"noreferrer noopener\" href=\"https:\/\/medium.com\/@jrcharney\/connect-your-raspberry-pi-to-your-computer-via-ethernet-4564e1e68922\" target=\"_blank\">Ethernet<\/a> cable).<\/p>\n\n\n\n<p class=\"has-primary-color has-subtle-background-background-color has-text-color has-background has-small-font-size wp-block-paragraph\">sudo apt-get update &amp;&amp; sudo apt-get install libqmi-utils udhcpc<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, you can insert in the 4G Board a SIM and connect to the internet through the following script:<\/p>\n\n\n\n<p class=\"has-primary-color has-subtle-background-background-color has-text-color has-background has-small-font-size wp-block-paragraph\">!\/bin\/bash<br>sudo qmicli -d \/dev\/cdc-wdm0 &#8211;dms-set-operating-mode=&#8217;online&#8217;<br><br><em>#Check the signal<br><\/em>sudo qmicli -d \/dev\/cdc-wdm0 &#8211;dms-get-operating-mode<br>sudo qmicli -d \/dev\/cdc-wdm0 &#8211;nas-get-signal-strength<br>sudo qmicli -d \/dev\/cdc-wdm0 &#8211;nas-get-home-network<br><br><em>#Reconfigure the network interface for raw-ip protocol<br><\/em>sudo qmicli -d \/dev\/cdc-wdm0 -w <br><em>#this confirms the name of the network interface, typically wwan0<br><\/em>sudo ip link set wwan0 down <br><em>#change the wwan0 to the one returned above if different<br><\/em><br>echo &#8216;Y&#8217; | sudo tee \/sys\/class\/net\/wwan0\/qmi\/raw_ip<br>sudo ip link set wwan0 up<br><br><strong>#NOTE: replace &#8220;wap.tim.it&#8221; with the APN of your own SIM network and PASSWORD with your own password<br><\/strong>sudo qmicli -p -d \/dev\/cdc-wdm0 &#8211;device-open-net=&#8217;net-raw-ip|net-no-qos-header&#8217; &#8211;wds-start-network=&#8221;apn=&#8217;wap.tim.it&#8217;,username=&#8217;pi&#8217;,password=&#8217;PASSWORD,ip-type=4&#8243; &#8211;client-no-release-cid<br><br>#configure the IP address and the default route with udhcpc<br>sudo udhcpc -i wwan0<br>ip a s wwan0<br>sleep 2<br>ip r s<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">If you wish, you can <a rel=\"noreferrer noopener\" href=\"http:\/\/yattaphone.org\/connect\" target=\"_blank\">download this script<\/a> here.<\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">Note: sometimes it does not immediately work and you have to run it several times before it actually gets your Raspberry on the internet. <br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The phone calls interface<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Next, you need an interface to make the calls. Here it is:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large img_border\"><img loading=\"lazy\" decoding=\"async\" width=\"747\" height=\"419\" src=\"http:\/\/www.yattaphone.org\/wp-content\/uploads\/2020\/09\/screen.png\" alt=\"\" class=\"wp-image-36\" srcset=\"http:\/\/www.yattaphone.org\/wp-content\/uploads\/2020\/09\/screen.png 747w, http:\/\/www.yattaphone.org\/wp-content\/uploads\/2020\/09\/screen-300x168.png 300w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><\/figure>\n\n\n\n<h6 class=\"wp-block-heading\">You can <a href=\"http:\/\/yattaphone.org\/yattaphone.py\" target=\"_blank\" rel=\"noreferrer noopener\">download it<\/a> here.<\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">It is a Python 3 script. <br>Note: in order to run it, you need to install all the needed Python 3 modules: <strong>threading<\/strong>, <strong>time<\/strong>, <strong>tkinter<\/strong>, <strong>RPi.GPIO<\/strong>, <strong>serial<\/strong> and <strong>pygame<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then you can run the script:<\/p>\n\n\n\n<p class=\"has-subtle-background-background-color has-background has-small-font-size wp-block-paragraph\">python3 yattaphone.py<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>C<\/strong> button <strong>C<\/strong>alls.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>A<\/strong> button <strong>A<\/strong>nswers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>O<\/strong> button hangs up.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>SMS<\/strong> button shows all the SMSs stored in the SIM memory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>M<\/strong> button is for debug, it reads the serial. If everything works, you don&#8217;t need it, as the serial is checked (and its content displayed) once a second. Each time a point is printed out. <br><strong>Note: if you do not see a new point in line every second, it means that it is not working and it is not checking the serial<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Enjoy<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once you have built your Yattaphone, you need to connect it to the internet and have a software that lets you make phone calls. The connection script Prior to running the script that you can find hereafter, you need to install some packages (in order to do that, connect the Raspberry to internet using WiFi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"http:\/\/www.yattaphone.org\/index.php\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.yattaphone.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.yattaphone.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.yattaphone.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.yattaphone.org\/index.php\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":22,"href":"http:\/\/www.yattaphone.org\/index.php\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":250,"href":"http:\/\/www.yattaphone.org\/index.php\/wp-json\/wp\/v2\/posts\/99\/revisions\/250"}],"wp:attachment":[{"href":"http:\/\/www.yattaphone.org\/index.php\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.yattaphone.org\/index.php\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.yattaphone.org\/index.php\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}