Connect breakout board to the Arduino as this:
- Board -> Arduino
- 3,3V -> 3,3V
- GND -> GND
- RX -> 11
- TX -> 10
dumpInfo
: get a string with ID and PACwakeup
: wake module up from software reset modegetID
getPac
getTemp
setPowerMode(uint8_t mode)
: mode can be 0, 1, 2 or one of the class constants SOFTWARE_RESET, SLEEP, DEEP_SLEEPenableSoftwareResetMode
: short forsetPowerMode(0)
enableSleepMode
: short forsetPowerMode(1)
enableDeepSleepMode
: short forsetPowerMode(2)
setOutputPower(uint8_t power)
cmd(String cmd)
: send a string to the module and get the responseread(uint16_t timeout = 15000)
: get module response, within the timeout. An empty string is returned if timeoutsend(const void* data, uint8_t size, bool ack = true)
: send message to the Sigfox cloud. Returns true if successful
#include <SoftwareSerial.h>
#include <Wisol.h>
typedef struct {
uint8_t counter;
} Payload;
SoftwareSerial stream(10, 11);
Wisol sigfox(&stream);
void setup() {
Serial.begin(115200);
delay(3000);
stream.begin(9600);
}
void loop() {
Payload p = { rand() * 100 };
Serial.println(sigfox.dumpInfo());
Serial.print("Temp: "); Serial.println(sigfox.getTemp());
Serial.print("Send: "); Serial.println(sigfox.send(&p, sizeof(p)) ? "OK" : "ERR");
delay(30000);
}
#include <HardwareSerial.h>
#include <Wisol.h>
typedef struct {
uint8_t counter;
} Payload;
HardwareSerial stream(1);
Wisol sigfox(&stream);
void setup() {
Serial.begin(115200);
delay(3000);
stream.begin(9600, SERIAL_8N1, 18, 19);
}
void loop() {
Payload p = { rand() * 100 };
Serial.println(sigfox.dumpInfo());
Serial.print("Temp: "); Serial.println(sigfox.getTemp());
Serial.print("Send: "); Serial.println(sigfox.send(&p, sizeof(p)) ? "OK" : "ERR");
delay(30000);
}