{"version":3,"sources":["webpack:///./src/components/ProjectOverviews/PRO001Overview.js","webpack:///./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack:///./src/components/DropdownFlukes.js","webpack:///./src/components/layout.js","webpack:///./src/pages/PRO001/CellLinking.js","webpack:///./src/components/layout.module.css","webpack:///./src/pages/pages.module.css","webpack:///./src/Figures/Site_Header_Background.png"],"names":["PRO001Overview","props","cellPadding","border","to","style","textDecoration","textShadow","backgroundImage","_assertThisInitialized","self","ReferenceError","ListLink","backgroundColor","marginRight","children","DropdownFlukes","state","showMenu","bind","closeMenu","event","preventDefault","this","setState","window","addEventListener","dropdownMenu","contains","target","removeEventListener","render","display","onClick","className","ref","element","marginLeft","marginTop","listStyle","float","Component","Layout","layoutStyles","top","marginBottom","CellLinking","background","backgroundSize","minHeight","pageLayout","text","color","href","maxHeight","overflow","borderRadius","side","module","exports"],"mappings":"8FAAA,iFAIe,SAASA,EAAeC,GACnC,OACA,2BAAOC,YAAY,IAAIC,OAAO,KAC5B,4BACA,gCAAK,kBAAC,IAAD,CAAMC,GAAG,0BAA0BC,MAAO,CAAEC,eAAe,OAAQC,WAAW,OAASC,gBAAgB,SAAvG,4BACL,+CAEF,4BACA,4BAAI,kBAAC,IAAD,CAAMJ,GAAG,2BAA2BC,MAAO,CAAEE,WAAW,OAASC,gBAAgB,SAAjF,qBACF,+CAEF,4BACE,4BAAI,kBAAC,IAAD,CAAMJ,GAAG,2BAA2BC,MAAO,CAAEE,WAAW,OAASC,gBAAgB,SAAjF,+BACJ,mD,8HCjBS,SAASC,EAAuBC,GAC7C,QAAa,IAATA,EACF,MAAM,IAAIC,eAAe,6DAG3B,OAAOD,E,gBCFHE,EAAW,SAAAX,GAAK,OACpB,wBAAII,MAAO,CAAEQ,gBAAgB,QAASC,YAAY,SAChD,kBAAC,IAAD,CAAMV,GAAIH,EAAMG,IAAKH,EAAMc,YAgEZC,E,YA1DjB,aAAe,IAAD,SACZ,sBAEKC,MAAQ,CACXC,UAAU,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EAAD,MACA,kBAAC,EAAD,CAAUA,GAAG,aAAb,aAKHW,K,kCC5BP,sJAOe,SAAS+B,IACtB,OACE,6BACA,6BACA,kBAAC,IAAD,MAEA,yBAAKzC,MAAO,CAACG,gBAAiB,OAASuC,IAAa,IAAKC,eAAgB,QAASC,UAAW,UACzF,yBAAKf,UAAWgB,IAAWC,MAC7B,wBAAI9C,MAAO,CAAC+C,MAAO,UAAnB,6BACA,6BACA,wBAAI/C,MAAO,CAAC+C,MAAO,UAAnB,sCAIA,6BACA,yBAAKlB,UAAWgB,IAAWC,MACzB,qCACA,iEAAsC,uBAAGE,KAAK,2PAAR,YAAtC,8IACA,yDACA,gKACA,2BAAG,qCAAH,0TAAuU,kBAAC,IAAD,CAAMjD,GAAG,kBAAT,iBAAvU,sDACA,2BAAG,6CAAH,sMACA,uDACA,sRAA2P,uBAAGiD,KAAK,mHAAR,wBAA3P,mOACA,uDACA,2JACA,yBAAKhD,MAAO,CAACiD,UAAU,QAAQC,SAAS,OAAQ1C,gBAAgB,UAAU2C,aAAa,OACtF,2NAFD,SASM,qCATN,0GAWA,4CACA,ihBAAsf,6BAAtf,6DACA,wCACA,0IAC8G,6BAD9G,IACqH,6BACrH,yBAAKnD,MAAO,CAACiD,UAAU,QAAQC,SAAS,OAAQ1C,gBAAgB,UAAU2C,aAAa,OACtF,ysLAyKH,yBAAKtB,UAAWgB,IAAWO,MACzB,wBAAIpD,MAAO,IAAX,qBACF,kBAAC,IAAD,W,qBC3NNqD,EAAOC,QAAU,CAAC,IAAM,4BAA4B,MAAQ,gC,uBCA5DD,EAAOC,QAAU,CAAC,IAAM,2BAA2B,KAAO,4BAA4B,OAAS,8BAA8B,KAAO,8B,qBCDpID,EAAOC,QAAU,IAA0B","file":"component---src-pages-pro-001-cell-linking-js-92db520f74b4868c3865.js","sourcesContent":["import React from \"react\"\nimport { Link } from \"gatsby\"\nimport layoutStyles from \"../layout.module.css\"\n\nexport default function PRO001Overview(props) {\n return(\n
Reading the rotary dial | \nJune 28th 2020 | \n
Ringing the bell | \nJuly 12th 2020 | \n
Linking to the cell module | \nAugust 1st 2020 | \n
The A6 SIM module that I bought is this one. In this page I explain how I connected the phone and the Arduino to the GSM shield and what code I use for receviving and making a call.
\nConnections between the Arduino and the A6 module are quite straight forward. I did have two issues that I didn't direclty debug:
\nPower: Connecting the Arduino to the laptop I use for code development and routing the 5V out of the Arduino to the A6 module does not allow for enough current draw for the module to fully function. Full functionality is acheived by powering the A6 module seperately. Later using the AC/DC module as described in the previous page, enough power is provided for full functionality.
\nCommunication: In hindsight it sounds very stupid, but make sure you connect the Rx port ofthe Arduino to te Tx of the A6 and vice versa. We want to receive what one module is sending out by the other module.
\nThe only thing needed to connect to the A6 module is the horn of the phone, which contains to wires for the microphone and two for the speaker. Since the first plan was to connect the horn to the phone and the A6 module has a Jack input I bought a solderable converter. Using the Jack plug and connecting it to the A6 only gave me the functionality of the microphone, not the speaker of the horn. After that I connected the horn directly to the pins on the A6 module and everything was fine.
\nA lot of examples out there, but I wanted a way to detect it with a simple command, which is why I went with te option below:\n
\n {` \n //Rigistering the \"RING\" being transmitted by the SIM module == incoming call\n if (ringer.indexOf(\"RING\") > 0) {\n Call_receive();\n }\n `}
\n
\n where ringer is a String variable containing the most recent information available as received from the A6 module.\n \n Only one thing to say here, don't go to cheap on the SIM. I was happy like a child when I had and the A6 module and my SIM card, the latter bought after searching the web for the operator that give the the best rates without a monthly subscription. I went to bed crying that day. couldn't get it to receive cell connection, while most of the other communication was fine, could read the sim card number etc. I later tried with a SIM from a more prominent provider and everything worked instantly...
Still haven't figured out why the other SIM didn't work.
\n The code used for the entire project can be found below. Feel free to reach out should anything be unclear.
\n
\n {` \n// Global variable definition\n/// Varialbes mainly for receiving a call\nint ringstate = 0; // state of the bell\nint hornstate = 0; // is the telephone horn lifted or not\nint hornstate_prev = 1; // previous state of the hrn\nString ringer = \"\"; // detecting an incomming call\nchar letter;\n\n/// Variables mainly for making a call\nfloat pulscount = 0; // measured state of the 'digitalPin_cnt' signal\nfloat pulscount_prev = 0; // previous state of the 'digitalPin_cnt' signal\nfloat reset = 0; // measured state of the 'digitalPin_reset' signal\nfloat reset_prev = 0; // previous state of the 'digitalPin_reset' signal\nint count = 0; // variable counting the amount of pulses received when dialing a number\nString PHnumber = \"\"; // string capturing the full phone number dialed\nunsigned long timer;\n\n// Arduino PIN selection\nint digitalPin_cnt = 6; // Pin 6 is input connected to the number pulses of rotary dial\nint digitalPin_reset = 7; // Pin 7 is input connected to the single pulse showing rotary dial usage\nint digitalPin_ringer_out = 8; // Pin 8 is output to the relay swithing the ringer on and off\nint digitalPin_horn = 9; // Pin 9 is input connected to the horn sensor detecting a picked up horn\n\nvoid setup()\n{\n pinMode(digitalPin_cnt, INPUT);\n pinMode(digitalPin_reset, INPUT);\n pinMode(digitalPin_ringer_out, OUTPUT);\n pinMode(digitalPin_horn, INPUT);\n\n //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)\n Serial.begin(19200);\n //Begin serial communication with Arduino and A6\n Serial1.begin(19200);\n // Initializing the A6 module\n Serial.println(\"Initializing...\");\n delay(1000);\n Serial1.println(\"AT+IPR?\"); //checking the baud rate of the A6 module\n updateSerial();\n Serial1.println(\"AT+IPR=19200\"); // setting the baud rate of the A6 module\n updateSerial();\n Serial1.println(\"AT\"); //Once the handshake test is successful, it will back to OK\n updateSerial();\n Serial1.println(\"AT+CSQ\"); //Signal quality test, value range is 0-31 , 31 is the best\n updateSerial();\n Serial1.println(\"AT+CCID\"); //Read SIM information to confirm whether the SIM is plugged\n updateSerial();\n Serial1.println(\"AT+CREG?\"); //Check whether it has registered in the network\n updateSerial();\n Serial1.println(\"AT\"); //Once the handshake test is successful, it will back to OK\n updateSerial();\n Serial.println(\"Done!\");\n}\n\nvoid loop()\n{\n delay(10);\n hornstate_prev = hornstate;\n hornstate = digitalRead(digitalPin_horn);\n \n//Detecting a picked up horn\n if (hornstate_prev == 1 && hornstate == 1)\n {\n Dialing();\n }\n \n//Rigistering the \"RING\" being transmitted by the SIM module == incoming call\n if (ringer.indexOf(\"RING\") > 0) {\n Call_receive();\n }\nupdateSerial(); \n}\n\n// update the signals sent/received from/to the SIM module.\n// don't write everything to the Serial.Println, causes problems and delays.\nvoid updateSerial() \n{\n ringer = \"\";\n delay(250);\n while (Serial.available())\n {\n Serial1.write(Serial.read());//Forward what Serial received to Software Serial Port\n }\n while (Serial1.available())\n {\n letter = Serial1.read();\n ringer += letter;\n }\n}\n\nvoid Call_receive() // How to handle an incoming call\n{\n boolean finishedcall = false;\n unsigned long timer;\n timer = micros();\n ringer = \"\";\n ringstate = 1;\n digitalWrite(digitalPin_ringer_out, ringstate);\n // while no 'ERROR' or '+..' is received indicating a stopped or cancelled call\n while (ringer.indexOf(\"O\") < 0 && ringer.indexOf(\"+\") < 0 && finishedcall == false) { \n hornstate_prev = hornstate;\n hornstate = digitalRead(digitalPin_horn);\n // Turn on the horn of the phone with 1000 ms intervals\n if (micros() - timer > 1000000) \n { \n timer = micros();\n ringstate = (ringstate + 1) % 2;\n digitalWrite(digitalPin_ringer_out, ringstate);\n }\n // Detecting a picked up horn after incoming call\n if (hornstate == 1 && hornstate_prev == 0) \n {\n digitalWrite(digitalPin_ringer_out, 0);\n // accept the call once the horn has been picked up\n Serial1.println(\"ATA\");\n hornstate_prev = hornstate;\n while ((hornstate == 1 || hornstate_prev == 1)&& ringer.indexOf(\"+\") < 0 && ringer.indexOf(\"O\") < 0) { // \n hornstate_prev = hornstate;\n hornstate = digitalRead(digitalPin_horn);\n delay(10);\n finishedcall = true;\n }\n Serial1.println(\"ATH\");\n finishedcall = true;\n updateSerial();\n delay(10);\n }\n updateSerial();\n delay(10);\n }\n digitalWrite(digitalPin_ringer_out, 0);\n Serial1.println(\"AT\");\n finishedcall = 1;\n}\nvoid Dialing() // Handling dialing and calling\n{\n while (hornstate_prev == 1 && hornstate == 1) {\n delay(10);\n pulscount = digitalRead(digitalPin_cnt);\n reset = digitalRead(digitalPin_reset);\n hornstate_prev == hornstate;\n hornstate = digitalRead(digitalPin_horn);\n\n if ( pulscount == 0 && pulscount_prev == 1 && reset == 1) {\n count = count + 1;\n timer = micros();\n }\n if ( reset == 0 && reset_prev == 1) {\n PHnumber.concat(String(count % 10));\n count = 0;\n Serial.println(PHnumber);\n timer = micros();\n }\n if (micros() - timer >= 3000000 && PHnumber != \"\") {\n //Serial.println(PHnumber); // the dialed number.\n Serial1.println(\"ATD\"+PHnumber); //call the dialed number\n PHnumber = \"\";\n timer = micros();\n }\n pulscount_prev = pulscount;\n reset_prev = reset;\n }\n Serial1.println(\"ATH\");\n}\n `}
\n
\n \n