Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Arduino for Secret Agents

You're reading from   Arduino for Secret Agents Transform your tiny Arduino device into a secret agent gadget to build a range of espionage projects with this practical guide for hackers

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher
ISBN-13 9781783986088
Length 170 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Marco Schwartz Marco Schwartz
Author Profile Icon Marco Schwartz
Marco Schwartz
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. A Simple Alarm System with Arduino 2. Creating a Spy Microphone FREE CHAPTER 3. Building an EMF Bug Detector 4. Access Control with a Fingerprint Sensor 5. Opening a Lock with an SMS 6. Building a Cloud Spy Camera 7. Monitoring Secret Data from Anywhere 8. Creating a GPS Tracker with Arduino 9. Building an Arduino Spy Robot Index

Testing the FONA shield


Now that our hardware is ready, we are going to test the FONA shield to see whether it is correctly connected and can connect to the network. As a test, we will send an SMS to the shield and also read all the messages present in the SIM card.

This is the complete Arduino sketch for this part, minus some helper functions that won't be detailed here:

// Include library
#include "Adafruit_FONA.h"
#include <SoftwareSerial.h>

// Pins
#define FONA_RX 2
#define FONA_TX 3
#define FONA_RST 4

// Buffer for replies
char replybuffer[255];

// Software serial
SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);
SoftwareSerial *fonaSerial = &fonaSS;

// Fona
Adafruit_FONA fona = Adafruit_FONA(FONA_RST);

// Readline function
uint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout = 0);

void setup() {

  // Start Serial
  while (!Serial);
  Serial.begin(115200);
  Serial.println(F("FONA basic test"));
  Serial.println(F("Initializing....(May take 3 seconds...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image