Follow the schematics below to connect all components together, it can be done using breadboard but eventually this will be turned into a standalone product with 3D printed enclosure.
After assembly the circuits should work as expected, any movements detected should wake-up the Cricket board, this is indicated by LED blinking.
2Setting-up IFTTT and email service
Follow the steps:
- Go to: https://ifttt.com/
- Login or register
- Click Create from User / Account menu (top right corner)
- Click + to create new source event
- Select Webhooks service
- Click Continue
- Click Receive a web request (on the left hand side)
- Create event name e.g. pir_sensor
- The source event should be set-up now, click + after Then event
- Search email service
- Change subject and body of the email accordingly
- Click Finish
Nearly done, we need to get a HTTP address to which we can post events from the IoT module.
Search for Webhooks service and click on the document in the right up corner.
Next copy web links under "Make a POST or GET web request to:" you will need it later.
3Configure Wi-Fi Cricket module
Cricket is entirely configured OTA (Over The Air) through TOE Developer Portal (https://dev.thingsonedge.com). Once the Cricket module is paired to a Wi-Fi network it retrieves a configuration from the Developer Portal automatically. Now let's configure it first.
For our Wi-Fi Motion Sensor device we want to configure Cricket to send HTTP Post Requests to the IFTTT / Webhooks when it wakes up on IO1: WAKE_UP pin. The IOT Cricket module wakes up when IO1 receives a high signal from the PIR sensor module.
Now open TOE Developer Portal from any browser either from PC or mobile. You must register/login to Developer Portal to activate and configure the device in your account. Otherwise the device won't work.
After successful login / registration you need to click "Add new" device to activate your device in the system. You need to use the unique serial number printed on a label stick on the back of Cricket.
Unique serial number at the back of the module
WARNING: You must keep the serial number for yourself only. Do not share it with anyone else.
Now we can configure the device.
Set the following configuration:
- RTC: OFF
- IO2: OFF
- IO3: OFF
- Battery monitor: OFF
- Force updates on - IO1 Wake Up: On
- Force updates on - RTC Wake Up: OFF
- Post Events: see below
Copy / paste the link we copied from Webhooks in io1_wakeup and leave data empty.
Just two more steps:
- replace https to http
- replace event to pir_sensor
The link should look like below:
Set configuration and hit the Save button.
Great! We are almost there! We just need to connect our device to the internet over Wi-Fi network. See the next step.
4Connecting IoT module to the internet
In a few steps you will connect your device to the internet over your Wi-Fi network. All you need to do is to activate Cricket's private Wi-Fi hotspot and then open a private web page to pass your Wi-Fi network credentials. Please follow the steps below:
- Press and hold a button on the module for 5 seconds until the LED is constantly lit.
- Once the LED is constantly lit Cricket opens a private Wi-Fi hotspot. Connect from either a laptop or smartphone to the hot spot with the following credentials:SSID: toe_device
No password is required
- Once connected, open a private web page: http://192.168.4.1/index.html
NOTE:make sure LED is still ON! If is OFF repeat the steps from the beginning
Enter your WiFi credentials
- Now you can pass your Wi-Fi network credentials and click CONNECT. If you pass the correct SSID and Password then after a few seconds the device should report is online and the LED will be OFF.
Your device is live and connected to the internet!
53D printing (optional)
If you have access to 3D printer you can print attached stl files and en-up with really nice device ready to be used and less looking like prototype.
You can download files from our GitHUB ( https://github.com/thingsonedge/cricket/blob/master/stl/TOE_WIFI_PIR_sensor_3D_stl_files.zip )