https://github.com/ubidots/ubidots-sodaq-wifibee
https://github.com/ubidots/ubidots-sodaq-wifibee
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ubidots/ubidots-sodaq-wifibee
- Owner: ubidots
- License: gpl-3.0
- Created: 2016-04-22T13:52:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-02-10T15:13:25.000Z (about 2 years ago)
- Last Synced: 2025-02-14T04:52:45.207Z (3 months ago)
- Language: C++
- Size: 53.7 KB
- Stars: 0
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ubidots SODAQ Autonomo with WiFibee
This library is to connect easily an mDot with SODAQ Autonomo
## Requiremets
* [SODAQ Autonomo](http://shop.sodaq.com/nl/arduino-boards/)
* [WiFi bee](http://gprsbee.com/)
* [Arduino IDE 1.6.7 or higher](https://www.arduino.cc/en/Main/Software)## Setup
1. Download Arduino IDE [here](https://www.arduino.cc/en/Main/Software)
2. Go to Arduino IDE **File -> Preferences -> Additional Board Manager URLs** and add next line there "http://downloads.sodaq.net/package_sodaq_index.json".
3. Open Board Manager via **Tools -> Board -> Board Manager** and search for SODAQ boards, select SODAQ SAMD boards for the Autonomo.
4. Download the GPRSbee library of Ubidots [here](https://github.com/ubidots/ubidots-sodaq-gprsbee)
5. Go to the Arduino IDE, click on **Sketch -> Include Library -> Add .ZIP Library**
6. Select the .ZIP file of GPRSbee and then "Accept" or "Choose"
5. Close the Arduino IDE and open it again.Note:
* This library uses WiFly library of SeeedStudio. For this reason I added it to this repository.
* This library creates a new Ubidots data source named "SODAQWiFly", Inside that the library will save the variables.
## Send one value to UbidotsIn the next example we explain how to send a Temperature value to Ubidots API from your device. Please don't forget to change **SSID**, **KEY**, **AUTH** and **TOKEN**.
```cpp
#include/* Change the AUTH according to your network settings
If is open change to WIFLY_AUTH_OPEN
If is WPA1 change to WIFLY_AUTH_WPA1
If is WPA1_2 change to WIFLY_AUTH_WPA1
If is WPA2 change to WIFLY_AUTH_WPA1
*/// To add space in RN171 you just put "$" instead of " "
#define SSID "SSID"
#define KEY "PASS"
#define AUTH WIFLY_AUTH_WPA2_PSK
#define TOKEN "asdasenas12321adaxxxxx" // Replace it with your Ubidots tokenUbidots client(TOKEN);
void setup() {
client.wifiConnection(SSID, KEY, AUTH);
}void loop() {
float value = analogRead(A0);
client.add("Tmeperature", value);
client.sendAll();
delay(1000);
}
```## Get one value from Ubidots
In the next example we will explain you how to get the last value from a Ubidots variable. Please don't forget to change **SSID**, **KEY**, **AUTH** and **TOKEN**.
```cpp
#include/* Change the AUTH according to your network settings
If is open change to WIFLY_AUTH_OPEN
If is WPA1 change to WIFLY_AUTH_WPA1
If is WPA1_2 change to WIFLY_AUTH_WPA1
If is WPA2 change to WIFLY_AUTH_WPA1
*/// To add space in RN171 you just put "$" instead of " "
#define SSID "WIFI$SSID"
#define KEY "WiFi_Pass"
#define AUTH WIFLY_AUTH_WPA2_PSK
#define TOKEN "asdasenas12321adaxxxxx" // Replace it with your Ubidots tokenUbidots client(TOKEN);
void setup() {
client.wifiConnection(SSID, KEY, AUTH);
}void loop() {
float value = client.getValue(ID);
delay(1000);
}
```